openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 8914e0ae7871414622086c53480a0caf05dbf683
parent 6fad9e0243550d40cd2088c3438ae525cb120c1d
Author: Jan Dankert <develop@jandankert.de>
Date:   Fri, 21 Aug 2020 00:22:13 +0200

Refactoring: Collect all frontend compiler scripts in update.php. Compiling of CSS and JS was extracted to a new TemplateCompiler. JS and CSS is now collected in a new openrat.[min.][js|css].

Diffstat:
dev-helper/create-output-files.sh | 6++++++
dev-helper/template-watcher.sh | 24+++++++++++++++++++-----
dev-helper/update.html | 19-------------------
dev-helper/update.php | 79+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/cms/Dispatcher.class.php | 3+--
modules/cms/ui/action/IndexAction.class.php | 366++-----------------------------------------------------------------------------
modules/cms/ui/themes/ThemeCompiler.class.php | 323+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/cms/ui/themes/default/production/combined.min.css | 9---------
modules/cms/ui/themes/default/production/combined.min.js | 10850-------------------------------------------------------------------------------
modules/cms/ui/themes/default/script/jquery-ui.js | 4351-------------------------------------------------------------------------------
modules/cms/ui/themes/default/script/jquery.hotkeys.js | 204-------------------------------------------------------------------------------
modules/cms/ui/themes/default/script/jquery.js | 10598-------------------------------------------------------------------------------
modules/cms/ui/themes/default/script/jquery.scrollTo.js | 217-------------------------------------------------------------------------------
modules/cms/ui/themes/default/script/mark.min.js | 27---------------------------
modules/cms/ui/themes/default/script/openrat.js | 53396+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/cms/ui/themes/default/script/openrat.min.js | 1673+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/cms/ui/themes/default/script/openrat/common.min.js | 6------
modules/cms/ui/themes/default/script/openrat/form.min.js | 5-----
modules/cms/ui/themes/default/script/openrat/init.min.js | 2--
modules/cms/ui/themes/default/script/openrat/navigator.min.js | 2--
modules/cms/ui/themes/default/script/openrat/view.min.js | 4----
modules/cms/ui/themes/default/script/openrat/workbench.min.js | 4----
modules/cms/ui/themes/default/script/plugin/jquery-plugin-orAutoheight.min.js | 2--
modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js | 2--
modules/cms/ui/themes/default/script/plugin/jquery-plugin-orSearch.min.js | 3---
modules/cms/ui/themes/default/script/plugin/jquery-plugin-orTree.min.js | 5-----
modules/cms/ui/themes/default/style/openrat-base.css | 206-------------------------------------------------------------------------------
modules/cms/ui/themes/default/style/openrat-base.min.css | 2--
modules/cms/ui/themes/default/style/openrat-header.css | 102-------------------------------------------------------------------------------
modules/cms/ui/themes/default/style/openrat-header.min.css | 2--
modules/cms/ui/themes/default/style/openrat-navigation.css | 31-------------------------------
modules/cms/ui/themes/default/style/openrat-navigation.min.css | 2--
modules/cms/ui/themes/default/style/openrat-ui.css | 752-------------------------------------------------------------------------------
modules/cms/ui/themes/default/style/openrat-ui.min.css | 2--
modules/cms/ui/themes/default/style/openrat-workbench.css | 336-------------------------------------------------------------------------------
modules/cms/ui/themes/default/style/openrat-workbench.min.css | 2--
modules/cms/ui/themes/default/style/openrat.css | 1670+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/cms/ui/themes/default/style/openrat.min.css | 19+++++++++++++++++++
modules/language/Language.class.php | 119++++++++++++-------------------------------------------------------------------
modules/language/LanguageCompiler.class.php | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
modules/language/lang-cn.php | 36++++++++++++++++++------------------
modules/language/lang-de.php | 2+-
modules/language/lang-en.php | 36++++++++++++++++++------------------
modules/language/lang-es.php | 32++++++++++++++++----------------
modules/language/lang-fr.php | 32++++++++++++++++----------------
modules/language/lang-it.php | 32++++++++++++++++----------------
modules/language/lang-ru.php | 32++++++++++++++++----------------
modules/language/language.yml | 18++++++++++++++++++
modules/template_engine/TemplateCompiler.php | 8+++-----
modules/template_engine/components/XSDGenerator.php | 5+----
modules/template_engine/components/html/column/column.min.js | 2--
modules/template_engine/components/html/editor/editor.css | 33---------------------------------
modules/template_engine/components/html/editor/editor.min.css | 2--
modules/template_engine/components/html/editor/editor.min.js | 2--
modules/template_engine/components/html/group/group.css | 13-------------
modules/template_engine/components/html/group/group.min.css | 2--
modules/template_engine/components/html/group/group.min.js | 2--
modules/template_engine/components/html/image/image.css | 3---
modules/template_engine/components/html/image/image.min.css | 0
modules/template_engine/components/html/image/image.min.js | 2--
modules/template_engine/components/html/link/link.min.js | 2--
modules/template_engine/components/html/qrcode/qrcode.min.js | 2--
modules/template_engine/components/html/table/table.css | 176-------------------------------------------------------------------------------
modules/template_engine/components/html/table/table.min.css | 2--
modules/template_engine/components/html/table/table.min.js | 2--
modules/template_engine/components/html/tree/tree.min.js | 2--
modules/template_engine/components/html/upload/upload.css | 7-------
modules/template_engine/components/html/upload/upload.min.css | 2--
modules/template_engine/components/html/upload/upload.min.js | 2--
69 files changed, 57432 insertions(+), 28583 deletions(-)

diff --git a/dev-helper/create-output-files.sh b/dev-helper/create-output-files.sh @@ -96,6 +96,12 @@ function xsdfile if [ -f $xsd ]; then chmod 666 -v $xsd fi + + components="../modules/template_engine/components/components.ini" + if [ -f $components ]; then + chmod 666 -v $components + fi + } language diff --git a/dev-helper/template-watcher.sh b/dev-helper/template-watcher.sh @@ -4,19 +4,33 @@ # # Need for: # - inotify-tools +# - curl +# +# On Ubuntu/Debian install them with 'apt-get install inotify-tools curl'. # CMS_URL=$1 +function update { + echo "update started at $(date)" + curl -X POST -d "type=all" $1/dev-helper/update.php + retVal=$? + if [ $retVal -ne 0 ]; then + echo "An error occured! Returncode was $retVal" + else + echo "Sucessful update." + fi +exit $retVal + echo "update ended at $(date)" +} + while true; do # Calling compiler first - echo "compiling started at $(date)" - curl $1/modules/template_engine/TemplateCompiler.php - echo "compiling ended at $(date)" + update + echo "waiting for changes ..." inotifywait --event modify -r ../modules/template_engine/ ../modules/cms/ui/themes/default/html/views/ - echo File was changed. - + echo "a file was changed. updating ..." done diff --git a/dev-helper/update.html b/dev-helper/update.html @@ -1,19 +0,0 @@ -<html> - -<body> - -<h1>XSD Generator</h1> - -<ul> - <li> - <a href="../modules/template_engine/components/XSDGenerator.php">XSD Generator</a> - </li> - - <li> - <a href="../modules/template_engine/TemplateCompiler.php">Template Compiler</a> - </li> - -</ul> - -</body> -</html> diff --git a/dev-helper/update.php b/dev-helper/update.php @@ -0,0 +1,78 @@ +<?php + +use cms\ui\themes\ThemeCompiler; +use language\LanguageCompiler; + +define('XSD' ,'xsd' ); +define('TPL' ,'tpl' ); +define('ALL' ,'all' ); +define('CSS' ,'css' ); +define('JS' ,'js' ); +define('LANG','lang'); + +$type = $_POST['type']; + + +if ( @$type ) +{ + ini_set('display_errors', 1); + ini_set('html_errors', 0); + error_reporting(E_ALL & ~E_NOTICE); + + require (__DIR__.'/../modules/autoload.php'); + + header('Content-Type: text/plain'); + switch ($type) { + case XSD: + require (__DIR__.'/../modules/template_engine/components/XSDGenerator.php'); + break; + + case TPL: + require (__DIR__.'/../modules/template_engine/TemplateCompiler.php'); + break; + + case LANG: + $compiler = new LanguageCompiler(); + $compiler->updateProduction(); + break; + + case CSS: + $compiler = new ThemeCompiler(); + $compiler->compileStyles(); + break; + + case JS: + $compiler = new ThemeCompiler(); + $compiler->compileScripts(); + break; + + default: + echo "Unknown type"; + } +} + +else { + ?> +<html> + +<body> + + +<h1>Updating OpenRat UI components</h1> + +<p><i>Only for developers</i></p> + +<form action="./<?php echo basename(__FILE__) ?>" method="POST"> + + + <div><label><input type="radio" name="type" value="<?php echo XSD ?>" /> XSD Generator</label></div> + <div><label><input type="radio" name="type" value="<?php echo TPL ?>" /> Template Compiler</label></div> + <div><label><input type="radio" name="type" value="<?php echo CSS ?>" /> LESS Compiler and CSS Minifier</label></div> + <div><label><input type="radio" name="type" value="<?php echo JS ?>" /> JS Minifier</label></div> + <div><label><input type="radio" name="type" value="<?php echo LANG ?>" /> Language files Compiler</label></div> + + <div><input type="submit" /></div> +</form> + +</body> +</html><?php } ?>+ \ No newline at end of file diff --git a/modules/cms/Dispatcher.class.php b/modules/cms/Dispatcher.class.php @@ -249,9 +249,8 @@ class Dispatcher if (!in_array($l, $available)) continue; // language is not configured as available. - $isProduction = $conf['production']; $language = new \language\Language(); - $lang = $language->getLanguage( $l,$isProduction); + $lang = $language->getLanguage( $l ); $conf['language'] = $lang; $conf['language']['language_code'] = $l; break; diff --git a/modules/cms/ui/action/IndexAction.class.php b/modules/cms/ui/action/IndexAction.class.php @@ -168,129 +168,9 @@ class IndexAction extends Action private function getCSSFiles() { - $productionCSSFile = OR_THEMES_DIR . 'default/production/combined.min.css'; - - if (PRODUCTION) - { - return array( - $productionCSSFile - ); - } - - - $css = array(); - - $styleFiles = \util\FileUtils::readDir( __DIR__.'/../themes/default/style'); - foreach( $styleFiles as $styleFile ) { - if (substr($styleFile,-5) == '.less' ) - $css[] = OR_THEMES_DIR . 'default/style'.'/'.substr($styleFile,0,-5); - } - - //$css[] = OR_HTML_MODULES_DIR . 'editor/codemirror/lib/codemirror'; - - // Komponentenbasiertes CSS - foreach (TemplateEngineInfo::getComponentList() as $c) - { - $componentCssFile = 'template_engine/components/html/' . $c . '/' . $c; - if (is_file( OR_MODULES_DIR . $componentCssFile . '.less')) - $css[] = OR_HTML_MODULES_DIR . $componentCssFile; - } - - $css[] = OR_HTML_MODULES_DIR . 'editor/simplemde/simplemde'; - $css[] = OR_HTML_MODULES_DIR . 'editor/trumbowyg/ui/trumbowyg'; - - $outFiles = array(); - $modified = false; - foreach ($css as $cssF) - { - $lessFile = $cssF . '.less'; - $cssFile = $cssF . '.css'; - $cssMinFile = $cssF . '.min.css'; - - if (! is_file($lessFile) && is_file($cssMinFile)) - { - // Nur die min.css existiert. Das ist ok. - // Aber vielleicht muss die Production-CSS aktualisiert werden. - if (filemtime($cssMinFile) > filemtime($productionCSSFile)) { - // minifizierte CSS-Version ist neuer als Production-CSS, muss aktualisiert werden. - $modified = true; - } - $outFiles[] = $cssMinFile; - } - elseif (! is_file($lessFile)) - { - Logger::warn("Stylesheet not found: $lessFile"); - continue; - } - elseif (! is_file($cssFile) || ! is_writable($cssFile)) - { - Logger::warn("Stylesheet output file not found or not writable: $cssFile"); - continue; - } - elseif (! is_file($cssMinFile) || ! is_writable($cssMinFile)) - { - Logger::warn("Stylesheet output file not found or not writable: $cssMinFile"); - continue; - } - else - { - if (filemtime($lessFile) > filemtime($cssMinFile)) - { - // LESS-Source wurde geändert, CSS-Version muss aktualisiert werden. - $modified = true; - - // Den absoluten Pfad zur LESS-Datei ermitteln. Dieser wird vom LESS-Parser für den korrekten Link - // auf die LESS-Datei in der Sourcemap benötigt. - $pfx = substr(realpath($lessFile),0,0-strlen(basename($lessFile))); - - $parser = new Less_Parser(array( - 'sourceMap' => true, - 'indentation' => ' ', - 'outputSourceFiles' => false, - 'sourceMapBasepath' => $pfx - )); - - - $parser->parseFile( ltrim($lessFile,'./') ); - $source = $parser->getCss(); - - file_put_contents($cssFile, $source); - - $parser = new Less_Parser(array( - 'compress' => true, - 'sourceMap' => false, - 'indentation' => '' - )); - $parser->parseFile($lessFile); - $source = $parser->getCss(); - - - file_put_contents($cssMinFile, $source); - } - - $outFiles[] = $cssFile; - } - } - - if ($modified) - { - if ( !is_writable($productionCSSFile)) - { - Logger::warn('Development mode, but style file is not writable: '.$productionCSSFile); - } - else - { - file_put_contents($productionCSSFile,''); - foreach ($css as $cssF) - { - $cssMinFile = $cssF . '.min.css'; - if ( is_file($cssMinFile)) - file_put_contents($productionCSSFile,file_get_contents($cssMinFile),FILE_APPEND); - } - } - } - - return $outFiles; + return array( + OR_THEMES_DIR . 'default/style/openrat'.(PRODUCTION?'.min':'').'.css' + ); } @@ -355,243 +235,9 @@ class IndexAction extends Action private function getJSFiles() { - $productionJSFile = OR_THEMES_DIR . 'default/production/combined.min.js'; - - if (PRODUCTION) - { - return array( - $productionJSFile - ); - } - else - { - $js = array(); - $js[] = OR_THEMES_DIR . 'default/script/jquery'; - $js[] = OR_THEMES_DIR . 'default/script/jquery-ui'; - //$js[] = OR_THEMES_DIR . 'default/script/jquery.scrollTo'; - // $js[] = OR_THEMES_EXT_DIR default/script/jquery.mjs.nestedSortable.js"></script> - - // Jquery-Plugins - $js[] = OR_THEMES_DIR . 'default/script/plugin/jquery-plugin-orSearch'; - $js[] = OR_THEMES_DIR . 'default/script/plugin/jquery-plugin-orLinkify'; - $js[] = OR_THEMES_DIR . 'default/script/plugin/jquery-plugin-orTree'; - $js[] = OR_THEMES_DIR . 'default/script/plugin/jquery-plugin-orLoadView'; - $js[] = OR_THEMES_DIR . 'default/script/plugin/jquery-plugin-orAutoheight'; - $js[] = OR_THEMES_DIR . 'default/script/jquery-qrcode'; - $js[] = OR_THEMES_DIR . 'default/script/jquery.hotkeys'; - - // Codemirror Source Editor - - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/lib/codemirror'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/handlebars/handlebars'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/smalltalk/smalltalk'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/php/php'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/cobol/cobol'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/haskell/haskell'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/mathematica/mathematica'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/pug/pug'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/livescript/livescript'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/yaml-frontmatter/yaml-frontmatter'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/stylus/stylus'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/markdown/markdown'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/jsx/jsx'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/velocity/velocity'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/fortran/fortran'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/mirc/mirc'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/xquery/xquery'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/elm/elm'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/vhdl/vhdl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/verilog/verilog'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/spreadsheet/spreadsheet'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/coffeescript/coffeescript'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/tiddlywiki/tiddlywiki'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/mumps/mumps'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/eiffel/eiffel'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/webidl/webidl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/ebnf/ebnf'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/http/http'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/textile/textile'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/r/r'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/haml/haml'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/ecl/ecl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/cypher/cypher'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/sieve/sieve'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/soy/soy'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/pig/pig'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/apl/apl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/crystal/crystal'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/clike/clike'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/oz/oz'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/modelica/modelica'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/gherkin/gherkin'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/swift/swift'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/scheme/scheme'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/idl/idl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/yaml/yaml'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/vue/vue'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/twig/twig'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/cmake/cmake'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/asciiarmor/asciiarmor'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/pegjs/pegjs'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/solr/solr'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/tiki/tiki'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/slim/slim'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/puppet/puppet'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/meta'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/go/go'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/commonlisp/commonlisp'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/rust/rust'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/powershell/powershell'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/stex/stex'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/q/q'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/htmlembedded/htmlembedded'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/d/d'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/protobuf/protobuf'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/mscgen/mscgen'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/django/django'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/toml/toml'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/yacas/yacas'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/dockerfile/dockerfile'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/python/python'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/vb/vb'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/octave/octave'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/tcl/tcl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/clojure/clojure'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/sass/sass'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/gas/gas'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/sas/sas'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/julia/julia'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/fcl/fcl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/tornado/tornado'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/asterisk/asterisk'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/sql/sql'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/gfm/gfm'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/mllike/mllike'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/rst/rst'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/ntriples/ntriples'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/sparql/sparql'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/properties/properties'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/rpm/rpm'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/htmlmixed/htmlmixed'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/xml/xml'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/ttcn-cfg/ttcn-cfg'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/ttcn/ttcn'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/z80/z80'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/brainfuck/brainfuck'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/forth/forth'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/nginx/nginx'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/javascript/javascript'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/pascal/pascal'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/haxe/haxe'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/perl/perl'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/factor/factor'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/smarty/smarty'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/vbscript/vbscript'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/dylan/dylan'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/asn.1/asn.1'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/ruby/ruby'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/nsis/nsis'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/css/css'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/haskell-literate/haskell-literate'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/mbox/mbox'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/dtd/dtd'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/erlang/erlang'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/turtle/turtle'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/troff/troff'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/jinja2/jinja2'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/diff/diff'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/dart/dart'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/shell/shell'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/lua/lua'; - $js[] = OR_HTML_MODULES_DIR . 'editor/codemirror/mode/groovy/groovy'; - - - $js[] = OR_HTML_MODULES_DIR . 'editor/simplemde/simplemde'; - $js[] = OR_HTML_MODULES_DIR . 'editor/trumbowyg/trumbowyg'; - - - // OpenRat internal JS - als letztes, damit die vorigen bereits geladen sind. - $js[] = OR_THEMES_DIR . 'default/script/openrat/init'; - $js[] = OR_THEMES_DIR . 'default/script/openrat/view'; - $js[] = OR_THEMES_DIR . 'default/script/openrat/form'; - $js[] = OR_THEMES_DIR . 'default/script/openrat/workbench'; - $js[] = OR_THEMES_DIR . 'default/script/openrat/navigator'; - $js[] = OR_THEMES_DIR . 'default/script/openrat/common'; - - // Komponentenbasiertes Javascript - foreach ( TemplateEngineInfo::getComponentList() as $c) - { - $componentJsFile = OR_HTML_MODULES_DIR . '/template_engine/components/html/' . $c . '/' . $c; - if (is_file($componentJsFile . '.js')) - $js[] = $componentJsFile; - } - - - $outDevJsFiles = array(); - $outProJsFiles = array(); - $lastModTime = 0; - - foreach ($js as $jsFile) - { - $jsFileMin = $jsFile . '.min.js'; - $jsFileNormal = $jsFile . '.js'; - - if (!is_file($jsFileNormal) && !is_file($jsFileMin)) - { - Logger::warn("Missing Javascript file: $jsFileNormal"); - continue; - } - elseif (is_file($jsFileNormal) && !is_file($jsFileMin)) - { - Logger::warn("Missing Min-Javascript file: $jsFileMin"); - continue; - } - elseif (!is_file($jsFileNormal) && is_file($jsFileMin)) - { - // Nur eine Min-Version existiert. Das ist ok. - $outDevJsFiles[] = $jsFileMin; - $outProJsFiles[] = $jsFileMin; - $modTime = filemtime($jsFileMin); - } - else - { - if ( filemtime($jsFileNormal) > filemtime($jsFileMin) ) - { - if ( is_writable( $jsFileMin) ) - { - $jz = new JSqueeze(); - file_put_contents($jsFileMin, $jz->squeeze(file_get_contents($jsFileNormal))); - $modTime = time(); - } - else - Logger::warn("Not writable: " . $jsFileMin); - } - else - { - $modTime = filemtime($jsFileMin); - } - $outDevJsFiles[] = $jsFileNormal; - $outProJsFiles[] = $jsFileMin; - } - $lastModTime = max($lastModTime, $modTime); - } - - if ($lastModTime > filemtime($productionJSFile)) - { - if (! is_writable($productionJSFile)) - { - Logger::warn("Not writable: " . $productionJSFile); - } - else - { - file_put_contents($productionJSFile, ''); // Truncate file - foreach ($outProJsFiles as $srcFile) - file_put_contents($productionJSFile, "\n/* $srcFile */". file_get_contents($srcFile), FILE_APPEND); - } - } - } - - return $outDevJsFiles; + return array( + OR_THEMES_DIR . 'default/script/openrat'.(PRODUCTION?'.min':'').'.js' + ); } diff --git a/modules/cms/ui/themes/ThemeCompiler.class.php b/modules/cms/ui/themes/ThemeCompiler.class.php @@ -0,0 +1,323 @@ +<?php + +namespace cms\ui\themes; + +use util\JSqueeze; +use logger\Logger; +use template_engine\TemplateEngineInfo; +use \Less_Parser; + +require (__DIR__.'/../../../util/require.php'); + + +/** + * Theme-Compiler. + * + * @author Jan Dankert + */ +class ThemeCompiler +{ + public $theme = 'default'; + + public function compileAll() { + $this->compileStyles(); + $this->compileScripts(); + + } + + public function compileStyles() + { + $combinedCssFile = __DIR__.'/default/style/openrat.css'; + $combinedCssFileMin = __DIR__.'/default/style/openrat.min.css'; + + file_put_contents($combinedCssFile ,''); + file_put_contents($combinedCssFileMin,''); + + $css = []; + + $styleFiles = \util\FileUtils::readDir( __DIR__.'/default/style'); + foreach( $styleFiles as $styleFile ) { + if (substr($styleFile,-5) == '.less' ) + $css[] = __DIR__.'/default/style'.'/'.substr($styleFile,0,-5); + } + + //$css[] = __DIR__.'/../../../editor/codemirror/lib/codemirror'; + + // Komponentenbasiertes CSS + foreach (TemplateEngineInfo::getComponentList() as $c) + { + $componentCssFile = 'template_engine/components/html/' . $c . '/' . $c; + if (is_file( __DIR__.'/../../../'. $componentCssFile . '.less')) + $css[] = __DIR__.'/../../../'.$componentCssFile; + } + + $css[] = __DIR__.'/../../../editor/simplemde/simplemde'; + $css[] = __DIR__.'/../../../editor/trumbowyg/ui/trumbowyg'; + + foreach ($css as $cssF) + { + $lessFile = $cssF . '.less'; + $cssFile = $cssF . '.css'; + $cssMinFile = $cssF . '.min.css'; + + file_put_contents($combinedCssFile, '/* Include style: '.$cssF.' */'."\n",FILE_APPEND); + + if (! is_file($lessFile) && is_file($cssMinFile)) + { + // Copy minified CSS files (from integrated third-party apps) + file_put_contents($combinedCssFile , file_get_contents($cssMinFile)."\n",FILE_APPEND); + file_put_contents($combinedCssFileMin, file_get_contents($cssMinFile)."\n",FILE_APPEND); + echo 'Copied source from minified css file '.$cssMinFile."\n"; + } + elseif (! is_file($lessFile)) + { + Logger::warn("Stylesheet not found: $lessFile"); + continue; + } + else + { + // Den absoluten Pfad zur LESS-Datei ermitteln. Dieser wird vom LESS-Parser für den korrekten Link + // auf die LESS-Datei in der Sourcemap benötigt. + $pfx = substr(realpath($lessFile),0,0-strlen(basename($lessFile))); + + $parser = new Less_Parser(array( + 'sourceMap' => true, + 'indentation' => ' ', + 'outputSourceFiles' => false, + 'sourceMapBasepath' => $pfx + )); + + + $parser->parseFile( $lessFile ); + $source = $parser->getCss(); + + file_put_contents($combinedCssFile, $source."\n",FILE_APPEND); + + $parser = new Less_Parser(array( + 'compress' => true, + 'sourceMap' => false, + 'indentation' => '' + )); + $parser->parseFile($lessFile); + $source = $parser->getCss(); + + file_put_contents($combinedCssFileMin, $source."\n",FILE_APPEND); + + echo 'Copied source from less source file '.$lessFile."\n"; + } + } + + echo 'Created file '.$combinedCssFileMin."\n"; + echo 'Created file '.$combinedCssFile ."\n"; + + } + + + + public function compileScripts() + { + $combinedJsFile = __DIR__.'/default/script/openrat.js'; + $combinedJsFileMin = __DIR__.'/default/script/openrat.min.js'; + + file_put_contents( $combinedJsFile ,''); + file_put_contents( $combinedJsFileMin,''); + + $js = []; + $js[] = __DIR__.'/default/script/jquery'; + $js[] = __DIR__.'/default/script/jquery-ui'; + //$js[] = __DIR__.'/default/script/jquery.scrollTo'; + // $js[] = OR_THEMES_EXT_DIR default/script/jquery.mjs.nestedSortable.js"></script> + + // Jquery-Plugins + $js[] = __DIR__.'/default/script/plugin/jquery-plugin-orSearch'; + $js[] = __DIR__.'/default/script/plugin/jquery-plugin-orLinkify'; + $js[] = __DIR__.'/default/script/plugin/jquery-plugin-orTree'; + $js[] = __DIR__.'/default/script/plugin/jquery-plugin-orLoadView'; + $js[] = __DIR__.'/default/script/plugin/jquery-plugin-orAutoheight'; + $js[] = __DIR__.'/default/script/jquery-qrcode'; + $js[] = __DIR__.'/default/script/jquery.hotkeys'; + + // Codemirror Source Editor + + $js[] = __DIR__.'/../../../editor/codemirror/lib/codemirror'; + $js[] = __DIR__.'/../../../editor/codemirror/lib/codemirror'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/handlebars/handlebars'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/smalltalk/smalltalk'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/php/php'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/cobol/cobol'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/haskell/haskell'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/mathematica/mathematica'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/pug/pug'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/livescript/livescript'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/yaml-frontmatter/yaml-frontmatter'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/stylus/stylus'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/markdown/markdown'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/jsx/jsx'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/velocity/velocity'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/fortran/fortran'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/mirc/mirc'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/xquery/xquery'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/elm/elm'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/vhdl/vhdl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/verilog/verilog'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/spreadsheet/spreadsheet'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/coffeescript/coffeescript'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/tiddlywiki/tiddlywiki'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/mumps/mumps'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/eiffel/eiffel'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/webidl/webidl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/ebnf/ebnf'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/http/http'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/textile/textile'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/r/r'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/haml/haml'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/ecl/ecl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/cypher/cypher'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/sieve/sieve'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/soy/soy'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/pig/pig'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/apl/apl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/crystal/crystal'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/clike/clike'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/oz/oz'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/modelica/modelica'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/gherkin/gherkin'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/swift/swift'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/scheme/scheme'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/idl/idl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/yaml/yaml'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/vue/vue'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/twig/twig'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/cmake/cmake'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/asciiarmor/asciiarmor'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/pegjs/pegjs'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/solr/solr'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/tiki/tiki'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/slim/slim'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/puppet/puppet'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/meta'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/go/go'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/commonlisp/commonlisp'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/rust/rust'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/powershell/powershell'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/stex/stex'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/q/q'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/htmlembedded/htmlembedded'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/d/d'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/protobuf/protobuf'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/mscgen/mscgen'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/django/django'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/toml/toml'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/yacas/yacas'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/dockerfile/dockerfile'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/python/python'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/vb/vb'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/octave/octave'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/tcl/tcl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/clojure/clojure'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/sass/sass'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/gas/gas'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/sas/sas'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/julia/julia'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/fcl/fcl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/tornado/tornado'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/asterisk/asterisk'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/sql/sql'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/gfm/gfm'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/mllike/mllike'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/rst/rst'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/ntriples/ntriples'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/sparql/sparql'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/properties/properties'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/rpm/rpm'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/htmlmixed/htmlmixed'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/xml/xml'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/ttcn-cfg/ttcn-cfg'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/ttcn/ttcn'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/z80/z80'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/brainfuck/brainfuck'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/forth/forth'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/nginx/nginx'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/javascript/javascript'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/pascal/pascal'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/haxe/haxe'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/perl/perl'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/factor/factor'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/smarty/smarty'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/vbscript/vbscript'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/dylan/dylan'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/asn.1/asn.1'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/ruby/ruby'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/nsis/nsis'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/css/css'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/haskell-literate/haskell-literate'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/mbox/mbox'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/dtd/dtd'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/erlang/erlang'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/turtle/turtle'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/troff/troff'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/jinja2/jinja2'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/diff/diff'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/dart/dart'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/shell/shell'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/lua/lua'; + $js[] = __DIR__.'/../../../editor/codemirror/mode/groovy/groovy'; + + + $js[] = __DIR__.'/../../../editor/simplemde/simplemde'; + $js[] = __DIR__.'/../../../editor/trumbowyg/trumbowyg'; + + + // OpenRat internal JS - als letztes, damit die vorigen bereits geladen sind. + $js[] = __DIR__.'/default/script/openrat/init'; + $js[] = __DIR__.'/default/script/openrat/view'; + $js[] = __DIR__.'/default/script/openrat/form'; + $js[] = __DIR__.'/default/script/openrat/workbench'; + $js[] = __DIR__.'/default/script/openrat/navigator'; + $js[] = __DIR__.'/default/script/openrat/common'; + + // Komponentenbasiertes Javascript + foreach ( TemplateEngineInfo::getComponentList() as $c) + { + $componentJsFile = __DIR__.'/../../../template_engine/components/html/' . $c . '/' . $c; + if (is_file($componentJsFile . '.js')) + $js[] = $componentJsFile; + } + + foreach ($js as $jsFile) + { + $jsFileMin = $jsFile . '.min.js'; + $jsFileNormal = $jsFile . '.js'; + + + if (!is_file($jsFileNormal) && !is_file($jsFileMin)) + { + Logger::warn("Missing Javascript file: $jsFileNormal"); + continue; + } + + file_put_contents($combinedJsFile, '/* Include script: '.$jsFileMin.' */'."\n",FILE_APPEND); + + if (!is_file($jsFileNormal) && is_file($jsFileMin)) + { + // Nur eine Min-Version existiert. Das ist ok. + file_put_contents($combinedJsFile , file_get_contents($jsFileMin),FILE_APPEND); + file_put_contents($combinedJsFileMin, file_get_contents($jsFileMin),FILE_APPEND); + + echo 'Copied content from minified source file '.$jsFileMin."\n"; + } + else + { + file_put_contents($combinedJsFile , file_get_contents($jsFileNormal),FILE_APPEND); + + $jz = new JSqueeze(); + file_put_contents($combinedJsFileMin, $jz->squeeze(file_get_contents($jsFileNormal)."\n"),FILE_APPEND); + + echo 'Copied content from source file '.$jsFileNormal."\n"; + } + } + echo 'Created file '.$combinedJsFile."\n"; + echo 'Created file '.$combinedJsFileMin."\n"; + } + +} diff --git a/modules/cms/ui/themes/default/production/combined.min.css b/modules/cms/ui/themes/default/production/combined.min.css @@ -1,8 +0,0 @@ -/*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family: 'Oxygen', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;font-size: 0.8em;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%}body{margin: 0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display: block}audio,canvas,progress,video{display: inline-block;vertical-align: baseline}audio:not([controls]){display: none;height: 0}[hidden],template{display: none}a{background: transparent}a:active,a:hover{outline: 0}abbr[title]{border-bottom: 1px dotted}b,strong{font-weight: bold}dfn{font-style: italic}h1{font-size: 1.2em;margin: .67em 0}mark{background: #ff0;color: #000}small{font-size: 80%}sub,sup{font-size: 75%;line-height: 0;position: relative;vertical-align: baseline}sup{top: -0.5em}sub{bottom: -0.25em}img{border: 0}svg:not(:root){overflow: hidden}figure{margin: 1em 40px}hr{-moz-box-sizing: content-box;box-sizing: content-box;height: 0}pre{overflow: auto}code,kbd,pre,samp{font-family: 'Source Code Pro', monospace, monospace;font-size: 1em}button,input,optgroup,select,textarea{color: inherit;background-color: inherit;font: inherit;margin: 0}button{overflow: visible}button,select{text-transform: none}button,html input[type="button"]{-webkit-appearance: button;cursor: pointer}button[disabled],html input[disabled]{cursor: default}button input::-moz-focus-inner{border: 0;padding: 0}input{line-height: normal}input[type="reset"],input[type="submit"]{-webkit-appearance: button;cursor: pointer}input[type="checkbox"],input[type="radio"]{box-sizing: border-box;padding: 0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height: auto}input[type="search"]{-webkit-appearance: textfield;-moz-box-sizing: content-box;-webkit-box-sizing: content-box;box-sizing: content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance: none}fieldset{border: 1px solid #c0c0c0;margin: 0 2px;padding: .35em .625em .75em}legend{border: 0;padding: 0}textarea{overflow: auto}optgroup{font-weight: bold}table{border-collapse: collapse;border-spacing: 0}td,th{padding: 0;text-align: left}*,::before,::after{box-sizing: border-box}.initial-hidden{display: none}.sort-value{display: none}legend{font-size: 1.1em;font-weight: bold;padding: 0 .5em}@font-face{font-family: 'Oxygen';font-style: normal;font-weight: 400;src: local('Oxygen Regular'), local('Oxygen-Regular'), url('../font/oxygen-v7-latin-regular.woff') format('woff2'), url('../font/oxygen-v7-latin-regular.woff') format('woff')}@font-face{font-family: 'Source Code Pro';font-style: normal;font-weight: 400;src: local('Source Code Pro'), local('SourceCodePro-Regular'), url('../font/source-code-pro-v8-latin-regular.woff2') format('woff2'), url('../font/source-code-pro-v8-latin-regular.woff') format('woff')}@font-face{font-family: 'Material Icons';font-style: normal;font-weight: 400;src: local('Material Icons'), local('MaterialIcons-Regular'), url('../font/MaterialIcons-Regular.woff2') format('woff2'), url('../font/MaterialIcons-Regular.woff') format('woff')}.image-icon{font-family: 'Material Icons';font-weight: normal;font-style: normal;display: inline-block;text-transform: none;letter-spacing: normal;word-wrap: normal;white-space: nowrap;direction: ltr;font-feature-settings: 'liga'}.image-icon.image-icon--action-el_text:after{content: "spellcheck"}.image-icon.image-icon--action-el_longtext:after{content: "view_headline"}.image-icon.image-icon--action-el_select:after{content: "list"}.image-icon.image-icon--action-el_number:after{content: "looks_one"}.image-icon.image-icon--action-el_link:after{content: "call_made"}.image-icon.image-icon--action-el_date:after{content: "date_range"}.image-icon.image-icon--action-el_insert:after{content: "keyboard_return"}.image-icon.image-icon--action-el_copy:after{content: "flip_to_back"}.image-icon.image-icon--action-el_linkinfo:after{content: "info"}.image-icon.image-icon--action-el_linkdate:after{content: "info"}.image-icon.image-icon--action-el_code:after{content: "code"}.image-icon.image-icon--action-el_dynamic:after{content: "play_circle_outline"}.image-icon.image-icon--action-el_info:after{content: "info"}.image-icon.image-icon--action-el_infodate:after{content: "info"}.image-icon.image-icon--action-el_checkbox:after{content: "check_box"}.image-icon.image-icon--action-image:after{content: "image"}.image-icon.image-icon--action-link:after{content: "call_made"}.image-icon.image-icon--action-url:after{content: "link"}.image-icon.image-icon--action-alias:after{content: "bookmark_border"}.image-icon.image-icon--action-text:after{content: "text_format"}.image-icon.image-icon--action-page:after{content: "insert_drive_file"}.image-icon.image-icon--action-file:after{content: "save"}.image-icon.image-icon--action-modellist:after{content: "device_hub"}.image-icon.image-icon--action-model:after{content: "device_hub"}.image-icon.image-icon--action-folder:after{content: "folder_open"}.image-icon.image-icon--action-languagelist:after{content: "language"}.image-icon.image-icon--action-language:after{content: "language"}.image-icon.image-icon--action-template:after{content: "receipt"}.image-icon.image-icon--action-templatelist:after{content: "receipt"}.image-icon.image-icon--action-groupllist:after{content: "group"}.image-icon.image-icon--action-group:after{content: "group"}.image-icon.image-icon--action-userlist:after{content: "person"}.image-icon.image-icon--action-user:after{content: "person"}.image-icon.image-icon--action-profile:after{content: "person_pin"}.image-icon.image-icon--method-settings:after{content: "settings"}.image-icon.image-icon--action-configuration:after{content: "settings"}.image-icon.image-icon--action-projectlist:after{content: "list"}.image-icon.image-icon--action-project:after{content: "account_balance"}.image-icon.image-icon--action-macro:after{content: "data_usage"}.image-icon.image-icon--action-membership{content: "card_membership"}.image-icon.image-icon--method-password:after{content: "lock"}.image-icon.image-icon--method-publish:after{content: "cloud_upload"}.image-icon.image-icon--method-show:after{content: "slideshow"}.image-icon.image-icon--method-src:after{content: "code"}.image-icon.image-icon--method-acl:after{content: "https"}.image-icon.image-icon--method-rights:after{content: "https"}.image-icon.image-icon--method-archive:after{content: "schedule"}.image-icon.image-icon--method-mail:after{content: "mail"}.image-icon.image-icon--method-search:after{content: "search"}.image-icon.image-icon--method-add:after{content: "add_box"}.image-icon.image-icon--menu-close:after{content: "close"}.image-icon.image-icon--menu-fullscreen:after{content: "fullscreen"}.image-icon.image-icon--menu-edit:after{content: "description"}.image-icon.image-icon--menu-extra:after{content: "build"}.image-icon.image-icon--menu-menu:after{content: "menu"}.image-icon.image-icon--menu-minimize:after{content: "compare_arrows"}.image-icon.image-icon--menu-qrcode:after{content: "phone_android"}.image-icon.image-icon--node-open:after{content: "expand_more"}.image-icon.image-icon--node-closed:after{content: "chevron_right"}.image-icon.image-icon--form-ok:after{content: "done"}.image-icon.image-icon--form-cancel:after{content: "clear"}.image-icon.image-icon--editor-bold:after{content: "format_bold"}.image-icon.image-icon--editor-italic:after{content: "format_italic"}.image-icon.image-icon--editor-headline:after{content: "format_size"}.image-icon.image-icon--editor-help:after{content: "help_outline"}.image-icon.image-icon--editor-fullscreen:after{content: "fullscreen"}.image-icon.image-icon--editor-quote:after{content: "format_quote"}.image-icon.image-icon--editor-unnumberedlist:after{content: "format_list_bulleted"}.image-icon.image-icon--editor-numberedlist:after{content: "format_list_numbered"}.image-icon.image-icon--editor-preview:after{content: "desktop_windows"}.image-icon.image-icon--editor-sidebyside:after{content: "flip"}.image-icon.image-icon--editor-link:after{content: "link"}.image-icon.image-icon--editor-image:after{content: "image"}.image-icon.image-icon--editor-undo:after{content: "undo"}.image-icon.image-icon--editor-redo:after{content: "redo"}.image-icon.image-icon--editor-code:after{content: "code"}.image-icon.image-icon--editor-horizontalrule:after{content: "remove"}.image-icon.image-icon--editor-table:after{content: "view_comfy"}.editor-toolbar{font-size: 1.5em}iframe{width: 100%;height: 500px;display: block}div.breadcrumb,div.breadcrumb a,div.panel > div.title{font-weight: bold}div#noticebar{display: block;position: fixed;bottom: 40px;right: 40px;width: 25em;z-index: 113}div#noticebar div.notice{border: 2px solid #000;padding: 1.1em;margin: 5px;position: relative;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;-webkit-box-shadow: 3px 2px 5px #000;-moz-box-shadow: 3px 2px 5px #000;box-shadow: 3px 2px 5px #000}div#noticebar div.notice .or-notice-toolbar{float: right;margin: 0 .2em;font-size: 2em;color: gray;cursor: pointer}div#noticebar div.notice:hover .or-notice-toolbar{color: black}div#noticebar div.notice.full{display: block;position: fixed;bottom: 10%;top: 10%;right: 10%;left: 10%;width: 80%;z-index: 114}div#noticebar div.notice.error div.text{font-weight: bold}div#noticebar div.notice div.text{font-size: 1.1em}div#noticebar div.notice:after{content: '';position: absolute;right: 0;top: 50%;width: 0;height: 0;border: 1em solid transparent;border-right: 0;margin-top: -1em;margin-right: -1em}div#noticebar div.notice div.log{display: none;position: relative;max-height: 90%;overflow: auto;font-family: 'Source Code Pro', Monospace, Monospaced, Courier}div#noticebar div.notice.full div.log{display: block}div.onrowvisible{visibility: hidden;display: inline}a:link,a:visited{font-weight: normal;text-decoration: none}a:active,a:hover{font-weight: normal;text-decoration: none}img[align=left],img[align=right]{padding-right: 1px;padding-left: 1px}div.logo h2{font-weight: normal;font-size: 24px}div.logo p{font-size: 13px}label,.clickable{cursor: pointer}.or-droppable--active{background-color: #2E8B57 !important;cursor: move}.or-droppable--hover{background-color: #00d95a !important;cursor: move}img.icon{padding: 4px;width: 16px;height: 16px}div.panel ul.views li{vertical-align: middle;padding: 0px;cursor: pointer;border-right: 1px solid #000;-moz-border-radius-topleft: 5px;-webkit-border-radius-topleft: 5px;-khtml-border-top-radius-topleft: 5px;-moz-border-radius-topright: 5px;-webkit-border-radius-topright: 5px;-khtml-border-top-radius-topright: 5px;border-top-right-radius: 5px;display: inline;white-space: nowrap;float: left}div.panel{margin: 0px;padding: 0px}div.panel div.status{padding: 10px}div.panel div.status div.error,div.message.error{background: url(../images/notice_error.png) no-repeat;background-position: 5px 7px}div.panel div.status div.warn,div.message.warn{background: url(../images/notice_warning.png) no-repeat;background-position: 5px 7px}div.panel div.status div.ok,div.message.ok{background: url(../images/notice_ok.png) no-repeat;background-position: 5px 7px}div.panel div.status div.info,div.message.info{background: url(../images/notice_info.png) no-repeat;background-position: 5px 7px}div.panel div.status div,div.message{border: 1px solid #000;padding: 5px 0px 5px 25px;margin: 10px 10px 20px 10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border-radius: 5px}#workbench div.panel.fullscreen{display: block;z-index: 109;position: fixed;top: 0;left: 0;background-color: #000;margin: 0px;width: 100% !important;height: 100% !important}#workbench div.panel.fullscreen > div.content{width: 100% !important;height: 100% !important}#workbench div.panel{border: 1px solid #000;margin: 0px;padding: 0px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border-radius: 5px}#workbench div.container,#workbench div.panel,#workbench div.divider{display: inline;float: left;margin: 0px}#workbench div.panel > div.content{overflow: auto}.invisible{visibility: hidden}.visible{visibility: visible}div.panel{position: relative}div.content div.bottom{height: 55px;width: 100%;position: absolute;padding-right: 40px;bottom: 0px;right: 0px;xvisibility: hidden}div.content div.bottom > div.command{xvisibility: visible;float: right;z-index: 20}div.content form[data-autosave='true'] div.command{display: none}div.content > form{padding-bottom: 45px}main .or-form .or-form-actionbar{display: none}.or-form{padding: 1em}.or-form input[type=checkbox] + label,.or-form input[type=radio] + label{width: 80%}.or-form .headline{font-size: 1.8em}.or-form div.inputholder > div.dropdown{width: 70%}.or-form input.submit{padding: 7px;border: 0px;-moz-border-radius: 7px;-webkit-border-radius: 7px;-khtml-border-radius: 7px;border-radius: 7px;margin-left: 20px;cursor: pointer}.or-form input[type=text],.or-form select,.or-form textarea{width: 100%;padding: 12px;border: 1px solid #ccc;border-radius: 4px;box-sizing: border-box;resize: vertical}.or-form label{padding: 12px 12px 12px 0;display: inline-block}.or-form input[type=submit]{color: white;padding: 12px 20px;border: none;border-radius: 4px;cursor: pointer;float: right}.or-form div.label{float: left;width: 25%;margin-top: 6px}.or-form div.input{float: left;width: 75%;margin-top: 6px}.or-form .line:after{content: "";display: table;clear: both}.or-form .or-form-row{display: flex;align-items: center}.or-form .or-form-row .or-form-label{width: 25%}.or-form .or-form-row .or-form-input{width: 75%}.or-form .or-form-actionbar{position: sticky;bottom: 0;left: 0;right: 0;display: flex;justify-content: end;padding: 1em;height: auto}.or-form .or-form-actionbar .or-form-btn{padding: 1em 2em;margin-left: 1.5em;min-width: 14em;border: 0;border-radius: .5em;-moz-border-radius: .5em;-webkit-border-radius: .5em;-khtml-border-radius: .5em;cursor: pointer}.or-form .or-form-actionbar .or-form-btn--primary{font-weight: bold}@media screen and (max-width: 65rem){.or-form div.label,.or-form div.input{width: 100%;margin-top: 0}.or-form .or-form-row{flex-direction: column}.or-form .or-form-row .or-form-label,.or-form .or-form-row .or-form-input{width: 100%}.or-form .or-form-actionbar{align-items: center;display: block}.or-form .or-form-actionbar .or-form-btn{width: 90%}}.or-link-btn{padding: .5em 1em;min-width: 5em;border: 0;border-radius: .3em;-moz-border-radius: .3em;-webkit-border-radius: .3em;-khtml-border-radius: .3em;cursor: pointer}div.search > div.inputholder{padding-top: 1px}div.inputholder > input,div.inputholder > textarea,div.inputholder > select{padding: 2px;margin: 0px}fieldset > div input.name,fieldset > div span.name{font-weight: bold}fieldset > div input.filename,fieldset > div input.extension,fieldset > div input.ansidate,fieldset > div span.filename,fieldset > div span.extension,fieldset > div span.ansidate{font-family: 'Source Code Pro', Monospace, Monospaced, Courier}dl.notice{padding: 15px}div.content pre,div.dropdown{min-width: 150px;max-width: 450px}img.image-icon{visibility: hidden}.CodeMirror{height: auto}.or-linklist{display: flex;flex-direction: column;padding: 10% 20%}.or-linklist > .or-linklist-line{border: 1px solid;margin-top: 1em;padding: 1em;border-radius: .5em;-moz-border-radius: .5em;-webkit-border-radius: .5em;-khtml-border-radius: .5em}.or-info{position: relative}.or-info:hover .or-info-popup{display: block}.or-info .or-info-popup{display: none;position: absolute;top: 0px;left: 0px;overflow: visible;border: 0.5em;font-size: 2em;border-radius: .3em;-moz-border-radius: .3em;-webkit-border-radius: .3em;-khtml-border-radius: .3em;padding: 1.0em;z-index: 105}.or-info .or-info-popup > div{display: inline-block}#title{overflow: hidden;padding: 5px}.or-menu{display: flex;justify-content: space-between}.or-menu .or-menu-group{display: flex}.or-menu .or-menu-group:nth-last-child(1) div.dropdown{right: 10px}.or-menu .or-menu-group i.image-icon{width: 1.1em}.or-menu .or-menu-group div > div.arrow-down{width: 0;height: 0;margin: 6px;padding: 0px;margin-top: 10px}.or-menu .or-menu-group div.toolbar-icon{padding: 2px;margin-left: 10px;float: left}.or-menu .or-menu-group div.toolbar-icon.user,.or-menu .or-menu-group div.toolbar-icon.search,.or-menu .or-menu-group div.toolbar-icon.history{float: right;margin-right: 10px;margin-left: 10px}.or-menu .or-menu-group div.toolbar-icon.menu{cursor: default}.or-menu .or-menu-group div.toolbar-icon.search .inputholder{margin: 0;padding: 0;border: 0;display: inline}.or-menu .or-menu-group div.toolbar-icon.search .inputholder input{border: 0;margin: 0;padding: 0;width: 3em;display: inline;transition: width .3s ease-in-out}.or-menu .or-menu-group div.toolbar-icon.search .inputholder input:focus{width: 8em}.or-menu .or-menu-group div.toolbar-icon div.dropdown{z-index: 120;min-width: 250px;display: none;position: absolute;padding: 5px 0px;font-style: normal;font-weight: normal;text-decoration: none}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry{padding: 0}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a{display: flex;align-items: center;padding: 0 .5em}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a *{margin: 0.25em}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a span:first-of-type{flex: 1}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > .text{display: block;margin: 10px}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.divide{height: 1px;width: 100%;margin-top: 5px;margin-bottom: 5px}.or-menu.open .toolbar-icon.open > div.dropdown{display: block}#navigation ul.or-navtree-list{list-style-type: none;margin: 0;padding: 0}#navigation ul.or-navtree-list ul{margin-left: 18px}#navigation ul.or-navtree-list .or-navtree-node-control{width: 18px;min-width: 18px;height: 18px;float: left;cursor: pointer}#navigation ul.or-navtree-list .or-navtree-node{margin: 0;padding: 0;line-height: 18px;font-weight: normal;white-space: nowrap}#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected{font-weight: bold}#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected > div > a{font-weight: bold}div#dialog > .view{overflow: auto;position: absolute;top: 5%;left: 10%;width: 80%;height: 80%;z-index: 110;border: 1px solid !important}@media only screen and (max-width: 55rem){div#dialog > .view{top: 2.5%;left: 2.5%;width: 95%;height: 95%}}div#dialog.is-closed{display: none;width: 0}div#dialog .filler{position: absolute;z-index: 100;top: 0;left: 0;height: 100%;width: 100%;opacity: 0.5}div#dialog .filler span.icon{opacity: 1;font-size: 3em;font-weight: bold;text-align: center;width: 40px;height: 40px;position: absolute;right: 20px;top: 20px}.arrow{width: 0;height: 0;margin: 6px;padding: 0;font-size: 0}.arrow.arrow-down{border-right: 6px solid transparent;border-top: 6px solid;border-left: 6px solid transparent;border-bottom: 4px solid transparent;margin-top: 10px}.arrow.arrow-right{border-top: 6px solid transparent;border-left: 6px solid;border-bottom: 6px solid transparent;border-right: 4px solid transparent;margin-left: 10px}#editor .dirty{font-weight: bold}.visible-for-nojs{display: none}html.nojs .noscript{display: block}.toggle-open-close{display: flex;flex-direction: column}.toggle-open-close .on-click-open-close{cursor: pointer;font-weight: normal}.toggle-open-close > .closable{transition: opacity .3s ease-out;flex: 1;display: block}.toggle-open-close.closed > .on-click-open-close > .on-closed{display: inline}.toggle-open-close.closed > .on-click-open-close > .on-open{display: none}.toggle-open-close.closed > .closable{opacity: 0;max-height: 0;overflow: hidden}.toggle-open-close.open > .closable{height: auto}.toggle-open-close.open > .on-click-open-close > .on-closed{display: none}.toggle-open-close.open > .on-click-open-close > .on-open{display: inline}html,body{width: 100%;height: 100%}div#workbench{width: 100%;height: 100%;display: flex;flex-direction: column}div#workbench > header{height: 3.0rem}div#workbench > header .toolbar-icon .arrow-down{display: inline}@media only screen and (max-width: 55rem){div#workbench > header .toolbar-icon span.label,div#workbench > header .toolbar-icon .arrow-down{display: none}}div#workbench > .or-main-area{flex: 1;min-height: 0;padding-top: 0.5em}div#workbench > .or-main-area > *{min-width: 0;min-height: 0;overflow-y: auto;overflow-x: hidden;height: 100%}div#workbench > .or-main-area > nav{width: 33%;transition: width .15s ease-in-out;position: fixed;height: calc(100% - 3.0rem - 0.5em)}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > nav{width: 0}}div#workbench > .or-main-area > nav.small{width: 5%;opacity: 0.5;overflow-y: hidden}div#workbench > .or-main-area > nav.small:hover{width: 33%;overflow-y: auto;opacity: 1;background-color: inherit;border-right: 1px solid inherit}div#workbench > .or-main-area > nav.small ~ .or-workplace{margin-left: 5%}div#workbench > .or-main-area > nav.open{overflow-y: auto}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > nav.open{width: 95%;border-right: 1px solid;opacity: 0.95}}@media only screen and (min-width: 75rem){div#workbench > .or-main-area > nav{width: 33%;overflow-y: auto}}div#workbench > .or-main-area > nav div.view{height: 100%}div#workbench > .or-main-area header .or-view-icon,div#workbench > .or-main-area header .or-view-headline{margin: 0.3em;display: inline;font-size: 1.2em;line-height: 1.5em}div#workbench > .or-main-area > .or-workplace{margin-left: 33%;transition: margin-left .15s ease-in-out}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace{margin-left: 0}}div#workbench > .or-main-area > .or-workplace > #editor{transition: opacity .5s ease;display: flex;flex-direction: column}div#workbench > .or-main-area > .or-workplace > #editor.is-closed{flex: 0.5;cursor: not-allowed;pointer-events: none}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace > #editor.is-closed{flex: 0}}div#workbench > .or-main-area > .or-workplace > #editor > section{margin: 1.5em;border: 1px solid;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace > #editor > section{margin: 0.5em}}div#workbench > .or-main-area > .or-workplace > #editor > section .view-toolbar{display: inline}div#workbench > .or-main-area > .or-workplace > #editor > section.closed .view-toolbar{display: none}#title .toggle-nav-small{display: inline}@media only screen and (max-width: 55rem){#title .toggle-nav-small{display: none}}#title .toggle-nav-open-close{display: none}@media only screen and (max-width: 55rem){#title .toggle-nav-open-close{display: inline}}@media only screen and (max-width: 55rem){#title .toolbar-icon.search input{width: 3em}}.loader{background: url(../images/loader.gif) no-repeat;background-position: center, top;height: 30px;opacity: 0.5;cursor: wait;pointer-events: none}@media only screen and (max-width: 55rem){html{font-size: 1em}}.toggle-nav-small,.or-navigation{z-index: 102}.toggle-nav-small:hover,.or-navigation:hover{z-index: 112}.or-breadcrumb{margin-bottom: 0.1em;margin-left: 1.5em;line-height: 18px;font-weight: normal;white-space: nowrap}.or-breadcrumb li{display: inline;margin-right: 0.3em}.or-breadcrumb .or-breadcrumb-item .image-icon{margin-right: 0.2em}.editor__text-editor{width: 100%;height: 300px}textarea.editor__code-editor{display: none}div.editor__code-editor{position: absolute;height: 500px;width: 100%;font-size: 14px;z-index: 256}textarea.editor__text-editor,textarea.editor__wiki-editor,textarea.editor__html-editor{width: 100%}a.editorlink:active,a.editorlink:hover{font-weight: normal;text-decoration: none}a.editorlink:link,a.editorlink:visited{font-weight: normal;text-decoration: none}@media screen and (max-width: 40em){.or-table-wrapper .or-table-area{overflow-x: auto}}.or-table-wrapper .or-table-area table{overflow: auto;border: 2px;width: 100%}.or-table-wrapper .or-table-area table tr.headline > td,.or-table-wrapper .or-table-area table tr > th{padding: 3px;font-weight: bold}.or-table-wrapper .or-table-area table tr.headline > td.sort-asc > span:last-child:after,.or-table-wrapper .or-table-area table tr > th.sort-asc > span:last-child:after{content: " \2193"}.or-table-wrapper .or-table-area table tr.headline > td.sort-desc > span:last-child:after,.or-table-wrapper .or-table-area table tr > th.sort-desc > span:last-child:after{content: " \2191"}.or-table-wrapper .or-table-area table tr.data > td{padding: 3px}.or-table-wrapper .or-table-area table tr > td{white-space: nowrap;text-overflow: ellipsis;overflow: hidden;max-width: 0}.or-table-wrapper .or-table-area table td.readonly{font-style: italic;font-weight: normal}.or-table-wrapper .or-table-area table td.default{font-style: normal;font-weight: normal}.or-table-wrapper .or-table-area table td.changed{font-style: normal;font-weight: bold}.or-table-wrapper .or-table-area table td.notice{margin: 0px;padding: 5%;text-align: center}.or-table-wrapper .or-table-area table.notice{width: 100%;border: 1px solid;border-spacing: 0px}.or-table-wrapper .or-table-area table.notice th{padding: 2px;white-space: nowrap;border-bottom: 1px solid #000;font-weight: normal;text-align: left}.or-table-wrapper .or-table-area table.notice tr.warning{margin: 0px;padding: 0px}.or-table-wrapper .or-table-area table.calendar{table-layout: fixed;border-collapse: collapse;text-align: center}.or-table-wrapper .or-table-area table.calendar td{border: 1px dotted}.or-table-wrapper .or-table-area table td.notice{margin: 0px;padding: 5%;text-align: center}.or-table-wrapper .or-table-area table.notice{width: 100%;border: 1px solid;border-spacing: 0px}.or-table-wrapper .or-table-area table.notice th{padding: 2px;white-space: nowrap;border-bottom: 1px solid #000;font-weight: normal;text-align: left}.or-table-wrapper .or-table-area table.notice tr.warning{margin: 0px;padding: 0px}.or-table-wrapper .or-table-area table.calendar{table-layout: fixed;border-collapse: collapse;text-align: center}.or-table-wrapper .or-table-area table.calendar td{border: 1px dotted}.or-table-wrapper .or-table-area table td.motd{border-left: 3px solid #f00;border-right: 3px solid #f00;font-weight: bold;padding: 10px;margin: 10px}.or-table-wrapper .or-table-area table td:hover > div.onrowvisible{visibility: visible}.or-table-wrapper .or-table-area table tr.diff > td.line{background-color: #000;padding-right: 2px;border-right: 3px solid #000;text-align: right;margin-right: 2px}.or-table-wrapper .or-table-area table tr.diff > td.old{background-color: red}.or-table-wrapper .or-table-area table tr.diff td.new{background-color: green}.or-table-wrapper .or-table-area table tr.diff td.notequal{background-color: yellow}.or-table-wrapper .or-table-area table tr td.help{font-style: italic}.or-table-wrapper .or-table-area table tr.headline td.help{font-style: normal}.or-table-wrapper .or-table-area table td.logo{padding: 10px;margin: 0px}.or-table-wrapper .or-table-filter{width: 100%;text-align: right}.or-table-wrapper .or-table-filter input{border-radius: 3px;-moz-border-radius: 3px;-webkit-border-radius: 3px;-khtml-border-radius: 3px;padding: 0.5em;margin: 1em;background-color: #000;color: #000;border: 1px solid #000}.or-group{border: 1px solid;border-bottom: 0;border-left: 0;border-right: 0;margin-top: 20px;margin-bottom: 20px;margin-left: 0px;margin-right: 0px;padding: 10px}div.or-dropzone-upload > div.input{width: 100%;height: 100px;border: 1px dotted}/** - * simplemde v1.11.2 - * Copyright Next Step Webs, Inc. - * @link https://github.com/NextStepWebs/simplemde-markdown-editor - * @license MIT - */ -.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)}/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ -#trumbowyg-icons,#trumbowyg-icons svg{height:0;width:0}#trumbowyg-icons{overflow:hidden;visibility:hidden}.trumbowyg-box *,.trumbowyg-box ::after,.trumbowyg-box ::before{box-sizing:border-box}.trumbowyg-box svg{width:17px;height:100%;fill:#222}.trumbowyg-box,.trumbowyg-editor{display:block;position:relative;border:1px solid #DDD;width:100%;min-height:300px;margin:17px auto}.trumbowyg-box .trumbowyg-editor{margin:0 auto}.trumbowyg-box.trumbowyg-fullscreen{background:#FEFEFE;border:none!important}.trumbowyg-editor,.trumbowyg-textarea{position:relative;box-sizing:border-box;padding:20px;min-height:300px;width:100%;border-style:none;resize:none;outline:0;overflow:auto}.trumbowyg-editor.trumbowyg-autogrow-on-enter,.trumbowyg-textarea.trumbowyg-autogrow-on-enter{transition:height .3s ease-out}.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:transparent!important;text-shadow:0 0 7px #333}@media screen and (min-width:0 \0){.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(200,200,200,.6)!important}}@supports (-ms-accelerator:true){.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(200,200,200,.6)!important}}.trumbowyg-box-blur .trumbowyg-editor hr,.trumbowyg-box-blur .trumbowyg-editor img{opacity:.2}.trumbowyg-textarea{position:relative;display:block;overflow:auto;border:none;font-size:14px;font-family:Inconsolata,Consolas,Courier,"Courier New",sans-serif;line-height:18px}.trumbowyg-box.trumbowyg-editor-visible .trumbowyg-textarea{height:1px!important;width:25%;min-height:0!important;padding:0!important;background:0 0;opacity:0!important}.trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-textarea{display:block}.trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-editor{display:none}.trumbowyg-box.trumbowyg-disabled .trumbowyg-textarea{opacity:.8;background:0 0}.trumbowyg-editor[contenteditable=true]:empty:not(:focus)::before{content:attr(placeholder);color:#999;pointer-events:none}.trumbowyg-button-pane{width:100%;min-height:36px;background:#ecf0f1;border-bottom:1px solid #d7e0e2;margin:0;padding:0 5px;position:relative;list-style-type:none;line-height:10px;backface-visibility:hidden;z-index:11}.trumbowyg-button-pane::after{content:" ";display:block;position:absolute;top:36px;left:0;right:0;width:100%;height:1px;background:#d7e0e2}.trumbowyg-button-pane .trumbowyg-button-group{display:inline-block}.trumbowyg-button-pane .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:transparent}.trumbowyg-button-pane .trumbowyg-button-group::after{content:" ";display:inline-block;width:1px;background:#d7e0e2;margin:0 5px;height:35px;vertical-align:top}.trumbowyg-button-pane .trumbowyg-button-group:last-child::after{content:none}.trumbowyg-button-pane button{display:inline-block;position:relative;width:35px;height:35px;padding:1px 6px!important;margin-bottom:1px;overflow:hidden;border:none;cursor:pointer;background:0 0;vertical-align:middle;transition:background-color 150ms,opacity 150ms}.trumbowyg-button-pane button.trumbowyg-textual-button{width:auto;line-height:35px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-button-pane button.trumbowyg-disable,.trumbowyg-button-pane.trumbowyg-disable button:not(.trumbowyg-not-disable):not(.trumbowyg-active),.trumbowyg-disabled .trumbowyg-button-pane button:not(.trumbowyg-not-disable):not(.trumbowyg-viewHTML-button){opacity:.2;cursor:default}.trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::before,.trumbowyg-disabled .trumbowyg-button-pane .trumbowyg-button-group::before{background:#e3e9eb}.trumbowyg-button-pane button.trumbowyg-active,.trumbowyg-button-pane button:not(.trumbowyg-disable):focus,.trumbowyg-button-pane button:not(.trumbowyg-disable):hover{background-color:#FFF;outline:0}.trumbowyg-button-pane .trumbowyg-open-dropdown::after{display:block;content:" ";position:absolute;top:25px;right:3px;height:0;width:0;border:3px solid transparent;border-top-color:#555}.trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button{padding-left:10px!important;padding-right:18px!important}.trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button::after{top:17px;right:7px}.trumbowyg-modal,.trumbowyg-modal-box{top:0;left:50%;transform:translateX(-50%);backface-visibility:hidden;position:absolute}.trumbowyg-button-pane .trumbowyg-right{float:right}.trumbowyg-dropdown{width:200px;border:1px solid #ecf0f1;padding:5px 0;border-top:none;background:#FFF;margin-left:-1px;box-shadow:rgba(0,0,0,.1) 0 2px 3px;z-index:12}.trumbowyg-dropdown button{display:block;width:100%;height:35px;line-height:35px;text-decoration:none;background:#FFF;padding:0 10px;color:#333!important;border:none;cursor:pointer;text-align:left;font-size:15px;transition:all 150ms}.trumbowyg-dropdown button:focus,.trumbowyg-dropdown button:hover{background:#ecf0f1}.trumbowyg-dropdown button svg{float:left;margin-right:14px}.trumbowyg-modal{max-width:520px;width:100%;height:350px;z-index:12;overflow:hidden}.trumbowyg-modal-box{max-width:500px;width:calc(100% - 20px);padding-bottom:45px;z-index:1;background-color:#FFF;text-align:center;font-size:14px;box-shadow:rgba(0,0,0,.2) 0 2px 3px}.trumbowyg-modal-box .trumbowyg-modal-title{font-size:24px;font-weight:700;margin:0 0 20px;padding:15px 0 13px;display:block;border-bottom:1px solid #EEE;color:#333;background:#fbfcfc}.trumbowyg-modal-box .trumbowyg-progress{width:100%;height:3px;position:absolute;top:58px}.trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar{background:#2BC06A;width:0;height:100%;transition:width 150ms linear}.trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:29px;line-height:29px;overflow:hidden}.trumbowyg-modal-box label .trumbowyg-input-infos{display:block;text-align:left;height:25px;line-height:25px;transition:all 150ms}.trumbowyg-modal-box label .trumbowyg-input-infos span{display:block;color:#69878f;background-color:#fbfcfc;border:1px solid #DEDEDE;padding:0 7px;width:150px}.trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-modal-box label.trumbowyg-input-error textarea{border:1px solid #e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos{margin-top:-27px}.trumbowyg-modal-box label input{position:absolute;top:0;right:0;height:27px;line-height:27px;border:1px solid #DEDEDE;background:#fff;font-size:14px;max-width:330px;width:70%;padding:0 7px;transition:all 150ms}.trumbowyg-modal-box label input:focus,.trumbowyg-modal-box label input:hover{outline:0;border:1px solid #95a5a6}.trumbowyg-modal-box label input:focus{background:#fbfcfc}.trumbowyg-modal-box label input[type=checkbox]{left:5px;top:5px;right:auto}.trumbowyg-modal-box label input[type=checkbox]+.trumbowyg-input-infos span{width:auto;padding-left:25px}.trumbowyg-modal-box .error{margin-top:25px;display:block;color:red}.trumbowyg-modal-box .trumbowyg-modal-button{position:absolute;bottom:10px;right:0;text-decoration:none;color:#FFF;display:block;width:100px;height:35px;line-height:33px;margin:0 10px;background-color:#333;border:none;cursor:pointer;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif;font-size:16px;transition:all 150ms}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{right:110px;background:#2bc06a}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover{background:#40d47e;outline:0}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#25a25a}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{color:#555;background:#e6e6e6}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover{background:#fbfbfb;outline:0}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#d5d5d5}.trumbowyg-overlay{position:absolute;background-color:rgba(255,255,255,.5);height:100%;width:100%;left:0;display:none;top:0;z-index:10}body.trumbowyg-body-fullscreen{overflow:hidden}.trumbowyg-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:99999}.trumbowyg-fullscreen .trumbowyg-editor,.trumbowyg-fullscreen.trumbowyg-box{border:none}.trumbowyg-fullscreen .trumbowyg-editor,.trumbowyg-fullscreen .trumbowyg-textarea{height:calc(100% - 37px)!important;overflow:auto}.trumbowyg-fullscreen .trumbowyg-overlay{height:100%!important}.trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:#222;fill:transparent}.trumbowyg-editor embed,.trumbowyg-editor img,.trumbowyg-editor object,.trumbowyg-editor video{max-width:100%}.trumbowyg-editor img,.trumbowyg-editor video{height:auto}.trumbowyg-editor img{cursor:move}.trumbowyg-editor.trumbowyg-reset-css{background:#FEFEFE!important;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif!important;font-size:14px!important;line-height:1.45em!important;color:#333}.trumbowyg-editor.trumbowyg-reset-css a{color:#15c!important;text-decoration:underline!important}.trumbowyg-editor.trumbowyg-reset-css blockquote,.trumbowyg-editor.trumbowyg-reset-css div,.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css p,.trumbowyg-editor.trumbowyg-reset-css ul{box-shadow:none!important;background:0 0!important;margin:0 0 15px!important;line-height:1.4em!important;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif!important;font-size:14px!important;border:none}.trumbowyg-editor.trumbowyg-reset-css hr,.trumbowyg-editor.trumbowyg-reset-css iframe,.trumbowyg-editor.trumbowyg-reset-css object{margin-bottom:15px!important}.trumbowyg-editor.trumbowyg-reset-css blockquote{margin-left:32px!important;font-style:italic!important;color:#555}.trumbowyg-editor.trumbowyg-reset-css ul{list-style:disc}.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css ul{padding-left:20px!important}.trumbowyg-editor.trumbowyg-reset-css ol ol,.trumbowyg-editor.trumbowyg-reset-css ol ul,.trumbowyg-editor.trumbowyg-reset-css ul ol,.trumbowyg-editor.trumbowyg-reset-css ul ul{border:none;margin:2px!important;padding:0 0 0 24px!important}.trumbowyg-editor.trumbowyg-reset-css hr{display:block;height:1px;border:none;border-top:1px solid #CCC}.trumbowyg-editor.trumbowyg-reset-css h1,.trumbowyg-editor.trumbowyg-reset-css h2,.trumbowyg-editor.trumbowyg-reset-css h3,.trumbowyg-editor.trumbowyg-reset-css h4{color:#111;background:0 0;margin:0!important;padding:0!important;font-weight:700}.trumbowyg-editor.trumbowyg-reset-css h1{font-size:32px!important;line-height:38px!important;margin-bottom:20px!important}.trumbowyg-editor.trumbowyg-reset-css h2{font-size:26px!important;line-height:34px!important;margin-bottom:15px!important}.trumbowyg-editor.trumbowyg-reset-css h3{font-size:22px!important;line-height:28px!important;margin-bottom:7px!important}.trumbowyg-editor.trumbowyg-reset-css h4{font-size:16px!important;line-height:22px!important;margin-bottom:7px!important}.trumbowyg-dark .trumbowyg-textarea{background:#111;color:#ddd}.trumbowyg-dark .trumbowyg-box{border:1px solid #343434}.trumbowyg-dark .trumbowyg-box.trumbowyg-fullscreen{background:#111}.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{text-shadow:0 0 7px #ccc}@media screen and (min-width:0 \0){.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(20,20,20,.6)!important}}@supports (-ms-accelerator:true){.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(20,20,20,.6)!important}}.trumbowyg-dark .trumbowyg-box svg{fill:#ecf0f1;color:#ecf0f1}.trumbowyg-dark .trumbowyg-button-pane{background-color:#222;border-bottom-color:#343434}.trumbowyg-dark .trumbowyg-button-pane::after{background:#343434}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty)::after{background-color:#343434}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty) .trumbowyg-fullscreen-button svg{color:transparent}.trumbowyg-dark .trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::after{background-color:#2a2a2a}.trumbowyg-dark .trumbowyg-button-pane button.trumbowyg-active,.trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):focus,.trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):hover{background-color:#333}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-open-dropdown::after{border-top-color:#fff}.trumbowyg-dark .trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:#ecf0f1;fill:transparent}.trumbowyg-dark .trumbowyg-dropdown{border-color:#222;background:#333;box-shadow:rgba(0,0,0,.3) 0 2px 3px}.trumbowyg-dark .trumbowyg-dropdown button{background:#333;color:#fff!important}.trumbowyg-dark .trumbowyg-dropdown button:focus,.trumbowyg-dark .trumbowyg-dropdown button:hover{background:#222}.trumbowyg-dark .trumbowyg-modal-box{background-color:#222}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-title{border-bottom:1px solid #555;color:#fff;background:#3c3c3c}.trumbowyg-dark .trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:27px;line-height:27px;overflow:hidden}.trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span{color:#eee;background-color:#2f2f2f;border-color:#222}.trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error textarea{border-color:#e74c3c}.trumbowyg-dark .trumbowyg-modal-box label input{border-color:#222;color:#eee;background:#333}.trumbowyg-dark .trumbowyg-modal-box label input:focus,.trumbowyg-dark .trumbowyg-modal-box label input:hover{border-color:#626262}.trumbowyg-dark .trumbowyg-modal-box label input:focus{background-color:#2f2f2f}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{background:#1b7943}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus,.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover{background:#25a25a}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#176437}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{background:#333;color:#ccc}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus,.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover{background:#444}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#111}.trumbowyg-dark .trumbowyg-overlay{background-color:rgba(15,15,15,.6)}- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/production/combined.min.js b/modules/cms/ui/themes/default/production/combined.min.js @@ -1,10849 +0,0 @@ - -/* ./modules/cms/ui/themes/default/script/jquery.min.js *//*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!==C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[k]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[k]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[k]&&(v=Ce(v)),y&&!y[k]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[k]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=N[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?i.push(a):o.push(a);(a=N(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=S+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t===C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument===C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(S=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(S=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=k.split("").sort(D).join("")===k,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=k.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&N.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){k.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return k.Deferred(function(r){k.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=k.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var _=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)_(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<k.inArray(o,r))i&&i.push(o);else if(l=oe(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<k(i,this).index(l):k.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Q.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ke:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ne),!1},trigger:function(){return De(this,e),!0},delegateType:t}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Me(o[r],a[r]);else Me(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return _(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Nt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||Nt.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Pt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+$t+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=_t(Wt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k}); - -/* ./modules/cms/ui/themes/default/script/jquery-ui.min.js *//*! jQuery UI - v1.12.1 - 2018-09-03 -* http://jqueryui.com -* Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js, widgets/droppable.js, widgets/sortable.js, widgets/mouse.js -* Copyright jQuery Foundation and other contributors; Licensed MIT */ -(function(t){if(typeof define==="function"&&define.amd){define(["jquery"],t)} -else{t(jQuery)}}(function(t){t.ui=t.ui||{};var g=t.ui.version="1.12.1"; -/*! - * jQuery UI Widget 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;var o=0,s=Array.prototype.slice;t.cleanData=(function(e){return function(i){var s,o,n;for(n=0;(o=i[n])!=null;n++){try{s=t._data(o,"events");if(s&&s.remove){t(o).triggerHandler("remove")}}catch(r){}};e(i)}})(t.cleanData);t.widget=function(e,i,s){var r,o,a,l={};var n=e.split(".")[0];e=e.split(".")[1];var h=n+"-"+e;if(!s){s=i;i=t.Widget};if(t.isArray(s)){s=t.extend.apply(null,[{}].concat(s))};t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)};t[n]=t[n]||{};r=t[n][e];o=t[n][e]=function(t,e){if(!this._createWidget){return new o(t,e)};if(arguments.length){this._createWidget(t,e)}};t.extend(o,r,{version:s.version,_proto:t.extend({},s),_childConstructors:[]});a=new i();a.options=t.widget.extend({},a.options);t.each(s,function(e,s){if(!t.isFunction(s)){l[e]=s;return};l[e]=(function(){function t(){return i.prototype[e].apply(this,arguments)};function o(t){return i.prototype[e].apply(this,t)};return function(){var i=this._super,n=this._superApply,e;this._super=t;this._superApply=o;e=s.apply(this,arguments);this._super=i;this._superApply=n;return e}})()});o.prototype=t.widget.extend(a,{widgetEventPrefix:r?(a.widgetEventPrefix||e):e},l,{constructor:o,namespace:n,widgetName:e,widgetFullName:h});if(r){t.each(r._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)});delete r._childConstructors} -else{i._childConstructors.push(o)};t.widget.bridge(e,o);return o};t.widget.extend=function(e){var r=s.call(arguments,1),n=0,a=r.length,i,o;for(;n<a;n++){for(i in r[n]){o=r[n][i];if(r[n].hasOwnProperty(i)&&o!==undefined){if(t.isPlainObject(o)){e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],o):t.widget.extend({},o)} -else{e[i]=o}}}};return e};t.widget.bridge=function(e,i){var o=i.prototype.widgetFullName||e;t.fn[e]=function(n){var h=typeof n==="string",a=s.call(arguments,1),r=this;if(h){if(!this.length&&n==="instance"){r=undefined} -else{this.each(function(){var i,s=t.data(this,o);if(n==="instance"){r=s;return!1};if(!s){return t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+n+"'")};if(!t.isFunction(s[n])||n.charAt(0)==="_"){return t.error("no such method '"+n+"' for "+e+" widget instance")};i=s[n].apply(s,a);if(i!==s&&i!==undefined){r=i&&i.jquery?r.pushStack(i.get()):i;return!1}})}} -else{if(a.length){n=t.widget.extend.apply(null,[n].concat(a))};this.each(function(){var e=t.data(this,o);if(e){e.option(n||{});if(e._init){e._init()}} -else{t.data(this,o,new i(n,this))}})};return r}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0];this.element=t(i);this.uuid=o++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=t();this.hoverable=t();this.focusable=t();this.classesElementLookup={};if(i!==this){t.data(i,this.widgetFullName,this);this._on(!0,this.element,{remove:function(t){if(t.target===i){this.destroy()}}});this.document=t(i.style?i.ownerDocument:i.document||i);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)};this.options=t.widget.extend({},this.options,this._getCreateOptions(),e);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)};this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy();t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var r=e,s,o,n;if(arguments.length===0){return t.widget.extend({},this.options)};if(typeof e==="string"){r={};s=e.split(".");e=s.shift();if(s.length){o=r[e]=t.widget.extend({},this.options[e]);for(n=0;n<s.length-1;n++){o[s[n]]=o[s[n]]||{};o=o[s[n]]};e=s.pop();if(arguments.length===1){return o[e]===undefined?null:o[e]};o[e]=i} -else{if(arguments.length===1){return this.options[e]===undefined?null:this.options[e]};r[e]=i}};this._setOptions(r);return this},_setOptions:function(t){var e;for(e in t){this._setOption(e,t[e])};return this},_setOption:function(t,e){if(t==="classes"){this._setOptionClasses(e)};this.options[t]=e;if(t==="disabled"){this._setOptionDisabled(e)};return this},_setOptionClasses:function(e){var i,o,s;for(i in e){s=this.classesElementLookup[i];if(e[i]===this.options.classes[i]||!s||!s.length){continue};o=t(s.get());this._removeClass(s,i);o.addClass(this._classes({element:o,keys:i,classes:e,add:!0}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],s=this;e=t.extend({element:this.element,classes:this.options.classes||{}},e);function o(o,n){var a,r;for(r=0;r<o.length;r++){a=s.classesElementLookup[o[r]]||t();if(e.add){a=t(t.unique(a.get().concat(e.element.get())))} -else{a=t(a.not(e.element).get())};s.classesElementLookup[o[r]]=a;i.push(o[r]);if(n&&e.classes[o[r]]){i.push(e.classes[o[r]])}}};this._on(e.element,{"remove":"_untrackClassesElement"});if(e.keys){o(e.keys.match(/\S+/g)||[],!0)};if(e.extra){o(e.extra.match(/\S+/g)||[])};return i.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,o){if(t.inArray(e.target,o)!==-1){i.classesElementLookup[s]=t(o.not(e.target).get())}})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s=(typeof s==="boolean")?s:i;var o=(typeof t==="string"||t===null),n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};n.element.toggleClass(this._classes(n),s);return this},_on:function(e,i,s){var n,o=this;if(typeof e!=="boolean"){s=i;i=e;e=!1};if(!s){s=i;i=this.element;n=this.widget()} -else{i=n=t(i);this.bindings=this.bindings.add(i)};t.each(s,function(s,r){function a(){if(!e&&(o.options.disabled===!0||t(this).hasClass("ui-state-disabled"))){return};return(typeof r==="string"?o[r]:r).apply(o,arguments)};if(typeof r!=="string"){a.guid=r.guid=r.guid||a.guid||t.guid++};var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];if(c){n.on(l,c,a)} -else{i.on(l,a)}})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.off(i).off(i);this.bindings=t(this.bindings.not(e).get());this.focusable=t(this.focusable.not(e).get());this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function s(){return(typeof t==="string"?i[t]:t).apply(i,arguments)};var i=this;return setTimeout(s,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var o,n,r=this.options[e];s=s||{};i=t.Event(i);i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();i.target=this.element[0];n=i.originalEvent;if(n){for(o in n){if(!(o in i)){i[o]=n[o]}}};this.element.trigger(i,s);return!(t.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,o,n){if(typeof o==="string"){o={effect:o}};var a,r=!o?e:o===!0||typeof o==="number"?i:o.effect||i;o=o||{};if(typeof o==="number"){o={duration:o}};a=!t.isEmptyObject(o);o.complete=n;if(o.delay){s.delay(o.delay)};if(a&&t.effects&&t.effects.effect[r]){s[e](o)} -else if(r!==e&&s[r]){s[r](o.duration,o.easing,n)} -else{s.queue(function(i){t(this)[e]();if(n){n.call(s[0])};i()})}}});var m=t.widget; -/*! - * jQuery UI :data 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;var d=t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}); -/*! - * jQuery UI Scroll Parent 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;var p=t.fn.scrollParent=function(e){var i=this.css("position"),o=i==="absolute",n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var e=t(this);if(o&&e.css("position")==="static"){return!1};return n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return i==="fixed"||!s.length?t(this[0].ownerDocument||document):s},u=t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); -/*! - * jQuery UI Mouse 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;var e=!1;t(document).on("mouseup",function(){e=!1});var f=t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent")){t.removeData(i.target,e.widgetName+".preventClickEvent");i.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(i){if(e){return};this._mouseMoved=!1;(this._mouseStarted&&this._mouseUp(i));this._mouseDownEvent=i;var s=this,o=(i.which===1),n=(typeof this.options.cancel==="string"&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1);if(!o||n||!this._mouseCapture(i)){return!0};this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)};if(this._mouseDistanceMet(i)&&this._mouseDelayMet(i)){this._mouseStarted=(this._mouseStart(i)!==!1);if(!this._mouseStarted){i.preventDefault();return!0}};if(!0===t.data(i.target,this.widgetName+".preventClickEvent")){t.removeData(i.target,this.widgetName+".preventClickEvent")};this._mouseMoveDelegate=function(t){return s._mouseMove(t)};this._mouseUpDelegate=function(t){return s._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);i.preventDefault();e=!0;return!0},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button){return this._mouseUp(e)} -else if(!e.which){if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey){this.ignoreMissingWhich=!0} -else if(!this.ignoreMissingWhich){return this._mouseUp(e)}}};if(e.which||e.button){this._mouseMoved=!0};if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()};if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==!1);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e))};return!this._mouseStarted},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;if(i.target===this._mouseDownEvent.target){t.data(i.target,this.widgetName+".preventClickEvent",!0)};this._mouseStop(i)};if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer};this.ignoreMissingWhich=!1;e=!1;i.preventDefault()},_mouseDistanceMet:function(t){return(Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});var c=t.ui.plugin={add:function(e,i,s){var o,n=t.ui[e].prototype;for(o in s){n.plugins[o]=n.plugins[o]||[];n.plugins[o].push([i,s[o]])}},call:function(t,e,i,o){var s,n=t.plugins[e];if(!n){return};if(!o&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return};for(s=0;s<n.length;s++){if(t.options[n[s][0]]){n[s][1].apply(t.element,i)}}}};var h=t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body};if(!e){e=t.body};if(!e.nodeName){e=t.body};return e},l=t.ui.safeBlur=function(e){if(e&&e.nodeName.toLowerCase()!=="body"){t(e).trigger("blur")}}; -/*! - * jQuery UI Draggable 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()};if(this.options.addClasses){this._addClass("ui-draggable")};this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return};this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;if(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0){return!1};this.handle=this._getHandle(e);if(!this.handle){return!1};this._blurActiveElement(e);this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix);return!0},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);if(s.closest(i).length){return};t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;this.helper=this._createHelper(e);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(t.ui.ddmanager){t.ui.ddmanager.current=this};this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(!0);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return t(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(e);this.originalPosition=this.position=this._generatePosition(e,!1);this.originalPageX=e.pageX;this.originalPageY=e.pageY;(i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt));this._setContainment();if(this._trigger("start",e)===!1){this._clear();return!1};this._cacheHelperProportions();if(t.ui.ddmanager&&!i.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)};this._mouseDrag(e,!0);if(t.ui.ddmanager){t.ui.ddmanager.dragStart(this,e)};return!0},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()};this.position=this._generatePosition(e,!0);this.positionAbs=this._convertPositionTo("absolute");if(!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1){this._mouseUp(new t.Event("mouseup",e));return!1};this.position=s.position};this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)};return!1},_mouseStop:function(e){var s=this,i=!1;if(t.ui.ddmanager&&!this.options.dropBehaviour){i=t.ui.ddmanager.drop(this,e)};if(this.dropped){i=this.dropped;this.dropped=!1};if((this.options.revert==="invalid"&&!i)||(this.options.revert==="valid"&&i)||this.options.revert===!0||(t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i))){t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(s._trigger("stop",e)!==!1){s._clear()}})} -else{if(this._trigger("stop",e)!==!1){this._clear()}};return!1},_mouseUp:function(e){this._unblockFrames();if(t.ui.ddmanager){t.ui.ddmanager.dragStop(this,e)};if(this.handleElement.is(e.target)){this.element.trigger("focus")};return t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new t.Event("mouseup",{target:this.element[0]}))} -else{this._clear()};return this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var s=this.options,o=t.isFunction(s.helper),i=o?t(s.helper.apply(this.element[0],[e])):(s.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!i.parents("body").length){i.appendTo((s.appendTo==="parent"?this.element[0].parentNode:s.appendTo))};if(o&&i[0]===this.element[0]){this._setPositionRelative()};if(i[0]!==this.element[0]&&!(/(fixed|absolute)/).test(i.css("position"))){i.css("position","absolute")};return i},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")};if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}};if("left" in e){this.offset.click.left=e.left+this.margins.left};if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left};if("top" in e){this.offset.click.top=e.top+this.margins.top};if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_isRootNode:function(t){return(/(html|body)/i).test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()};if(this._isRootNode(this.offsetParent[0])){e={top:0,left:0}};return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var n,e,i,s=this.options,o=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return};if(s.containment==="window"){this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return};if(s.containment==="document"){this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return};if(s.containment.constructor===Array){this.containment=s.containment;return};if(s.containment==="parent"){s.containment=this.helper[0].parentNode};e=t(s.containment);i=e[0];if(!i){return};n=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(n?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(n?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e){e=this.position};var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:(e.top+this.offset.relative.top*i+this.offset.parent.top*i-((this.cssPosition==="fixed"?-this.offset.scroll.top:(s?0:this.offset.scroll.top))*i)),left:(e.left+this.offset.relative.left*i+this.offset.parent.left*i-((this.cssPosition==="fixed"?-this.offset.scroll.left:(s?0:this.offset.scroll.left))*i))}},_generatePosition:function(t,e){var i,h,o,n,s=this.options,l=this._isRootNode(this.scrollParent[0]),r=t.pageX,a=t.pageY;if(!l||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}};if(e){if(this.containment){if(this.relativeContainer){h=this.relativeContainer.offset();i=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]} -else{i=this.containment};if(t.pageX-this.offset.click.left<i[0]){r=i[0]+this.offset.click.left};if(t.pageY-this.offset.click.top<i[1]){a=i[1]+this.offset.click.top};if(t.pageX-this.offset.click.left>i[2]){r=i[2]+this.offset.click.left};if(t.pageY-this.offset.click.top>i[3]){a=i[3]+this.offset.click.top}};if(s.grid){o=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY;a=i?((o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3])?o:((o-this.offset.click.top>=i[1])?o-s.grid[1]:o+s.grid[1])):o;n=s.grid[0]?this.originalPageX+Math.round((r-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX;r=i?((n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2])?n:((n-this.offset.click.left>=i[0])?n-s.grid[0]:n+s.grid[0])):n};if(s.axis==="y"){r=this.originalPageX};if(s.axis==="x"){a=this.originalPageY}};return{top:(a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(l?0:this.offset.scroll.top))),left:(r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(l?0:this.offset.scroll.left)))}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()};this.helper=null;this.cancelHelperRemoval=!1;if(this.destroyOnClear){this.destroy()}},_trigger:function(e,i,s){s=s||this._uiHash();t.ui.plugin.call(this,e,[i,s,this],!0);if(/^(drag|start|stop)/.test(e)){this.positionAbs=this._convertPositionTo("absolute");s.offset=this.positionAbs};return t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var o=t.extend({},i,{item:s.element});s.sortables=[];t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");if(i&&!i.options.disabled){s.sortables.push(i);i.refreshPositions();i._trigger("activate",e,o)}})},stop:function(e,i,s){var o=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1;t.each(s.sortables,function(){var t=this;if(t.isOver){t.isOver=0;s.cancelHelperRemoval=!0;t.cancelHelperRemoval=!1;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper} -else{t.cancelHelperRemoval=!0;t._trigger("deactivate",e,o)}})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs;o.helperProportions=s.helperProportions;o.offset.click=s.offset.click;if(o._intersectsWith(o.containerCache)){n=!0;t.each(s.sortables,function(){this.positionAbs=s.positionAbs;this.helperProportions=s.helperProportions;this.offset.click=s.offset.click;if(this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])){n=!1};return n})};if(n){if(!o.isOver){o.isOver=1;s._parent=i.helper.parent();o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0);o.options._helper=o.options.helper;o.options.helper=function(){return i.helper[0]};e.target=o.currentItem[0];o._mouseCapture(e,!0);o._mouseStart(e,!0,!0);o.offset.click.top=s.offset.click.top;o.offset.click.left=s.offset.click.left;o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left;o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top;s._trigger("toSortable",e);s.dropped=o.element;t.each(s.sortables,function(){this.refreshPositions()});s.currentItem=s.element;o.fromOutside=s};if(o.currentItem){o._mouseDrag(e);i.position=o.position}} -else{if(o.isOver){o.isOver=0;o.cancelHelperRemoval=!0;o.options._revert=o.options.revert;o.options.revert=!1;o._trigger("out",e,o._uiHash(o));o._mouseStop(e,!0);o.options.revert=o.options._revert;o.options.helper=o.options._helper;if(o.placeholder){o.placeholder.remove()};i.helper.appendTo(s._parent);s._refreshOffsets(e);i.position=s._generatePosition(e,!0);s._trigger("fromSortable",e);s.dropped=!1;t.each(s.sortables,function(){this.refreshPositions()})}}})}});t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var o=t("body"),n=s.options;if(o.css("cursor")){n._cursor=o.css("cursor")};o.css("cursor",n.cursor)},stop:function(e,i,s){var o=s.options;if(o._cursor){t("body").css("cursor",o._cursor)}}});t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var o=t(i.helper),n=s.options;if(o.css("opacity")){n._opacity=o.css("opacity")};o.css("opacity",n.opacity)},stop:function(e,i,s){var o=s.options;if(o._opacity){t(i.helper).css("opacity",o._opacity)}}});t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(!1)};if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(e,i,s){var o=s.options,a=!1,r=s.scrollParentNotHidden[0],n=s.document[0];if(r!==n&&r.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((s.overflowOffset.top+r.offsetHeight)-e.pageY<o.scrollSensitivity){r.scrollTop=a=r.scrollTop+o.scrollSpeed} -else if(e.pageY-s.overflowOffset.top<o.scrollSensitivity){r.scrollTop=a=r.scrollTop-o.scrollSpeed}};if(!o.axis||o.axis!=="y"){if((s.overflowOffset.left+r.offsetWidth)-e.pageX<o.scrollSensitivity){r.scrollLeft=a=r.scrollLeft+o.scrollSpeed} -else if(e.pageX-s.overflowOffset.left<o.scrollSensitivity){r.scrollLeft=a=r.scrollLeft-o.scrollSpeed}}} -else{if(!o.axis||o.axis!=="x"){if(e.pageY-t(n).scrollTop()<o.scrollSensitivity){a=t(n).scrollTop(t(n).scrollTop()-o.scrollSpeed)} -else if(t(window).height()-(e.pageY-t(n).scrollTop())<o.scrollSensitivity){a=t(n).scrollTop(t(n).scrollTop()+o.scrollSpeed)}};if(!o.axis||o.axis!=="y"){if(e.pageX-t(n).scrollLeft()<o.scrollSensitivity){a=t(n).scrollLeft(t(n).scrollLeft()-o.scrollSpeed)} -else if(t(window).width()-(e.pageX-t(n).scrollLeft())<o.scrollSensitivity){a=t(n).scrollLeft(t(n).scrollLeft()+o.scrollSpeed)}}};if(a!==!1&&t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(s,e)}}});t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var o=s.options;s.snapElements=[];t(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var e=t(this),i=e.offset();if(this!==s.element[0]){s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})}})},drag:function(e,i,s){var r,a,h,l,c,p,f,u,o,g,v=s.options,n=v.snapTolerance,d=i.offset.left,b=d+s.helperProportions.width,m=i.offset.top,P=m+s.helperProportions.height;for(o=s.snapElements.length-1;o>=0;o--){c=s.snapElements[o].left-s.margins.left;p=c+s.snapElements[o].width;f=s.snapElements[o].top-s.margins.top;u=f+s.snapElements[o].height;if(b<c-n||d>p+n||P<f-n||m>u+n||!t.contains(s.snapElements[o].item.ownerDocument,s.snapElements[o].item)){if(s.snapElements[o].snapping){(s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[o].item})))};s.snapElements[o].snapping=!1;continue};if(v.snapMode!=="inner"){r=Math.abs(f-P)<=n;a=Math.abs(u-m)<=n;h=Math.abs(c-b)<=n;l=Math.abs(p-d)<=n;if(r){i.position.top=s._convertPositionTo("relative",{top:f-s.helperProportions.height,left:0}).top};if(a){i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top};if(h){i.position.left=s._convertPositionTo("relative",{top:0,left:c-s.helperProportions.width}).left};if(l){i.position.left=s._convertPositionTo("relative",{top:0,left:p}).left}};g=(r||a||h||l);if(v.snapMode!=="outer"){r=Math.abs(f-m)<=n;a=Math.abs(u-P)<=n;h=Math.abs(c-d)<=n;l=Math.abs(p-b)<=n;if(r){i.position.top=s._convertPositionTo("relative",{top:f,left:0}).top};if(a){i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top};if(h){i.position.left=s._convertPositionTo("relative",{top:0,left:c}).left};if(l){i.position.left=s._convertPositionTo("relative",{top:0,left:p-s.helperProportions.width}).left}};if(!s.snapElements[o].snapping&&(r||a||h||l||g)){(s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[o].item})))};s.snapElements[o].snapping=(r||a||h||l||g)}}});t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,r=s.options,o=t.makeArray(t(r.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(!o.length){return};n=parseInt(t(o[0]).css("zIndex"),10)||0;t(o).each(function(e){t(this).css("zIndex",n+e)});this.css("zIndex",(n+o.length))}});t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var o=t(i.helper),n=s.options;if(o.css("zIndex")){n._zIndex=o.css("zIndex")};o.css("zIndex",n.zIndex)},stop:function(e,i,s){var o=s.options;if(o._zIndex){t(i.helper).css("zIndex",o._zIndex)}}});var a=t.ui.draggable; -/*! - * jQuery UI Droppable 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1;this.isout=!0;this.accept=t.isFunction(s)?s:function(t){return t.is(s)};this.proportions=function(){if(arguments.length){e=arguments[0]} -else{return e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(i.scope);i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[];t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++){if(t[e]===this){t.splice(e,1)}}},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if(e==="accept"){this.accept=t.isFunction(i)?i:function(t){return t.is(i)}} -else if(e==="scope"){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s);this._addToManager(i)};this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass();if(i){this._trigger("activate",e,this.ui(i))}},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass();if(i){this._trigger("deactivate",e,this.ui(i))}},_over:function(e){var i=t.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){this._addHoverClass();this._trigger("over",e,this.ui(i))}},_out:function(e){var i=t.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){this._removeHoverClass();this._trigger("out",e,this.ui(i))}},_drop:function(e,s){var o=s||t.ui.ddmanager.current,n=!1;if(!o||(o.currentItem||o.element)[0]===this.element[0]){return!1};this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var s=t(this).droppable("instance");if(s.options.greedy&&!s.options.disabled&&s.options.scope===o.options.scope&&s.accept.call(s.element[0],(o.currentItem||o.element))&&i(o,t.extend(s,{offset:s.element.offset()}),s.options.tolerance,e)){n=!0;return!1}});if(n){return!1};if(this.accept.call(this.element[0],(o.currentItem||o.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",e,this.ui(o));return this.element};return!1},ui:function(t){return{draggable:(t.currentItem||t.element),helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var i=t.ui.intersect=(function(){function t(t,e,i){return(t>=e)&&(t<(e+i))};return function(e,i,s,h){if(!i.offset){return!1};var r=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,l=r+e.helperProportions.width,c=a+e.helperProportions.height,o=i.offset.left,n=i.offset.top,f=o+i.proportions().width,p=n+i.proportions().height;switch(s){case"fit":return(o<=r&&l<=f&&n<=a&&c<=p);case"intersect":return(o<r+(e.helperProportions.width/2)&&l-(e.helperProportions.width/2)<f&&n<a+(e.helperProportions.height/2)&&c-(e.helperProportions.height/2)<p);case"pointer":return t(h.pageY,n,i.proportions().height)&&t(h.pageX,o,i.proportions().width);case"touch":return((a>=n&&a<=p)||(c>=n&&c<=p)||(a<n&&c>p))&&((r>=o&&r<=f)||(l>=o&&l<=f)||(r<o&&l>f));default:return!1}}})();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(s=0;s<o.length;s++){if(o[s].options.disabled||(e&&!o[s].accept.call(o[s].element[0],(e.currentItem||e.element)))){continue};for(n=0;n<r.length;n++){if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue;droppablesLoop}};o[s].visible=o[s].element.css("display")!=="none";if(!o[s].visible){continue};if(a==="mousedown"){o[s]._activate.call(o[s],i)};o[s].offset=o[s].element.offset();o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight})}},drop:function(e,s){var o=!1;t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){if(!this.options){return};if(!this.options.disabled&&this.visible&&i(e,this,this.options.tolerance,s)){o=this._drop.call(this,s)||o};if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(e.currentItem||e.element))){this.isout=!0;this.isover=!1;this._deactivate.call(this,s)}});return o},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){if(!e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,i)}})},drag:function(e,s){if(e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,s)};t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return};var o,a,r,h=i(e,this,this.options.tolerance,s),n=!h&&this.isover?"isout":(h&&!this.isover?"isover":null);if(!n){return};if(this.options.greedy){a=this.options.scope;r=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===a});if(r.length){o=t(r[0]).droppable("instance");o.greedyChild=(n==="isover")}};if(o&&n==="isover"){o.isover=!1;o.isout=!0;o._out.call(o,s)};this[n]=!0;this[n==="isout"?"isover":"isout"]=!1;this[n==="isover"?"_over":"_out"].call(this,s);if(o&&n==="isout"){o.isout=!1;o.isover=!0;o._over.call(o,s)}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable");if(!e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,i)}}};if(t.uiBackCompat!==!1){t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})};var r=t.ui.droppable; -/*! - * jQuery UI Sortable 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ -;var n=t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return(t>=e)&&(t<(e+i))},_isFloating:function(t){return(/left|right/).test(t.css("float"))||(/inline|table-cell/).test(t.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=!0},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--){this.items[t].item.removeData(this.widgetName+"-item")};return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;if(this.reverting){return!1};if(this.options.disabled||this.options.type==="static"){return!1};this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o){s=t(this);return!1}});if(t.data(e.target,o.widgetName+"-item")===o){s=t(e.target)};if(!s){return!1};if(this.options.handle&&!i){t(this.options.handle,s).find("*").addBack().each(function(){if(this===e.target){n=!0}});if(!n){return!1}};this.currentItem=s;this._removeCurrentsFromItems();return!0},_mouseStart:function(e,i,s){var n,r,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()};this._createPlaceholder();if(o.containment){this._setContainment()};if(o.cursor&&o.cursor!=="auto"){r=this.document.find("body");this.storedCursor=r.css("cursor");r.css("cursor",o.cursor);this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(r)};if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")};this.helper.css("opacity",o.opacity)};if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")};this.helper.css("zIndex",o.zIndex)};if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()};this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()};if(!s){for(n=this.containers.length-1;n>=0;n--){this.containers[n]._trigger("activate",e,this._uiHash(this))}};if(t.ui.ddmanager){t.ui.ddmanager.current=this};if(t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)};this.dragging=!0;this._addClass(this.helper,"ui-sortable-helper");this._mouseDrag(e);return!0},_mouseDrag:function(e){var r,o,n,a,i=this.options,s=!1;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs};if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-e.pageY<i.scrollSensitivity){this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+i.scrollSpeed} -else if(e.pageY-this.overflowOffset.top<i.scrollSensitivity){this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-i.scrollSpeed};if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-e.pageX<i.scrollSensitivity){this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+i.scrollSpeed} -else if(e.pageX-this.overflowOffset.left<i.scrollSensitivity){this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-i.scrollSpeed}} -else{if(e.pageY-this.document.scrollTop()<i.scrollSensitivity){s=this.document.scrollTop(this.document.scrollTop()-i.scrollSpeed)} -else if(this.window.height()-(e.pageY-this.document.scrollTop())<i.scrollSensitivity){s=this.document.scrollTop(this.document.scrollTop()+i.scrollSpeed)};if(e.pageX-this.document.scrollLeft()<i.scrollSensitivity){s=this.document.scrollLeft(this.document.scrollLeft()-i.scrollSpeed)} -else if(this.window.width()-(e.pageX-this.document.scrollLeft())<i.scrollSensitivity){s=this.document.scrollLeft(this.document.scrollLeft()+i.scrollSpeed)}};if(s!==!1&&t.ui.ddmanager&&!i.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)}};this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"};if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"};for(r=this.items.length-1;r>=0;r--){o=this.items[r];n=o.item[0];a=this._intersectsWithPointer(o);if(!a){continue};if(o.instance!==this.currentContainer){continue};if(n!==this.currentItem[0]&&this.placeholder[a===1?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&(this.options.type==="semi-dynamic"?!t.contains(this.element[0],n):!0)){this.direction=a===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(o)){this._rearrange(e,o)} -else{break};this._trigger("change",e,this._uiHash());break}};this._contactContainers(e);if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)};this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(e,i){if(!e){return};if(t.ui.ddmanager&&!this.options.dropBehaviour){t.ui.ddmanager.drop(this,e)};if(this.options.revert){var r=this,n=this.placeholder.offset(),s=this.options.axis,o={};if(!s||s==="x"){o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)};if(!s||s==="y"){o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)};this.reverting=!0;t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(e)})} -else{this._clear(e,i)};return!1},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")} -else{this.currentItem.show()};for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}};if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])};if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()};t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});if(this.domPosition.prev){t(this.domPosition.prev).after(this.currentItem)} -else{t(this.domPosition.parent).prepend(this.currentItem)}};return this},serialize:function(e){var s=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};t(s).each(function(){var s=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[\-=_](.+)/));if(s){i.push((e.key||s[1]+"[]")+"="+(e.key&&e.expression?s[1]:s[2]))}});if(!i.length&&e.key){i.push(e.key+"=")};return i.join("&")},toArray:function(e){var s=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};s.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")});return i},_intersectsWith:function(t){var e=this.positionAbs.left,l=e+this.helperProportions.width,i=this.positionAbs.top,c=i+this.helperProportions.height,s=t.left,n=s+t.width,o=t.top,r=o+t.height,a=this.offset.click.top,h=this.offset.click.left,f=(this.options.axis==="x")||((i+a)>o&&(i+a)<r),p=(this.options.axis==="y")||((e+h)>s&&(e+h)<n),u=f&&p;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"])){return u} -else{return(s<e+(this.helperProportions.width/2)&&l-(this.helperProportions.width/2)<n&&o<i+(this.helperProportions.height/2)&&c-(this.helperProportions.height/2)<r)}},_intersectsWithPointer:function(t){var e,i,s=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),o=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=s&&o;if(!n){return!1};e=this._getDragVerticalDirection();i=this._getDragHorizontalDirection();return this.floating?((i==="right"||e==="down")?2:1):(e&&(e==="down"?2:1))},_intersectsWithSides:function(t){var s=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+(t.height/2),t.height),o=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+(t.width/2),t.width),e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();if(this.floating&&i){return((i==="right"&&o)||(i==="left"&&!o))} -else{return e&&((e==="down"&&s)||(e==="up"&&!s))}},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return t!==0&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return t!==0&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var s,o,r,i,h=[],n=[],a=this._connectWith();if(a&&e){for(s=a.length-1;s>=0;s--){r=t(a[s],this.document[0]);for(o=r.length-1;o>=0;o--){i=t.data(r[o],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){n.push([t.isFunction(i.options.items)?i.options.items.call(i.element):t(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i])}}}};n.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function l(){h.push(this)};for(s=n.length-1;s>=0;s--){n[s][0].each(l)};return t(h)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++){if(e[i]===t.item[0]){return!1}};return!0})},_refreshItems:function(e){this.items=[];this.containers=[this];var s,o,r,i,a,h,l,f,p=this.items,n=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready){for(s=c.length-1;s>=0;s--){r=t(c[s],this.document[0]);for(o=r.length-1;o>=0;o--){i=t.data(r[o],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){n.push([t.isFunction(i.options.items)?i.options.items.call(i.element[0],e,{item:this.currentItem}):t(i.options.items,i.element),i]);this.containers.push(i)}}}};for(s=n.length-1;s>=0;s--){a=n[s][1];h=n[s][0];for(o=0,f=h.length;o<f;o++){l=t(h[o]);l.data(this.widgetName+"-item",a);p.push({item:l,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):!1;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()};var i,s,n,o;for(i=this.items.length-1;i>=0;i--){s=this.items[i];if(s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]){continue};n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item;if(!e){s.width=n.outerWidth();s.height=n.outerHeight()};o=n.offset();s.left=o.left;s.top=o.top};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)} -else{for(i=this.containers.length-1;i>=0;i--){o=this.containers[i].element.offset();this.containers[i].containerCache.left=o.left;this.containers[i].containerCache.top=o.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}};return this},_createPlaceholder:function(e){e=e||this;var s,i=e.options;if(!i.placeholder||i.placeholder.constructor===String){s=i.placeholder;i.placeholder={element:function(){var o=e.currentItem[0].nodeName.toLowerCase(),i=t("<"+o+">",e.document[0]);e._addClass(i,"ui-sortable-placeholder",s||e.currentItem[0].className)._removeClass(i,"ui-sortable-helper");if(o==="tbody"){e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(i))} -else if(o==="tr"){e._createTrPlaceholder(e.currentItem,i)} -else if(o==="img"){i.attr("src",e.currentItem.attr("src"))};if(!s){i.css("visibility","hidden")};return i},update:function(t,o){if(s&&!i.forcePlaceholderSize){return};if(!o.height()){o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10))};if(!o.width()){o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}};e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);i.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var s,o,c,n,p,u,a,f,h,l,r=null,i=null;for(s=this.containers.length-1;s>=0;s--){if(t.contains(this.currentItem[0],this.containers[s].element[0])){continue};if(this._intersectsWith(this.containers[s].containerCache)){if(r&&t.contains(this.containers[s].element[0],r.element[0])){continue};r=this.containers[s];i=s} -else{if(this.containers[s].containerCache.over){this.containers[s]._trigger("out",e,this._uiHash(this));this.containers[s].containerCache.over=0}}};if(!r){return};if(this.containers.length===1){if(!this.containers[i].containerCache.over){this.containers[i]._trigger("over",e,this._uiHash(this));this.containers[i].containerCache.over=1}} -else{c=10000;n=null;h=r.floating||this._isFloating(this.currentItem);p=h?"left":"top";u=h?"width":"height";l=h?"pageX":"pageY";for(o=this.items.length-1;o>=0;o--){if(!t.contains(this.containers[i].element[0],this.items[o].item[0])){continue};if(this.items[o].item[0]===this.currentItem[0]){continue};a=this.items[o].item.offset()[p];f=!1;if(e[l]-a>this.items[o][u]/2){f=!0};if(Math.abs(e[l]-a)<c){c=Math.abs(e[l]-a);n=this.items[o];this.direction=f?"up":"down"}};if(!n&&!this.options.dropOnEmpty){return};if(this.currentContainer===this.containers[i]){if(!this.currentContainer.containerCache.over){this.containers[i]._trigger("over",e,this._uiHash());this.currentContainer.containerCache.over=1};return};n?this._rearrange(e,n,null,!0):this._rearrange(e,null,this.containers[i].element,!0);this._trigger("change",e,this._uiHash());this.containers[i]._trigger("change",e,this._uiHash(this));this.currentContainer=this.containers[i];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[i]._trigger("over",e,this._uiHash(this));this.containers[i].containerCache.over=1}},_createHelper:function(e){var s=this.options,i=t.isFunction(s.helper)?t(s.helper.apply(this.element[0],[e,this.currentItem])):(s.helper==="clone"?this.currentItem.clone():this.currentItem);if(!i.parents("body").length){t(s.appendTo!=="parent"?s.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0])};if(i[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}};if(!i[0].style.width||s.forceHelperSize){i.width(this.currentItem.width())};if(!i[0].style.height||s.forceHelperSize){i.height(this.currentItem.height())};return i},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")};if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}};if("left" in e){this.offset.click.left=e.left+this.margins.left};if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left};if("top" in e){this.offset.click.top=e.top+this.margins.top};if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()};if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&t.ui.ie)){e={top:0,left:0}};return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}} -else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,s,o,i=this.options;if(i.containment==="parent"){i.containment=this.helper[0].parentNode};if(i.containment==="document"||i.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,i.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(i.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]};if(!(/^(document|window|parent)$/).test(i.containment)){e=t(i.containment)[0];s=t(i.containment).offset();o=(t(e).css("overflow")!=="hidden");this.containment=[s.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,s.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,s.left+(o?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,s.top+(o?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){if(!i){i=this.position};var s=e==="absolute"?1:-1,o=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,n=(/(html|body)/i).test(o[0].tagName);return{top:(i.top+this.offset.relative.top*s+this.offset.parent.top*s-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(n?0:o.scrollTop()))*s)),left:(i.left+this.offset.relative.left*s+this.offset.parent.left*s-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():n?0:o.scrollLeft())*s))}},_generatePosition:function(e){var s,o,i=this.options,n=e.pageX,r=e.pageY,a=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(a[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()};if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){n=this.containment[0]+this.offset.click.left};if(e.pageY-this.offset.click.top<this.containment[1]){r=this.containment[1]+this.offset.click.top};if(e.pageX-this.offset.click.left>this.containment[2]){n=this.containment[2]+this.offset.click.left};if(e.pageY-this.offset.click.top>this.containment[3]){r=this.containment[3]+this.offset.click.top}};if(i.grid){s=this.originalPageY+Math.round((r-this.originalPageY)/i.grid[1])*i.grid[1];r=this.containment?((s-this.offset.click.top>=this.containment[1]&&s-this.offset.click.top<=this.containment[3])?s:((s-this.offset.click.top>=this.containment[1])?s-i.grid[1]:s+i.grid[1])):s;o=this.originalPageX+Math.round((n-this.originalPageX)/i.grid[0])*i.grid[0];n=this.containment?((o-this.offset.click.left>=this.containment[0]&&o-this.offset.click.left<=this.containment[2])?o:((o-this.offset.click.left>=this.containment[0])?o-i.grid[0]:o+i.grid[0])):o}};return{top:(r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(h?0:a.scrollTop())))),left:(n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():h?0:a.scrollLeft())))}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?e.item[0]:e.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){if(o===this.counter){this.refreshPositions(!s)}})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)};this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}};this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")} -else{this.currentItem.show()};if(this.fromOutside&&!e){s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})};if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!e){s.push(function(t){this._trigger("update",t,this._uiHash())})};if(this!==this.currentContainer){if(!e){s.push(function(t){this._trigger("remove",t,this._uiHash())});s.push((function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}).call(this,this.currentContainer));s.push((function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}).call(this,this.currentContainer))}};function o(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}};for(i=this.containers.length-1;i>=0;i--){if(!e){s.push(o("deactivate",this,this.containers[i]))};if(this.containers[i].containerCache.over){s.push(o("out",this,this.containers[i]));this.containers[i].containerCache.over=0}};if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()};if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)};if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)};this.dragging=!1;if(!e){this._trigger("beforeStop",t,this._uiHash())};this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()};this.helper=null};if(!e){for(i=0;i<s.length;i++){s[i].call(this,t)};this._trigger("stop",t,this._uiHash())};this.fromOutside=!1;return!this.cancelHelperRemoval},_trigger:function(){if(t.Widget.prototype._trigger.apply(this,arguments)===!1){this.cancel()}},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})); -/* ./modules/cms/ui/themes/default/script/plugin/jquery-plugin-orSearch.min.js */;jQuery.fn.orSearch=function(e){var t=$.extend({'dropdown':$(),'select':function(e){}},e);return $(this).on('input',function(){let searchArgument=$(this).val();let dropdownEl=$(t.dropdown);if(searchArgument.length>3){$(dropdownEl).empty();$.ajax({'type':'GET',url:'./api/?action=search&subaction=quicksearch&output=json&search='+searchArgument,data:null,success:function(e,n,r){for(id in e.output.result){let result=e.output.result[id];let div=$('<div class="entry or-search-result" title="'+result.desc+'"></div>');div.data('object',{'name':result.name,'action':result.type,'id':result.id});let link=$('<a />').attr('href',Openrat.Navigator.createShortUrl(result.type,result.id));link.click(function(e){e.preventDefault()});$(link).append('<i class="image-icon image-icon--action-'+result.type+'" />');$(link).append('<span>'+result.name+'</span>');$(div).append(link);$(dropdownEl).append(div)};$(dropdownEl).closest('.or-menu').addClass('open');$(dropdownEl).find('.or-search-result').click(function(e){t.select($(this).data('object'))})}})} -else{$(dropdownEl).empty()}})}; -/* ./modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js */;var popupWindow;jQuery.fn.orLinkify=function(){$(this).find('a').click(function(t){t.preventDefault()});return $(this).click(function(){$(this).find('a').first().each(function(){let type=$(this).attr('data-type');if($(this).parent().hasClass('inactive'))return;switch(type){case'post':$form=$('<form />').attr('method','POST').addClass('invisible');$form.data('afterSuccess',$(this).data('afterSuccess'));let params=jQuery.parseJSON($(this).attr('data-data'));params.output='json';$.each(params,function(t,a){let $input=$('<input />').attr('type','hidden').attr('name',t).attr('value',a);$form.append($input)});let form=new Openrat.Form();form.initOnElement($form);form.submit();break;case'edit':case'dialog':startDialog($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-method'),$(this).attr('data-id'),$(this).attr('data-extra'));break;case'external':window.open($(this).attr('data-url'),' _blank');break;case'popup':popupWindow=window.open($(this).attr('data-url'),'Popup','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes');break;case'help':help(this,$(this).attr('data-url'),$(this).attr('data-suffix'));break;case'fullscreen':fullscreen(this);break;case'open':openNewAction($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-id'));break;default:throw'UI error: Unknown link type: '+type+' in link '+$(this).html()}})})}; -/* ./modules/cms/ui/themes/default/script/plugin/jquery-plugin-orTree.min.js */;jQuery.fn.orTree=function(){$(this).each(function(a,e){$(e).children('.or-navtree-node-control').click(function(){var a=$(this).parent('.or-navtree-node');if($(a).is('.or-navtree-node--is-open')){$(a).children('ul').slideUp('fast').remove();$(a).removeClass('or-navtree-node--is-open').addClass('or-navtree-node--is-closed').find('.tree-icon').removeClass('image-icon--node-open').addClass('image-icon--node-closed')} -else{$(e).closest('div.view').addClass('loader');var i=$(a).data('type'),o=$(a).data('id'),t=$(a).data('extra'),n='./api/?action=tree&subaction=loadBranch&id='+o+'&type='+i+'&output=json';if(typeof t==='string'){jQuery.each(jQuery.parseJSON(t.replace(/'/g,'"')),function(e,a){n=n+'&'+e+'='+a})} -else if(typeof t==='object'){jQuery.each(t,function(e,a){n=n+'&'+e+'='+a})} -else{};$.getJSON(n,function(a){let ul=$('<ul class="or-navtree-list" />');$(e).append(ul);let output=a['output'];$.each(output['branch'],function(a,e){let new_li=$('<li class="or-navtree-node or-navtree-node--is-closed or-draggable or-draggable--type-'+e.type+'" data-name="'+e.text+'" data-id="'+e.internalId+'" data-type="'+e.type+'" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'"><div class="tree or-navtree-node-control"><i class="tree-icon image-icon image-icon--node-closed"></i></div><div class="clickable"><a href="'+Openrat.Navigator.createShortUrl(e.action,e.internalId)+'" class="entry" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'" data-id="'+e.internalId+'" data-action="'+e.action+'" data-type="open" title="'+e.description+'"><i class="image-icon image-icon--action-'+e['icon']+'"></i> '+e.text+'</a></div></li>');$(ul).append(new_li);$(new_li).orTree();$(new_li).find('.clickable').orLinkify();$(new_li).find('.clickable a').click(function(e){e.preventDefault()});registerTreeBranchEvents(ul)});$(ul).slideDown('fast')}).fail(function(){Openrat.Workbench.notify('','','ERROR','failed to load subtree',[],!1)}).always(function(){$(e).closest('div.view').removeClass('loader')});$(a).addClass('or-navtree-node--is-open').removeClass('or-navtree-node--is-closed').find('.tree-icon').addClass('image-icon--node-open').removeClass('image-icon--node-closed')}})})}; -/* ./modules/cms/ui/themes/default/script/plugin/jquery-plugin-orAutoheight.min.js */;jQuery.fn.orAutoheight=function(){var t=function(t){var n=$(t).val().split('\n').length;$(t).attr('rows',n+3)};$(this).each(function(n){t(this)});return $(this).keypress(function(){t(this)})}; -/* ./modules/cms/ui/themes/default/script/jquery-qrcode.min.js *//*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */ -!function(r){"use strict";function t(t,e,n,o){function a(r,t){return r-=o,t-=o,0>r||r>=c||0>t||t>=c?!1:f.isDark(r,t)}function i(r,t,e,n){var o=u.isDark,a=1/l;u.isDark=function(i,u){var f=u*a,c=i*a,l=f+a,g=c+a;return o(i,u)&&(r>l||f>e||t>g||c>n)}}var u={},f=r(n,e);f.addData(t),f.make(),o=o||0;var c=f.getModuleCount(),l=f.getModuleCount()+2*o;return u.text=t,u.level=e,u.version=n,u.moduleCount=l,u.isDark=a,u.addBlank=i,u}function e(r,e,n,o,a){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var i=n;o>=i;i+=1)try{return t(r,e,i,a)}catch(u){}}function n(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,a=w("<canvas/>")[0].getContext("2d");a.font=o;var i=a.measureText(e.label).width,u=e.mSize,f=i/n,c=(1-f)*e.mPosX,l=(1-u)*e.mPosY,g=c+f,s=l+u,v=.01;1===e.mode?r.addBlank(0,l-v,n,s+v):r.addBlank(c-v,l-v,g+v,s+v),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,l*n+.75*e.mSize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalWidth||1,a=e.image.naturalHeight||1,i=e.mSize,u=i*o/a,f=(1-u)*e.mPosX,c=(1-i)*e.mPosY,l=f+u,g=c+i,s=.01;3===e.mode?r.addBlank(0,c-s,n,g+s):r.addBlank(f-s,c-s,l+s,g+s),t.drawImage(e.image,f*n,c*n,u*n,i*n)}function a(r,t,e){w(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var a=e.mode;1===a||2===a?n(r,t,e):(3===a||4===a)&&o(r,t,e)}function i(r,t,e,n,o,a,i,u){r.isDark(i,u)&&t.rect(n,o,a,a)}function u(r,t,e,n,o,a,i,u,f,c){i?r.moveTo(t+a,e):r.moveTo(t,e),u?(r.lineTo(n-a,e),r.arcTo(n,e,n,o,a)):r.lineTo(n,e),f?(r.lineTo(n,o-a),r.arcTo(n,o,t,o,a)):r.lineTo(n,o),c?(r.lineTo(t+a,o),r.arcTo(t,o,t,e,a)):r.lineTo(t,o),i?(r.lineTo(t,e+a),r.arcTo(t,e,n,e,a)):r.lineTo(t,e)}function f(r,t,e,n,o,a,i,u,f,c){i&&(r.moveTo(t+a,e),r.lineTo(t,e),r.lineTo(t,e+a),r.arcTo(t,e,t+a,e,a)),u&&(r.moveTo(n-a,e),r.lineTo(n,e),r.lineTo(n,e+a),r.arcTo(n,e,n-a,e,a)),f&&(r.moveTo(n-a,o),r.lineTo(n,o),r.lineTo(n,o-a),r.arcTo(n,o,n-a,o,a)),c&&(r.moveTo(t+a,o),r.lineTo(t,o),r.lineTo(t,o-a),r.arcTo(t,o,t+a,o,a))}function c(r,t,e,n,o,a,i,c){var l=r.isDark,g=n+a,s=o+a,v=e.radius*a,h=i-1,d=i+1,w=c-1,m=c+1,y=l(i,c),T=l(h,w),p=l(h,c),B=l(h,m),A=l(i,m),E=l(d,m),k=l(d,c),M=l(d,w),C=l(i,w);y?u(t,n,o,g,s,v,!p&&!C,!p&&!A,!k&&!A,!k&&!C):f(t,n,o,g,s,v,p&&C&&T,p&&A&&B,k&&A&&E,k&&C&&M)}function l(r,t,e){var n,o,a=r.moduleCount,u=e.size/a,f=i;for(e.radius>0&&e.radius<=.5&&(f=c),t.beginPath(),n=0;a>n;n+=1)for(o=0;a>o;o+=1){var l=e.left+o*u,g=e.top+n*u,s=u;f(r,t,e,l,g,s,n,o)}if(w(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var v=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=v,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function g(r,t){var n=e(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!n)return null;var o=w(r).data("qrcode",n),i=o[0].getContext("2d");return a(n,i,t),l(n,i,t),o}function s(r){var t=w("<canvas/>").attr("width",r.size).attr("height",r.size);return g(t,r)}function v(r){return w("<img/>").attr("src",s(r)[0].toDataURL("image/png"))}function h(r){var t=e(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var n,o,a=r.size,i=r.background,u=Math.floor,f=t.moduleCount,c=u(a/f),l=u(.5*(a-c*f)),g={position:"relative",left:0,top:0,padding:0,margin:0,width:a,height:a},s={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},v=w("<div/>").data("qrcode",t).css(g);for(i&&v.css("background-color",i),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isDark(n,o)&&w("<div/>").css(s).css({left:l+o*c,top:l+n*c}).appendTo(v);return v}function d(r){return m&&"canvas"===r.render?s(r):m&&"image"===r.render?v(r):h(r)}var w=window.jQuery,m=function(){var r=document.createElement("canvas");return!(!r.getContext||!r.getContext("2d"))}(),y={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};w.fn.qrcode=function(r){var t=w.extend({},y,r);return this.each(function(r,e){"canvas"===e.nodeName.toLowerCase()?g(e,t):w(e).append(d(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),o={};return o.getAt=function(r){return n[r]},o.getLength=function(){return n.length},o.multiply=function(t){for(var e=new Array(o.getLength()+t.getLength()-1),n=0;n<o.getLength();n+=1)for(var a=0;a<t.getLength();a+=1)e[n+a]^=i.gexp(i.glog(o.getAt(n))+i.glog(t.getAt(a)));return r(e,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=i.glog(o.getAt(0))-i.glog(t.getAt(0)),n=new Array(o.getLength()),a=0;a<o.getLength();a+=1)n[a]=o.getAt(a);for(var a=0;a<t.getLength();a+=1)n[a]^=i.gexp(i.glog(t.getAt(a))+e);return r(n,0).mod(t)},o}var t=function(t,e){var o=236,i=17,l=t,g=n[e],s=null,v=0,d=null,w=new Array,m={},y=function(r,t){v=4*l+17,s=function(r){for(var t=new Array(r),e=0;r>e;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(v),T(0,0),T(v-7,0),T(0,v-7),A(),B(),k(r,t),l>=7&&E(r),null==d&&(d=D(l,g,w)),M(d,t)},T=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=v))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=v||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?s[r+e][t+n]=!0:s[r+e][t+n]=!1)},p=function(){for(var r=0,t=0,e=0;8>e;e+=1){y(!0,e);var n=a.getLostPoint(m);(0==e||r>n)&&(r=n,t=e)}return t},B=function(){for(var r=8;v-8>r;r+=1)null==s[r][6]&&(s[r][6]=r%2==0);for(var t=8;v-8>t;t+=1)null==s[6][t]&&(s[6][t]=t%2==0)},A=function(){for(var r=a.getPatternPosition(l),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==s[n][o])for(var i=-2;2>=i;i+=1)for(var u=-2;2>=u;u+=1)-2==i||2==i||-2==u||2==u||0==i&&0==u?s[n+i][o+u]=!0:s[n+i][o+u]=!1}},E=function(r){for(var t=a.getBCHTypeNumber(l),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[Math.floor(e/3)][e%3+v-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[e%3+v-8-3][Math.floor(e/3)]=n}},k=function(r,t){for(var e=g<<3|t,n=a.getBCHTypeInfo(e),o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);6>o?s[o][8]=i:8>o?s[o+1][8]=i:s[v-15+o][8]=i}for(var o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);8>o?s[8][v-o-1]=i:9>o?s[8][15-o-1+1]=i:s[8][15-o-1]=i}s[v-8][8]=!r},M=function(r,t){for(var e=-1,n=v-1,o=7,i=0,u=a.getMaskFunction(t),f=v-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==s[n][f-c]){var l=!1;i<r.length&&(l=1==(r[i]>>>o&1));var g=u(n,f-c);g&&(l=!l),s[n][f-c]=l,o-=1,-1==o&&(i+=1,o=7)}if(n+=e,0>n||n>=v){n-=e,e=-e;break}}},C=function(t,e){for(var n=0,o=0,i=0,u=new Array(e.length),f=new Array(e.length),c=0;c<e.length;c+=1){var l=e[c].dataCount,g=e[c].totalCount-l;o=Math.max(o,l),i=Math.max(i,g),u[c]=new Array(l);for(var s=0;s<u[c].length;s+=1)u[c][s]=255&t.getBuffer()[s+n];n+=l;var v=a.getErrorCorrectPolynomial(g),h=r(u[c],v.getLength()-1),d=h.mod(v);f[c]=new Array(v.getLength()-1);for(var s=0;s<f[c].length;s+=1){var w=s+d.getLength()-f[c].length;f[c][s]=w>=0?d.getAt(w):0}}for(var m=0,s=0;s<e.length;s+=1)m+=e[s].totalCount;for(var y=new Array(m),T=0,s=0;o>s;s+=1)for(var c=0;c<e.length;c+=1)s<u[c].length&&(y[T]=u[c][s],T+=1);for(var s=0;i>s;s+=1)for(var c=0;c<e.length;c+=1)s<f[c].length&&(y[T]=f[c][s],T+=1);return y},D=function(r,t,e){for(var n=u.getRSBlocks(r,t),c=f(),l=0;l<e.length;l+=1){var g=e[l];c.put(g.getMode(),4),c.put(g.getLength(),a.getLengthInBits(g.getMode(),r)),g.write(c)}for(var s=0,l=0;l<n.length;l+=1)s+=n[l].dataCount;if(c.getLengthInBits()>8*s)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*s+")");for(c.getLengthInBits()+4<=8*s&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;;){if(c.getLengthInBits()>=8*s)break;if(c.put(o,8),c.getLengthInBits()>=8*s)break;c.put(i,8)}return C(c,n)};return m.addData=function(r){var t=c(r);w.push(t),d=null},m.isDark=function(r,t){if(0>r||r>=v||0>t||t>=v)throw new Error(r+","+t);return s[r][t]},m.getModuleCount=function(){return v},m.make=function(){y(!1,p())},m.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+t+"px;",e+='">',e+="<tbody>";for(var n=0;n<m.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<m.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=m.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},m.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=m.getModuleCount()*r+2*t,n=t,o=e-t;return h(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var a=Math.floor((t-n)/r),i=Math.floor((e-n)/r);return m.isDark(i,a)?0:1}return 1})},m};t.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},t.createStringToBytes=function(r,t){var e=function(){for(var e=s(r),n=function(){var r=e.read();if(-1==r)throw new Error;return r},o=0,a={};;){var i=e.read();if(-1==i)break;var u=n(),f=n(),c=n(),l=String.fromCharCode(i<<8|u),g=f<<8|c;a[l]=g,o+=1}if(o!=t)throw new Error(o+" != "+t);return a}(),n="?".charCodeAt(0);return function(r){for(var t=new Array,o=0;o<r.length;o+=1){var a=r.charCodeAt(o);if(128>a)t.push(a);else{var i=e[r.charAt(o)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,a=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<<c(t)-c(n);return(r<<10|t)^u},f.getBCHTypeNumber=function(r){for(var t=r<<12;c(t)-c(a)>=0;)t^=a<<c(t)-c(a);return r<<12|t},f.getPatternPosition=function(r){return t[r-1]},f.getMaskFunction=function(r){switch(r){case o.PATTERN000:return function(r,t){return(r+t)%2==0};case o.PATTERN001:return function(r,t){return r%2==0};case o.PATTERN010:return function(r,t){return t%3==0};case o.PATTERN011:return function(r,t){return(r+t)%3==0};case o.PATTERN100:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(r,t){return r*t%2+r*t%3==0};case o.PATTERN110:return function(r,t){return(r*t%2+r*t%3)%2==0};case o.PATTERN111:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},f.getErrorCorrectPolynomial=function(t){for(var e=r([1],0),n=0;t>n;n+=1)e=e.multiply(r([1,i.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var a=0,i=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&i==r.isDark(n+u,o+f)&&(a+=1);a>5&&(e+=3+a-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var l=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(l+=1);var g=Math.abs(100*l/t/t-50)/5;return e+=10*g},f}(),i=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<<e;for(var e=8;256>e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var a=n.length/3,i=new Array,u=0;a>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],l=n[3*u+2],g=0;f>g;g+=1)i.push(t(c,l));return i},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),a={};return a.getMode=function(){return n},a.getLength=function(r){return o.length},a.write=function(r){for(var t=0;t<o.length;t+=1)r.put(o[t],8)},a},l=function(){var r=new Array,t={};return t.writeByte=function(t){r.push(255&t)},t.writeShort=function(r){t.writeByte(r),t.writeByte(r>>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e<r.length;e+=1)t.writeByte(r.charCodeAt(e))},t.toByteArray=function(){return r},t.toString=function(){var t="";t+="[";for(var e=0;e<r.length;e+=1)e>0&&(t+=","),t+=r[e];return t+="]"},t},g=function(){var r=0,t=0,e=0,n="",o={},a=function(r){n+=String.fromCharCode(i(63&r))},i=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)a(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(a(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,i=0;o>i;i+=1)n+="="},o.toString=function(){return n},o},s=function(r){var t=r,e=0,n=0,o=0,a={};a.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|i(r.charCodeAt(0)),o+=6)}var a=n>>>o-8&255;return o-=8,a};var i=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return a},v=function(r,t){var e=r,n=t,o=new Array(r*t),a={};a.setPixel=function(r,t,n){o[t*e+r]=n},a.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var a=0;o.length-a>255;)r.writeByte(255),r.writeBytes(o,a,255),a+=255;r.writeByte(o.length-a),r.writeBytes(o,a,o.length-a),r.writeByte(0),r.writeString(";")};var i=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<<e|n)),o-=8-e,r>>>=8-e,n=0,e=0;n=r<<e|n,e+=o},o.flush=function(){e>0&&t.writeByte(n)},o},u=function(r){for(var t=1<<r,e=(1<<r)+1,n=r+1,a=f(),u=0;t>u;u+=1)a.add(String.fromCharCode(u));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(e));var c=l(),g=i(c);g.write(t,n);var s=0,v=String.fromCharCode(o[s]);for(s+=1;s<o.length;){var h=String.fromCharCode(o[s]);s+=1,a.contains(v+h)?v+=h:(g.write(a.indexOf(v),n),a.size()<4095&&(a.size()==1<<n&&(n+=1),a.add(v+h)),v=h)}return g.write(a.indexOf(v),n),g.write(e,n),g.flush(),c.toByteArray()},f=function(){var r={},t=0,e={};return e.add=function(n){if(e.contains(n))throw new Error("dup key:"+n);r[n]=t,t+=1},e.size=function(){return t},e.indexOf=function(t){return r[t]},e.contains=function(t){return"undefined"!=typeof r[t]},e};return a},h=function(r,t,e,n){for(var o=v(r,t),a=0;t>a;a+=1)for(var i=0;r>i;i+=1)o.setPixel(i,a,e(i,a));var u=l();o.write(u);for(var f=g(),c=u.toByteArray(),s=0;s<c.length;s+=1)f.writeByte(c[s]);f.flush();var h="";return h+="<img",h+=' src="',h+="data:image/gif;base64,",h+=f,h+='"',h+=' width="',h+=r,h+='"',h+=' height="',h+=t,h+='"',n&&(h+=' alt="',h+=n,h+='"'),h+="/>"};return t}();return function(r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r())}(function(){return r}),!function(r){r.stringToBytes=function(r){function t(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);128>n?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}()); -/* ./modules/cms/ui/themes/default/script/jquery.hotkeys.min.js */(function(t){t.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}};function e(e){if(typeof e.data==="string"){e.data={keys:e.data}};if(!e.data||!e.data.keys||typeof e.data.keys!=="string"){return};var a=e.handler,s=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this!==e.target&&(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||(t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable"))||(t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1))){return};var n=e.type!=="keypress"&&t.hotkeys.specialKeys[e.which],f=String.fromCharCode(e.which).toLowerCase(),i="",r={};t.each(["alt","ctrl","shift"],function(t,s){if(e[s+"Key"]&&n!==s){i+=s+"+"}});if(e.metaKey&&!e.ctrlKey&&n!=="meta"){i+="meta+"};if(e.metaKey&&n!=="meta"&&i.indexOf("alt+ctrl+shift+")>-1){i=i.replace("alt+ctrl+shift+","hyper+")};if(n){r[i+n]=!0} -else{r[i+f]=!0;r[i+t.hotkeys.shiftNums[f]]=!0;if(i==="shift+"){r[t.hotkeys.shiftNums[f]]=!0}};for(var o=0,p=s.length;o<p;o++){if(r[s[o]]){return a.apply(this,arguments)}}}};t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})})(jQuery||this.jQuery||window.jQuery); -/* ./modules/editor/codemirror/lib/codemirror.min.js */// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -// This is CodeMirror (http://codemirror.net), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.CodeMirror = factory()); -}(this, (function () { 'use strict'; - -// Kludges for bugs and behavior differences that can't be feature -// detected are enabled based on userAgent etc sniffing. - var userAgent = navigator.userAgent - var platform = navigator.platform - - var gecko = /gecko\/\d/i.test(userAgent) - var ie_upto10 = /MSIE \d/.test(userAgent) - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent) - var edge = /Edge\/(\d+)/.exec(userAgent) - var ie = ie_upto10 || ie_11up || edge - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]) - var webkit = !edge && /WebKit\//.test(userAgent) - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent) - var chrome = !edge && /Chrome\//.test(userAgent) - var presto = /Opera\//.test(userAgent) - var safari = /Apple Computer/.test(navigator.vendor) - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent) - var phantom = /PhantomJS/.test(userAgent) - - var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent) - var android = /Android/.test(userAgent) -// This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent) - var mac = ios || /Mac/.test(platform) - var chromeOS = /\bCrOS\b/.test(userAgent) - var windows = /win/i.test(platform) - - var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/) - if (presto_version) { presto_version = Number(presto_version[1]) } - if (presto_version && presto_version >= 15) { presto = false; webkit = true } -// Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)) - var captureRightClick = gecko || (ie && ie_version >= 9) - - function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } - - var rmClass = function(node, cls) { - var current = node.className - var match = classTest(cls).exec(current) - if (match) { - var after = current.slice(match.index + match[0].length) - node.className = current.slice(0, match.index) + (after ? match[1] + after : "") - } - } - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - { e.removeChild(e.firstChild) } - return e - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e) - } - - function elt(tag, content, className, style) { - var e = document.createElement(tag) - if (className) { e.className = className } - if (style) { e.style.cssText = style } - if (typeof content == "string") { e.appendChild(document.createTextNode(content)) } - else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } } - return e - } -// wrapper for elt, which removes the elt from the accessibility tree - function eltP(tag, content, className, style) { - var e = elt(tag, content, className, style) - e.setAttribute("role", "presentation") - return e - } - - var range - if (document.createRange) { range = function(node, start, end, endNode) { - var r = document.createRange() - r.setEnd(endNode || node, end) - r.setStart(node, start) - return r - } } - else { range = function(node, start, end) { - var r = document.body.createTextRange() - try { r.moveToElementText(node.parentNode) } - catch(e) { return r } - r.collapse(true) - r.moveEnd("character", end) - r.moveStart("character", start) - return r - } } - - function contains(parent, child) { - if (child.nodeType == 3) // Android browser always returns false when child is a textnode - { child = child.parentNode } - if (parent.contains) - { return parent.contains(child) } - do { - if (child.nodeType == 11) { child = child.host } - if (child == parent) { return true } - } while (child = child.parentNode) - } - - function activeElt() { - // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. - // IE < 10 will throw when accessed while the page is loading or in an iframe. - // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. - var activeElement - try { - activeElement = document.activeElement - } catch(e) { - activeElement = document.body || null - } - while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) - { activeElement = activeElement.shadowRoot.activeElement } - return activeElement - } - - function addClass(node, cls) { - var current = node.className - if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls } - } - function joinClasses(a, b) { - var as = a.split(" ") - for (var i = 0; i < as.length; i++) - { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } } - return b - } - - var selectInput = function(node) { node.select() } - if (ios) // Mobile Safari apparently has a bug where select() is broken. - { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } } - else if (ie) // Suppress mysterious IE10 errors - { selectInput = function(node) { try { node.select() } catch(_e) {} } } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1) - return function(){return f.apply(null, args)} - } - - function copyObj(obj, target, overwrite) { - if (!target) { target = {} } - for (var prop in obj) - { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - { target[prop] = obj[prop] } } - return target - } - -// Counts the column offset in a string, taking tabs into account. -// Used mostly to find indentation. - function countColumn(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/) - if (end == -1) { end = string.length } - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i) - if (nextTab < 0 || nextTab >= end) - { return n + (end - i) } - n += nextTab - i - n += tabSize - (n % tabSize) - i = nextTab + 1 - } - } - - var Delayed = function() {this.id = null}; - Delayed.prototype.set = function (ms, f) { - clearTimeout(this.id) - this.id = setTimeout(f, ms) - }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - { if (array[i] == elt) { return i } } - return -1 - } - -// Number of pixels added to scroller and sizer to hide scrollbar - var scrollerGap = 30 - -// Returned or thrown by various protocols to signal 'I'm not -// handling this'. - var Pass = {toString: function(){return "CodeMirror.Pass"}} - -// Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}; - var sel_mouse = {origin: "*mouse"}; - var sel_move = {origin: "+move"}; -// The inverse of countColumn -- find the offset that corresponds to -// a particular column. - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos) - if (nextTab == -1) { nextTab = string.length } - var skipped = nextTab - pos - if (nextTab == string.length || col + skipped >= goal) - { return pos + Math.min(skipped, goal - col) } - col += nextTab - pos - col += tabSize - (col % tabSize) - pos = nextTab + 1 - if (col >= goal) { return pos } - } - } - - var spaceStrs = [""] - function spaceStr(n) { - while (spaceStrs.length <= n) - { spaceStrs.push(lst(spaceStrs) + " ") } - return spaceStrs[n] - } - - function lst(arr) { return arr[arr.length-1] } - - function map(array, f) { - var out = [] - for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) } - return out - } - - function insertSorted(array, value, score) { - var pos = 0, priority = score(value) - while (pos < array.length && score(array[pos]) <= priority) { pos++ } - array.splice(pos, 0, value) - } - - function nothing() {} - - function createObj(base, props) { - var inst - if (Object.create) { - inst = Object.create(base) - } else { - nothing.prototype = base - inst = new nothing() - } - if (props) { copyObj(props, inst) } - return inst - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/ - function isWordCharBasic(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) - } - function isWordChar(ch, helper) { - if (!helper) { return isWordCharBasic(ch) } - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } - return helper.test(ch) - } - - function isEmpty(obj) { - for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } - return true - } - -// Extending unicode characters. A series of a non-extending char + -// any number of extending chars is treated as a single unit as far -// as editing and measuring is concerned. This is not fully correct, -// since some scripts/fonts/browsers also treat other configurations -// of code points as a group. - var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/ - function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } - -// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. - function skipExtendingChars(str, pos, dir) { - while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir } - return pos - } - -// Returns the value from the range [`from`; `to`] that satisfies -// `pred` and is closest to `from`. Assumes that at least `to` -// satisfies `pred`. Supports `from` being greater than `to`. - function findFirst(pred, from, to) { - // At any point we are certain `to` satisfies `pred`, don't know - // whether `from` does. - var dir = from > to ? -1 : 1 - for (;;) { - if (from == to) { return from } - var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF) - if (mid == from) { return pred(mid) ? from : to } - if (pred(mid)) { to = mid } - else { from = mid + dir } - } - } - -// The display handles the DOM integration, both for input reading -// and content drawing. It holds references to DOM nodes and -// display-related state. - - function Display(place, doc, input) { - var d = this - this.input = input - - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler") - d.scrollbarFiller.setAttribute("cm-not-content", "true") - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler") - d.gutterFiller.setAttribute("cm-not-content", "true") - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = eltP("div", null, "CodeMirror-code") - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1") - d.cursorDiv = elt("div", null, "CodeMirror-cursors") - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure") - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure") - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none") - var lines = eltP("div", [d.lineSpace], "CodeMirror-lines") - // Moved around its parent to cover visible view. - d.mover = elt("div", [lines], null, "position: relative") - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer") - d.sizerWidth = null - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;") - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters") - d.lineGutter = null - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll") - d.scroller.setAttribute("tabIndex", "-1") - // The element in which the editor lives. - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror") - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 } - if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true } - - if (place) { - if (place.appendChild) { place.appendChild(d.wrapper) } - else { place(d.wrapper) } - } - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first - d.reportedViewFrom = d.reportedViewTo = doc.first - // Information about the rendered lines. - d.view = [] - d.renderedView = null - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null - // Empty space (in pixels) above the view - d.viewOffset = 0 - d.lastWrapHeight = d.lastWrapWidth = 0 - d.updateLineNumbers = null - - d.nativeBarWidth = d.barHeight = d.barWidth = 0 - d.scrollbarsClipped = false - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null - d.maxLineLength = 0 - d.maxLineChanged = false - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null - - // True when shift is held down. - d.shift = false - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null - - d.activeTouch = null - - input.init(d) - } - -// Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first - if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } - var chunk = doc - while (!chunk.lines) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize() - if (n < sz) { chunk = child; break } - n -= sz - } - } - return chunk.lines[n] - } - -// Get the part of a document between two positions, as an array of -// strings. - function getBetween(doc, start, end) { - var out = [], n = start.line - doc.iter(start.line, end.line + 1, function (line) { - var text = line.text - if (n == end.line) { text = text.slice(0, end.ch) } - if (n == start.line) { text = text.slice(start.ch) } - out.push(text) - ++n - }) - return out - } -// Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = [] - doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value - return out - } - -// Update the height of a line, propagating the height change -// upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height - if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } } - } - -// Given a line object, find its line number by walking up through -// its parent links. - function lineNo(line) { - if (line.parent == null) { return null } - var cur = line.parent, no = indexOf(cur.lines, line) - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) { break } - no += chunk.children[i].chunkSize() - } - } - return no + cur.first - } - -// Find the line at the given vertical position, using the height -// information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first - outer: do { - for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { - var child = chunk.children[i$1], ch = child.height - if (h < ch) { chunk = child; continue outer } - h -= ch - n += child.chunkSize() - } - return n - } while (!chunk.lines) - var i = 0 - for (; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height - if (h < lh) { break } - h -= lh - } - return n + i - } - - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)) - } - -// A Pos instance represents a position within the text. - function Pos(line, ch, sticky) { - if ( sticky === void 0 ) sticky = null; - - if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } - this.line = line - this.ch = ch - this.sticky = sticky - } - -// Compare two positions, return 0 if they are the same, a negative -// number when a is less, and a positive number otherwise. - function cmp(a, b) { return a.line - b.line || a.ch - b.ch } - - function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } - - function copyPos(x) {return Pos(x.line, x.ch)} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b } - -// Most of the external API clips given positions to make sure they -// actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} - function clipPos(doc, pos) { - if (pos.line < doc.first) { return Pos(doc.first, 0) } - var last = doc.first + doc.size - 1 - if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } - return clipToLen(pos, getLine(doc, pos.line).text.length) - } - function clipToLen(pos, linelen) { - var ch = pos.ch - if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } - else if (ch < 0) { return Pos(pos.line, 0) } - else { return pos } - } - function clipPosArray(doc, array) { - var out = [] - for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) } - return out - } - -// Optimize some code when these features are not used. - var sawReadOnlySpans = false; - var sawCollapsedSpans = false; - function seeReadOnlySpans() { - sawReadOnlySpans = true - } - - function seeCollapsedSpans() { - sawCollapsedSpans = true - } - -// TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker - this.from = from; this.to = to - } - -// Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i] - if (span.marker == marker) { return span } - } } - } -// Remove a span from an array, returning undefined if no spans are -// left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - var r - for (var i = 0; i < spans.length; ++i) - { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } } - return r - } -// Add a span to a line. - function addMarkedSpan(line, span) { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span] - span.marker.attachLine(line) - } - -// Used for the algorithm that adjusts markers for a change in the -// document. These functions cut an array of spans at a given -// character position, returning an array of remaining chunks (or -// undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - var nw - if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh) - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)) - } - } } - return nw - } - function markedSpansAfter(old, endCh, isInsert) { - var nw - if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh) - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)) - } - } } - return nw - } - -// Given a change object, compute the new set of marker spans that -// cover the line in which the change took place. Removes spans -// entirely within the change, reconnects spans belonging to the -// same marker that appear on both sides of the change, and cuts off -// spans partially within the change. Returns an array of span -// arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - if (change.full) { return null } - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans - if (!oldFirst && !oldLast) { return null } - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0 - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert) - var last = markedSpansAfter(oldLast, endCh, isInsert) - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0) - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i] - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker) - if (!found) { span.to = startCh } - else if (sameLine) { span.to = found.to == null ? null : found.to + offset } - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i$1 = 0; i$1 < last.length; ++i$1) { - var span$1 = last[i$1] - if (span$1.to != null) { span$1.to += offset } - if (span$1.from == null) { - var found$1 = getMarkedSpanFor(first, span$1.marker) - if (!found$1) { - span$1.from = offset - if (sameLine) { (first || (first = [])).push(span$1) } - } - } else { - span$1.from += offset - if (sameLine) { (first || (first = [])).push(span$1) } - } - } - } - // Make sure we didn't create any zero-length spans - if (first) { first = clearEmptySpans(first) } - if (last && last != first) { last = clearEmptySpans(last) } - - var newMarkers = [first] - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers - if (gap > 0 && first) - { for (var i$2 = 0; i$2 < first.length; ++i$2) - { if (first[i$2].to == null) - { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } } - for (var i$3 = 0; i$3 < gap; ++i$3) - { newMarkers.push(gapMarkers) } - newMarkers.push(last) - } - return newMarkers - } - -// Remove spans that are empty and don't have a clearWhenEmpty -// option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i] - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - { spans.splice(i--, 1) } - } - if (!spans.length) { return null } - return spans - } - -// Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null - doc.iter(from.line, to.line + 1, function (line) { - if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - { (markers || (markers = [])).push(mark) } - } } - }) - if (!markers) { return null } - var parts = [{from: from, to: to}] - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0) - for (var j = 0; j < parts.length; ++j) { - var p = parts[j] - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to) - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - { newParts.push({from: p.from, to: m.from}) } - if (dto > 0 || !mk.inclusiveRight && !dto) - { newParts.push({from: m.to, to: p.to}) } - parts.splice.apply(parts, newParts) - j += newParts.length - 3 - } - } - return parts - } - -// Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans - if (!spans) { return } - for (var i = 0; i < spans.length; ++i) - { spans[i].marker.detachLine(line) } - line.markedSpans = null - } - function attachMarkedSpans(line, spans) { - if (!spans) { return } - for (var i = 0; i < spans.length; ++i) - { spans[i].marker.attachLine(line) } - line.markedSpans = spans - } - -// Helpers used when computing which overlapping collapsed span -// counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } - -// Returns a number indicating which of two overlapping collapsed -// spans is larger (and thus includes the other). Falls back to -// comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length - if (lenDiff != 0) { return lenDiff } - var aPos = a.find(), bPos = b.find() - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b) - if (fromCmp) { return -fromCmp } - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b) - if (toCmp) { return toCmp } - return b.id - a.id - } - -// Find out whether a line ends or starts in a collapsed span. If -// so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found - if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i] - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - { found = sp.marker } - } } - return found - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } - -// Test whether there exists a collapsed span that partially -// overlaps (covers the start or end, but not both) of a new span. -// Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo) - var sps = sawCollapsedSpans && line.markedSpans - if (sps) { for (var i = 0; i < sps.length; ++i) { - var sp = sps[i] - if (!sp.marker.collapsed) { continue } - var found = sp.marker.find(0) - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker) - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker) - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } - if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || - fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) - { return true } - } } - } - -// A visual line is a line as drawn on the screen. Folding, for -// example, can cause multiple logical lines to appear on the same -// visual line. This finds the start of the visual line that the -// given line is part of (usually that is the line itself). - function visualLine(line) { - var merged - while (merged = collapsedSpanAtStart(line)) - { line = merged.find(-1, true).line } - return line - } - - function visualLineEnd(line) { - var merged - while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line } - return line - } - -// Returns an array of logical lines that continue the visual line -// started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line - ;(lines || (lines = [])).push(line) - } - return lines - } - -// Get the line number of the start of the visual line that the -// given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line) - if (line == vis) { return lineN } - return lineNo(vis) - } - -// Get the line number of the start of the next visual line after -// the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) { return lineN } - var line = getLine(doc, lineN), merged - if (!lineIsHidden(doc, line)) { return lineN } - while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line } - return lineNo(line) + 1 - } - -// Compute whether a line is hidden. Lines count as hidden when they -// are part of a visual line that starts with another line, or when -// they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans - if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i] - if (!sp.marker.collapsed) { continue } - if (sp.from == null) { return true } - if (sp.marker.widgetNode) { continue } - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - { return true } - } } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true) - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) - } - if (span.marker.inclusiveRight && span.to == line.text.length) - { return true } - for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i] - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) { return true } - } - } - -// Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj) - - var h = 0, chunk = lineObj.parent - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i] - if (line == lineObj) { break } - else { h += line.height } - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i$1 = 0; i$1 < p.children.length; ++i$1) { - var cur = p.children[i$1] - if (cur == chunk) { break } - else { h += cur.height } - } - } - return h - } - -// Compute the character length of a line, taking into account -// collapsed ranges (see markText) that might hide parts, and join -// other lines onto it. - function lineLength(line) { - if (line.height == 0) { return 0 } - var len = line.text.length, merged, cur = line - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true) - cur = found.from.line - len += found.from.ch - found.to.ch - } - cur = line - while (merged = collapsedSpanAtEnd(cur)) { - var found$1 = merged.find(0, true) - len -= cur.text.length - found$1.from.ch - cur = found$1.to.line - len += cur.text.length - found$1.to.ch - } - return len - } - -// Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc - d.maxLine = getLine(doc, doc.first) - d.maxLineLength = lineLength(d.maxLine) - d.maxLineChanged = true - doc.iter(function (line) { - var len = lineLength(line) - if (len > d.maxLineLength) { - d.maxLineLength = len - d.maxLine = line - } - }) - } - -// BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) { return f(from, to, "ltr", 0) } - var found = false - for (var i = 0; i < order.length; ++i) { - var part = order[i] - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i) - found = true - } - } - if (!found) { f(from, to, "ltr") } - } - - var bidiOther = null - function getBidiPartAt(order, ch, sticky) { - var found - bidiOther = null - for (var i = 0; i < order.length; ++i) { - var cur = order[i] - if (cur.from < ch && cur.to > ch) { return i } - if (cur.to == ch) { - if (cur.from != cur.to && sticky == "before") { found = i } - else { bidiOther = i } - } - if (cur.from == ch) { - if (cur.from != cur.to && sticky != "before") { found = i } - else { bidiOther = i } - } - } - return found != null ? found : bidiOther - } - -// Bidirectional ordering algorithm -// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm -// that this (partially) implements. - -// One-char codes used for character types: -// L (L): Left-to-Right -// R (R): Right-to-Left -// r (AL): Right-to-Left Arabic -// 1 (EN): European Number -// + (ES): European Number Separator -// % (ET): European Number Terminator -// n (AN): Arabic Number -// , (CS): Common Number Separator -// m (NSM): Non-Spacing Mark -// b (BN): Boundary Neutral -// s (B): Paragraph Separator -// t (S): Segment Separator -// w (WS): Whitespace -// N (ON): Other Neutrals - -// Returns null if characters are ordered as they appear -// (left-to-right), or an array of sections ({from, to, level} -// objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN" - // Character types for codepoints 0x600 to 0x6f9 - var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111" - function charType(code) { - if (code <= 0xf7) { return lowTypes.charAt(code) } - else if (0x590 <= code && code <= 0x5f4) { return "R" } - else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } - else if (0x6ee <= code && code <= 0x8ac) { return "r" } - else if (0x2000 <= code && code <= 0x200b) { return "w" } - else if (code == 0x200c) { return "b" } - else { return "L" } - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/ - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/ - - function BidiSpan(level, from, to) { - this.level = level - this.from = from; this.to = to - } - - return function(str, direction) { - var outerType = direction == "ltr" ? "L" : "R" - - if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } - var len = str.length, types = [] - for (var i = 0; i < len; ++i) - { types.push(charType(str.charCodeAt(i))) } - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { - var type = types[i$1] - if (type == "m") { types[i$1] = prev } - else { prev = type } - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { - var type$1 = types[i$2] - if (type$1 == "1" && cur == "r") { types[i$2] = "n" } - else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { - var type$2 = types[i$3] - if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" } - else if (type$2 == "," && prev$1 == types[i$3+1] && - (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 } - prev$1 = type$2 - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i$4 = 0; i$4 < len; ++i$4) { - var type$3 = types[i$4] - if (type$3 == ",") { types[i$4] = "N" } - else if (type$3 == "%") { - var end = (void 0) - for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N" - for (var j = i$4; j < end; ++j) { types[j] = replace } - i$4 = end - 1 - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { - var type$4 = types[i$5] - if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" } - else if (isStrong.test(type$4)) { cur$1 = type$4 } - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i$6 = 0; i$6 < len; ++i$6) { - if (isNeutral.test(types[i$6])) { - var end$1 = (void 0) - for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} - var before = (i$6 ? types[i$6-1] : outerType) == "L" - var after = (end$1 < len ? types[end$1] : outerType) == "L" - var replace$1 = before == after ? (before ? "L" : "R") : outerType - for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 } - i$6 = end$1 - 1 - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m - for (var i$7 = 0; i$7 < len;) { - if (countsAsLeft.test(types[i$7])) { - var start = i$7 - for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} - order.push(new BidiSpan(0, start, i$7)) - } else { - var pos = i$7, at = order.length - for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} - for (var j$2 = pos; j$2 < i$7;) { - if (countsAsNum.test(types[j$2])) { - if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) } - var nstart = j$2 - for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} - order.splice(at, 0, new BidiSpan(2, nstart, j$2)) - pos = j$2 - } else { ++j$2 } - } - if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) } - } - } - if (direction == "ltr") { - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length - order.unshift(new BidiSpan(0, 0, m[0].length)) - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length - order.push(new BidiSpan(0, len - m[0].length, len)) - } - } - - return direction == "rtl" ? order.reverse() : order - } - })() - -// Get the bidi ordering for the given line (and cache it). Returns -// false for lines that are fully left-to-right, and an array of -// BidiSpan objects otherwise. - function getOrder(line, direction) { - var order = line.order - if (order == null) { order = line.order = bidiOrdering(line.text, direction) } - return order - } - -// EVENT HANDLING - -// Lightweight event framework. on/off also work on DOM nodes, -// registering native DOM handlers. - - var noHandlers = [] - - var on = function(emitter, type, f) { - if (emitter.addEventListener) { - emitter.addEventListener(type, f, false) - } else if (emitter.attachEvent) { - emitter.attachEvent("on" + type, f) - } else { - var map = emitter._handlers || (emitter._handlers = {}) - map[type] = (map[type] || noHandlers).concat(f) - } - } - - function getHandlers(emitter, type) { - return emitter._handlers && emitter._handlers[type] || noHandlers - } - - function off(emitter, type, f) { - if (emitter.removeEventListener) { - emitter.removeEventListener(type, f, false) - } else if (emitter.detachEvent) { - emitter.detachEvent("on" + type, f) - } else { - var map = emitter._handlers, arr = map && map[type] - if (arr) { - var index = indexOf(arr, f) - if (index > -1) - { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) } - } - } - } - - function signal(emitter, type /*, values...*/) { - var handlers = getHandlers(emitter, type) - if (!handlers.length) { return } - var args = Array.prototype.slice.call(arguments, 2) - for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) } - } - -// The DOM events that CodeMirror handles can be overridden by -// registering a (non-DOM) handler on the editor for the event name, -// and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") - { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} } - signal(cm, override || e.type, cm, e) - return e_defaultPrevented(e) || e.codemirrorIgnore - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity - if (!arr) { return } - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []) - for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) - { set.push(arr[i]) } } - } - - function hasHandler(emitter, type) { - return getHandlers(emitter, type).length > 0 - } - -// Add on and off methods to a constructor's prototype, to make -// registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f)} - ctor.prototype.off = function(type, f) {off(this, type, f)} - } - -// Due to the fact that we still support jurassic IE versions, some -// compatibility wrappers are needed. - - function e_preventDefault(e) { - if (e.preventDefault) { e.preventDefault() } - else { e.returnValue = false } - } - function e_stopPropagation(e) { - if (e.stopPropagation) { e.stopPropagation() } - else { e.cancelBubble = true } - } - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false - } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)} - - function e_target(e) {return e.target || e.srcElement} - function e_button(e) { - var b = e.which - if (b == null) { - if (e.button & 1) { b = 1 } - else if (e.button & 2) { b = 3 } - else if (e.button & 4) { b = 2 } - } - if (mac && e.ctrlKey && b == 1) { b = 3 } - return b - } - -// Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) { return false } - var div = elt('div') - return "draggable" in div || "dragDrop" in div - }() - - var zwspSupported - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b") - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])) - if (measure.firstChild.offsetHeight != 0) - { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) } - } - var node = zwspSupported ? elt("span", "\u200b") : - elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px") - node.setAttribute("cm-text", "") - return node - } - -// Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects - function hasBadBidiRects(measure) { - if (badBidiRects != null) { return badBidiRects } - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")) - var r0 = range(txt, 0, 1).getBoundingClientRect() - var r1 = range(txt, 1, 2).getBoundingClientRect() - removeChildren(measure) - if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) - return badBidiRects = (r1.right - r0.right < 3) - } - -// See if "".split is the broken IE version, if so, provide an -// alternative way to split lines. - var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { - var pos = 0, result = [], l = string.length - while (pos <= l) { - var nl = string.indexOf("\n", pos) - if (nl == -1) { nl = string.length } - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl) - var rt = line.indexOf("\r") - if (rt != -1) { - result.push(line.slice(0, rt)) - pos += rt + 1 - } else { - result.push(line) - pos = nl + 1 - } - } - return result - } : function (string) { return string.split(/\r\n?|\n/); } - - var hasSelection = window.getSelection ? function (te) { - try { return te.selectionStart != te.selectionEnd } - catch(e) { return false } - } : function (te) { - var range - try {range = te.ownerDocument.selection.createRange()} - catch(e) {} - if (!range || range.parentElement() != te) { return false } - return range.compareEndPoints("StartToEnd", range) != 0 - } - - var hasCopyEvent = (function () { - var e = elt("div") - if ("oncopy" in e) { return true } - e.setAttribute("oncopy", "return;") - return typeof e.oncopy == "function" - })() - - var badZoomedRects = null - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) { return badZoomedRects } - var node = removeChildrenAndAdd(measure, elt("span", "x")) - var normal = node.getBoundingClientRect() - var fromRange = range(node, 0, 1).getBoundingClientRect() - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 - } - - var modes = {}; - var mimeModes = {}; -// Extra arguments are stored as the mode's dependencies, which is -// used by (legacy) mechanisms like loadmode.js to automatically -// load a mode. (Preferred mechanism is the require/define calls.) - function defineMode(name, mode) { - if (arguments.length > 2) - { mode.dependencies = Array.prototype.slice.call(arguments, 2) } - modes[name] = mode - } - - function defineMIME(mime, spec) { - mimeModes[mime] = spec - } - -// Given a MIME type, a {name, ...options} config object, or a name -// string, return a mode config object. - function resolveMode(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec] - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name] - if (typeof found == "string") { found = {name: found} } - spec = createObj(found, spec) - spec.name = found.name - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return resolveMode("application/xml") - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { - return resolveMode("application/json") - } - if (typeof spec == "string") { return {name: spec} } - else { return spec || {name: "null"} } - } - -// Given a mode spec (anything that resolveMode accepts), find and -// initialize an actual mode object. - function getMode(options, spec) { - spec = resolveMode(spec) - var mfactory = modes[spec.name] - if (!mfactory) { return getMode(options, "text/plain") } - var modeObj = mfactory(options, spec) - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name] - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) { continue } - if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] } - modeObj[prop] = exts[prop] - } - } - modeObj.name = spec.name - if (spec.helperType) { modeObj.helperType = spec.helperType } - if (spec.modeProps) { for (var prop$1 in spec.modeProps) - { modeObj[prop$1] = spec.modeProps[prop$1] } } - - return modeObj - } - -// This can be used to attach properties to mode objects from -// outside the actual mode definition. - var modeExtensions = {} - function extendMode(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}) - copyObj(properties, exts) - } - - function copyState(mode, state) { - if (state === true) { return state } - if (mode.copyState) { return mode.copyState(state) } - var nstate = {} - for (var n in state) { - var val = state[n] - if (val instanceof Array) { val = val.concat([]) } - nstate[n] = val - } - return nstate - } - -// Given a mode and a state (for that mode), find the inner mode and -// state at the position that the state refers to. - function innerMode(mode, state) { - var info - while (mode.innerMode) { - info = mode.innerMode(state) - if (!info || info.mode == mode) { break } - state = info.state - mode = info.mode - } - return info || {mode: mode, state: state} - } - - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true - } - -// STRING STREAM - -// Fed to the mode parsers, provides helper functions to make -// parsers more succinct. - - var StringStream = function(string, tabSize, lineOracle) { - this.pos = this.start = 0 - this.string = string - this.tabSize = tabSize || 8 - this.lastColumnPos = this.lastColumnValue = 0 - this.lineStart = 0 - this.lineOracle = lineOracle - }; - - StringStream.prototype.eol = function () {return this.pos >= this.string.length}; - StringStream.prototype.sol = function () {return this.pos == this.lineStart}; - StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; - StringStream.prototype.next = function () { - if (this.pos < this.string.length) - { return this.string.charAt(this.pos++) } - }; - StringStream.prototype.eat = function (match) { - var ch = this.string.charAt(this.pos) - var ok - if (typeof match == "string") { ok = ch == match } - else { ok = ch && (match.test ? match.test(ch) : match(ch)) } - if (ok) {++this.pos; return ch} - }; - StringStream.prototype.eatWhile = function (match) { - var start = this.pos - while (this.eat(match)){} - return this.pos > start - }; - StringStream.prototype.eatSpace = function () { - var this$1 = this; - - var start = this.pos - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos } - return this.pos > start - }; - StringStream.prototype.skipToEnd = function () {this.pos = this.string.length}; - StringStream.prototype.skipTo = function (ch) { - var found = this.string.indexOf(ch, this.pos) - if (found > -1) {this.pos = found; return true} - }; - StringStream.prototype.backUp = function (n) {this.pos -= n}; - StringStream.prototype.column = function () { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue) - this.lastColumnPos = this.start - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }; - StringStream.prototype.indentation = function () { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }; - StringStream.prototype.match = function (pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; } - var substr = this.string.substr(this.pos, pattern.length) - if (cased(substr) == cased(pattern)) { - if (consume !== false) { this.pos += pattern.length } - return true - } - } else { - var match = this.string.slice(this.pos).match(pattern) - if (match && match.index > 0) { return null } - if (match && consume !== false) { this.pos += match[0].length } - return match - } - }; - StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; - StringStream.prototype.hideFirstChars = function (n, inner) { - this.lineStart += n - try { return inner() } - finally { this.lineStart -= n } - }; - StringStream.prototype.lookAhead = function (n) { - var oracle = this.lineOracle - return oracle && oracle.lookAhead(n) - }; - StringStream.prototype.baseToken = function () { - var oracle = this.lineOracle - return oracle && oracle.baseToken(this.pos) - }; - - var SavedContext = function(state, lookAhead) { - this.state = state - this.lookAhead = lookAhead - }; - - var Context = function(doc, state, line, lookAhead) { - this.state = state - this.doc = doc - this.line = line - this.maxLookAhead = lookAhead || 0 - this.baseTokens = null - this.baseTokenPos = 1 - }; - - Context.prototype.lookAhead = function (n) { - var line = this.doc.getLine(this.line + n) - if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n } - return line - }; - - Context.prototype.baseToken = function (n) { - var this$1 = this; - - if (!this.baseTokens) { return null } - while (this.baseTokens[this.baseTokenPos] <= n) - { this$1.baseTokenPos += 2 } - var type = this.baseTokens[this.baseTokenPos + 1] - return {type: type && type.replace(/( |^)overlay .*/, ""), - size: this.baseTokens[this.baseTokenPos] - n} - }; - - Context.prototype.nextLine = function () { - this.line++ - if (this.maxLookAhead > 0) { this.maxLookAhead-- } - }; - - Context.fromSaved = function (doc, saved, line) { - if (saved instanceof SavedContext) - { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } - else - { return new Context(doc, copyState(doc.mode, saved), line) } - }; - - Context.prototype.save = function (copy) { - var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state - return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state - }; - - -// Compute a style array (an array starting with a mode generation -// -- for invalidation -- followed by pairs of end positions and -// style strings), which is used to highlight the tokens on the -// line. - function highlightLine(cm, line, context, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {} - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, - lineClasses, forceToEnd) - var state = context.state - - // Run overlays, adjust style array. - var loop = function ( o ) { - context.baseTokens = st - var overlay = cm.state.overlays[o], i = 1, at = 0 - context.state = true - runMode(cm, line.text, overlay.mode, context, function (end, style) { - var start = i - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i] - if (i_end > end) - { st.splice(i, 1, end, st[i+1], i_end) } - i += 2 - at = Math.min(end, i_end) - } - if (!style) { return } - if (overlay.opaque) { - st.splice(start, i - start, end, "overlay " + style) - i = start + 2 - } else { - for (; start < i; start += 2) { - var cur = st[start+1] - st[start+1] = (cur ? cur + " " : "") + "overlay " + style - } - } - }, lineClasses) - context.state = state - context.baseTokens = null - context.baseTokenPos = 1 - }; - - for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} - } - - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var context = getContextBefore(cm, lineNo(line)) - var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state) - var result = highlightLine(cm, line, context) - if (resetState) { context.state = resetState } - line.stateAfter = context.save(!resetState) - line.styles = result.styles - if (result.classes) { line.styleClasses = result.classes } - else if (line.styleClasses) { line.styleClasses = null } - if (updateFrontier === cm.doc.highlightFrontier) - { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) } - } - return line.styles - } - - function getContextBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display - if (!doc.mode.startState) { return new Context(doc, true, n) } - var start = findStartLine(cm, n, precise) - var saved = start > doc.first && getLine(doc, start - 1).stateAfter - var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start) - - doc.iter(start, n, function (line) { - processLine(cm, line.text, context) - var pos = context.line - line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null - context.nextLine() - }) - if (precise) { doc.modeFrontier = context.line } - return context - } - -// Lightweight form of highlight -- proceed over this line and -// update state, but don't save a style array. Used for lines that -// aren't currently visible. - function processLine(cm, text, context, startAt) { - var mode = cm.doc.mode - var stream = new StringStream(text, cm.options.tabSize, context) - stream.start = stream.pos = startAt || 0 - if (text == "") { callBlankLine(mode, context.state) } - while (!stream.eol()) { - readToken(mode, stream, context.state) - stream.start = stream.pos - } - } - - function callBlankLine(mode, state) { - if (mode.blankLine) { return mode.blankLine(state) } - if (!mode.innerMode) { return } - var inner = innerMode(mode, state) - if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } - } - - function readToken(mode, stream, state, inner) { - for (var i = 0; i < 10; i++) { - if (inner) { inner[0] = innerMode(mode, state).mode } - var style = mode.token(stream, state) - if (stream.pos > stream.start) { return style } - } - throw new Error("Mode " + mode.name + " failed to advance stream.") - } - - var Token = function(stream, type, state) { - this.start = stream.start; this.end = stream.pos - this.string = stream.current() - this.type = type || null - this.state = state - }; - -// Utility for getTokenAt and getLineTokens - function takeToken(cm, pos, precise, asArray) { - var doc = cm.doc, mode = doc.mode, style - pos = clipPos(doc, pos) - var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise) - var stream = new StringStream(line.text, cm.options.tabSize, context), tokens - if (asArray) { tokens = [] } - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos - style = readToken(mode, stream, context.state) - if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) } - } - return asArray ? tokens : new Token(stream, style, context.state) - } - - function extractLineClasses(type, output) { - if (type) { for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/) - if (!lineClass) { break } - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length) - var prop = lineClass[1] ? "bgClass" : "textClass" - if (output[prop] == null) - { output[prop] = lineClass[2] } - else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) - { output[prop] += " " + lineClass[2] } - } } - return type - } - -// Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans - if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans } - var curStart = 0, curStyle = null - var stream = new StringStream(text, cm.options.tabSize, context), style - var inner = cm.options.addModeClass && [null] - if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) } - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false - if (forceToEnd) { processLine(cm, text, context, stream.pos) } - stream.pos = text.length - style = null - } else { - style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses) - } - if (inner) { - var mName = inner[0].name - if (mName) { style = "m-" + (style ? mName + " " + style : mName) } - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 5000) - f(curStart, curStyle) - } - curStyle = style - } - stream.start = stream.pos - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 - // characters, and returns inaccurate measurements in nodes - // starting around 5000 chars. - var pos = Math.min(stream.pos, curStart + 5000) - f(pos, curStyle) - curStart = pos - } - } - -// Finds the line to start with when starting a parse. Tries to -// find a line with a stateAfter, so that it can start with a -// valid state. If that fails, it returns the line with the -// smallest indentation, which tends to need the least context to -// parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100) - for (var search = n; search > lim; --search) { - if (search <= doc.first) { return doc.first } - var line = getLine(doc, search - 1), after = line.stateAfter - if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) - { return search } - var indented = countColumn(line.text, null, cm.options.tabSize) - if (minline == null || minindent > indented) { - minline = search - 1 - minindent = indented - } - } - return minline - } - - function retreatFrontier(doc, n) { - doc.modeFrontier = Math.min(doc.modeFrontier, n) - if (doc.highlightFrontier < n - 10) { return } - var start = doc.first - for (var line = n - 1; line > start; line--) { - var saved = getLine(doc, line).stateAfter - // change is on 3 - // state on line 1 looked ahead 2 -- so saw 3 - // test 1 + 2 < 3 should cover this - if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { - start = line + 1 - break - } - } - doc.highlightFrontier = Math.min(doc.highlightFrontier, start) - } - -// LINE DATA STRUCTURE - -// Line objects. These hold state related to a line, including -// highlighting info (the styles array). - var Line = function(text, markedSpans, estimateHeight) { - this.text = text - attachMarkedSpans(this, markedSpans) - this.height = estimateHeight ? estimateHeight(this) : 1 - }; - - Line.prototype.lineNo = function () { return lineNo(this) }; - eventMixin(Line) - -// Change the content (text, markers) of a line. Automatically -// invalidates cached information and tries to re-estimate the -// line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text - if (line.stateAfter) { line.stateAfter = null } - if (line.styles) { line.styles = null } - if (line.order != null) { line.order = null } - detachMarkedSpans(line) - attachMarkedSpans(line, markedSpans) - var estHeight = estimateHeight ? estimateHeight(line) : 1 - if (estHeight != line.height) { updateLineHeight(line, estHeight) } - } - -// Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null - detachMarkedSpans(line) - } - -// Convert a style as returned by a mode (either null, or a string -// containing one or more styles) to a CSS style. This is cached, -// and also looks for line-wide styles. - var styleToClassCache = {}; - var styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) { return null } - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")) - } - -// Render the DOM representation of the text of a line. Also builds -// up a 'line map', which points at the DOM nodes that represent -// specific stretches of text, and is used by the measuring code. -// The returned object contains the DOM node, this map, and -// information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null) - var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, - col: 0, pos: 0, cm: cm, - trailingSpace: false, - splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")} - lineView.measure = {} - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0) - builder.pos = 0 - builder.addToken = buildToken - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) - { builder.addToken = buildTokenBadBidi(builder.addToken, order) } - builder.map = [] - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line) - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)) - if (line.styleClasses) { - if (line.styleClasses.bgClass) - { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") } - if (line.styleClasses.textClass) - { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") } - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) } - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map - lineView.measure.cache = {} - } else { - ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) - ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}) - } - } - - // See issue #2901 - if (webkit) { - var last = builder.content.lastChild - if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) - { builder.content.className = "cm-tab-wrap-hack" } - } - - signal(cm, "renderLine", cm, lineView.line, builder.pre) - if (builder.pre.className) - { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") } - - return builder - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar") - token.title = "\\u" + ch.charCodeAt(0).toString(16) - token.setAttribute("aria-label", token.title) - return token - } - -// Build up the DOM representation for a single token, and add it to -// the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, title, css) { - if (!text) { return } - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text - var special = builder.cm.state.specialChars, mustWrap = false - var content - if (!special.test(text)) { - builder.col += text.length - content = document.createTextNode(displayText) - builder.map.push(builder.pos, builder.pos + text.length, content) - if (ie && ie_version < 9) { mustWrap = true } - builder.pos += text.length - } else { - content = document.createDocumentFragment() - var pos = 0 - while (true) { - special.lastIndex = pos - var m = special.exec(text) - var skipped = m ? m.index - pos : text.length - pos - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)) - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) } - else { content.appendChild(txt) } - builder.map.push(builder.pos, builder.pos + skipped, txt) - builder.col += skipped - builder.pos += skipped - } - if (!m) { break } - pos += skipped + 1 - var txt$1 = (void 0) - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize - txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")) - txt$1.setAttribute("role", "presentation") - txt$1.setAttribute("cm-text", "\t") - builder.col += tabWidth - } else if (m[0] == "\r" || m[0] == "\n") { - txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")) - txt$1.setAttribute("cm-text", m[0]) - builder.col += 1 - } else { - txt$1 = builder.cm.options.specialCharPlaceholder(m[0]) - txt$1.setAttribute("cm-text", m[0]) - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) } - else { content.appendChild(txt$1) } - builder.col += 1 - } - builder.map.push(builder.pos, builder.pos + 1, txt$1) - builder.pos++ - } - } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32 - if (style || startStyle || endStyle || mustWrap || css) { - var fullStyle = style || "" - if (startStyle) { fullStyle += startStyle } - if (endStyle) { fullStyle += endStyle } - var token = elt("span", [content], fullStyle, css) - if (title) { token.title = title } - return builder.content.appendChild(token) - } - builder.content.appendChild(content) - } - - function splitSpaces(text, trailingBefore) { - if (text.length > 1 && !/ /.test(text)) { return text } - var spaceBefore = trailingBefore, result = "" - for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i) - if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) - { ch = "\u00a0" } - result += ch - spaceBefore = ch == " " - } - return result - } - -// Work around nonsense dimensions being reported for stretches of -// right-to-left text. - function buildTokenBadBidi(inner, order) { - return function (builder, text, style, startStyle, endStyle, title, css) { - style = style ? style + " cm-force-border" : "cm-force-border" - var start = builder.pos, end = start + text.length - for (;;) { - // Find the part that overlaps with the start of this text - var part = (void 0) - for (var i = 0; i < order.length; i++) { - part = order[i] - if (part.to > start && part.from <= start) { break } - } - if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) } - inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css) - startStyle = null - text = text.slice(part.to - start) - start = part.to - } - } - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode - if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) } - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) - { widget = builder.content.appendChild(document.createElement("span")) } - widget.setAttribute("cm-marker", marker.id) - } - if (widget) { - builder.cm.display.input.setUneditable(widget) - builder.content.appendChild(widget) - } - builder.pos += size - builder.trailingSpace = false - } - -// Outputs a number of spans to make up a line, taking highlighting -// and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0 - if (!spans) { - for (var i$1 = 1; i$1 < styles.length; i$1+=2) - { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) } - return - } - - var len = allText.length, pos = 0, i = 1, text = "", style, css - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = title = css = "" - collapsed = null; nextChange = Infinity - var foundBookmarks = [], endStyles = (void 0) - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m) - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to - spanEndStyle = "" - } - if (m.className) { spanStyle += " " + m.className } - if (m.css) { css = (css ? css + ";" : "") + m.css } - if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle } - if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) } - if (m.title && !title) { title = m.title } - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - { collapsed = sp } - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from - } - } - if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) - { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } } - - if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) - { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null) - if (collapsed.to == null) { return } - if (collapsed.to == pos) { collapsed = false } - } - } - if (pos >= len) { break } - - var upto = Math.min(len, nextChange) - while (true) { - if (text) { - var end = pos + text.length - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css) - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} - pos = end - spanStartStyle = "" - } - text = allText.slice(at, at = styles[i++]) - style = interpretTokenStyle(styles[i++], builder.cm.options) - } - } - } - - -// These objects are used to represent the visible (currently drawn) -// part of the document. A LineView may correspond to multiple -// logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line - // Continuing lines, if any - this.rest = visualLineContinued(line) - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1 - this.node = this.text = null - this.hidden = lineIsHidden(doc, line) - } - -// Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos) - nextPos = pos + view.size - array.push(view) - } - return array - } - - var operationGroup = null - - function pushOperation(op) { - if (operationGroup) { - operationGroup.ops.push(op) - } else { - op.ownsGroup = operationGroup = { - ops: [op], - delayedCallbacks: [] - } - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0 - do { - for (; i < callbacks.length; i++) - { callbacks[i].call(null) } - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j] - if (op.cursorActivityHandlers) - { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } } - } - } while (i < callbacks.length) - } - - function finishOperation(op, endCb) { - var group = op.ownsGroup - if (!group) { return } - - try { fireCallbacksForOps(group) } - finally { - operationGroup = null - endCb(group) - } - } - - var orphanDelayedCallbacks = null - -// Often, we want to signal events at a point where we are in the -// middle of some work, but don't want the handler to start calling -// other methods on the editor, which might be in an inconsistent -// state or simply not expect any other events to happen. -// signalLater looks whether there are any handlers, and schedules -// them to be executed when the last operation ends, or, if no -// operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = getHandlers(emitter, type) - if (!arr.length) { return } - var args = Array.prototype.slice.call(arguments, 2), list - if (operationGroup) { - list = operationGroup.delayedCallbacks - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks - } else { - list = orphanDelayedCallbacks = [] - setTimeout(fireOrphanDelayed, 0) - } - var loop = function ( i ) { - list.push(function () { return arr[i].apply(null, args); }) - }; - - for (var i = 0; i < arr.length; ++i) - loop( i ); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks - orphanDelayedCallbacks = null - for (var i = 0; i < delayed.length; ++i) { delayed[i]() } - } - -// When an aspect of a line changes, a string is added to -// lineView.changes. This updates the relevant part of the line's -// DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j] - if (type == "text") { updateLineText(cm, lineView) } - else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) } - else if (type == "class") { updateLineClasses(cm, lineView) } - else if (type == "widget") { updateLineWidgets(cm, lineView, dims) } - } - lineView.changes = null - } - -// Lines with gutter elements, widgets or a background class need to -// be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative") - if (lineView.text.parentNode) - { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) } - lineView.node.appendChild(lineView.text) - if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 } - } - return lineView.node - } - - function updateLineBackground(cm, lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass - if (cls) { cls += " CodeMirror-linebackground" } - if (lineView.background) { - if (cls) { lineView.background.className = cls } - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null } - } else if (cls) { - var wrap = ensureLineWrapped(lineView) - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild) - cm.display.input.setUneditable(lineView.background) - } - } - -// Wrapper around buildLineContent which will reuse the structure -// in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null - lineView.measure = ext.measure - return ext.built - } - return buildLineContent(cm, lineView) - } - -// Redraw the line's text. Interacts with the background and text -// classes because the mode may output tokens that influence these -// classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className - var built = getLineContent(cm, lineView) - if (lineView.text == lineView.node) { lineView.node = built.pre } - lineView.text.parentNode.replaceChild(built.pre, lineView.text) - lineView.text = built.pre - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass - lineView.textClass = built.textClass - updateLineClasses(cm, lineView) - } else if (cls) { - lineView.text.className = cls - } - } - - function updateLineClasses(cm, lineView) { - updateLineBackground(cm, lineView) - if (lineView.line.wrapClass) - { ensureLineWrapped(lineView).className = lineView.line.wrapClass } - else if (lineView.node != lineView.text) - { lineView.node.className = "" } - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass - lineView.text.className = textClass || "" - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter) - lineView.gutter = null - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground) - lineView.gutterBackground = null - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView) - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, - ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")) - cm.display.input.setUneditable(lineView.gutterBackground) - wrap.insertBefore(lineView.gutterBackground, lineView.text) - } - var markers = lineView.line.gutterMarkers - if (cm.options.lineNumbers || markers) { - var wrap$1 = ensureLineWrapped(lineView) - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")) - cm.display.input.setUneditable(gutterWrap) - wrap$1.insertBefore(gutterWrap, lineView.text) - if (lineView.line.gutterClass) - { gutterWrap.className += " " + lineView.line.gutterClass } - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - { lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) } - if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) { - var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id] - if (found) - { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) } - } } - } - } - - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) { lineView.alignable = null } - for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { - next = node.nextSibling - if (node.className == "CodeMirror-linewidget") - { lineView.node.removeChild(node) } - } - insertLineWidgets(cm, lineView, dims) - } - -// Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView) - lineView.text = lineView.node = built.pre - if (built.bgClass) { lineView.bgClass = built.bgClass } - if (built.textClass) { lineView.textClass = built.textClass } - - updateLineClasses(cm, lineView) - updateLineGutter(cm, lineView, lineN, dims) - insertLineWidgets(cm, lineView, dims) - return lineView.node - } - -// A lineView may contain multiple logical lines (when merged by -// collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true) - if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } } - } - - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) { return } - var wrap = ensureLineWrapped(lineView) - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget") - if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") } - positionLineWidget(widget, node, lineView, dims) - cm.display.input.setUneditable(node) - if (allowAbove && widget.above) - { wrap.insertBefore(node, lineView.gutter || lineView.text) } - else - { wrap.appendChild(node) } - signalLater(widget, "redraw") - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - ;(lineView.alignable || (lineView.alignable = [])).push(node) - var width = dims.wrapperWidth - node.style.left = dims.fixedPos + "px" - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth - node.style.paddingLeft = dims.gutterTotalWidth + "px" - } - node.style.width = width + "px" - } - if (widget.coverGutter) { - node.style.zIndex = 5 - node.style.position = "relative" - if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" } - } - } - - function widgetHeight(widget) { - if (widget.height != null) { return widget.height } - var cm = widget.doc.cm - if (!cm) { return 0 } - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;" - if (widget.coverGutter) - { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" } - if (widget.noHScroll) - { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" } - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)) - } - return widget.height = widget.node.parentNode.offsetHeight - } - -// Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || - (n.parentNode == display.sizer && n != display.mover)) - { return true } - } - } - -// POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} - function paddingH(display) { - if (display.cachedPaddingH) { return display.cachedPaddingH } - var e = removeChildrenAndAdd(display.measure, elt("pre", "x")) - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)} - if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data } - return data - } - - function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight - } - -// Ensure the lineView.wrapping.heights array is populated. This is -// an array of bottom offsets for the lines that make up a drawn -// line. When lineWrapping is on, there might be more than one -// height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping - var curWidth = wrapping && displayWidth(cm) - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = [] - if (wrapping) { - lineView.measure.width = curWidth - var rects = lineView.text.firstChild.getClientRects() - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1] - if (Math.abs(cur.bottom - next.bottom) > 2) - { heights.push((cur.bottom + next.top) / 2 - rect.top) } - } - } - heights.push(rect.bottom - rect.top) - } - } - -// Find a line map (mapping character offsets to text nodes) and a -// measurement cache for the given line number. (A line view might -// contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - { return {map: lineView.measure.map, cache: lineView.measure.cache} } - for (var i = 0; i < lineView.rest.length; i++) - { if (lineView.rest[i] == line) - { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } - for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) - { if (lineNo(lineView.rest[i$1]) > lineN) - { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } - } - -// Render a line into the hidden node display.externalMeasured. Used -// when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line) - var lineN = lineNo(line) - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN) - view.lineN = lineN - var built = view.built = buildLineContent(cm, view) - view.text = built.pre - removeChildrenAndAdd(cm.display.lineMeasure, built.pre) - return view - } - -// Get a {top, bottom, left, right} box (in line-local coordinates) -// for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) - } - -// Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - { return cm.display.view[findViewIndex(cm, lineN)] } - var ext = cm.display.externalMeasured - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - { return ext } - } - -// Measurement can be split in two steps, the set-up work that -// applies to the whole line, and the measurement of the actual -// character. Functions like coordsChar, that need to do a lot of -// measurements in a row, can thus ensure that the set-up work is -// only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line) - var view = findViewForLine(cm, lineN) - if (view && !view.text) { - view = null - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)) - cm.curOp.forceUpdate = true - } - if (!view) - { view = updateExternalMeasurement(cm, line) } - - var info = mapFromLineView(view, line, lineN) - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - } - } - -// Given a prepared measurement object, measures the position of an -// actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) { ch = -1 } - var key = ch + (bias || ""), found - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key] - } else { - if (!prepared.rect) - { prepared.rect = prepared.view.text.getBoundingClientRect() } - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect) - prepared.hasHeights = true - } - found = measureCharInner(cm, prepared, ch, bias) - if (!found.bogus) { prepared.cache[key] = found } - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom} - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0} - - function nodeAndOffsetInLineMap(map, ch, bias) { - var node, start, end, collapse, mStart, mEnd - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - mStart = map[i] - mEnd = map[i + 1] - if (ch < mStart) { - start = 0; end = 1 - collapse = "left" - } else if (ch < mEnd) { - start = ch - mStart - end = start + 1 - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart - start = end - 1 - if (ch >= mEnd) { collapse = "right" } - } - if (start != null) { - node = map[i + 2] - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - { collapse = bias } - if (bias == "left" && start == 0) - { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2] - collapse = "left" - } } - if (bias == "right" && start == mEnd - mStart) - { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2] - collapse = "right" - } } - break - } - } - return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} - } - - function getUsefulRect(rects, bias) { - var rect = nullRect - if (bias == "left") { for (var i = 0; i < rects.length; i++) { - if ((rect = rects[i]).left != rect.right) { break } - } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { - if ((rect = rects[i$1]).left != rect.right) { break } - } } - return rect - } - - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias) - var node = place.node, start = place.start, end = place.end, collapse = place.collapse - - var rect - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start } - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end } - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) - { rect = node.parentNode.getBoundingClientRect() } - else - { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) } - if (rect.left || rect.right || start == 0) { break } - end = start - start = start - 1 - collapse = "right" - } - if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) } - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) { collapse = bias = "right" } - var rects - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - { rect = rects[bias == "right" ? rects.length - 1 : 0] } - else - { rect = node.getBoundingClientRect() } - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0] - if (rSpan) - { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} } - else - { rect = nullRect } - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top - var mid = (rtop + rbot) / 2 - var heights = prepared.view.measure.heights - var i = 0 - for (; i < heights.length - 1; i++) - { if (mid < heights[i]) { break } } - var top = i ? heights[i - 1] : 0, bot = heights[i] - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot} - if (!rect.left && !rect.right) { result.bogus = true } - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot } - - return result - } - -// Work around problem with bounding client rects on ranges being -// returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - { return rect } - var scaleX = screen.logicalXDPI / screen.deviceXDPI - var scaleY = screen.logicalYDPI / screen.deviceYDPI - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY} - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {} - lineView.measure.heights = null - if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { lineView.measure.caches[i] = {} } } - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null - removeChildren(cm.display.lineMeasure) - for (var i = 0; i < cm.display.view.length; i++) - { clearLineMeasurementCacheFor(cm.display.view[i]) } - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm) - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null - if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true } - cm.display.lineNumChars = null - } - - function pageScrollX() { - // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 - // which causes page_Offset and bounding client rects to use - // different reference viewports and invalidate our calculations. - if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } - return window.pageXOffset || (document.documentElement || document.body).scrollLeft - } - function pageScrollY() { - if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } - return window.pageYOffset || (document.documentElement || document.body).scrollTop - } - - function widgetTopHeight(lineObj) { - var height = 0 - if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) - { height += widgetHeight(lineObj.widgets[i]) } } } - return height - } - -// Converts a {top, bottom, left, right} box from line-local -// coordinates into another coordinate system. Context may be one of -// "line", "div" (display.lineDiv), "local"./null (editor), "window", -// or "page". - function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { - if (!includeWidgets) { - var height = widgetTopHeight(lineObj) - rect.top += height; rect.bottom += height - } - if (context == "line") { return rect } - if (!context) { context = "local" } - var yOff = heightAtLine(lineObj) - if (context == "local") { yOff += paddingTop(cm.display) } - else { yOff -= cm.display.viewOffset } - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect() - yOff += lOff.top + (context == "window" ? 0 : pageScrollY()) - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()) - rect.left += xOff; rect.right += xOff - } - rect.top += yOff; rect.bottom += yOff - return rect - } - -// Coverts a box from "div" coords to another coordinate system. -// Context may be "window", "page", "div", or "local"./null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") { return coords } - var left = coords.left, top = coords.top - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX() - top -= pageScrollY() - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect() - left += localBox.left - top += localBox.top - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect() - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) { lineObj = getLine(cm.doc, pos.line) } - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) - } - -// Returns a box for a given cursor position, which may have an -// 'other' property containing the position of the secondary cursor -// on a bidi boundary. -// A cursor Pos(line, char, "before") is on the same visual line as `char - 1` -// and after `char - 1` in writing order of `char - 1` -// A cursor Pos(line, char, "after") is on the same visual line as `char` -// and before `char` in writing order of `char` -// Examples (upper-case letters are RTL, lower-case are LTR): -// Pos(0, 1, ...) -// before after -// ab a|b a|b -// aB a|B aB| -// Ab |Ab A|b -// AB B|A B|A -// Every position after the last character on a line is considered to stick -// to the last character on the line. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line) - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight) - if (right) { m.left = m.right; } else { m.right = m.left } - return intoCoordSystem(cm, lineObj, m, context) - } - var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky - if (ch >= lineObj.text.length) { - ch = lineObj.text.length - sticky = "before" - } else if (ch <= 0) { - ch = 0 - sticky = "after" - } - if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } - - function getBidi(ch, partPos, invert) { - var part = order[partPos], right = part.level == 1 - return get(invert ? ch - 1 : ch, right != invert) - } - var partPos = getBidiPartAt(order, ch, sticky) - var other = bidiOther - var val = getBidi(ch, partPos, sticky == "before") - if (other != null) { val.other = getBidi(ch, other, sticky != "before") } - return val - } - -// Used to cheaply estimate the coordinates for a position. Used for -// intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0 - pos = clipPos(cm.doc, pos) - if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch } - var lineObj = getLine(cm.doc, pos.line) - var top = heightAtLine(lineObj) + paddingTop(cm.display) - return {left: left, right: left, top: top, bottom: top + lineObj.height} - } - -// Positions returned by coordsChar contain some extra information. -// xRel is the relative x position of the input coordinates compared -// to the found position (so xRel > 0 means the coordinates are to -// the right of the character position, for example). When outside -// is true, that means the coordinates lie outside the line's -// vertical range. - function PosWithInfo(line, ch, sticky, outside, xRel) { - var pos = Pos(line, ch, sticky) - pos.xRel = xRel - if (outside) { pos.outside = true } - return pos - } - -// Compute the character position closest to the given coordinates. -// Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc - y += cm.display.viewOffset - if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) } - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1 - if (lineN > last) - { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) } - if (x < 0) { x = 0 } - - var lineObj = getLine(doc, lineN) - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y) - var merged = collapsedSpanAtEnd(lineObj) - var mergedPos = merged && merged.find(0, true) - if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) - { lineN = lineNo(lineObj = mergedPos.to.line) } - else - { return found } - } - } - - function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { - y -= widgetTopHeight(lineObj) - var end = lineObj.text.length - var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0) - end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end) - return {begin: begin, end: end} - } - - function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } - var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top - return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) - } - -// Returns true if the given side of a box is after the given -// coordinates, in top-to-bottom, left-to-right order. - function boxIsAfter(box, x, y, left) { - return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - // Move y into line-local coordinate space - y -= heightAtLine(lineObj) - var preparedMeasure = prepareMeasureForLine(cm, lineObj) - // When directly calling `measureCharPrepared`, we have to adjust - // for the widgets at this line. - var widgetHeight = widgetTopHeight(lineObj) - var begin = 0, end = lineObj.text.length, ltr = true - - var order = getOrder(lineObj, cm.doc.direction) - // If the line isn't plain left-to-right text, first figure out - // which bidi section the coordinates fall into. - if (order) { - var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) - (cm, lineObj, lineNo, preparedMeasure, order, x, y) - ltr = part.level != 1 - // The awkward -1 offsets are needed because findFirst (called - // on these below) will treat its first bound as inclusive, - // second as exclusive, but we want to actually address the - // characters in the part's range - begin = ltr ? part.from : part.to - 1 - end = ltr ? part.to : part.from - 1 - } - - // A binary search to find the first character whose bounding box - // starts after the coordinates. If we run across any whose box wrap - // the coordinates, store that. - var chAround = null, boxAround = null - var ch = findFirst(function (ch) { - var box = measureCharPrepared(cm, preparedMeasure, ch) - box.top += widgetHeight; box.bottom += widgetHeight - if (!boxIsAfter(box, x, y, false)) { return false } - if (box.top <= y && box.left <= x) { - chAround = ch - boxAround = box - } - return true - }, begin, end) - - var baseX, sticky, outside = false - // If a box around the coordinates was found, use that - if (boxAround) { - // Distinguish coordinates nearer to the left or right side of the box - var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr - ch = chAround + (atStart ? 0 : 1) - sticky = atStart ? "after" : "before" - baseX = atLeft ? boxAround.left : boxAround.right - } else { - // (Adjust for extended bound, if necessary.) - if (!ltr && (ch == end || ch == begin)) { ch++ } - // To determine which side to associate with, get the box to the - // left of the character and compare it's vertical position to the - // coordinates - sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : - (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ? - "after" : "before" - // Now get accurate coordinates for this place, in order to get a - // base X position - var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure) - baseX = coords.left - outside = y < coords.top || y >= coords.bottom - } - - ch = skipExtendingChars(lineObj.text, ch, 1) - return PosWithInfo(lineNo, ch, sticky, outside, x - baseX) - } - - function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { - // Bidi parts are sorted left-to-right, and in a non-line-wrapping - // situation, we can take this ordering to correspond to the visual - // ordering. This finds the first part whose end is after the given - // coordinates. - var index = findFirst(function (i) { - var part = order[i], ltr = part.level != 1 - return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), - "line", lineObj, preparedMeasure), x, y, true) - }, 0, order.length - 1) - var part = order[index] - // If this isn't the first part, the part's start is also after - // the coordinates, and the coordinates aren't on the same line as - // that start, move one part back. - if (index > 0) { - var ltr = part.level != 1 - var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), - "line", lineObj, preparedMeasure) - if (boxIsAfter(start, x, y, true) && start.top > y) - { part = order[index - 1] } - } - return part - } - - function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { - // In a wrapped line, rtl text on wrapping boundaries can do things - // that don't correspond to the ordering in our `order` array at - // all, so a binary search doesn't work, and we want to return a - // part that only spans one line so that the binary search in - // coordsCharInner is safe. As such, we first find the extent of the - // wrapped line, and then do a flat search in which we discard any - // spans that aren't on the line. - var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); - var begin = ref.begin; - var end = ref.end; - if (/\s/.test(lineObj.text.charAt(end - 1))) { end-- } - var part = null, closestDist = null - for (var i = 0; i < order.length; i++) { - var p = order[i] - if (p.from >= end || p.to <= begin) { continue } - var ltr = p.level != 1 - var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right - // Weigh against spans ending before this, so that they are only - // picked if nothing ends after - var dist = endX < x ? x - endX + 1e9 : endX - x - if (!part || closestDist > dist) { - part = p - closestDist = dist - } - } - if (!part) { part = order[order.length - 1] } - // Clip the part to the wrapped line. - if (part.from < begin) { part = {from: begin, to: part.to, level: part.level} } - if (part.to > end) { part = {from: part.from, to: end, level: part.level} } - return part - } - - var measureText -// Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) { return display.cachedTextHeight } - if (measureText == null) { - measureText = elt("pre") - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")) - measureText.appendChild(elt("br")) - } - measureText.appendChild(document.createTextNode("x")) - } - removeChildrenAndAdd(display.measure, measureText) - var height = measureText.offsetHeight / 50 - if (height > 3) { display.cachedTextHeight = height } - removeChildren(display.measure) - return height || 1 - } - -// Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) { return display.cachedCharWidth } - var anchor = elt("span", "xxxxxxxxxx") - var pre = elt("pre", [anchor]) - removeChildrenAndAdd(display.measure, pre) - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10 - if (width > 2) { display.cachedCharWidth = width } - return width || 10 - } - -// Do a bulk-read of the DOM positions and sizes needed to draw the -// view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {} - var gutterLeft = d.gutters.clientLeft - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft - width[cm.options.gutters[i]] = n.clientWidth - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth} - } - -// Computes display.scroller.scrollLeft + display.gutters.offsetWidth, -// but using getBoundingClientRect to get a sub-pixel-accurate -// result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left - } - -// Returns a function that estimates the height of a line, to use as -// first approximation until the line becomes visible (and is thus -// properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3) - return function (line) { - if (lineIsHidden(cm.doc, line)) { return 0 } - - var widgetsHeight = 0 - if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height } - } } - - if (wrapping) - { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } - else - { return widgetsHeight + th } - } - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm) - doc.iter(function (line) { - var estHeight = est(line) - if (estHeight != line.height) { updateLineHeight(line, estHeight) } - }) - } - -// Given a mouse event, find the corresponding position. If liberal -// is false, it checks whether a gutter or scrollbar was clicked, -// and returns null if it was. forRect is used by rectangular -// selections, and tries to estimate a character position even for -// coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } - - var x, y, space = display.lineSpace.getBoundingClientRect() - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top } - catch (e) { return null } - var coords = coordsChar(cm, x, y), line - if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)) - } - return coords - } - -// Find the view element corresponding to a given line. Return null -// when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) { return null } - n -= cm.display.viewFrom - if (n < 0) { return null } - var view = cm.display.view - for (var i = 0; i < view.length; i++) { - n -= view[i].size - if (n < 0) { return i } - } - } - - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()) - } - - function prepareSelection(cm, primary) { - if ( primary === void 0 ) primary = true; - - var doc = cm.doc, result = {} - var curFragment = result.cursors = document.createDocumentFragment() - var selFragment = result.selection = document.createDocumentFragment() - - for (var i = 0; i < doc.sel.ranges.length; i++) { - if (!primary && i == doc.sel.primIndex) { continue } - var range = doc.sel.ranges[i] - if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } - var collapsed = range.empty() - if (collapsed || cm.options.showCursorWhenSelecting) - { drawSelectionCursor(cm, range.head, curFragment) } - if (!collapsed) - { drawSelectionRange(cm, range, selFragment) } - } - return result - } - -// Draws a cursor for the given range - function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine) - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")) - cursor.style.left = pos.left + "px" - cursor.style.top = pos.top + "px" - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px" - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")) - otherCursor.style.display = "" - otherCursor.style.left = pos.other.left + "px" - otherCursor.style.top = pos.other.top + "px" - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px" - } - } - - function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } - -// Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc - var fragment = document.createDocumentFragment() - var padding = paddingH(cm.display), leftSide = padding.left - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right - var docLTR = doc.direction == "ltr" - - function add(left, top, width, bottom) { - if (top < 0) { top = 0 } - top = Math.round(top) - bottom = Math.round(bottom) - fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))) - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line) - var lineLen = lineObj.text.length - var start, end - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias) - } - - function wrapX(pos, dir, side) { - var extent = wrappedLineExtentChar(cm, lineObj, null, pos) - var prop = (dir == "ltr") == (side == "after") ? "left" : "right" - var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1) - return coords(ch, prop)[prop] - } - - var order = getOrder(lineObj, doc.direction) - iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { - var ltr = dir == "ltr" - var fromPos = coords(from, ltr ? "left" : "right") - var toPos = coords(to - 1, ltr ? "right" : "left") - - var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen - var first = i == 0, last = !order || i == order.length - 1 - if (toPos.top - fromPos.top <= 3) { // Single line - var openLeft = (docLTR ? openStart : openEnd) && first - var openRight = (docLTR ? openEnd : openStart) && last - var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left - var right = openRight ? rightSide : (ltr ? toPos : fromPos).right - add(left, fromPos.top, right - left, fromPos.bottom) - } else { // Multiple lines - var topLeft, topRight, botLeft, botRight - if (ltr) { - topLeft = docLTR && openStart && first ? leftSide : fromPos.left - topRight = docLTR ? rightSide : wrapX(from, dir, "before") - botLeft = docLTR ? leftSide : wrapX(to, dir, "after") - botRight = docLTR && openEnd && last ? rightSide : toPos.right - } else { - topLeft = !docLTR ? leftSide : wrapX(from, dir, "before") - topRight = !docLTR && openStart && first ? rightSide : fromPos.right - botLeft = !docLTR && openEnd && last ? leftSide : toPos.left - botRight = !docLTR ? rightSide : wrapX(to, dir, "after") - } - add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom) - if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top) } - add(botLeft, toPos.top, botRight - botLeft, toPos.bottom) - } - - if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos } - if (cmpCoords(toPos, start) < 0) { start = toPos } - if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos } - if (cmpCoords(toPos, end) < 0) { end = toPos } - }) - return {start: start, end: end} - } - - var sFrom = range.from(), sTo = range.to() - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch) - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line) - var singleVLine = visualLine(fromLine) == visualLine(toLine) - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom) - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom) - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom) - } - } - if (leftEnd.bottom < rightStart.top) - { add(leftSide, leftEnd.bottom, null, rightStart.top) } - } - - output.appendChild(fragment) - } - -// Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) { return } - var display = cm.display - clearInterval(display.blinker) - var on = true - display.cursorDiv.style.visibility = "" - if (cm.options.cursorBlinkRate > 0) - { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, - cm.options.cursorBlinkRate) } - else if (cm.options.cursorBlinkRate < 0) - { display.cursorDiv.style.visibility = "hidden" } - } - - function ensureFocus(cm) { - if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) } - } - - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true - setTimeout(function () { if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false - onBlur(cm) - } }, 100) - } - - function onFocus(cm, e) { - if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false } - - if (cm.options.readOnly == "nocursor") { return } - if (!cm.state.focused) { - signal(cm, "focus", cm, e) - cm.state.focused = true - addClass(cm.display.wrapper, "CodeMirror-focused") - // This test prevents this from firing when a context - // menu is closed (since the input reset would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset() - if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730 - } - cm.display.input.receivedFocus() - } - restartBlink(cm) - } - function onBlur(cm, e) { - if (cm.state.delayingBlurEvent) { return } - - if (cm.state.focused) { - signal(cm, "blur", cm, e) - cm.state.focused = false - rmClass(cm.display.wrapper, "CodeMirror-focused") - } - clearInterval(cm.display.blinker) - setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150) - } - -// Read the actual heights of the rendered lines, and update their -// stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display - var prevBottom = display.lineDiv.offsetTop - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], height = (void 0) - if (cur.hidden) { continue } - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight - height = bot - prevBottom - prevBottom = bot - } else { - var box = cur.node.getBoundingClientRect() - height = box.bottom - box.top - } - var diff = cur.line.height - height - if (height < 2) { height = textHeight(display) } - if (diff > .005 || diff < -.005) { - updateLineHeight(cur.line, height) - updateWidgetHeight(cur.line) - if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) - { updateWidgetHeight(cur.rest[j]) } } - } - } - } - -// Read and store the height of line widgets associated with the -// given line. - function updateWidgetHeight(line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { - var w = line.widgets[i], parent = w.node.parentNode - if (parent) { w.height = parent.offsetHeight } - } } - } - -// Compute the lines that are visible in a given viewport (defaults -// the the current scroll position). viewport may contain top, -// height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop - top = Math.floor(top - paddingTop(display)) - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom) - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line - if (ensureFrom < from) { - from = ensureFrom - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight) - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight) - to = ensureTo - } - } - return {from: from, to: Math.max(to, from + 1)} - } - -// Re-align line numbers and gutter marks to compensate for -// horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft - var gutterW = display.gutters.offsetWidth, left = comp + "px" - for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { - if (cm.options.fixedGutter) { - if (view[i].gutter) - { view[i].gutter.style.left = left } - if (view[i].gutterBackground) - { view[i].gutterBackground.style.left = left } - } - var align = view[i].alignable - if (align) { for (var j = 0; j < align.length; j++) - { align[j].style.left = left } } - } } - if (cm.options.fixedGutter) - { display.gutters.style.left = (comp + gutterW) + "px" } - } - -// Used to ensure that the line number gutter is still the right -// size for the current document size. Returns true when an update -// is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) { return false } - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")) - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW - display.lineGutter.style.width = "" - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1 - display.lineNumWidth = display.lineNumInnerWidth + padding - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1 - display.lineGutter.style.width = display.lineNumWidth + "px" - updateGutterSpace(cm) - return true - } - return false - } - -// SCROLLING THINGS INTO VIEW - -// If an editor sits on the top or bottom of the window, partially -// scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, rect) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null - if (rect.top + box.top < 0) { doScroll = true } - else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false } - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")) - cm.display.lineSpace.appendChild(scrollNode) - scrollNode.scrollIntoView(doScroll) - cm.display.lineSpace.removeChild(scrollNode) - } - } - -// Scroll a given position into view (immediately), verifying that -// it actually became visible (as line heights are accurately -// measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) { margin = 0 } - var rect - if (!cm.options.lineWrapping && pos == end) { - // Set pos and end to the cursor positions around the character pos sticks to - // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch - // If pos == Pos(_, 0, "before"), pos and end are unchanged - pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos - end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos - } - for (var limit = 0; limit < 5; limit++) { - var changed = false - var coords = cursorCoords(cm, pos) - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end) - rect = {left: Math.min(coords.left, endCoords.left), - top: Math.min(coords.top, endCoords.top) - margin, - right: Math.max(coords.left, endCoords.left), - bottom: Math.max(coords.bottom, endCoords.bottom) + margin} - var scrollPos = calculateScrollPos(cm, rect) - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop) - if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true } - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft) - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true } - } - if (!changed) { break } - } - return rect - } - -// Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, rect) { - var scrollPos = calculateScrollPos(cm, rect) - if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) } - if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) } - } - -// Calculate a new scroll position needed to scroll the given -// rectangle into view. Returns an object with scrollTop and -// scrollLeft properties. When these are undefined, the -// vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, rect) { - var display = cm.display, snapMargin = textHeight(cm.display) - if (rect.top < 0) { rect.top = 0 } - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop - var screen = displayHeight(cm), result = {} - if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen } - var docBottom = cm.doc.height + paddingVert(display) - var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin - if (rect.top < screentop) { - result.scrollTop = atTop ? 0 : rect.top - } else if (rect.bottom > screentop + screen) { - var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen) - if (newTop != screentop) { result.scrollTop = newTop } - } - - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0) - var tooWide = rect.right - rect.left > screenw - if (tooWide) { rect.right = rect.left + screenw } - if (rect.left < 10) - { result.scrollLeft = 0 } - else if (rect.left < screenleft) - { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) } - else if (rect.right > screenw + screenleft - 3) - { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw } - return result - } - -// Store a relative adjustment to the scroll position in the current -// operation (to be applied when the operation finishes). - function addToScrollTop(cm, top) { - if (top == null) { return } - resolveScrollToPos(cm) - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top - } - -// Make sure that at the end of the operation the current cursor is -// shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm) - var cur = cm.getCursor() - cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin} - } - - function scrollToCoords(cm, x, y) { - if (x != null || y != null) { resolveScrollToPos(cm) } - if (x != null) { cm.curOp.scrollLeft = x } - if (y != null) { cm.curOp.scrollTop = y } - } - - function scrollToRange(cm, range) { - resolveScrollToPos(cm) - cm.curOp.scrollToPos = range - } - -// When an operation has its scrollToPos property set, and another -// scroll action is applied before the end of the operation, this -// 'simulates' scrolling that position into view in a cheap way, so -// that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos - if (range) { - cm.curOp.scrollToPos = null - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to) - scrollToCoordsRange(cm, from, to, range.margin) - } - } - - function scrollToCoordsRange(cm, from, to, margin) { - var sPos = calculateScrollPos(cm, { - left: Math.min(from.left, to.left), - top: Math.min(from.top, to.top) - margin, - right: Math.max(from.right, to.right), - bottom: Math.max(from.bottom, to.bottom) + margin - }) - scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop) - } - -// Sync the scrollable area and scrollbars, ensure the viewport -// covers the visible area. - function updateScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) { return } - if (!gecko) { updateDisplaySimple(cm, {top: val}) } - setScrollTop(cm, val, true) - if (gecko) { updateDisplaySimple(cm) } - startWorker(cm, 100) - } - - function setScrollTop(cm, val, forceScroll) { - val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val) - if (cm.display.scroller.scrollTop == val && !forceScroll) { return } - cm.doc.scrollTop = val - cm.display.scrollbars.setScrollTop(val) - if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val } - } - -// Sync scroller and scrollbar, ensure the gutter elements are -// aligned. - function setScrollLeft(cm, val, isScroller, forceScroll) { - val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth) - if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } - cm.doc.scrollLeft = val - alignHorizontally(cm) - if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val } - cm.display.scrollbars.setScrollLeft(val) - } - -// SCROLLBARS - -// Prepare DOM reads needed to update the scrollbars. Done in one -// shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth - var docH = Math.round(cm.doc.height + paddingVert(cm.display)) - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - } - } - - var NativeScrollbars = function(place, scroll, cm) { - this.cm = cm - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar") - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar") - place(vert); place(horiz) - - on(vert, "scroll", function () { - if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") } - }) - on(horiz, "scroll", function () { - if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") } - }) - - this.checkedZeroWidth = false - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" } - }; - - NativeScrollbars.prototype.update = function (measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1 - var needsV = measure.scrollHeight > measure.clientHeight + 1 - var sWidth = measure.nativeBarWidth - - if (needsV) { - this.vert.style.display = "block" - this.vert.style.bottom = needsH ? sWidth + "px" : "0" - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0) - // A bug in IE8 can cause this value to be negative, so guard it. - this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px" - } else { - this.vert.style.display = "" - this.vert.firstChild.style.height = "0" - } - - if (needsH) { - this.horiz.style.display = "block" - this.horiz.style.right = needsV ? sWidth + "px" : "0" - this.horiz.style.left = measure.barLeft + "px" - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0) - this.horiz.firstChild.style.width = - Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px" - } else { - this.horiz.style.display = "" - this.horiz.firstChild.style.width = "0" - } - - if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) { this.zeroWidthHack() } - this.checkedZeroWidth = true - } - - return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} - }; - - NativeScrollbars.prototype.setScrollLeft = function (pos) { - if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos } - if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz") } - }; - - NativeScrollbars.prototype.setScrollTop = function (pos) { - if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos } - if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert") } - }; - - NativeScrollbars.prototype.zeroWidthHack = function () { - var w = mac && !mac_geMountainLion ? "12px" : "18px" - this.horiz.style.height = this.vert.style.width = w - this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none" - this.disableHoriz = new Delayed - this.disableVert = new Delayed - }; - - NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { - bar.style.pointerEvents = "auto" - function maybeDisable() { - // To find out whether the scrollbar is still visible, we - // check whether the element under the pixel in the bottom - // right corner of the scrollbar box is the scrollbar box - // itself (when the bar is still visible) or its filler child - // (when the bar is hidden). If it is still visible, we keep - // it enabled, if it's hidden, we disable pointer events. - var box = bar.getBoundingClientRect() - var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) - : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1) - if (elt != bar) { bar.style.pointerEvents = "none" } - else { delay.set(1000, maybeDisable) } - } - delay.set(1000, maybeDisable) - }; - - NativeScrollbars.prototype.clear = function () { - var parent = this.horiz.parentNode - parent.removeChild(this.horiz) - parent.removeChild(this.vert) - }; - - var NullScrollbars = function () {}; - - NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; - NullScrollbars.prototype.setScrollLeft = function () {}; - NullScrollbars.prototype.setScrollTop = function () {}; - NullScrollbars.prototype.clear = function () {}; - - function updateScrollbars(cm, measure) { - if (!measure) { measure = measureForScrollbars(cm) } - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight - updateScrollbarsInner(cm, measure) - for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - { updateHeightsInViewport(cm) } - updateScrollbarsInner(cm, measureForScrollbars(cm)) - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight - } - } - -// Re-synchronize the fake scrollbars with the actual size of the -// content. - function updateScrollbarsInner(cm, measure) { - var d = cm.display - var sizes = d.scrollbars.update(measure) - - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px" - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px" - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" - - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block" - d.scrollbarFiller.style.height = sizes.bottom + "px" - d.scrollbarFiller.style.width = sizes.right + "px" - } else { d.scrollbarFiller.style.display = "" } - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block" - d.gutterFiller.style.height = sizes.bottom + "px" - d.gutterFiller.style.width = measure.gutterWidth + "px" - } else { d.gutterFiller.style.display = "" } - } - - var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars} - - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear() - if (cm.display.scrollbars.addClass) - { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) } - } - - cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller) - // Prevent clicks in the scrollbars from killing focus - on(node, "mousedown", function () { - if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) } - }) - node.setAttribute("cm-not-content", "true") - }, function (pos, axis) { - if (axis == "horizontal") { setScrollLeft(cm, pos) } - else { updateScrollTop(cm, pos) } - }, cm) - if (cm.display.scrollbars.addClass) - { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) } - } - -// Operations are used to wrap a series of changes to the editor -// state in such a way that each change won't have to update the -// cursor and display (which would be awkward, slow, and -// error-prone). Instead, display updates are batched and then all -// combined and executed at once. - - var nextOpId = 0 -// Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: null, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - focus: false, - id: ++nextOpId // Unique ID - } - pushOperation(cm.curOp) - } - -// Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp - finishOperation(op, function (group) { - for (var i = 0; i < group.ops.length; i++) - { group.ops[i].cm.curOp = null } - endOperations(group) - }) - } - -// The DOM updates done when an operation finishes are batched so -// that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops - for (var i = 0; i < ops.length; i++) // Read DOM - { endOperation_R1(ops[i]) } - for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) - { endOperation_W1(ops[i$1]) } - for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM - { endOperation_R2(ops[i$2]) } - for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) - { endOperation_W2(ops[i$3]) } - for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM - { endOperation_finish(ops[i$4]) } - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display - maybeClipScrollbars(cm) - if (op.updateMaxLine) { findMaxLine(cm) } - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate) - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update) - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display - if (op.updatedDisplay) { updateHeightsInViewport(cm) } - - op.barMeasure = measureForScrollbars(cm) - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3 - cm.display.sizerWidth = op.adjustWidthTo - op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth) - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)) - } - - if (op.updatedDisplay || op.selectionChanged) - { op.preparedSelection = display.input.prepareSelection() } - } - - function endOperation_W2(op) { - var cm = op.cm - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px" - if (op.maxScrollLeft < cm.doc.scrollLeft) - { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) } - cm.display.maxLineChanged = false - } - - var takeFocus = op.focus && op.focus == activeElt() - if (op.preparedSelection) - { cm.display.input.showSelection(op.preparedSelection, takeFocus) } - if (op.updatedDisplay || op.startHeight != cm.doc.height) - { updateScrollbars(cm, op.barMeasure) } - if (op.updatedDisplay) - { setDocumentHeight(cm, op.barMeasure) } - - if (op.selectionChanged) { restartBlink(cm) } - - if (cm.state.focused && op.updateInput) - { cm.display.input.reset(op.typing) } - if (takeFocus) { ensureFocus(op.cm) } - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc - - if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) } - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - { display.wheelStartX = display.wheelStartY = null } - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) } - - if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin) - maybeScrollWindow(cm, rect) - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers - if (hidden) { for (var i = 0; i < hidden.length; ++i) - { if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } } - if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) - { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } } - - if (display.wrapper.offsetHeight) - { doc.scrollTop = cm.display.scroller.scrollTop } - - // Fire change events, and delayed event handlers - if (op.changeObjs) - { signal(cm, "changes", cm, op.changeObjs) } - if (op.update) - { op.update.finish() } - } - -// Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) { return f() } - startOperation(cm) - try { return f() } - finally { endOperation(cm) } - } -// Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) { return f.apply(cm, arguments) } - startOperation(cm) - try { return f.apply(cm, arguments) } - finally { endOperation(cm) } - } - } -// Used to add methods to editor and doc instances, wrapping them in -// operations. - function methodOp(f) { - return function() { - if (this.curOp) { return f.apply(this, arguments) } - startOperation(this) - try { return f.apply(this, arguments) } - finally { endOperation(this) } - } - } - function docMethodOp(f) { - return function() { - var cm = this.cm - if (!cm || cm.curOp) { return f.apply(this, arguments) } - startOperation(cm) - try { return f.apply(this, arguments) } - finally { endOperation(cm) } - } - } - -// Updates the display.view data structure for a given change to the -// document. From and to are in pre-change coordinates. Lendiff is -// the amount of lines added or subtracted by the change. This is -// used for changes that span multiple lines, or change the way -// lines are divided into visual lines. regLineChange (below) -// registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) { from = cm.doc.first } - if (to == null) { to = cm.doc.first + cm.doc.size } - if (!lendiff) { lendiff = 0 } - - var display = cm.display - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - { display.updateLineNumbers = from } - - cm.curOp.viewChanged = true - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - { resetView(cm) } - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm) - } else { - display.viewFrom += lendiff - display.viewTo += lendiff - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm) - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1) - if (cut) { - display.view = display.view.slice(cut.index) - display.viewFrom = cut.lineN - display.viewTo += lendiff - } else { - resetView(cm) - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut$1 = viewCuttingPoint(cm, from, from, -1) - if (cut$1) { - display.view = display.view.slice(0, cut$1.index) - display.viewTo = cut$1.lineN - } else { - resetView(cm) - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1) - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1) - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)) - display.viewTo += lendiff - } else { - resetView(cm) - } - } - - var ext = display.externalMeasured - if (ext) { - if (to < ext.lineN) - { ext.lineN += lendiff } - else if (from < ext.lineN + ext.size) - { display.externalMeasured = null } - } - } - -// Register a change to a single line. Type must be one of "text", -// "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true - var display = cm.display, ext = cm.display.externalMeasured - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - { display.externalMeasured = null } - - if (line < display.viewFrom || line >= display.viewTo) { return } - var lineView = display.view[findViewIndex(cm, line)] - if (lineView.node == null) { return } - var arr = lineView.changes || (lineView.changes = []) - if (indexOf(arr, type) == -1) { arr.push(type) } - } - -// Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first - cm.display.view = [] - cm.display.viewOffset = 0 - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - { return {index: index, lineN: newN} } - var n = cm.display.viewFrom - for (var i = 0; i < index; i++) - { n += view[i].size } - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) { return null } - diff = (n + view[index].size) - oldN - index++ - } else { - diff = n - oldN - } - oldN += diff; newN += diff - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) { return null } - newN += dir * view[index - (dir < 0 ? 1 : 0)].size - index += dir - } - return {index: index, lineN: newN} - } - -// Force the view to cover a given range, adding empty view element -// or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to) - display.viewFrom = from - } else { - if (display.viewFrom > from) - { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) } - else if (display.viewFrom < from) - { display.view = display.view.slice(findViewIndex(cm, from)) } - display.viewFrom = from - if (display.viewTo < to) - { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) } - else if (display.viewTo > to) - { display.view = display.view.slice(0, findViewIndex(cm, to)) } - } - display.viewTo = to - } - -// Count the number of lines in the view whose DOM representation is -// out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0 - for (var i = 0; i < view.length; i++) { - var lineView = view[i] - if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty } - } - return dirty - } - -// HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.highlightFrontier < cm.display.viewTo) - { cm.state.highlight.set(time, bind(highlightWorker, cm)) } - } - - function highlightWorker(cm) { - var doc = cm.doc - if (doc.highlightFrontier >= cm.display.viewTo) { return } - var end = +new Date + cm.options.workTime - var context = getContextBefore(cm, doc.highlightFrontier) - var changedLines = [] - - doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { - if (context.line >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles - var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null - var highlighted = highlightLine(cm, line, context, true) - if (resetState) { context.state = resetState } - line.styles = highlighted.styles - var oldCls = line.styleClasses, newCls = highlighted.classes - if (newCls) { line.styleClasses = newCls } - else if (oldCls) { line.styleClasses = null } - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass) - for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] } - if (ischange) { changedLines.push(context.line) } - line.stateAfter = context.save() - context.nextLine() - } else { - if (line.text.length <= cm.options.maxHighlightLength) - { processLine(cm, line.text, context) } - line.stateAfter = context.line % 5 == 0 ? context.save() : null - context.nextLine() - } - if (+new Date > end) { - startWorker(cm, cm.options.workDelay) - return true - } - }) - doc.highlightFrontier = context.line - doc.modeFrontier = Math.max(doc.modeFrontier, context.line) - if (changedLines.length) { runInOp(cm, function () { - for (var i = 0; i < changedLines.length; i++) - { regLineChange(cm, changedLines[i], "text") } - }) } - } - -// DISPLAY DRAWING - - var DisplayUpdate = function(cm, viewport, force) { - var display = cm.display - - this.viewport = viewport - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport) - this.editorIsHidden = !display.wrapper.offsetWidth - this.wrapperHeight = display.wrapper.clientHeight - this.wrapperWidth = display.wrapper.clientWidth - this.oldDisplayWidth = displayWidth(cm) - this.force = force - this.dims = getDimensions(cm) - this.events = [] - }; - - DisplayUpdate.prototype.signal = function (emitter, type) { - if (hasHandler(emitter, type)) - { this.events.push(arguments) } - }; - DisplayUpdate.prototype.finish = function () { - var this$1 = this; - - for (var i = 0; i < this.events.length; i++) - { signal.apply(null, this$1.events[i]) } - }; - - function maybeClipScrollbars(cm) { - var display = cm.display - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth - display.heightForcer.style.height = scrollGap(cm) + "px" - display.sizer.style.marginBottom = -display.nativeBarWidth + "px" - display.sizer.style.borderRightWidth = scrollGap(cm) + "px" - display.scrollbarsClipped = true - } - } - - function selectionSnapshot(cm) { - if (cm.hasFocus()) { return null } - var active = activeElt() - if (!active || !contains(cm.display.lineDiv, active)) { return null } - var result = {activeElt: active} - if (window.getSelection) { - var sel = window.getSelection() - if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { - result.anchorNode = sel.anchorNode - result.anchorOffset = sel.anchorOffset - result.focusNode = sel.focusNode - result.focusOffset = sel.focusOffset - } - } - return result - } - - function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } - snapshot.activeElt.focus() - if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { - var sel = window.getSelection(), range = document.createRange() - range.setEnd(snapshot.anchorNode, snapshot.anchorOffset) - range.collapse(false) - sel.removeAllRanges() - sel.addRange(range) - sel.extend(snapshot.focusNode, snapshot.focusOffset) - } - } - -// Does the actual updating of the line display. Bails out -// (returning false) when there is nothing to be done and forced is -// false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc - - if (update.editorIsHidden) { - resetView(cm) - return false - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - display.renderedView == display.view && countDirtyView(cm) == 0) - { return false } - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm) - update.dims = getDimensions(cm) - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first) - var to = Math.min(end, update.visible.to + cm.options.viewportMargin) - if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) } - if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) } - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from) - to = visualLineEndNo(cm.doc, to) - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth - adjustView(cm, from, to) - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)) - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px" - - var toUpdate = countDirtyView(cm) - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - { return false } - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var selSnapshot = selectionSnapshot(cm) - if (toUpdate > 4) { display.lineDiv.style.display = "none" } - patchDisplay(cm, display.updateLineNumbers, update.dims) - if (toUpdate > 4) { display.lineDiv.style.display = "" } - display.renderedView = display.view - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - restoreSelection(selSnapshot) - - // Prevent selection and cursors from interfering with the scroll - // width and height. - removeChildren(display.cursorDiv) - removeChildren(display.selectionDiv) - display.gutters.style.height = display.sizer.style.minHeight = 0 - - if (different) { - display.lastWrapHeight = update.wrapperHeight - display.lastWrapWidth = update.wrapperWidth - startWorker(cm, 400) - } - - display.updateLineNumbers = null - - return true - } - - function postUpdateDisplay(cm, update) { - var viewport = update.viewport - - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} } - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport) - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - { break } - } - if (!updateDisplayIfNeeded(cm, update)) { break } - updateHeightsInViewport(cm) - var barMeasure = measureForScrollbars(cm) - updateSelection(cm) - updateScrollbars(cm, barMeasure) - setDocumentHeight(cm, barMeasure) - update.force = false - } - - update.signal(cm, "update", cm) - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo) - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo - } - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport) - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm) - postUpdateDisplay(cm, update) - var barMeasure = measureForScrollbars(cm) - updateSelection(cm) - updateScrollbars(cm, barMeasure) - setDocumentHeight(cm, barMeasure) - update.finish() - } - } - -// Sync the actual display DOM structure with display.view, removing -// nodes for lines that are no longer in view, and creating the ones -// that are not there yet, and updating the ones that are out of -// date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers - var container = display.lineDiv, cur = container.firstChild - - function rm(node) { - var next = node.nextSibling - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - { node.style.display = "none" } - else - { node.parentNode.removeChild(node) } - return next - } - - var view = display.view, lineN = display.viewFrom - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i] - if (lineView.hidden) { - } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims) - container.insertBefore(node, cur) - } else { // Already drawn - while (cur != lineView.node) { cur = rm(cur) } - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false } - updateLineForChanges(cm, lineView, lineN, dims) - } - if (updateNumber) { - removeChildren(lineView.lineNumber) - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))) - } - cur = lineView.node.nextSibling - } - lineN += lineView.size - } - while (cur) { cur = rm(cur) } - } - - function updateGutterSpace(cm) { - var width = cm.display.gutters.offsetWidth - cm.display.sizer.style.marginLeft = width + "px" - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px" - cm.display.heightForcer.style.top = measure.docHeight + "px" - cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px" - } - -// Rebuild the gutter elements, ensure the margin to the left of the -// code matches their width. - function updateGutters(cm) { - var gutters = cm.display.gutters, specs = cm.options.gutters - removeChildren(gutters) - var i = 0 - for (; i < specs.length; ++i) { - var gutterClass = specs[i] - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)) - if (gutterClass == "CodeMirror-linenumbers") { - cm.display.lineGutter = gElt - gElt.style.width = (cm.display.lineNumWidth || 1) + "px" - } - } - gutters.style.display = i ? "" : "none" - updateGutterSpace(cm) - } - -// Make sure the gutters options contains the element -// "CodeMirror-linenumbers" when the lineNumbers option is true. - function setGuttersForLineNumbers(options) { - var found = indexOf(options.gutters, "CodeMirror-linenumbers") - if (found == -1 && options.lineNumbers) { - options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]) - } else if (found > -1 && !options.lineNumbers) { - options.gutters = options.gutters.slice(0) - options.gutters.splice(found, 1) - } - } - - var wheelSamples = 0; - var wheelPixelsPerUnit = null; -// Fill in a browser-detected starting value on browsers where we -// know one. These don't have to be accurate -- the result of them -// being wrong would just be a slight flicker on the first wheel -// scroll (if it is large enough). - if (ie) { wheelPixelsPerUnit = -.53 } - else if (gecko) { wheelPixelsPerUnit = 15 } - else if (chrome) { wheelPixelsPerUnit = -.7 } - else if (safari) { wheelPixelsPerUnit = -1/3 } - - function wheelEventDelta(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail } - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail } - else if (dy == null) { dy = e.wheelDelta } - return {x: dx, y: dy} - } - function wheelEventPixels(e) { - var delta = wheelEventDelta(e) - delta.x *= wheelPixelsPerUnit - delta.y *= wheelPixelsPerUnit - return delta - } - - function onScrollWheel(cm, e) { - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y - - var display = cm.display, scroll = display.scroller - // Quit if there's nothing to scroll here - var canScrollX = scroll.scrollWidth > scroll.clientWidth - var canScrollY = scroll.scrollHeight > scroll.clientHeight - if (!(dx && canScrollX || dy && canScrollY)) { return } - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur - break outer - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { - if (dy && canScrollY) - { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) } - setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)) - // Only prevent default scrolling if vertical scrolling is - // actually possible. Otherwise, it causes vertical scroll - // jitter on OSX trackpads when deltaX is small and deltaY - // is large (issue #3579) - if (!dy || (dy && canScrollY)) - { e_preventDefault(e) } - display.wheelStartX = null // Abort measurement, if in progress - return - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && wheelPixelsPerUnit != null) { - var pixels = dy * wheelPixelsPerUnit - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight - if (pixels < 0) { top = Math.max(0, top + pixels - 50) } - else { bot = Math.min(cm.doc.height, bot + pixels + 50) } - updateDisplaySimple(cm, {top: top, bottom: bot}) - } - - if (wheelSamples < 20) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop - display.wheelDX = dx; display.wheelDY = dy - setTimeout(function () { - if (display.wheelStartX == null) { return } - var movedX = scroll.scrollLeft - display.wheelStartX - var movedY = scroll.scrollTop - display.wheelStartY - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX) - display.wheelStartX = display.wheelStartY = null - if (!sample) { return } - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1) - ++wheelSamples - }, 200) - } else { - display.wheelDX += dx; display.wheelDY += dy - } - } - } - -// Selection objects are immutable. A new one is created every time -// the selection changes. A selection is one or more non-overlapping -// (and non-touching) ranges, sorted, and an integer that indicates -// which one is the primary selection (the one that's scrolled into -// view, that getCursor returns, etc). - var Selection = function(ranges, primIndex) { - this.ranges = ranges - this.primIndex = primIndex - }; - - Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; - - Selection.prototype.equals = function (other) { - var this$1 = this; - - if (other == this) { return true } - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } - for (var i = 0; i < this.ranges.length; i++) { - var here = this$1.ranges[i], there = other.ranges[i] - if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } - } - return true - }; - - Selection.prototype.deepCopy = function () { - var this$1 = this; - - var out = [] - for (var i = 0; i < this.ranges.length; i++) - { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) } - return new Selection(out, this.primIndex) - }; - - Selection.prototype.somethingSelected = function () { - var this$1 = this; - - for (var i = 0; i < this.ranges.length; i++) - { if (!this$1.ranges[i].empty()) { return true } } - return false - }; - - Selection.prototype.contains = function (pos, end) { - var this$1 = this; - - if (!end) { end = pos } - for (var i = 0; i < this.ranges.length; i++) { - var range = this$1.ranges[i] - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - { return i } - } - return -1 - }; - - var Range = function(anchor, head) { - this.anchor = anchor; this.head = head - }; - - Range.prototype.from = function () { return minPos(this.anchor, this.head) }; - Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; - Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; - -// Take an unsorted, potentially overlapping set of ranges, and -// build a selection out of it. 'Consumes' ranges array (modifying -// it). - function normalizeSelection(ranges, primIndex) { - var prim = ranges[primIndex] - ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }) - primIndex = indexOf(ranges, prim) - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1] - if (cmp(prev.to(), cur.from()) >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()) - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head - if (i <= primIndex) { --primIndex } - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)) - } - } - return new Selection(ranges, primIndex) - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0) - } - -// Compute the position of the end of a change (its 'to' property -// refers to the pre-change end). - function changeEnd(change) { - if (!change.text) { return change.to } - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) - } - -// Adjust a position to refer to the post-change position of the -// same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) { return pos } - if (cmp(pos, change.to) <= 0) { return changeEnd(change) } - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch - if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch } - return Pos(line, ch) - } - - function computeSelAfterChange(doc, change) { - var out = [] - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i] - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))) - } - return normalizeSelection(out, doc.sel.primIndex) - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - { return Pos(nw.line, pos.ch - old.ch + nw.ch) } - else - { return Pos(nw.line + (pos.line - old.line), pos.ch) } - } - -// Used by replaceSelections to allow moving the selection to the -// start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = [] - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev - for (var i = 0; i < changes.length; i++) { - var change = changes[i] - var from = offsetPos(change.from, oldPrev, newPrev) - var to = offsetPos(changeEnd(change), oldPrev, newPrev) - oldPrev = change.to - newPrev = to - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0 - out[i] = new Range(inv ? to : from, inv ? from : to) - } else { - out[i] = new Range(from, from) - } - } - return new Selection(out, doc.sel.primIndex) - } - -// Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = getMode(cm.options, cm.doc.modeOption) - resetModeState(cm) - } - - function resetModeState(cm) { - cm.doc.iter(function (line) { - if (line.stateAfter) { line.stateAfter = null } - if (line.styles) { line.styles = null } - }) - cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first - startWorker(cm, 100) - cm.state.modeGen++ - if (cm.curOp) { regChange(cm) } - } - -// DOCUMENT DATA STRUCTURE - -// By default, updates that start and end at the beginning of a line -// are treated specially, in order to make the association of line -// widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore) - } - -// Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight) - signalLater(line, "change", line, change) - } - function linesFor(start, end) { - var result = [] - for (var i = start; i < end; ++i) - { result.push(new Line(text[i], spansFor(i), estimateHeight)) } - return result - } - - var from = change.from, to = change.to, text = change.text - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line) - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line - - // Adjust the line structure - if (change.full) { - doc.insert(0, linesFor(0, text.length)) - doc.remove(text.length, doc.size - text.length) - } else if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1) - update(lastLine, lastLine.text, lastSpans) - if (nlines) { doc.remove(from.line, nlines) } - if (added.length) { doc.insert(from.line, added) } - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans) - } else { - var added$1 = linesFor(1, text.length - 1) - added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)) - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) - doc.insert(from.line + 1, added$1) - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)) - doc.remove(from.line + 1, nlines) - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans) - var added$2 = linesFor(1, text.length - 1) - if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) } - doc.insert(from.line + 1, added$2) - } - - signalLater(doc, "change", doc, change) - } - -// Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i] - if (rel.doc == skip) { continue } - var shared = sharedHist && rel.sharedHist - if (sharedHistOnly && !shared) { continue } - f(rel.doc, shared) - propagate(rel.doc, doc, shared) - } } - } - propagate(doc, null, true) - } - -// Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) { throw new Error("This document is already in use.") } - cm.doc = doc - doc.cm = cm - estimateLineHeights(cm) - loadMode(cm) - setDirectionClass(cm) - if (!cm.options.lineWrapping) { findMaxLine(cm) } - cm.options.mode = doc.modeOption - regChange(cm) - } - - function setDirectionClass(cm) { - ;(cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl") - } - - function directionChanged(cm) { - runInOp(cm, function () { - setDirectionClass(cm) - regChange(cm) - }) - } - - function History(startGen) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = [] - this.undoDepth = Infinity - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0 - this.lastOp = this.lastSelOp = null - this.lastOrigin = this.lastSelOrigin = null - // Used by the isClean() method - this.generation = this.maxGeneration = startGen || 1 - } - -// Create a history change event from an updateDoc-style change -// object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)} - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1) - linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true) - return histChange - } - -// Pop all selection events off the end of a history array. Stop at -// a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array) - if (last.ranges) { array.pop() } - else { break } - } - } - -// Find the top change event in the history. Pop off selection -// events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done) - return lst(hist.done) - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done) - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop() - return lst(hist.done) - } - } - -// Register a change in the history. Merges changes that are within -// a single operation, or are close together with an origin that -// allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history - hist.undone.length = 0 - var time = +new Date, cur - var last - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - last = lst(cur.changes) - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change) - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)) - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done) - if (!before || !before.ranges) - { pushSelectionToHistory(doc.sel, hist.done) } - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation} - hist.done.push(cur) - while (hist.done.length > hist.undoDepth) { - hist.done.shift() - if (!hist.done[0].ranges) { hist.done.shift() } - } - } - hist.done.push(selAfter) - hist.generation = ++hist.maxGeneration - hist.lastModTime = hist.lastSelTime = time - hist.lastOp = hist.lastSelOp = opId - hist.lastOrigin = hist.lastSelOrigin = change.origin - - if (!last) { signal(doc, "historyAdded") } - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0) - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) - } - -// Called whenever the selection changes, sets the new selection as -// the pending selection in the history, and pushes the old pending -// selection into the 'done' array when it was significantly -// different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - { hist.done[hist.done.length - 1] = sel } - else - { pushSelectionToHistory(sel, hist.done) } - - hist.lastSelTime = +new Date - hist.lastSelOrigin = origin - hist.lastSelOp = opId - if (options && options.clearRedo !== false) - { clearSelectionEvents(hist.undone) } - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest) - if (!(top && top.ranges && top.equals(sel))) - { dest.push(sel) } - } - -// Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0 - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { - if (line.markedSpans) - { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans } - ++n - }) - } - -// When un/re-doing restores text containing marked spans, those -// that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) { return null } - var out - for (var i = 0; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } } - else if (out) { out.push(spans[i]) } - } - return !out ? spans : out.length ? out : null - } - -// Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id] - if (!found) { return null } - var nw = [] - for (var i = 0; i < change.text.length; ++i) - { nw.push(removeClearedSpans(found[i])) } - return nw - } - -// Used for un/re-doing changes from the history. Combines the -// result of computing the existing spans with the set of spans that -// existed in the history (so that deleting around a span and then -// undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change) - var stretched = stretchSpansOverChange(doc, change) - if (!old) { return stretched } - if (!stretched) { return old } - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i] - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j] - for (var k = 0; k < oldCur.length; ++k) - { if (oldCur[k].marker == span.marker) { continue spans } } - oldCur.push(span) - } - } else if (stretchCur) { - old[i] = stretchCur - } - } - return old - } - -// Used both to provide a JSON-safe object in .getHistory, and, when -// detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - var copy = [] - for (var i = 0; i < events.length; ++i) { - var event = events[i] - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event) - continue - } - var changes = event.changes, newChanges = [] - copy.push({changes: newChanges}) - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m = (void 0) - newChanges.push({from: change.from, to: change.to, text: change.text}) - if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop] - delete change[prop] - } - } } } - } - } - return copy - } - -// The 'scroll' parameter given to many of these indicated whether -// the new cursor position should be scrolled into view after -// modifying the selection. - -// If shift is held or the extend flag is set, extends a range to -// include a given position (and optionally a second position). -// Otherwise, simply returns the range between the given positions. -// Used for cursor motion and such. - function extendRange(range, head, other, extend) { - if (extend) { - var anchor = range.anchor - if (other) { - var posBefore = cmp(head, anchor) < 0 - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head - head = other - } else if (posBefore != (cmp(head, other) < 0)) { - head = other - } - } - return new Range(anchor, head) - } else { - return new Range(other || head, head) - } - } - -// Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options, extend) { - if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) } - setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options) - } - -// Extend all selections (pos is an array of selections with length -// equal the number of selections) - function extendSelections(doc, heads, options) { - var out = [] - var extend = doc.cm && (doc.cm.display.shift || doc.extend) - for (var i = 0; i < doc.sel.ranges.length; i++) - { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) } - var newSel = normalizeSelection(out, doc.sel.primIndex) - setSelection(doc, newSel, options) - } - -// Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0) - ranges[i] = range - setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options) - } - -// Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options) - } - -// Give beforeSelectionChange handlers a change to influence a -// selection update. - function filterSelectionChange(doc, sel, options) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - var this$1 = this; - - this.ranges = [] - for (var i = 0; i < ranges.length; i++) - { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)) } - }, - origin: options && options.origin - } - signal(doc, "beforeSelectionChange", doc, obj) - if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) } - if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) } - else { return sel } - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done) - if (last && last.ranges) { - done[done.length - 1] = sel - setSelectionNoUndo(doc, sel, options) - } else { - setSelection(doc, sel, options) - } - } - -// Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options) - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options) - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - { sel = filterSelectionChange(doc, sel, options) } - - var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1) - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)) - - if (!(options && options.scroll === false) && doc.cm) - { ensureCursorVisible(doc.cm) } - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) { return } - - doc.sel = sel - - if (doc.cm) { - doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true - signalCursorActivity(doc.cm) - } - signalLater(doc, "cursorActivity", doc) - } - -// Verify that the selection does not partially select any atomic -// marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)) - } - -// Return a selection that does not partially select any atomic -// ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i] - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i] - var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear) - var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear) - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) { out = sel.ranges.slice(0, i) } - out[i] = new Range(newAnchor, newHead) - } - } - return out ? normalizeSelection(out, sel.primIndex) : sel - } - - function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line) - if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker - if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && - (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter") - if (m.explicitlyCleared) { - if (!line.markedSpans) { break } - else {--i; continue} - } - } - if (!m.atomic) { continue } - - if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), diff = (void 0) - if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) - { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) } - if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) - { return skipAtomicInner(doc, near, pos, dir, mayClear) } - } - - var far = m.find(dir < 0 ? -1 : 1) - if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) - { far = movePos(doc, far, dir, far.line == pos.line ? line : null) } - return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null - } - } } - return pos - } - -// Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1 - var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || - skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)) - if (!found) { - doc.cantEdit = true - return Pos(doc.first, 0) - } - return found - } - - function movePos(doc, pos, dir, line) { - if (dir < 0 && pos.ch == 0) { - if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } - else { return null } - } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { - if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } - else { return null } - } else { - return new Pos(pos.line, pos.ch + dir) - } - } - - function selectAll(cm) { - cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll) - } - -// UPDATING - -// Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function () { return obj.canceled = true; } - } - if (update) { obj.update = function (from, to, text, origin) { - if (from) { obj.from = clipPos(doc, from) } - if (to) { obj.to = clipPos(doc, to) } - if (text) { obj.text = text } - if (origin !== undefined) { obj.origin = origin } - } } - signal(doc, "beforeChange", doc, obj) - if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) } - - if (obj.canceled) { return null } - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} - } - -// Apply a change to a document, and add it to the document's -// history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } - if (doc.cm.state.suppressEdits) { return } - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true) - if (!change) { return } - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to) - if (split) { - for (var i = split.length - 1; i >= 0; --i) - { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}) } - } else { - makeChangeInner(doc, change) - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } - var selAfter = computeSelAfterChange(doc, change) - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN) - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)) - var rebased = [] - - linkedDocs(doc, function (doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change) - rebased.push(doc.history) - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)) - }) - } - -// Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return } - - var hist = doc.history, event, selAfter = doc.sel - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - var i = 0 - for (; i < source.length; i++) { - event = source[i] - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - { break } - } - if (i == source.length) { return } - hist.lastOrigin = hist.lastSelOrigin = null - - for (;;) { - event = source.pop() - if (event.ranges) { - pushSelectionToHistory(event, dest) - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}) - return - } - selAfter = event - } - else { break } - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = [] - pushSelectionToHistory(selAfter, dest) - dest.push({changes: antiChanges, generation: hist.generation}) - hist.generation = event.generation || ++hist.maxGeneration - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange") - - var loop = function ( i ) { - var change = event.changes[i] - change.origin = type - if (filter && !filterChange(doc, change, false)) { - source.length = 0 - return {} - } - - antiChanges.push(historyChangeFromChange(doc, change)) - - var after = i ? computeSelAfterChange(doc, change) : lst(source) - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)) - if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) } - var rebased = [] - - // Propagate to the linked documents - linkedDocs(doc, function (doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change) - rebased.push(doc.history) - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)) - }) - }; - - for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { - var returned = loop( i$1 ); - - if ( returned ) return returned.v; - } - } - -// Sub-views need their line numbers shifted when text is added -// above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) { return } - doc.first += distance - doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( - Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch) - ); }), doc.sel.primIndex) - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance) - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - { regLineChange(doc.cm, l, "gutter") } - } - } - -// More lower-level change function, handling only a single document -// (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)) - return - } - if (change.from.line > doc.lastLine()) { return } - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line) - shiftDoc(doc, shift) - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin} - } - var last = doc.lastLine() - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin} - } - - change.removed = getBetween(doc, change.from, change.to) - - if (!selAfter) { selAfter = computeSelAfterChange(doc, change) } - if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) } - else { updateDoc(doc, change, spans) } - setSelectionNoUndo(doc, selAfter, sel_dontScroll) - } - -// Handle the interaction of a change to a document with the editor -// that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to - - var recomputeMaxLength = false, checkWidthStart = from.line - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))) - doc.iter(checkWidthStart, to.line + 1, function (line) { - if (line == display.maxLine) { - recomputeMaxLength = true - return true - } - }) - } - - if (doc.sel.contains(change.from, change.to) > -1) - { signalCursorActivity(cm) } - - updateDoc(doc, change, spans, estimateHeight(cm)) - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function (line) { - var len = lineLength(line) - if (len > display.maxLineLength) { - display.maxLine = line - display.maxLineLength = len - display.maxLineChanged = true - recomputeMaxLength = false - } - }) - if (recomputeMaxLength) { cm.curOp.updateMaxLine = true } - } - - retreatFrontier(doc, from.line) - startWorker(cm, 400) - - var lendiff = change.text.length - (to.line - from.line) - 1 - // Remember that these lines changed, for updating the display - if (change.full) - { regChange(cm) } - else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - { regLineChange(cm, from.line, "text") } - else - { regChange(cm, from.line, to.line + 1, lendiff) } - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change") - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - } - if (changeHandler) { signalLater(cm, "change", cm, obj) } - if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) } - } - cm.display.selForContextMenu = null - } - - function replaceRange(doc, code, from, to, origin) { - if (!to) { to = from } - if (cmp(to, from) < 0) { var assign; - (assign = [to, from], from = assign[0], to = assign[1], assign) } - if (typeof code == "string") { code = doc.splitLines(code) } - makeChange(doc, {from: from, to: to, text: code, origin: origin}) - } - -// Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff - } else if (from < pos.line) { - pos.line = from - pos.ch = 0 - } - } - -// Tries to rebase an array of history events given a change in the -// document. If the change touches the same lines as the event, the -// event, and everything 'behind' it, is discarded. If the change is -// before the event, the event's positions are updated. Uses a -// copy-on-write scheme for the positions, to avoid having to -// reallocate them all on every rebase, but also avoid problems with -// shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff) - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff) - } - continue - } - for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { - var cur = sub.changes[j$1] - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch) - cur.to = Pos(cur.to.line + diff, cur.to.ch) - } else if (from <= cur.to.line) { - ok = false - break - } - } - if (!ok) { - array.splice(0, i + 1) - i = 0 - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1 - rebaseHistArray(hist.done, from, to, diff) - rebaseHistArray(hist.undone, from, to, diff) - } - -// Utility for applying a change to a line by handle or number, -// returning the number and optionally registering the line as -// changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle - if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) } - else { no = lineNo(handle) } - if (no == null) { return null } - if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) } - return line - } - -// The document is represented as a BTree consisting of leaves, with -// chunk of lines in them, and branches, with up to ten leaves or -// other branch nodes below them. The top node is always a branch -// node, and is the document object itself (meaning it has -// additional methods and properties). -// -// All nodes have parent links. The tree is used both to go from -// line numbers to line objects, and to go from objects to numbers. -// It also indexes by height, and is used to convert between height -// and line object, and to find the total height of the document. -// -// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - var this$1 = this; - - this.lines = lines - this.parent = null - var height = 0 - for (var i = 0; i < lines.length; ++i) { - lines[i].parent = this$1 - height += lines[i].height - } - this.height = height - } - - LeafChunk.prototype = { - chunkSize: function chunkSize() { return this.lines.length }, - - // Remove the n lines at offset 'at'. - removeInner: function removeInner(at, n) { - var this$1 = this; - - for (var i = at, e = at + n; i < e; ++i) { - var line = this$1.lines[i] - this$1.height -= line.height - cleanUpLine(line) - signalLater(line, "delete") - } - this.lines.splice(at, n) - }, - - // Helper used to collapse a small branch into a single leaf. - collapse: function collapse(lines) { - lines.push.apply(lines, this.lines) - }, - - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function insertInner(at, lines, height) { - var this$1 = this; - - this.height += height - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)) - for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 } - }, - - // Used to iterate over a part of the tree. - iterN: function iterN(at, n, op) { - var this$1 = this; - - for (var e = at + n; at < e; ++at) - { if (op(this$1.lines[at])) { return true } } - } - } - - function BranchChunk(children) { - var this$1 = this; - - this.children = children - var size = 0, height = 0 - for (var i = 0; i < children.length; ++i) { - var ch = children[i] - size += ch.chunkSize(); height += ch.height - ch.parent = this$1 - } - this.size = size - this.height = height - this.parent = null - } - - BranchChunk.prototype = { - chunkSize: function chunkSize() { return this.size }, - - removeInner: function removeInner(at, n) { - var this$1 = this; - - this.size -= n - for (var i = 0; i < this.children.length; ++i) { - var child = this$1.children[i], sz = child.chunkSize() - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height - child.removeInner(at, rm) - this$1.height -= oldHeight - child.height - if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null } - if ((n -= rm) == 0) { break } - at = 0 - } else { at -= sz } - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = [] - this.collapse(lines) - this.children = [new LeafChunk(lines)] - this.children[0].parent = this - } - }, - - collapse: function collapse(lines) { - var this$1 = this; - - for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) } - }, - - insertInner: function insertInner(at, lines, height) { - var this$1 = this; - - this.size += lines.length - this.height += height - for (var i = 0; i < this.children.length; ++i) { - var child = this$1.children[i], sz = child.chunkSize() - if (at <= sz) { - child.insertInner(at, lines, height) - if (child.lines && child.lines.length > 50) { - // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. - // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. - var remaining = child.lines.length % 25 + 25 - for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)) - child.height -= leaf.height - this$1.children.splice(++i, 0, leaf) - leaf.parent = this$1 - } - child.lines = child.lines.slice(0, remaining) - this$1.maybeSpill() - } - break - } - at -= sz - } - }, - - // When a node has grown, check whether it should be split. - maybeSpill: function maybeSpill() { - if (this.children.length <= 10) { return } - var me = this - do { - var spilled = me.children.splice(me.children.length - 5, 5) - var sibling = new BranchChunk(spilled) - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children) - copy.parent = me - me.children = [copy, sibling] - me = copy - } else { - me.size -= sibling.size - me.height -= sibling.height - var myIndex = indexOf(me.parent.children, me) - me.parent.children.splice(myIndex + 1, 0, sibling) - } - sibling.parent = me.parent - } while (me.children.length > 10) - me.parent.maybeSpill() - }, - - iterN: function iterN(at, n, op) { - var this$1 = this; - - for (var i = 0; i < this.children.length; ++i) { - var child = this$1.children[i], sz = child.chunkSize() - if (at < sz) { - var used = Math.min(n, sz - at) - if (child.iterN(at, used, op)) { return true } - if ((n -= used) == 0) { break } - at = 0 - } else { at -= sz } - } - } - } - -// Line widgets are block elements displayed above or below a line. - - var LineWidget = function(doc, node, options) { - var this$1 = this; - - if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) - { this$1[opt] = options[opt] } } } - this.doc = doc - this.node = node - }; - - LineWidget.prototype.clear = function () { - var this$1 = this; - - var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line) - if (no == null || !ws) { return } - for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } } - if (!ws.length) { line.widgets = null } - var height = widgetHeight(this) - updateLineHeight(line, Math.max(0, line.height - height)) - if (cm) { - runInOp(cm, function () { - adjustScrollWhenAboveVisible(cm, line, -height) - regLineChange(cm, no, "widget") - }) - signalLater(cm, "lineWidgetCleared", cm, this, no) - } - }; - - LineWidget.prototype.changed = function () { - var this$1 = this; - - var oldH = this.height, cm = this.doc.cm, line = this.line - this.height = null - var diff = widgetHeight(this) - oldH - if (!diff) { return } - updateLineHeight(line, line.height + diff) - if (cm) { - runInOp(cm, function () { - cm.curOp.forceUpdate = true - adjustScrollWhenAboveVisible(cm, line, diff) - signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)) - }) - } - }; - eventMixin(LineWidget) - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - { addToScrollTop(cm, diff) } - } - - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options) - var cm = doc.cm - if (cm && widget.noHScroll) { cm.display.alignWidgets = true } - changeLine(doc, handle, "widget", function (line) { - var widgets = line.widgets || (line.widgets = []) - if (widget.insertAt == null) { widgets.push(widget) } - else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) } - widget.line = line - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop - updateLineHeight(line, line.height + widgetHeight(widget)) - if (aboveVisible) { addToScrollTop(cm, widget.height) } - cm.curOp.forceUpdate = true - } - return true - }) - signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)) - return widget - } - -// TEXTMARKERS - -// Created with markText and setBookmark methods. A TextMarker is a -// handle that can be used to clear or find a marked position in the -// document. Line objects hold arrays (markedSpans) containing -// {from, to, marker} object pointing to such marker objects, and -// indicating that such a marker is present on that line. Multiple -// lines may point to the same marker when it spans across lines. -// The spans will have null for their from/to properties when the -// marker continues beyond the start/end of the line. Markers have -// links back to the lines they currently touch. - -// Collapsed markers have unique ids, in order to be able to order -// them, which is needed for uniquely determining an outer marker -// when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0 - - var TextMarker = function(doc, type) { - this.lines = [] - this.type = type - this.doc = doc - this.id = ++nextMarkerId - }; - -// Clear the marker. - TextMarker.prototype.clear = function () { - var this$1 = this; - - if (this.explicitlyCleared) { return } - var cm = this.doc.cm, withOp = cm && !cm.curOp - if (withOp) { startOperation(cm) } - if (hasHandler(this, "clear")) { - var found = this.find() - if (found) { signalLater(this, "clear", found.from, found.to) } - } - var min = null, max = null - for (var i = 0; i < this.lines.length; ++i) { - var line = this$1.lines[i] - var span = getMarkedSpanFor(line.markedSpans, this$1) - if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") } - else if (cm) { - if (span.to != null) { max = lineNo(line) } - if (span.from != null) { min = lineNo(line) } - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span) - if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) - { updateLineHeight(line, textHeight(cm.display)) } - } - if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { - var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual) - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual - cm.display.maxLineLength = len - cm.display.maxLineChanged = true - } - } } - - if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) } - this.lines.length = 0 - this.explicitlyCleared = true - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false - if (cm) { reCheckSelection(cm.doc) } - } - if (cm) { signalLater(cm, "markerCleared", cm, this, min, max) } - if (withOp) { endOperation(cm) } - if (this.parent) { this.parent.clear() } - }; - -// Find the position of the marker in the document. Returns a {from, -// to} object by default. Side can be passed to get a specific side -// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the -// Pos objects returned contain a line object, rather than a line -// number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function (side, lineObj) { - var this$1 = this; - - if (side == null && this.type == "bookmark") { side = 1 } - var from, to - for (var i = 0; i < this.lines.length; ++i) { - var line = this$1.lines[i] - var span = getMarkedSpanFor(line.markedSpans, this$1) - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from) - if (side == -1) { return from } - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to) - if (side == 1) { return to } - } - } - return from && {from: from, to: to} - }; - -// Signals that the marker's widget changed, and surrounding layout -// should be recomputed. - TextMarker.prototype.changed = function () { - var this$1 = this; - - var pos = this.find(-1, true), widget = this, cm = this.doc.cm - if (!pos || !cm) { return } - runInOp(cm, function () { - var line = pos.line, lineN = lineNo(pos.line) - var view = findViewForLine(cm, lineN) - if (view) { - clearLineMeasurementCacheFor(view) - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true - } - cm.curOp.updateMaxLine = true - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height - widget.height = null - var dHeight = widgetHeight(widget) - oldHeight - if (dHeight) - { updateLineHeight(line, line.height + dHeight) } - } - signalLater(cm, "markerChanged", cm, this$1) - }) - }; - - TextMarker.prototype.attachLine = function (line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) } - } - this.lines.push(line) - }; - - TextMarker.prototype.detachLine = function (line) { - this.lines.splice(indexOf(this.lines, line), 1) - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp - ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this) - } - }; - eventMixin(TextMarker) - -// Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) { return markTextShared(doc, from, to, options, type) } - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } - - var marker = new TextMarker(doc, type), diff = cmp(from, to) - if (options) { copyObj(options, marker, false) } - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - { return marker } - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true - marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget") - if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") } - if (options.insertLeft) { marker.widgetNode.insertLeft = true } - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - { throw new Error("Inserting collapsed marker partially overlapping an existing one") } - seeCollapsedSpans() - } - - if (marker.addToHistory) - { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) } - - var curLine = from.line, cm = doc.cm, updateMaxLine - doc.iter(curLine, to.line + 1, function (line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - { updateMaxLine = true } - if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) } - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null)) - ++curLine - }) - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { - if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) } - }) } - - if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) } - - if (marker.readOnly) { - seeReadOnlySpans() - if (doc.history.done.length || doc.history.undone.length) - { doc.clearHistory() } - } - if (marker.collapsed) { - marker.id = ++nextMarkerId - marker.atomic = true - } - if (cm) { - // Sync editor state - if (updateMaxLine) { cm.curOp.updateMaxLine = true } - if (marker.collapsed) - { regChange(cm, from.line, to.line + 1) } - else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) - { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } } - if (marker.atomic) { reCheckSelection(cm.doc) } - signalLater(cm, "markerAdded", cm, marker) - } - return marker - } - -// SHARED TEXTMARKERS - -// A shared marker spans multiple linked documents. It is -// implemented as a meta-marker-object controlling multiple normal -// markers. - var SharedTextMarker = function(markers, primary) { - var this$1 = this; - - this.markers = markers - this.primary = primary - for (var i = 0; i < markers.length; ++i) - { markers[i].parent = this$1 } - }; - - SharedTextMarker.prototype.clear = function () { - var this$1 = this; - - if (this.explicitlyCleared) { return } - this.explicitlyCleared = true - for (var i = 0; i < this.markers.length; ++i) - { this$1.markers[i].clear() } - signalLater(this, "clear") - }; - - SharedTextMarker.prototype.find = function (side, lineObj) { - return this.primary.find(side, lineObj) - }; - eventMixin(SharedTextMarker) - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options) - options.shared = false - var markers = [markText(doc, from, to, options, type)], primary = markers[0] - var widget = options.widgetNode - linkedDocs(doc, function (doc) { - if (widget) { options.widgetNode = widget.cloneNode(true) } - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)) - for (var i = 0; i < doc.linked.length; ++i) - { if (doc.linked[i].isParent) { return } } - primary = lst(markers) - }) - return new SharedTextMarker(markers, primary) - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find() - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to) - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type) - marker.markers.push(subMark) - subMark.parent = marker - } - } - } - - function detachSharedMarkers(markers) { - var loop = function ( i ) { - var marker = markers[i], linked = [marker.primary.doc] - linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }) - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j] - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null - marker.markers.splice(j--, 1) - } - } - }; - - for (var i = 0; i < markers.length; i++) loop( i ); - } - - var nextDocId = 0 - var Doc = function(text, mode, firstLine, lineSep, direction) { - if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } - if (firstLine == null) { firstLine = 0 } - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]) - this.first = firstLine - this.scrollTop = this.scrollLeft = 0 - this.cantEdit = false - this.cleanGeneration = 1 - this.modeFrontier = this.highlightFrontier = firstLine - var start = Pos(firstLine, 0) - this.sel = simpleSelection(start) - this.history = new History(null) - this.id = ++nextDocId - this.modeOption = mode - this.lineSep = lineSep - this.direction = (direction == "rtl") ? "rtl" : "ltr" - this.extend = false - - if (typeof text == "string") { text = this.splitLines(text) } - updateDoc(this, {from: start, to: start, text: text}) - setSelection(this, simpleSelection(start), sel_dontScroll) - } - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) { this.iterN(from - this.first, to - from, op) } - else { this.iterN(this.first, this.first + this.size, from) } - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0 - for (var i = 0; i < lines.length; ++i) { height += lines[i].height } - this.insertInner(at - this.first, lines, height) - }, - remove: function(at, n) { this.removeInner(at - this.first, n) }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size) - if (lineSep === false) { return lines } - return lines.join(lineSep || this.lineSeparator()) - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1 - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), origin: "setValue", full: true}, true) - if (this.cm) { scrollToCoords(this.cm, 0, 0) } - setSelection(this, simpleSelection(top), sel_dontScroll) - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from) - to = to ? clipPos(this, to) : from - replaceRange(this, code, from, to, origin) - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)) - if (lineSep === false) { return lines } - return lines.join(lineSep || this.lineSeparator()) - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, - - getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, - getLineNumber: function(line) {return lineNo(line)}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") { line = getLine(this, line) } - return visualLine(line) - }, - - lineCount: function() {return this.size}, - firstLine: function() {return this.first}, - lastLine: function() {return this.first + this.size - 1}, - - clipPos: function(pos) {return clipPos(this, pos)}, - - getCursor: function(start) { - var range = this.sel.primary(), pos - if (start == null || start == "head") { pos = range.head } - else if (start == "anchor") { pos = range.anchor } - else if (start == "end" || start == "to" || start === false) { pos = range.to() } - else { pos = range.from() } - return pos - }, - listSelections: function() { return this.sel.ranges }, - somethingSelected: function() {return this.sel.somethingSelected()}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options) - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options) - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options) - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads), options) - }), - extendSelectionsBy: docMethodOp(function(f, options) { - var heads = map(this.sel.ranges, f) - extendSelections(this, clipPosArray(this, heads), options) - }), - setSelections: docMethodOp(function(ranges, primary, options) { - var this$1 = this; - - if (!ranges.length) { return } - var out = [] - for (var i = 0; i < ranges.length; i++) - { out[i] = new Range(clipPos(this$1, ranges[i].anchor), - clipPos(this$1, ranges[i].head)) } - if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) } - setSelection(this, normalizeSelection(out, primary), options) - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0) - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))) - setSelection(this, normalizeSelection(ranges, ranges.length - 1), options) - }), - - getSelection: function(lineSep) { - var this$1 = this; - - var ranges = this.sel.ranges, lines - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) - lines = lines ? lines.concat(sel) : sel - } - if (lineSep === false) { return lines } - else { return lines.join(lineSep || this.lineSeparator()) } - }, - getSelections: function(lineSep) { - var this$1 = this; - - var parts = [], ranges = this.sel.ranges - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) - if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) } - parts[i] = sel - } - return parts - }, - replaceSelection: function(code, collapse, origin) { - var dup = [] - for (var i = 0; i < this.sel.ranges.length; i++) - { dup[i] = code } - this.replaceSelections(dup, collapse, origin || "+input") - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var this$1 = this; - - var changes = [], sel = this.sel - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i] - changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin} - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse) - for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) - { makeChange(this$1, changes[i$1]) } - if (newSel) { setSelectionReplaceHistory(this, newSel) } - else if (this.cm) { ensureCursorVisible(this.cm) } - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}), - - setExtending: function(val) {this.extend = val}, - getExtending: function() {return this.extend}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0 - for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } } - for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } } - return {undo: done, redo: undone} - }, - clearHistory: function() {this.history = new History(this.history.maxGeneration)}, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true) - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null } - return this.history.generation - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration) - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)} - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history.maxGeneration) - hist.done = copyHistoryArray(histData.done.slice(0), null, true) - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true) - }, - - setGutterMarker: docMethodOp(function(line, gutterID, value) { - return changeLine(this, line, "gutter", function (line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}) - markers[gutterID] = value - if (!value && isEmpty(markers)) { line.gutterMarkers = null } - return true - }) - }), - - clearGutter: docMethodOp(function(gutterID) { - var this$1 = this; - - this.iter(function (line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - changeLine(this$1, line, "gutter", function () { - line.gutterMarkers[gutterID] = null - if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null } - return true - }) - } - }) - }), - - lineInfo: function(line) { - var n - if (typeof line == "number") { - if (!isLine(this, line)) { return null } - n = line - line = getLine(this, line) - if (!line) { return null } - } else { - n = lineNo(line) - if (n == null) { return null } - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets} - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass" - if (!line[prop]) { line[prop] = cls } - else if (classTest(cls).test(line[prop])) { return false } - else { line[prop] += " " + cls } - return true - }) - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass" - var cur = line[prop] - if (!cur) { return false } - else if (cls == null) { line[prop] = null } - else { - var found = cur.match(classTest(cls)) - if (!found) { return false } - var end = found.index + found[0].length - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null - } - return true - }) - }), - - addLineWidget: docMethodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options) - }), - removeLineWidget: function(widget) { widget.clear() }, - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents} - pos = clipPos(this, pos) - return markText(this, pos, pos, realOpts, "bookmark") - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos) - var markers = [], spans = getLine(this, pos.line).markedSpans - if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i] - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - { markers.push(span.marker.parent || span.marker) } - } } - return markers - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to) - var found = [], lineNo = from.line - this.iter(from.line, to.line + 1, function (line) { - var spans = line.markedSpans - if (spans) { for (var i = 0; i < spans.length; i++) { - var span = spans[i] - if (!(span.to != null && lineNo == from.line && from.ch >= span.to || - span.from == null && lineNo != from.line || - span.from != null && lineNo == to.line && span.from >= to.ch) && - (!filter || filter(span.marker))) - { found.push(span.marker.parent || span.marker) } - } } - ++lineNo - }) - return found - }, - getAllMarks: function() { - var markers = [] - this.iter(function (line) { - var sps = line.markedSpans - if (sps) { for (var i = 0; i < sps.length; ++i) - { if (sps[i].from != null) { markers.push(sps[i].marker) } } } - }) - return markers - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first, sepSize = this.lineSeparator().length - this.iter(function (line) { - var sz = line.text.length + sepSize - if (sz > off) { ch = off; return true } - off -= sz - ++lineNo - }) - return clipPos(this, Pos(lineNo, ch)) - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords) - var index = coords.ch - if (coords.line < this.first || coords.ch < 0) { return 0 } - var sepSize = this.lineSeparator().length - this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value - index += line.text.length + sepSize - }) - return index - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), - this.modeOption, this.first, this.lineSep, this.direction) - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft - doc.sel = this.sel - doc.extend = false - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth - doc.setHistory(this.getHistory()) - } - return doc - }, - - linkedDoc: function(options) { - if (!options) { options = {} } - var from = this.first, to = this.first + this.size - if (options.from != null && options.from > from) { from = options.from } - if (options.to != null && options.to < to) { to = options.to } - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction) - if (options.sharedHist) { copy.history = this.history - ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}) - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}] - copySharedMarkers(copy, findSharedMarkers(this)) - return copy - }, - unlinkDoc: function(other) { - var this$1 = this; - - if (other instanceof CodeMirror) { other = other.doc } - if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { - var link = this$1.linked[i] - if (link.doc != other) { continue } - this$1.linked.splice(i, 1) - other.unlinkDoc(this$1) - detachSharedMarkers(findSharedMarkers(this$1)) - break - } } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id] - linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true) - other.history = new History(null) - other.history.done = copyHistoryArray(this.history.done, splitIds) - other.history.undone = copyHistoryArray(this.history.undone, splitIds) - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f)}, - - getMode: function() {return this.mode}, - getEditor: function() {return this.cm}, - - splitLines: function(str) { - if (this.lineSep) { return str.split(this.lineSep) } - return splitLinesAuto(str) - }, - lineSeparator: function() { return this.lineSep || "\n" }, - - setDirection: docMethodOp(function (dir) { - if (dir != "rtl") { dir = "ltr" } - if (dir == this.direction) { return } - this.direction = dir - this.iter(function (line) { return line.order = null; }) - if (this.cm) { directionChanged(this.cm) } - }) - }) - -// Public alias. - Doc.prototype.eachLine = Doc.prototype.iter - -// Kludge to work around strange IE behavior where it'll sometimes -// re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0 - - function onDrop(e) { - var cm = this - clearDragCursor(cm) - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - { return } - e_preventDefault(e) - if (ie) { lastDrop = +new Date } - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files - if (!pos || cm.isReadOnly()) { return } - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0 - var loadFile = function (file, i) { - if (cm.options.allowDropFileTypes && - indexOf(cm.options.allowDropFileTypes, file.type) == -1) - { return } - - var reader = new FileReader - reader.onload = operation(cm, function () { - var content = reader.result - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" } - text[i] = content - if (++read == n) { - pos = clipPos(cm.doc, pos) - var change = {from: pos, to: pos, - text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), - origin: "paste"} - makeChange(cm.doc, change) - setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))) - } - }) - reader.readAsText(file) - } - for (var i = 0; i < n; ++i) { loadFile(files[i], i) } - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e) - // Ensure the editor is re-focused - setTimeout(function () { return cm.display.input.focus(); }, 20) - return - } - try { - var text$1 = e.dataTransfer.getData("Text") - if (text$1) { - var selected - if (cm.state.draggingText && !cm.state.draggingText.copy) - { selected = cm.listSelections() } - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)) - if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) - { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } } - cm.replaceSelection(text$1, "around", "paste") - cm.display.input.focus() - } - } - catch(e){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } - - e.dataTransfer.setData("Text", cm.getSelection()) - e.dataTransfer.effectAllowed = "copyMove" - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;") - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" - if (presto) { - img.width = img.height = 1 - cm.display.wrapper.appendChild(img) - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop - } - e.dataTransfer.setDragImage(img, 0, 0) - if (presto) { img.parentNode.removeChild(img) } - } - } - - function onDragOver(cm, e) { - var pos = posFromMouse(cm, e) - if (!pos) { return } - var frag = document.createDocumentFragment() - drawSelectionCursor(cm, pos, frag) - if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors") - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv) - } - removeChildrenAndAdd(cm.display.dragCursor, frag) - } - - function clearDragCursor(cm) { - if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor) - cm.display.dragCursor = null - } - } - -// These must be handled carefully, because naively registering a -// handler for each editor will cause the editors to never be -// garbage collected. - - function forEachCodeMirror(f) { - if (!document.getElementsByClassName) { return } - var byClass = document.getElementsByClassName("CodeMirror") - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror - if (cm) { f(cm) } - } - } - - var globalsRegistered = false - function ensureGlobalHandlers() { - if (globalsRegistered) { return } - registerGlobalHandlers() - globalsRegistered = true - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer - on(window, "resize", function () { - if (resizeTimer == null) { resizeTimer = setTimeout(function () { - resizeTimer = null - forEachCodeMirror(onResize) - }, 100) } - }) - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function () { return forEachCodeMirror(onBlur); }) - } -// Called when the window resizes - function onResize(cm) { - var d = cm.display - if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) - { return } - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null - d.scrollbarsClipped = false - cm.setSize() - } - - var keyNames = { - 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", - 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" - } - -// Number keys - for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) } -// Alphabetic keys - for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) } -// Function keys - for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 } - - var keyMap = {} - - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", - "Tab": "defaultTab", "Shift-Tab": "indentAuto", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", - "Esc": "singleSelection" - } -// Note that the save and find-related commands aren't defined by -// default. User code or addons can define them. Unknown commands -// are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", - "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", - "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", - fallthrough: "basic" - } -// Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", - "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", - "Ctrl-O": "openLine" - } - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", - "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", - "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", - "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", - fallthrough: ["basic", "emacsy"] - } - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault - -// KEYMAP DISPATCH - - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/) - name = parts[parts.length - 1] - var alt, ctrl, shift, cmd - for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i] - if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true } - else if (/^a(lt)?$/i.test(mod)) { alt = true } - else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true } - else if (/^s(hift)?$/i.test(mod)) { shift = true } - else { throw new Error("Unrecognized modifier name: " + mod) } - } - if (alt) { name = "Alt-" + name } - if (ctrl) { name = "Ctrl-" + name } - if (cmd) { name = "Cmd-" + name } - if (shift) { name = "Shift-" + name } - return name - } - -// This is a kludge to keep keymaps mostly working as raw objects -// (backwards compatibility) while at the same time support features -// like normalization and multi-stroke key bindings. It compiles a -// new normalized keymap, and then updates the old object to reflect -// this. - function normalizeKeyMap(keymap) { - var copy = {} - for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname] - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } - if (value == "...") { delete keymap[keyname]; continue } - - var keys = map(keyname.split(" "), normalizeKeyName) - for (var i = 0; i < keys.length; i++) { - var val = (void 0), name = (void 0) - if (i == keys.length - 1) { - name = keys.join(" ") - val = value - } else { - name = keys.slice(0, i + 1).join(" ") - val = "..." - } - var prev = copy[name] - if (!prev) { copy[name] = val } - else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } - } - delete keymap[keyname] - } } - for (var prop in copy) { keymap[prop] = copy[prop] } - return keymap - } - - function lookupKey(key, map, handle, context) { - map = getKeyMap(map) - var found = map.call ? map.call(key, context) : map[key] - if (found === false) { return "nothing" } - if (found === "...") { return "multi" } - if (found != null && handle(found)) { return "handled" } - - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - { return lookupKey(key, map.fallthrough, handle, context) } - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context) - if (result) { return result } - } - } - } - -// Modifier key presses don't count as 'real' key presses for the -// purpose of keymap fallthrough. - function isModifierKey(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode] - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" - } - - function addModifierNames(name, event, noShift) { - var base = name - if (event.altKey && base != "Alt") { name = "Alt-" + name } - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name } - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name } - if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name } - return name - } - -// Look up the name of a key as indicated by an event object. - function keyName(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) { return false } - var name = keyNames[event.keyCode] - if (name == null || event.altGraphKey) { return false } - return addModifierNames(name, event, noShift) - } - - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val - } - -// Helper for deleting text near the selection(s), used to implement -// backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = [] - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]) - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop() - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from - break - } - } - kill.push(toKill) - } - // Next, remove those actual ranges. - runInOp(cm, function () { - for (var i = kill.length - 1; i >= 0; i--) - { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") } - ensureCursorVisible(cm) - }) - } - - function moveCharLogically(line, ch, dir) { - var target = skipExtendingChars(line.text, ch + dir, dir) - return target < 0 || target > line.text.length ? null : target - } - - function moveLogically(line, start, dir) { - var ch = moveCharLogically(line, start.ch, dir) - return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") - } - - function endOfLine(visually, cm, lineObj, lineNo, dir) { - if (visually) { - var order = getOrder(lineObj, cm.doc.direction) - if (order) { - var part = dir < 0 ? lst(order) : order[0] - var moveInStorageOrder = (dir < 0) == (part.level == 1) - var sticky = moveInStorageOrder ? "after" : "before" - var ch - // With a wrapped rtl chunk (possibly spanning multiple bidi parts), - // it could be that the last bidi part is not on the last visual line, - // since visual lines contain content order-consecutive chunks. - // Thus, in rtl, we are looking for the first (content-order) character - // in the rtl chunk that is on the last line (that is, the same line - // as the last (content-order) character). - if (part.level > 0 || cm.doc.direction == "rtl") { - var prep = prepareMeasureForLine(cm, lineObj) - ch = dir < 0 ? lineObj.text.length - 1 : 0 - var targetTop = measureCharPrepared(cm, prep, ch).top - ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch) - if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) } - } else { ch = dir < 0 ? part.to : part.from } - return new Pos(lineNo, ch, sticky) - } - } - return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") - } - - function moveVisually(cm, line, start, dir) { - var bidi = getOrder(line, cm.doc.direction) - if (!bidi) { return moveLogically(line, start, dir) } - if (start.ch >= line.text.length) { - start.ch = line.text.length - start.sticky = "before" - } else if (start.ch <= 0) { - start.ch = 0 - start.sticky = "after" - } - var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos] - if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { - // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, - // nothing interesting happens. - return moveLogically(line, start, dir) - } - - var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); } - var prep - var getWrappedLineExtent = function (ch) { - if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } - prep = prep || prepareMeasureForLine(cm, line) - return wrappedLineExtentChar(cm, line, prep, ch) - } - var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch) - - if (cm.doc.direction == "rtl" || part.level == 1) { - var moveInStorageOrder = (part.level == 1) == (dir < 0) - var ch = mv(start, moveInStorageOrder ? 1 : -1) - if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { - // Case 2: We move within an rtl part or in an rtl editor on the same visual line - var sticky = moveInStorageOrder ? "before" : "after" - return new Pos(start.line, ch, sticky) - } - } - - // Case 3: Could not move within this bidi part in this visual line, so leave - // the current bidi part - - var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { - var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder - ? new Pos(start.line, mv(ch, 1), "before") - : new Pos(start.line, ch, "after"); } - - for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { - var part = bidi[partPos] - var moveInStorageOrder = (dir > 0) == (part.level != 1) - var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1) - if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } - ch = moveInStorageOrder ? part.from : mv(part.to, -1) - if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } - } - } - - // Case 3a: Look for other bidi parts on the same visual line - var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent) - if (res) { return res } - - // Case 3b: Look for other bidi parts on the next visual line - var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1) - if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { - res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)) - if (res) { return res } - } - - // Case 4: Nowhere to move - return null - } - -// Commands are parameter-less actions that can be performed on an -// editor, mostly used for keybindings. - var commands = { - selectAll: selectAll, - singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, - killLine: function (cm) { return deleteNearSelection(cm, function (range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length - if (range.head.ch == len && range.head.line < cm.lastLine()) - { return {from: range.head, to: Pos(range.head.line + 1, 0)} } - else - { return {from: range.head, to: Pos(range.head.line, len)} } - } else { - return {from: range.from(), to: range.to()} - } - }); }, - deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ - from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) - }); }); }, - delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ - from: Pos(range.from().line, 0), to: range.from() - }); }); }, - delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5 - var leftPos = cm.coordsChar({left: 0, top: top}, "div") - return {from: leftPos, to: range.from()} - }); }, - delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5 - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") - return {from: range.from(), to: rightPos } - }); }, - undo: function (cm) { return cm.undo(); }, - redo: function (cm) { return cm.redo(); }, - undoSelection: function (cm) { return cm.undoSelection(); }, - redoSelection: function (cm) { return cm.redoSelection(); }, - goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, - goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, - goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1} - ); }, - goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, - {origin: "+move", bias: 1} - ); }, - goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1} - ); }, - goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5 - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") - }, sel_move); }, - goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5 - return cm.coordsChar({left: 0, top: top}, "div") - }, sel_move); }, - goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5 - var pos = cm.coordsChar({left: 0, top: top}, "div") - if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } - return pos - }, sel_move); }, - goLineUp: function (cm) { return cm.moveV(-1, "line"); }, - goLineDown: function (cm) { return cm.moveV(1, "line"); }, - goPageUp: function (cm) { return cm.moveV(-1, "page"); }, - goPageDown: function (cm) { return cm.moveV(1, "page"); }, - goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, - goCharRight: function (cm) { return cm.moveH(1, "char"); }, - goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, - goColumnRight: function (cm) { return cm.moveH(1, "column"); }, - goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, - goGroupRight: function (cm) { return cm.moveH(1, "group"); }, - goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, - goWordRight: function (cm) { return cm.moveH(1, "word"); }, - delCharBefore: function (cm) { return cm.deleteH(-1, "char"); }, - delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, - delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, - delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, - delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, - delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, - indentAuto: function (cm) { return cm.indentSelection("smart"); }, - indentMore: function (cm) { return cm.indentSelection("add"); }, - indentLess: function (cm) { return cm.indentSelection("subtract"); }, - insertTab: function (cm) { return cm.replaceSelection("\t"); }, - insertSoftTab: function (cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from() - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize) - spaces.push(spaceStr(tabSize - col % tabSize)) - } - cm.replaceSelections(spaces) - }, - defaultTab: function (cm) { - if (cm.somethingSelected()) { cm.indentSelection("add") } - else { cm.execCommand("insertTab") } - }, - // Swap the two chars left and right of each selection's head. - // Move cursor behind the two swapped characters afterwards. - // - // Doesn't consider line feeds a character. - // Doesn't scan more than one line above to find a character. - // Doesn't do anything on an empty line. - // Doesn't do anything with non-empty selections. - transposeChars: function (cm) { return runInOp(cm, function () { - var ranges = cm.listSelections(), newSel = [] - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) { continue } - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text - if (line) { - if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) } - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1) - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose") - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text - if (prev) { - cur = new Pos(cur.line, 1) - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + - prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), cur, "+transpose") - } - } - } - newSel.push(new Range(cur, cur)) - } - cm.setSelections(newSel) - }); }, - newlineAndIndent: function (cm) { return runInOp(cm, function () { - var sels = cm.listSelections() - for (var i = sels.length - 1; i >= 0; i--) - { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") } - sels = cm.listSelections() - for (var i$1 = 0; i$1 < sels.length; i$1++) - { cm.indentLine(sels[i$1].from().line, null, true) } - ensureCursorVisible(cm) - }); }, - openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, - toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } - } - - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN) - var visual = visualLine(line) - if (visual != line) { lineN = lineNo(visual) } - return endOfLine(true, cm, visual, lineN, 1) - } - function lineEnd(cm, lineN) { - var line = getLine(cm.doc, lineN) - var visual = visualLineEnd(line) - if (visual != line) { lineN = lineNo(visual) } - return endOfLine(true, cm, line, lineN, -1) - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line) - var line = getLine(cm.doc, start.line) - var order = getOrder(line, cm.doc.direction) - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(0, line.text.search(/\S/)) - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch - return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) - } - return start - } - -// Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound] - if (!bound) { return false } - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - cm.display.input.ensurePolled() - var prevShift = cm.display.shift, done = false - try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true } - if (dropShift) { cm.display.shift = false } - done = bound(cm) != Pass - } finally { - cm.display.shift = prevShift - cm.state.suppressEdits = false - } - return done - } - - function lookupKeyForEditor(cm, name, handle) { - for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm) - if (result) { return result } - } - return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) - || lookupKey(name, cm.options.keyMap, handle, cm) - } - -// Note that, despite the name, this function is also used to check -// for bound mouse clicks. - - var stopSeq = new Delayed - - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq - if (seq) { - if (isModifierKey(name)) { return "handled" } - if (/\'$/.test(name)) - { cm.state.keySeq = null } - else - { stopSeq.set(50, function () { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null - cm.display.input.reset() - } - }) } - if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } - } - return dispatchKeyInner(cm, name, e, handle) - } - - function dispatchKeyInner(cm, name, e, handle) { - var result = lookupKeyForEditor(cm, name, handle) - - if (result == "multi") - { cm.state.keySeq = name } - if (result == "handled") - { signalLater(cm, "keyHandled", cm, name, e) } - - if (result == "handled" || result == "multi") { - e_preventDefault(e) - restartBlink(cm) - } - - return !!result - } - -// Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - var name = keyName(e, true) - if (!name) { return false } - - if (e.shiftKey && !cm.state.keySeq) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) - || dispatchKey(cm, name, e, function (b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - { return doHandleBinding(cm, b) } - }) - } else { - return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) - } - } - -// Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) - } - - var lastStoppedKey = null - function onKeyDown(e) { - var cm = this - cm.curOp.focus = activeElt() - if (signalDOMEvent(cm, e)) { return } - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false } - var code = e.keyCode - cm.display.shift = code == 16 || e.shiftKey - var handled = handleKeyBinding(cm, e) - if (presto) { - lastStoppedKey = handled ? code : null - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - { cm.replaceSelection("", null, "cut") } - } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - { showCrossHair(cm) } - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv - addClass(lineDiv, "CodeMirror-crosshair") - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair") - off(document, "keyup", up) - off(document, "mouseover", up) - } - } - on(document, "keyup", up) - on(document, "mouseover", up) - } - - function onKeyUp(e) { - if (e.keyCode == 16) { this.doc.sel.shift = false } - signalDOMEvent(this, e) - } - - function onKeyPress(e) { - var cm = this - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } - var keyCode = e.keyCode, charCode = e.charCode - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} - if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } - var ch = String.fromCharCode(charCode == null ? keyCode : charCode) - // Some browsers fire keypress events for backspace - if (ch == "\x08") { return } - if (handleCharBinding(cm, e, ch)) { return } - cm.display.input.onKeyPress(e) - } - - var DOUBLECLICK_DELAY = 400 - - var PastClick = function(time, pos, button) { - this.time = time - this.pos = pos - this.button = button - }; - - PastClick.prototype.compare = function (time, pos, button) { - return this.time + DOUBLECLICK_DELAY > time && - cmp(pos, this.pos) == 0 && button == this.button - }; - - var lastClick; - var lastDoubleClick; - function clickRepeat(pos, button) { - var now = +new Date - if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { - lastClick = lastDoubleClick = null - return "triple" - } else if (lastClick && lastClick.compare(now, pos, button)) { - lastDoubleClick = new PastClick(now, pos, button) - lastClick = null - return "double" - } else { - lastClick = new PastClick(now, pos, button) - lastDoubleClick = null - return "single" - } - } - -// A mouse down can be a single click, double click, triple click, -// start of selection drag, start of text drag, new cursor -// (ctrl-click), rectangle drag (alt-drag), or xwin -// middle-click-paste. Or it might be a click on something we should -// not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - var cm = this, display = cm.display - if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } - display.input.ensurePolled() - display.shift = e.shiftKey - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false - setTimeout(function () { return display.scroller.draggable = true; }, 100) - } - return - } - if (clickInGutter(cm, e)) { return } - var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single" - window.focus() - - // #3261: make sure, that we're not starting a second selection - if (button == 1 && cm.state.selectingText) - { cm.state.selectingText(e) } - - if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } - - if (button == 1) { - if (pos) { leftButtonDown(cm, pos, repeat, e) } - else if (e_target(e) == display.scroller) { e_preventDefault(e) } - } else if (button == 2) { - if (pos) { extendSelection(cm.doc, pos) } - setTimeout(function () { return display.input.focus(); }, 20) - } else if (button == 3) { - if (captureRightClick) { onContextMenu(cm, e) } - else { delayBlurEvent(cm) } - } - } - - function handleMappedButton(cm, button, pos, repeat, event) { - var name = "Click" - if (repeat == "double") { name = "Double" + name } - else if (repeat == "triple") { name = "Triple" + name } - name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name - - return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { - if (typeof bound == "string") { bound = commands[bound] } - if (!bound) { return false } - var done = false - try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true } - done = bound(cm, pos) != Pass - } finally { - cm.state.suppressEdits = false - } - return done - }) - } - - function configureMouse(cm, repeat, event) { - var option = cm.getOption("configureMouse") - var value = option ? option(cm, repeat, event) : {} - if (value.unit == null) { - var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey - value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line" - } - if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey } - if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey } - if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) } - return value - } - - function leftButtonDown(cm, pos, repeat, event) { - if (ie) { setTimeout(bind(ensureFocus, cm), 0) } - else { cm.curOp.focus = activeElt() } - - var behavior = configureMouse(cm, repeat, event) - - var sel = cm.doc.sel, contained - if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && - repeat == "single" && (contained = sel.contains(pos)) > -1 && - (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && - (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) - { leftButtonStartDrag(cm, event, pos, behavior) } - else - { leftButtonSelect(cm, event, pos, behavior) } - } - -// Start a text drag. When it ends, see if any dragging actually -// happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, event, pos, behavior) { - var display = cm.display, moved = false - var dragEnd = operation(cm, function (e) { - if (webkit) { display.scroller.draggable = false } - cm.state.draggingText = false - off(document, "mouseup", dragEnd) - off(document, "mousemove", mouseMove) - off(display.scroller, "dragstart", dragStart) - off(display.scroller, "drop", dragEnd) - if (!moved) { - e_preventDefault(e) - if (!behavior.addNew) - { extendSelection(cm.doc, pos, null, null, behavior.extend) } - // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) - if (webkit || ie && ie_version == 9) - { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) } - else - { display.input.focus() } - } - }) - var mouseMove = function(e2) { - moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10 - } - var dragStart = function () { return moved = true; } - // Let the drag handler handle this. - if (webkit) { display.scroller.draggable = true } - cm.state.draggingText = dragEnd - dragEnd.copy = !behavior.moveOnDrag - // IE's approach to draggable - if (display.scroller.dragDrop) { display.scroller.dragDrop() } - on(document, "mouseup", dragEnd) - on(document, "mousemove", mouseMove) - on(display.scroller, "dragstart", dragStart) - on(display.scroller, "drop", dragEnd) - - delayBlurEvent(cm) - setTimeout(function () { return display.input.focus(); }, 20) - } - - function rangeForUnit(cm, pos, unit) { - if (unit == "char") { return new Range(pos, pos) } - if (unit == "word") { return cm.findWordAt(pos) } - if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } - var result = unit(cm, pos) - return new Range(result.from, result.to) - } - -// Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, event, start, behavior) { - var display = cm.display, doc = cm.doc - e_preventDefault(event) - - var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges - if (behavior.addNew && !behavior.extend) { - ourIndex = doc.sel.contains(start) - if (ourIndex > -1) - { ourRange = ranges[ourIndex] } - else - { ourRange = new Range(start, start) } - } else { - ourRange = doc.sel.primary() - ourIndex = doc.sel.primIndex - } - - if (behavior.unit == "rectangle") { - if (!behavior.addNew) { ourRange = new Range(start, start) } - start = posFromMouse(cm, event, true, true) - ourIndex = -1 - } else { - var range = rangeForUnit(cm, start, behavior.unit) - if (behavior.extend) - { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) } - else - { ourRange = range } - } - - if (!behavior.addNew) { - ourIndex = 0 - setSelection(doc, new Selection([ourRange], 0), sel_mouse) - startSel = doc.sel - } else if (ourIndex == -1) { - ourIndex = ranges.length - setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}) - } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), - {scroll: false, origin: "*mouse"}) - startSel = doc.sel - } else { - replaceOneSelection(doc, ourIndex, ourRange, sel_mouse) - } - - var lastPos = start - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) { return } - lastPos = pos - - if (behavior.unit == "rectangle") { - var ranges = [], tabSize = cm.options.tabSize - var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize) - var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize) - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol) - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize) - if (left == right) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) } - else if (text.length > leftPos) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) } - } - if (!ranges.length) { ranges.push(new Range(start, start)) } - setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}) - cm.scrollIntoView(pos) - } else { - var oldRange = ourRange - var range = rangeForUnit(cm, pos, behavior.unit) - var anchor = oldRange.anchor, head - if (cmp(range.anchor, anchor) > 0) { - head = range.head - anchor = minPos(oldRange.from(), range.anchor) - } else { - head = range.anchor - anchor = maxPos(oldRange.to(), range.head) - } - var ranges$1 = startSel.ranges.slice(0) - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)) - setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse) - } - } - - var editorSize = display.wrapper.getBoundingClientRect() - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0 - - function extend(e) { - var curCount = ++counter - var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle") - if (!cur) { return } - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt() - extendTo(cur) - var visible = visibleLines(display, doc) - if (cur.line >= visible.to || cur.line < visible.from) - { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) } - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0 - if (outside) { setTimeout(operation(cm, function () { - if (counter != curCount) { return } - display.scroller.scrollTop += outside - extend(e) - }), 50) } - } - } - - function done(e) { - cm.state.selectingText = false - counter = Infinity - e_preventDefault(e) - display.input.focus() - off(document, "mousemove", move) - off(document, "mouseup", up) - doc.history.lastSelOrigin = null - } - - var move = operation(cm, function (e) { - if (!e_button(e)) { done(e) } - else { extend(e) } - }) - var up = operation(cm, done) - cm.state.selectingText = up - on(document, "mousemove", move) - on(document, "mouseup", up) - } - -// Used when mouse-selecting to adjust the anchor to the proper side -// of a bidi jump depending on the visual position of the head. - function bidiSimplify(cm, range) { - var anchor = range.anchor; - var head = range.head; - var anchorLine = getLine(cm.doc, anchor.line) - if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range } - var order = getOrder(anchorLine) - if (!order) { return range } - var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index] - if (part.from != anchor.ch && part.to != anchor.ch) { return range } - var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1) - if (boundary == 0 || boundary == order.length) { return range } - - // Compute the relative visual position of the head compared to the - // anchor (<0 is to the left, >0 to the right) - var leftSide - if (head.line != anchor.line) { - leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0 - } else { - var headIndex = getBidiPartAt(order, head.ch, head.sticky) - var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1) - if (headIndex == boundary - 1 || headIndex == boundary) - { leftSide = dir < 0 } - else - { leftSide = dir > 0 } - } - - var usePart = order[boundary + (leftSide ? -1 : 0)] - var from = leftSide == (usePart.level == 1) - var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before" - return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head) - } - - -// Determines whether an event happened in the gutter, and fires the -// handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent) { - var mX, mY - if (e.touches) { - mX = e.touches[0].clientX - mY = e.touches[0].clientY - } else { - try { mX = e.clientX; mY = e.clientY } - catch(e) { return false } - } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } - if (prevent) { e_preventDefault(e) } - - var display = cm.display - var lineBox = display.lineDiv.getBoundingClientRect() - - if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } - mY -= lineBox.top - display.viewOffset - - for (var i = 0; i < cm.options.gutters.length; ++i) { - var g = display.gutters.childNodes[i] - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY) - var gutter = cm.options.gutters[i] - signal(cm, type, cm, line, gutter, e) - return e_defaultPrevented(e) - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true) - } - -// CONTEXT MENU HANDLING - -// To make the context menu work, we need to briefly unhide the -// textarea (making it as unobtrusive as possible) to let the -// right-click take effect on it. - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } - if (signalDOMEvent(cm, e, "contextmenu")) { return } - cm.display.input.onContextMenu(e) - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) { return false } - return gutterEvent(cm, e, "gutterContextMenu", false) - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-") - clearCaches(cm) - } - - var Init = {toString: function(){return "CodeMirror.Init"}} - - var defaults = {} - var optionHandlers = {} - - function defineOptions(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt - if (handle) { optionHandlers[name] = - notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle } - } - - CodeMirror.defineOption = option - - // Passed to option handlers when there is no old value. - CodeMirror.Init = Init - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function (cm, val) { return cm.setValue(val); }, true) - option("mode", null, function (cm, val) { - cm.doc.modeOption = val - loadMode(cm) - }, true) - - option("indentUnit", 2, loadMode, true) - option("indentWithTabs", false) - option("smartIndent", true) - option("tabSize", 4, function (cm) { - resetModeState(cm) - clearCaches(cm) - regChange(cm) - }, true) - option("lineSeparator", null, function (cm, val) { - cm.doc.lineSep = val - if (!val) { return } - var newBreaks = [], lineNo = cm.doc.first - cm.doc.iter(function (line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos) - if (found == -1) { break } - pos = found + val.length - newBreaks.push(Pos(lineNo, found)) - } - lineNo++ - }) - for (var i = newBreaks.length - 1; i >= 0; i--) - { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) } - }) - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g") - if (old != Init) { cm.refresh() } - }) - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true) - option("electricChars", true) - option("inputStyle", mobile ? "contenteditable" : "textarea", function () { - throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME - }, true) - option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true) - option("rtlMoveVisually", !windows) - option("wholeLineUpdateBefore", true) - - option("theme", "default", function (cm) { - themeChanged(cm) - guttersChanged(cm) - }, true) - option("keyMap", "default", function (cm, val, old) { - var next = getKeyMap(val) - var prev = old != Init && getKeyMap(old) - if (prev && prev.detach) { prev.detach(cm, next) } - if (next.attach) { next.attach(cm, prev || null) } - }) - option("extraKeys", null) - option("configureMouse", null) - - option("lineWrapping", false, wrappingChanged, true) - option("gutters", [], function (cm) { - setGuttersForLineNumbers(cm.options) - guttersChanged(cm) - }, true) - option("fixedGutter", true, function (cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0" - cm.refresh() - }, true) - option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true) - option("scrollbarStyle", "native", function (cm) { - initScrollbars(cm) - updateScrollbars(cm) - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop) - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft) - }, true) - option("lineNumbers", false, function (cm) { - setGuttersForLineNumbers(cm.options) - guttersChanged(cm) - }, true) - option("firstLineNumber", 1, guttersChanged, true) - option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true) - option("showCursorWhenSelecting", false, updateSelection, true) - - option("resetSelectionOnContextMenu", true) - option("lineWiseCopyCut", true) - option("pasteLinesPerSelection", true) - - option("readOnly", false, function (cm, val) { - if (val == "nocursor") { - onBlur(cm) - cm.display.input.blur() - } - cm.display.input.readOnlyChanged(val) - }) - option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true) - option("dragDrop", true, dragDropChanged) - option("allowDropFileTypes", null) - - option("cursorBlinkRate", 530) - option("cursorScrollMargin", 0) - option("cursorHeight", 1, updateSelection, true) - option("singleCursorHeightPerLine", true, updateSelection, true) - option("workTime", 100) - option("workDelay", 100) - option("flattenSpans", true, resetModeState, true) - option("addModeClass", false, resetModeState, true) - option("pollInterval", 100) - option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }) - option("historyEventDelay", 1250) - option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true) - option("maxHighlightLength", 10000, resetModeState, true) - option("moveInputWithCursor", true, function (cm, val) { - if (!val) { cm.display.input.resetPosition() } - }) - - option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }) - option("autofocus", null) - option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true) - } - - function guttersChanged(cm) { - updateGutters(cm) - regChange(cm) - alignHorizontally(cm) - } - - function dragDropChanged(cm, value, old) { - var wasOn = old && old != Init - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions - var toggle = value ? on : off - toggle(cm.display.scroller, "dragstart", funcs.start) - toggle(cm.display.scroller, "dragenter", funcs.enter) - toggle(cm.display.scroller, "dragover", funcs.over) - toggle(cm.display.scroller, "dragleave", funcs.leave) - toggle(cm.display.scroller, "drop", funcs.drop) - } - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap") - cm.display.sizer.style.minWidth = "" - cm.display.sizerWidth = null - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap") - findMaxLine(cm) - } - estimateLineHeights(cm) - regChange(cm) - clearCaches(cm) - setTimeout(function () { return updateScrollbars(cm); }, 100) - } - -// A CodeMirror instance represents an editor. This is the object -// that user code is usually dealing with. - - function CodeMirror(place, options) { - var this$1 = this; - - if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } - - this.options = options = options ? copyObj(options) : {} - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false) - setGuttersForLineNumbers(options) - - var doc = options.value - if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) } - this.doc = doc - - var input = new CodeMirror.inputStyles[options.inputStyle](this) - var display = this.display = new Display(place, doc, input) - display.wrapper.CodeMirror = this - updateGutters(this) - themeChanged(this) - if (options.lineWrapping) - { this.display.wrapper.className += " CodeMirror-wrap" } - initScrollbars(this) - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll - selectingText: false, - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout - keySeq: null, // Unfinished key sequence - specialChars: null - } - - if (options.autofocus && !mobile) { display.input.focus() } - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) } - - registerEventHandlers(this) - ensureGlobalHandlers() - - startOperation(this) - this.curOp.forceUpdate = true - attachDoc(this, doc) - - if ((options.autofocus && !mobile) || this.hasFocus()) - { setTimeout(bind(onFocus, this), 20) } - else - { onBlur(this) } - - for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) - { optionHandlers[opt](this$1, options[opt], Init) } } - maybeUpdateLineNumberWidth(this) - if (options.finishInit) { options.finishInit(this) } - for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) } - endOperation(this) - // Suppress optimizelegibility in Webkit, since it breaks text - // measuring on line wrapping boundaries. - if (webkit && options.lineWrapping && - getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - { display.lineDiv.style.textRendering = "auto" } - } - -// The default configuration options. - CodeMirror.defaults = defaults -// Functions to run when options are changed. - CodeMirror.optionHandlers = optionHandlers - -// Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display - on(d.scroller, "mousedown", operation(cm, onMouseDown)) - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - { on(d.scroller, "dblclick", operation(cm, function (e) { - if (signalDOMEvent(cm, e)) { return } - var pos = posFromMouse(cm, e) - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } - e_preventDefault(e) - var word = cm.findWordAt(pos) - extendSelection(cm.doc, word.anchor, word.head) - })) } - else - { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) } - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) } - - // Used to suppress mouse event handling when a touch happens - var touchFinished, prevTouch = {end: 0} - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000) - prevTouch = d.activeTouch - prevTouch.end = +new Date - } - } - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) { return false } - var touch = e.touches[0] - return touch.radiusX <= 1 && touch.radiusY <= 1 - } - function farAway(touch, other) { - if (other.left == null) { return true } - var dx = other.left - touch.left, dy = other.top - touch.top - return dx * dx + dy * dy > 20 * 20 - } - on(d.scroller, "touchstart", function (e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { - d.input.ensurePolled() - clearTimeout(touchFinished) - var now = +new Date - d.activeTouch = {start: now, moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null} - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX - d.activeTouch.top = e.touches[0].pageY - } - } - }) - on(d.scroller, "touchmove", function () { - if (d.activeTouch) { d.activeTouch.moved = true } - }) - on(d.scroller, "touchend", function (e) { - var touch = d.activeTouch - if (touch && !eventInWidget(d, e) && touch.left != null && - !touch.moved && new Date - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), range - if (!touch.prev || farAway(touch, touch.prev)) // Single tap - { range = new Range(pos, pos) } - else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap - { range = cm.findWordAt(pos) } - else // Triple tap - { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } - cm.setSelection(range.anchor, range.head) - cm.focus() - e_preventDefault(e) - } - finishTouch() - }) - on(d.scroller, "touchcancel", finishTouch) - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function () { - if (d.scroller.clientHeight) { - updateScrollTop(cm, d.scroller.scrollTop) - setScrollLeft(cm, d.scroller.scrollLeft, true) - signal(cm, "scroll", cm) - } - }) - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }) - on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }) - - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }) - - d.dragFunctions = { - enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }}, - over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }}, - start: function (e) { return onDragStart(cm, e); }, - drop: operation(cm, onDrop), - leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }} - } - - var inp = d.input.getField() - on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }) - on(inp, "keydown", operation(cm, onKeyDown)) - on(inp, "keypress", operation(cm, onKeyPress)) - on(inp, "focus", function (e) { return onFocus(cm, e); }) - on(inp, "blur", function (e) { return onBlur(cm, e); }) - } - - var initHooks = [] - CodeMirror.defineInitHook = function (f) { return initHooks.push(f); } - -// Indent the given line. The how parameter can be "smart", -// "add"/null, "subtract", or "prev". When aggressive is false -// (typically set to true for forced single-line indents), empty -// lines are not indented, and places where the mode returns Pass -// are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state - if (how == null) { how = "add" } - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) { how = "prev" } - else { state = getContextBefore(cm, n).state } - } - - var tabSize = cm.options.tabSize - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize) - if (line.stateAfter) { line.stateAfter = null } - var curSpaceString = line.text.match(/^\s*/)[0], indentation - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0 - how = "not" - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text) - if (indentation == Pass || indentation > 150) { - if (!aggressive) { return } - how = "prev" - } - } - if (how == "prev") { - if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) } - else { indentation = 0 } - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit - } else if (typeof how == "number") { - indentation = curSpace + how - } - indentation = Math.max(0, indentation) - - var indentString = "", pos = 0 - if (cm.options.indentWithTabs) - { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} } - if (pos < indentation) { indentString += spaceStr(indentation - pos) } - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input") - line.stateAfter = null - return true - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { - var range = doc.sel.ranges[i$1] - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos$1 = Pos(n, curSpaceString.length) - replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)) - break - } - } - } - } - -// This will be set to a {lineWise: bool, text: [string]} object, so -// that, when pasting, we know what kind of selections the copied -// text was made out of. - var lastCopied = null - - function setLastCopied(newLastCopied) { - lastCopied = newLastCopied - } - - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc - cm.display.shift = false - if (!sel) { sel = doc.sel } - - var paste = cm.state.pasteIncoming || origin == "paste" - var textLines = splitLinesAuto(inserted), multiPaste = null - // When pasing N lines into N selections, insert one line per selection - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.text.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = [] - for (var i = 0; i < lastCopied.text.length; i++) - { multiPaste.push(doc.splitLines(lastCopied.text[i])) } - } - } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { - multiPaste = map(textLines, function (l) { return [l]; }) - } - } - - var updateInput - // Normal behavior is to insert the new text into every selection - for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { - var range = sel.ranges[i$1] - var from = range.from(), to = range.to() - if (range.empty()) { - if (deleted && deleted > 0) // Handle deletion - { from = Pos(from.line, from.ch - deleted) } - else if (cm.state.overwrite && !paste) // Handle overwrite - { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) } - else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) - { from = to = Pos(from.line, 0) } - } - updateInput = cm.curOp.updateInput - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")} - makeChange(cm.doc, changeEvent) - signalLater(cm, "inputRead", cm, changeEvent) - } - if (inserted && !paste) - { triggerElectric(cm, inserted) } - - ensureCursorVisible(cm) - cm.curOp.updateInput = updateInput - cm.curOp.typing = true - cm.state.pasteIncoming = cm.state.cutIncoming = false - } - - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text") - if (pasted) { - e.preventDefault() - if (!cm.isReadOnly() && !cm.options.disableInput) - { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) } - return true - } - } - - function triggerElectric(cm, inserted) { - // When an 'electric' character is inserted, immediately trigger a reindent - if (!cm.options.electricChars || !cm.options.smartIndent) { return } - var sel = cm.doc.sel - - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i] - if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } - var mode = cm.getModeAt(range.head) - var indented = false - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range.head.line, "smart") - break - } } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) - { indented = indentLine(cm, range.head.line, "smart") } - } - if (indented) { signalLater(cm, "electricInput", cm, range.head.line) } - } - } - - function copyableRanges(cm) { - var text = [], ranges = [] - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)} - ranges.push(lineRange) - text.push(cm.getRange(lineRange.anchor, lineRange.head)) - } - return {text: text, ranges: ranges} - } - - function disableBrowserMagic(field, spellcheck) { - field.setAttribute("autocorrect", "off") - field.setAttribute("autocapitalize", "off") - field.setAttribute("spellcheck", !!spellcheck) - } - - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none") - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;") - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) { te.style.width = "1000px" } - else { te.setAttribute("wrap", "off") } - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) { te.style.border = "1px solid black" } - disableBrowserMagic(te) - return div - } - -// The publicly visible API. Note that methodOp(f) means -// 'wrap f in an operation, performed on its `this` parameter'. - -// This is not the complete set of editor methods. Most of the -// methods defined on the Doc type are also injected into -// CodeMirror.prototype, for backwards compatibility and -// convenience. - - function addEditorMethods(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers - - var helpers = CodeMirror.helpers = {} - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){window.focus(); this.display.input.focus()}, - - setOption: function(option, value) { - var options = this.options, old = options[option] - if (options[option] == value && option != "mode") { return } - options[option] = value - if (optionHandlers.hasOwnProperty(option)) - { operation(this, optionHandlers[option])(this, value, old) } - signal(this, "optionChange", this, option) - }, - - getOption: function(option) {return this.options[option]}, - getDoc: function() {return this.doc}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)) - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps - for (var i = 0; i < maps.length; ++i) - { if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1) - return true - } } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec) - if (mode.startState) { throw new Error("Overlays may not be stateful.") } - insertSorted(this.state.overlays, - {mode: mode, modeSpec: spec, opaque: options && options.opaque, - priority: (options && options.priority) || 0}, - function (overlay) { return overlay.priority; }) - this.state.modeGen++ - regChange(this) - }), - removeOverlay: methodOp(function(spec) { - var this$1 = this; - - var overlays = this.state.overlays - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1) - this$1.state.modeGen++ - regChange(this$1) - return - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" } - else { dir = dir ? "add" : "subtract" } - } - if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) } - }), - indentSelection: methodOp(function(how) { - var this$1 = this; - - var ranges = this.doc.sel.ranges, end = -1 - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i] - if (!range.empty()) { - var from = range.from(), to = range.to() - var start = Math.max(end, from.line) - end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1 - for (var j = start; j < end; ++j) - { indentLine(this$1, j, how) } - var newRanges = this$1.doc.sel.ranges - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) } - } else if (range.head.line > end) { - indentLine(this$1, range.head.line, how, true) - end = range.head.line - if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) } - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - return takeToken(this, pos, precise) - }, - - getLineTokens: function(line, precise) { - return takeToken(this, Pos(line), precise, true) - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos) - var styles = getLineStyles(this, getLine(this.doc, pos.line)) - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch - var type - if (ch == 0) { type = styles[2] } - else { for (;;) { - var mid = (before + after) >> 1 - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid } - else if (styles[mid * 2 + 1] < ch) { before = mid + 1 } - else { type = styles[mid * 2 + 2]; break } - } } - var cut = type ? type.indexOf("overlay ") : -1 - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) - }, - - getModeAt: function(pos) { - var mode = this.doc.mode - if (!mode.innerMode) { return mode } - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0] - }, - - getHelpers: function(pos, type) { - var this$1 = this; - - var found = [] - if (!helpers.hasOwnProperty(type)) { return found } - var help = helpers[type], mode = this.getModeAt(pos) - if (typeof mode[type] == "string") { - if (help[mode[type]]) { found.push(help[mode[type]]) } - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]] - if (val) { found.push(val) } - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]) - } else if (help[mode.name]) { - found.push(help[mode.name]) - } - for (var i$1 = 0; i$1 < help._global.length; i$1++) { - var cur = help._global[i$1] - if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) - { found.push(cur.val) } - } - return found - }, - - getStateAfter: function(line, precise) { - var doc = this.doc - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line) - return getContextBefore(this, line + 1, precise).state - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary() - if (start == null) { pos = range.head } - else if (typeof start == "object") { pos = clipPos(this.doc, start) } - else { pos = start ? range.from() : range.to() } - return cursorCoords(this, pos, mode || "page") - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page") - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page") - return coordsChar(this, coords.left, coords.top) - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top - return lineAtHeight(this.doc, height + this.display.viewOffset) - }, - heightAtLine: function(line, mode, includeWidgets) { - var end = false, lineObj - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1 - if (line < this.doc.first) { line = this.doc.first } - else if (line > last) { line = last; end = true } - lineObj = getLine(this.doc, line) - } else { - lineObj = line - } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + - (end ? this.doc.height - heightAtLine(lineObj) : 0) - }, - - defaultTextHeight: function() { return textHeight(this.display) }, - defaultCharWidth: function() { return charWidth(this.display) }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display - pos = cursorCoords(this, clipPos(this.doc, pos)) - var top = pos.bottom, left = pos.left - node.style.position = "absolute" - node.setAttribute("cm-ignore-events", "true") - this.display.input.setUneditable(node) - display.sizer.appendChild(node) - if (vert == "over") { - top = pos.top - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth) - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - { top = pos.top - node.offsetHeight } - else if (pos.bottom + node.offsetHeight <= vspace) - { top = pos.bottom } - if (left + node.offsetWidth > hspace) - { left = hspace - node.offsetWidth } - } - node.style.top = top + "px" - node.style.left = node.style.right = "" - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth - node.style.right = "0px" - } else { - if (horiz == "left") { left = 0 } - else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 } - node.style.left = left + "px" - } - if (scroll) - { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) } - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - triggerOnMouseDown: methodOp(onMouseDown), - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - { return commands[cmd].call(null, this) } - }, - - triggerElectric: methodOp(function(text) { triggerElectric(this, text) }), - - findPosH: function(from, amount, unit, visually) { - var this$1 = this; - - var dir = 1 - if (amount < 0) { dir = -1; amount = -amount } - var cur = clipPos(this.doc, from) - for (var i = 0; i < amount; ++i) { - cur = findPosH(this$1.doc, cur, dir, unit, visually) - if (cur.hitSide) { break } - } - return cur - }, - - moveH: methodOp(function(dir, unit) { - var this$1 = this; - - this.extendSelectionsBy(function (range) { - if (this$1.display.shift || this$1.doc.extend || range.empty()) - { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } - else - { return dir < 0 ? range.from() : range.to() } - }, sel_move) - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc - if (sel.somethingSelected()) - { doc.replaceSelection("", null, "+delete") } - else - { deleteNearSelection(this, function (range) { - var other = findPosH(doc, range.head, dir, unit, false) - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} - }) } - }), - - findPosV: function(from, amount, unit, goalColumn) { - var this$1 = this; - - var dir = 1, x = goalColumn - if (amount < 0) { dir = -1; amount = -amount } - var cur = clipPos(this.doc, from) - for (var i = 0; i < amount; ++i) { - var coords = cursorCoords(this$1, cur, "div") - if (x == null) { x = coords.left } - else { coords.left = x } - cur = findPosV(this$1, coords, dir, unit) - if (cur.hitSide) { break } - } - return cur - }, - - moveV: methodOp(function(dir, unit) { - var this$1 = this; - - var doc = this.doc, goals = [] - var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected() - doc.extendSelectionsBy(function (range) { - if (collapse) - { return dir < 0 ? range.from() : range.to() } - var headPos = cursorCoords(this$1, range.head, "div") - if (range.goalColumn != null) { headPos.left = range.goalColumn } - goals.push(headPos.left) - var pos = findPosV(this$1, headPos, dir, unit) - if (unit == "page" && range == doc.sel.primary()) - { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top) } - return pos - }, sel_move) - if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) - { doc.sel.ranges[i].goalColumn = goals[i] } } - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text - var start = pos.ch, end = pos.ch - if (line) { - var helper = this.getHelper(pos, "wordChars") - if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end } - var startChar = line.charAt(start) - var check = isWordChar(startChar, helper) - ? function (ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } - : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); } - while (start > 0 && check(line.charAt(start - 1))) { --start } - while (end < line.length && check(line.charAt(end))) { ++end } - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)) - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) { return } - if (this.state.overwrite = !this.state.overwrite) - { addClass(this.display.cursorDiv, "CodeMirror-overwrite") } - else - { rmClass(this.display.cursorDiv, "CodeMirror-overwrite") } - - signal(this, "overwriteToggle", this, this.state.overwrite) - }, - hasFocus: function() { return this.display.input.getField() == activeElt() }, - isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, - - scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }), - getScrollInfo: function() { - var scroller = this.display.scroller - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), clientWidth: displayWidth(this)} - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null} - if (margin == null) { margin = this.options.cursorScrollMargin } - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null} - } else if (range.from == null) { - range = {from: range, to: null} - } - if (!range.to) { range.to = range.from } - range.margin = margin || 0 - - if (range.from.line != null) { - scrollToRange(this, range) - } else { - scrollToCoordsRange(this, range.from, range.to, range.margin) - } - }), - - setSize: methodOp(function(width, height) { - var this$1 = this; - - var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; } - if (width != null) { this.display.wrapper.style.width = interpret(width) } - if (height != null) { this.display.wrapper.style.height = interpret(height) } - if (this.options.lineWrapping) { clearLineMeasurementCache(this) } - var lineNo = this.display.viewFrom - this.doc.iter(lineNo, this.display.viewTo, function (line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) - { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } - ++lineNo - }) - this.curOp.forceUpdate = true - signal(this, "refresh", this) - }), - - operation: function(f){return runInOp(this, f)}, - startOperation: function(){return startOperation(this)}, - endOperation: function(){return endOperation(this)}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight - regChange(this) - this.curOp.forceUpdate = true - clearCaches(this) - scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop) - updateGutterSpace(this) - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) - { estimateLineHeights(this) } - signal(this, "refresh", this) - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc - old.cm = null - attachDoc(this, doc) - clearCaches(this) - this.display.input.reset() - scrollToCoords(this, doc.scrollLeft, doc.scrollTop) - this.curOp.forceScroll = true - signalLater(this, "swapDoc", this, old) - return old - }), - - getInputField: function(){return this.display.input.getField()}, - getWrapperElement: function(){return this.display.wrapper}, - getScrollerElement: function(){return this.display.scroller}, - getGutterElement: function(){return this.display.gutters} - } - eventMixin(CodeMirror) - - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} } - helpers[type][name] = value - } - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value) - helpers[type]._global.push({pred: predicate, val: value}) - } - } - -// Used for horizontal relative motion. Dir is -1 or 1 (left or -// right), unit can be "char", "column" (like char, but doesn't -// cross line boundaries), "word" (across next word), or "group" (to -// the start of next group of word or non-word-non-whitespace -// chars). The visually param controls whether, in right-to-left -// text, direction 1 means to move towards the next index in the -// string, or towards the character to the right of the current -// position. The resulting position will have a hitSide=true -// property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var oldPos = pos - var origDir = dir - var lineObj = getLine(doc, pos.line) - function findNextLine() { - var l = pos.line + dir - if (l < doc.first || l >= doc.first + doc.size) { return false } - pos = new Pos(l, pos.ch, pos.sticky) - return lineObj = getLine(doc, l) - } - function moveOnce(boundToLine) { - var next - if (visually) { - next = moveVisually(doc.cm, lineObj, pos, dir) - } else { - next = moveLogically(lineObj, pos, dir) - } - if (next == null) { - if (!boundToLine && findNextLine()) - { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) } - else - { return false } - } else { - pos = next - } - return true - } - - if (unit == "char") { - moveOnce() - } else if (unit == "column") { - moveOnce(true) - } else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group" - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars") - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) { break } - var cur = lineObj.text.charAt(pos.ch) || "\n" - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p" - if (group && !first && !type) { type = "s" } - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after"} - break - } - - if (type) { sawType = type } - if (dir > 0 && !moveOnce(!first)) { break } - } - } - var result = skipAtomic(doc, pos, oldPos, origDir, true) - if (equalCursorPos(oldPos, result)) { result.hitSide = true } - return result - } - -// For relative vertical movement. Dir may be -1 or 1. Unit can be -// "page" or "line". The resulting position will have a hitSide=true -// property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight) - var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3) - y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount - - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3 - } - var target - for (;;) { - target = coordsChar(cm, x, y) - if (!target.outside) { break } - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } - y += dir * 5 - } - return target - } - -// CONTENTEDITABLE INPUT STYLE - - var ContentEditableInput = function(cm) { - this.cm = cm - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null - this.polling = new Delayed() - this.composing = null - this.gracePeriod = false - this.readDOMTimeout = null - }; - - ContentEditableInput.prototype.init = function (display) { - var this$1 = this; - - var input = this, cm = input.cm - var div = input.div = display.lineDiv - disableBrowserMagic(div, cm.options.spellcheck) - - on(div, "paste", function (e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - // IE doesn't fire input events, so we schedule a read for the pasted content in this way - if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) } - }) - - on(div, "compositionstart", function (e) { - this$1.composing = {data: e.data, done: false} - }) - on(div, "compositionupdate", function (e) { - if (!this$1.composing) { this$1.composing = {data: e.data, done: false} } - }) - on(div, "compositionend", function (e) { - if (this$1.composing) { - if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() } - this$1.composing.done = true - } - }) - - on(div, "touchstart", function () { return input.forceCompositionEnd(); }) - - on(div, "input", function () { - if (!this$1.composing) { this$1.readFromDOMSoon() } - }) - - function onCopyCut(e) { - if (signalDOMEvent(cm, e)) { return } - if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}) - if (e.type == "cut") { cm.replaceSelection("", null, "cut") } - } else if (!cm.options.lineWiseCopyCut) { - return - } else { - var ranges = copyableRanges(cm) - setLastCopied({lineWise: true, text: ranges.text}) - if (e.type == "cut") { - cm.operation(function () { - cm.setSelections(ranges.ranges, 0, sel_dontScroll) - cm.replaceSelection("", null, "cut") - }) - } - } - if (e.clipboardData) { - e.clipboardData.clearData() - var content = lastCopied.text.join("\n") - // iOS exposes the clipboard API, but seems to discard content inserted into it - e.clipboardData.setData("Text", content) - if (e.clipboardData.getData("Text") == content) { - e.preventDefault() - return - } - } - // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild) - te.value = lastCopied.text.join("\n") - var hadFocus = document.activeElement - selectInput(te) - setTimeout(function () { - cm.display.lineSpace.removeChild(kludge) - hadFocus.focus() - if (hadFocus == div) { input.showPrimarySelection() } - }, 50) - } - on(div, "copy", onCopyCut) - on(div, "cut", onCopyCut) - }; - - ContentEditableInput.prototype.prepareSelection = function () { - var result = prepareSelection(this.cm, false) - result.focus = this.cm.state.focused - return result - }; - - ContentEditableInput.prototype.showSelection = function (info, takeFocus) { - if (!info || !this.cm.display.view.length) { return } - if (info.focus || takeFocus) { this.showPrimarySelection() } - this.showMultipleSelections(info) - }; - - ContentEditableInput.prototype.showPrimarySelection = function () { - var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary() - var from = prim.from(), to = prim.to() - - if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { - sel.removeAllRanges() - return - } - - var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) - var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset) - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && - cmp(minPos(curAnchor, curFocus), from) == 0 && - cmp(maxPos(curAnchor, curFocus), to) == 0) - { return } - - var view = cm.display.view - var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || - {node: view[0].measure.map[2], offset: 0} - var end = to.line < cm.display.viewTo && posToDOM(cm, to) - if (!end) { - var measure = view[view.length - 1].measure - var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map - end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]} - } - - if (!start || !end) { - sel.removeAllRanges() - return - } - - var old = sel.rangeCount && sel.getRangeAt(0), rng - try { rng = range(start.node, start.offset, end.offset, end.node) } - catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible - if (rng) { - if (!gecko && cm.state.focused) { - sel.collapse(start.node, start.offset) - if (!rng.collapsed) { - sel.removeAllRanges() - sel.addRange(rng) - } - } else { - sel.removeAllRanges() - sel.addRange(rng) - } - if (old && sel.anchorNode == null) { sel.addRange(old) } - else if (gecko) { this.startGracePeriod() } - } - this.rememberSelection() - }; - - ContentEditableInput.prototype.startGracePeriod = function () { - var this$1 = this; - - clearTimeout(this.gracePeriod) - this.gracePeriod = setTimeout(function () { - this$1.gracePeriod = false - if (this$1.selectionChanged()) - { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) } - }, 20) - }; - - ContentEditableInput.prototype.showMultipleSelections = function (info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors) - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection) - }; - - ContentEditableInput.prototype.rememberSelection = function () { - var sel = window.getSelection() - this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset - this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset - }; - - ContentEditableInput.prototype.selectionInEditor = function () { - var sel = window.getSelection() - if (!sel.rangeCount) { return false } - var node = sel.getRangeAt(0).commonAncestorContainer - return contains(this.div, node) - }; - - ContentEditableInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor()) - { this.showSelection(this.prepareSelection(), true) } - this.div.focus() - } - }; - ContentEditableInput.prototype.blur = function () { this.div.blur() }; - ContentEditableInput.prototype.getField = function () { return this.div }; - - ContentEditableInput.prototype.supportsTouch = function () { return true }; - - ContentEditableInput.prototype.receivedFocus = function () { - var input = this - if (this.selectionInEditor()) - { this.pollSelection() } - else - { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) } - - function poll() { - if (input.cm.state.focused) { - input.pollSelection() - input.polling.set(input.cm.options.pollInterval, poll) - } - } - this.polling.set(this.cm.options.pollInterval, poll) - }; - - ContentEditableInput.prototype.selectionChanged = function () { - var sel = window.getSelection() - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || - sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset - }; - - ContentEditableInput.prototype.pollSelection = function () { - if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } - var sel = window.getSelection(), cm = this.cm - // On Android Chrome (version 56, at least), backspacing into an - // uneditable block element will put the cursor in that element, - // and then, because it's not editable, hide the virtual keyboard. - // Because Android doesn't allow us to actually detect backspace - // presses in a sane way, this code checks for when that happens - // and simulates a backspace press in this case. - if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) { - this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}) - this.blur() - this.focus() - return - } - if (this.composing) { return } - this.rememberSelection() - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) - var head = domToPos(cm, sel.focusNode, sel.focusOffset) - if (anchor && head) { runInOp(cm, function () { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll) - if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true } - }) } - }; - - ContentEditableInput.prototype.pollContent = function () { - if (this.readDOMTimeout != null) { - clearTimeout(this.readDOMTimeout) - this.readDOMTimeout = null - } - - var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary() - var from = sel.from(), to = sel.to() - if (from.ch == 0 && from.line > cm.firstLine()) - { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) } - if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) - { to = Pos(to.line + 1, 0) } - if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } - - var fromIndex, fromLine, fromNode - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - fromLine = lineNo(display.view[0].line) - fromNode = display.view[0].node - } else { - fromLine = lineNo(display.view[fromIndex].line) - fromNode = display.view[fromIndex - 1].node.nextSibling - } - var toIndex = findViewIndex(cm, to.line) - var toLine, toNode - if (toIndex == display.view.length - 1) { - toLine = display.viewTo - 1 - toNode = display.lineDiv.lastChild - } else { - toLine = lineNo(display.view[toIndex + 1].line) - 1 - toNode = display.view[toIndex + 1].node.previousSibling - } - - if (!fromNode) { return false } - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)) - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)) - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- } - else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ } - else { break } - } - - var cutFront = 0, cutEnd = 0 - var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length) - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) - { ++cutFront } - var newBot = lst(newText), oldBot = lst(oldText) - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), - oldBot.length - (oldText.length == 1 ? cutFront : 0)) - while (cutEnd < maxCutEnd && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) - { ++cutEnd } - // Try to move start of change to start of selection if ambiguous - if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { - while (cutFront && cutFront > from.ch && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - cutFront-- - cutEnd++ - } - } - - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "") - newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "") - - var chFrom = Pos(fromLine, cutFront) - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0) - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input") - return true - } - }; - - ContentEditableInput.prototype.ensurePolled = function () { - this.forceCompositionEnd() - }; - ContentEditableInput.prototype.reset = function () { - this.forceCompositionEnd() - }; - ContentEditableInput.prototype.forceCompositionEnd = function () { - if (!this.composing) { return } - clearTimeout(this.readDOMTimeout) - this.composing = null - this.updateFromDOM() - this.div.blur() - this.div.focus() - }; - ContentEditableInput.prototype.readFromDOMSoon = function () { - var this$1 = this; - - if (this.readDOMTimeout != null) { return } - this.readDOMTimeout = setTimeout(function () { - this$1.readDOMTimeout = null - if (this$1.composing) { - if (this$1.composing.done) { this$1.composing = null } - else { return } - } - this$1.updateFromDOM() - }, 80) - }; - - ContentEditableInput.prototype.updateFromDOM = function () { - var this$1 = this; - - if (this.cm.isReadOnly() || !this.pollContent()) - { runInOp(this.cm, function () { return regChange(this$1.cm); }) } - }; - - ContentEditableInput.prototype.setUneditable = function (node) { - node.contentEditable = "false" - }; - - ContentEditableInput.prototype.onKeyPress = function (e) { - if (e.charCode == 0) { return } - e.preventDefault() - if (!this.cm.isReadOnly()) - { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) } - }; - - ContentEditableInput.prototype.readOnlyChanged = function (val) { - this.div.contentEditable = String(val != "nocursor") - }; - - ContentEditableInput.prototype.onContextMenu = function () {}; - ContentEditableInput.prototype.resetPosition = function () {}; - - ContentEditableInput.prototype.needsContentAttribute = true - - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line) - if (!view || view.hidden) { return null } - var line = getLine(cm.doc, pos.line) - var info = mapFromLineView(view, line, pos.line) - - var order = getOrder(line, cm.doc.direction), side = "left" - if (order) { - var partPos = getBidiPartAt(order, pos.ch) - side = partPos % 2 ? "right" : "left" - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side) - result.offset = result.collapse == "right" ? result.end : result.start - return result - } - - function isInGutter(node) { - for (var scan = node; scan; scan = scan.parentNode) - { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } - return false - } - - function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } - - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", closing = false, lineSep = cm.doc.lineSeparator() - function recognizeMarker(id) { return function (marker) { return marker.id == id; } } - function close() { - if (closing) { - text += lineSep - closing = false - } - } - function addText(str) { - if (str) { - close() - text += str - } - } - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text") - if (cmText != null) { - addText(cmText || node.textContent.replace(/\u200b/g, "")) - return - } - var markerID = node.getAttribute("cm-marker"), range - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)) - if (found.length && (range = found[0].find(0))) - { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) } - return - } - if (node.getAttribute("contenteditable") == "false") { return } - var isBlock = /^(pre|div|p)$/i.test(node.nodeName) - if (isBlock) { close() } - for (var i = 0; i < node.childNodes.length; i++) - { walk(node.childNodes[i]) } - if (isBlock) { closing = true } - } else if (node.nodeType == 3) { - addText(node.nodeValue) - } - } - for (;;) { - walk(from) - if (from == to) { break } - from = from.nextSibling - } - return text - } - - function domToPos(cm, node, offset) { - var lineNode - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset] - if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } - node = null; offset = 0 - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) { return null } - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } - } - } - for (var i = 0; i < cm.display.view.length; i++) { - var lineView = cm.display.view[i] - if (lineView.node == lineNode) - { return locateNodeInLineView(lineView, node, offset) } - } - } - - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, bad = false - if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } - if (node == wrapper) { - bad = true - node = wrapper.childNodes[offset] - offset = 0 - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line - return badPos(Pos(lineNo(line), line.text.length), bad) - } - } - - var textNode = node.nodeType == 3 ? node : null, topNode = node - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild - if (offset) { offset = textNode.nodeValue.length } - } - while (topNode.parentNode != wrapper) { topNode = topNode.parentNode } - var measure = lineView.measure, maps = measure.maps - - function find(textNode, topNode, offset) { - for (var i = -1; i < (maps ? maps.length : 0); i++) { - var map = i < 0 ? measure.map : maps[i] - for (var j = 0; j < map.length; j += 3) { - var curNode = map[j + 2] - if (curNode == textNode || curNode == topNode) { - var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]) - var ch = map[j] + offset - if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] } - return Pos(line, ch) - } - } - } - } - var found = find(textNode, topNode, offset) - if (found) { return badPos(found, bad) } - - // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0) - if (found) - { return badPos(Pos(found.line, found.ch - dist), bad) } - else - { dist += after.textContent.length } - } - for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1) - if (found) - { return badPos(Pos(found.line, found.ch + dist$1), bad) } - else - { dist$1 += before.textContent.length } - } - } - -// TEXTAREA INPUT STYLE - - var TextareaInput = function(cm) { - this.cm = cm - // See input.poll and input.reset - this.prevInput = "" - - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - this.pollingFast = false - // Self-resetting timeout for the poller - this.polling = new Delayed() - // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false - this.composing = null - }; - - TextareaInput.prototype.init = function (display) { - var this$1 = this; - - var input = this, cm = this.cm - - // Wraps and hides input textarea - var div = this.wrapper = hiddenTextarea() - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - var te = this.textarea = div.firstChild - display.wrapper.insertBefore(div, display.wrapper.firstChild) - - // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) - if (ios) { te.style.width = "0px" } - - on(te, "input", function () { - if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null } - input.poll() - }) - - on(te, "paste", function (e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - - cm.state.pasteIncoming = true - input.fastPoll() - }) - - function prepareCopyCut(e) { - if (signalDOMEvent(cm, e)) { return } - if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}) - } else if (!cm.options.lineWiseCopyCut) { - return - } else { - var ranges = copyableRanges(cm) - setLastCopied({lineWise: true, text: ranges.text}) - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll) - } else { - input.prevInput = "" - te.value = ranges.text.join("\n") - selectInput(te) - } - } - if (e.type == "cut") { cm.state.cutIncoming = true } - } - on(te, "cut", prepareCopyCut) - on(te, "copy", prepareCopyCut) - - on(display.scroller, "paste", function (e) { - if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } - cm.state.pasteIncoming = true - input.focus() - }) - - // Prevent normal selection in the editor (we handle our own) - on(display.lineSpace, "selectstart", function (e) { - if (!eventInWidget(display, e)) { e_preventDefault(e) } - }) - - on(te, "compositionstart", function () { - var start = cm.getCursor("from") - if (input.composing) { input.composing.range.clear() } - input.composing = { - start: start, - range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) - } - }) - on(te, "compositionend", function () { - if (input.composing) { - input.poll() - input.composing.range.clear() - input.composing = null - } - }) - }; - - TextareaInput.prototype.prepareSelection = function () { - // Redraw the selection and/or cursor - var cm = this.cm, display = cm.display, doc = cm.doc - var result = prepareSelection(cm) - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div") - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect() - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)) - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)) - } - - return result - }; - - TextareaInput.prototype.showSelection = function (drawn) { - var cm = this.cm, display = cm.display - removeChildrenAndAdd(display.cursorDiv, drawn.cursors) - removeChildrenAndAdd(display.selectionDiv, drawn.selection) - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px" - this.wrapper.style.left = drawn.teLeft + "px" - } - }; - -// Reset the input to correspond to the selection (or to be empty, -// when not typing and nothing is selected) - TextareaInput.prototype.reset = function (typing) { - if (this.contextMenuPending || this.composing) { return } - var cm = this.cm - if (cm.somethingSelected()) { - this.prevInput = "" - var content = cm.getSelection() - this.textarea.value = content - if (cm.state.focused) { selectInput(this.textarea) } - if (ie && ie_version >= 9) { this.hasSelection = content } - } else if (!typing) { - this.prevInput = this.textarea.value = "" - if (ie && ie_version >= 9) { this.hasSelection = null } - } - }; - - TextareaInput.prototype.getField = function () { return this.textarea }; - - TextareaInput.prototype.supportsTouch = function () { return false }; - - TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { - try { this.textarea.focus() } - catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM - } - }; - - TextareaInput.prototype.blur = function () { this.textarea.blur() }; - - TextareaInput.prototype.resetPosition = function () { - this.wrapper.style.top = this.wrapper.style.left = 0 - }; - - TextareaInput.prototype.receivedFocus = function () { this.slowPoll() }; - -// Poll for input changes, using the normal rate of polling. This -// runs as long as the editor is focused. - TextareaInput.prototype.slowPoll = function () { - var this$1 = this; - - if (this.pollingFast) { return } - this.polling.set(this.cm.options.pollInterval, function () { - this$1.poll() - if (this$1.cm.state.focused) { this$1.slowPoll() } - }) - }; - -// When an event has just come in that is likely to add or change -// something in the input textarea, we poll faster, to ensure that -// the change appears on the screen quickly. - TextareaInput.prototype.fastPoll = function () { - var missed = false, input = this - input.pollingFast = true - function p() { - var changed = input.poll() - if (!changed && !missed) {missed = true; input.polling.set(60, p)} - else {input.pollingFast = false; input.slowPoll()} - } - input.polling.set(20, p) - }; - -// Read input from the textarea, and update the document to match. -// When something is selected, it is present in the textarea, and -// selected (unless it is huge, in which case a placeholder is -// used). When nothing is selected, the cursor sits after previously -// seen text (can be empty), which is stored in prevInput (we must -// not reset the textarea when typing, because that breaks IME). - TextareaInput.prototype.poll = function () { - var this$1 = this; - - var cm = this.cm, input = this.textarea, prevInput = this.prevInput - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (this.contextMenuPending || !cm.state.focused || - (hasSelection(input) && !prevInput && !this.composing) || - cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) - { return false } - - var text = input.value - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) { return false } - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && this.hasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset() - return false - } - - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0) - if (first == 0x200b && !prevInput) { prevInput = "\u200b" } - if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } - } - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length) - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same } - - runInOp(cm, function () { - applyTextInput(cm, text.slice(same), prevInput.length - same, - null, this$1.composing ? "*compose" : null) - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" } - else { this$1.prevInput = text } - - if (this$1.composing) { - this$1.composing.range.clear() - this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), - {className: "CodeMirror-composing"}) - } - }) - return true - }; - - TextareaInput.prototype.ensurePolled = function () { - if (this.pollingFast && this.poll()) { this.pollingFast = false } - }; - - TextareaInput.prototype.onKeyPress = function () { - if (ie && ie_version >= 9) { this.hasSelection = null } - this.fastPoll() - }; - - TextareaInput.prototype.onContextMenu = function (e) { - var input = this, cm = input.cm, display = cm.display, te = input.textarea - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop - if (!pos || presto) { return } // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu - if (reset && cm.doc.sel.contains(pos) == -1) - { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) } - - var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText - input.wrapper.style.cssText = "position: absolute" - var wrapperBox = input.wrapper.getBoundingClientRect() - te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);" - var oldScrollY - if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712) - display.input.focus() - if (webkit) { window.scrollTo(null, oldScrollY) } - display.input.reset() - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) { te.value = input.prevInput = " " } - input.contextMenuPending = true - display.selForContextMenu = cm.doc.sel - clearTimeout(display.detectingSelectAll) - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected() - var extval = "\u200b" + (selected ? te.value : "") - te.value = "\u21da" // Used to catch context-menu undo - te.value = extval - input.prevInput = selected ? "" : "\u200b" - te.selectionStart = 1; te.selectionEnd = extval.length - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel - } - } - function rehide() { - input.contextMenuPending = false - input.wrapper.style.cssText = oldWrapperCSS - te.style.cssText = oldCSS - if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) } - - // Try to detect the user choosing select-all - if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() } - var i = 0, poll = function () { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && - te.selectionEnd > 0 && input.prevInput == "\u200b") { - operation(cm, selectAll)(cm) - } else if (i++ < 10) { - display.detectingSelectAll = setTimeout(poll, 500) - } else { - display.selForContextMenu = null - display.input.reset() - } - } - display.detectingSelectAll = setTimeout(poll, 200) - } - } - - if (ie && ie_version >= 9) { prepareSelectAllHack() } - if (captureRightClick) { - e_stop(e) - var mouseup = function () { - off(window, "mouseup", mouseup) - setTimeout(rehide, 20) - } - on(window, "mouseup", mouseup) - } else { - setTimeout(rehide, 50) - } - }; - - TextareaInput.prototype.readOnlyChanged = function (val) { - if (!val) { this.reset() } - this.textarea.disabled = val == "nocursor" - }; - - TextareaInput.prototype.setUneditable = function () {}; - - TextareaInput.prototype.needsContentAttribute = false - - function fromTextArea(textarea, options) { - options = options ? copyObj(options) : {} - options.value = textarea.value - if (!options.tabindex && textarea.tabIndex) - { options.tabindex = textarea.tabIndex } - if (!options.placeholder && textarea.placeholder) - { options.placeholder = textarea.placeholder } - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt() - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body - } - - function save() {textarea.value = cm.getValue()} - - var realSubmit - if (textarea.form) { - on(textarea.form, "submit", save) - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form - realSubmit = form.submit - try { - var wrappedSubmit = form.submit = function () { - save() - form.submit = realSubmit - form.submit() - form.submit = wrappedSubmit - } - } catch(e) {} - } - } - - options.finishInit = function (cm) { - cm.save = save - cm.getTextArea = function () { return textarea; } - cm.toTextArea = function () { - cm.toTextArea = isNaN // Prevent this from being ran twice - save() - textarea.parentNode.removeChild(cm.getWrapperElement()) - textarea.style.display = "" - if (textarea.form) { - off(textarea.form, "submit", save) - if (typeof textarea.form.submit == "function") - { textarea.form.submit = realSubmit } - } - } - } - - textarea.style.display = "none" - var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, - options) - return cm - } - - function addLegacyProps(CodeMirror) { - CodeMirror.off = off - CodeMirror.on = on - CodeMirror.wheelEventPixels = wheelEventPixels - CodeMirror.Doc = Doc - CodeMirror.splitLines = splitLinesAuto - CodeMirror.countColumn = countColumn - CodeMirror.findColumn = findColumn - CodeMirror.isWordChar = isWordCharBasic - CodeMirror.Pass = Pass - CodeMirror.signal = signal - CodeMirror.Line = Line - CodeMirror.changeEnd = changeEnd - CodeMirror.scrollbarModel = scrollbarModel - CodeMirror.Pos = Pos - CodeMirror.cmpPos = cmp - CodeMirror.modes = modes - CodeMirror.mimeModes = mimeModes - CodeMirror.resolveMode = resolveMode - CodeMirror.getMode = getMode - CodeMirror.modeExtensions = modeExtensions - CodeMirror.extendMode = extendMode - CodeMirror.copyState = copyState - CodeMirror.startState = startState - CodeMirror.innerMode = innerMode - CodeMirror.commands = commands - CodeMirror.keyMap = keyMap - CodeMirror.keyName = keyName - CodeMirror.isModifierKey = isModifierKey - CodeMirror.lookupKey = lookupKey - CodeMirror.normalizeKeyMap = normalizeKeyMap - CodeMirror.StringStream = StringStream - CodeMirror.SharedTextMarker = SharedTextMarker - CodeMirror.TextMarker = TextMarker - CodeMirror.LineWidget = LineWidget - CodeMirror.e_preventDefault = e_preventDefault - CodeMirror.e_stopPropagation = e_stopPropagation - CodeMirror.e_stop = e_stop - CodeMirror.addClass = addClass - CodeMirror.contains = contains - CodeMirror.rmClass = rmClass - CodeMirror.keyNames = keyNames - } - -// EDITOR CONSTRUCTOR - - defineOptions(CodeMirror) - - addEditorMethods(CodeMirror) - -// Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor constructor".split(" ") - for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - { CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments)} - })(Doc.prototype[prop]) } } - - eventMixin(Doc) - -// INPUT HANDLING - - CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput} - -// MODE DEFINITION AND QUERYING - -// Extra arguments are stored as the mode's dependencies, which is -// used by (legacy) mechanisms like loadmode.js to automatically -// load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name/*, mode, …*/) { - if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name } - defineMode.apply(this, arguments) - } - - CodeMirror.defineMIME = defineMIME - -// Minimal default mode. - CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }) - CodeMirror.defineMIME("text/plain", "null") - -// EXTENSIONS - - CodeMirror.defineExtension = function (name, func) { - CodeMirror.prototype[name] = func - } - CodeMirror.defineDocExtension = function (name, func) { - Doc.prototype[name] = func - } - - CodeMirror.fromTextArea = fromTextArea - - addLegacyProps(CodeMirror) - - CodeMirror.version = "5.32.0" - - return CodeMirror; - -}))); -/* ./modules/editor/codemirror/mode/handlebars/handlebars.min.js */ -/* ./modules/editor/codemirror/mode/smalltalk/smalltalk.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("smalltalk",function(e){var s=/[+\-\/\\*~<>=@%|&?!.,:;^]/,u=/true|false|nil|self|super|thisContext/,t=function(e,t){this.next=e;this.parent=t},n=function(e,t,n){this.name=e;this.context=t;this.eos=n},l=function(){this.context=new t(i,null);this.expectVariable=!0;this.indentation=0;this.userIndentationDelta=0};l.prototype.userIndent=function(t){this.userIndentationDelta=t>0?(t/e.indentUnit-this.indentation):0};var i=function(e,l,d){var i=new n(null,l,!1),c=e.next();if(c==="\""){i=a(e,new t(a,l))} -else if(c==="'"){i=r(e,new t(r,l))} -else if(c==="#"){if(e.peek()==="'"){e.next();i=o(e,new t(o,l))} -else{if(e.eatWhile(/[^\s.{}\[\]()]/))i.name="string-2";else i.name="meta"}} -else if(c==="$"){if(e.next()==="<"){e.eatWhile(/[^\s>]/);e.next()};i.name="string-2"} -else if(c==="|"&&d.expectVariable){i.context=new t(f,l)} -else if(/[\[\]{}()]/.test(c)){i.name="bracket";i.eos=/[\[{(]/.test(c);if(c==="["){d.indentation++} -else if(c==="]"){d.indentation=Math.max(0,d.indentation-1)}} -else if(s.test(c)){e.eatWhile(s);i.name="operator";i.eos=c!==";"} -else if(/\d/.test(c)){e.eatWhile(/[\w\d]/);i.name="number"} -else if(/[\w_]/.test(c)){e.eatWhile(/[\w\d_]/);i.name=d.expectVariable?(u.test(e.current())?"keyword":"variable"):null} -else{i.eos=d.expectVariable};return i},a=function(e,t){e.eatWhile(/[^"]/);return new n("comment",e.eat("\"")?t.parent:t,!0)},r=function(e,t){e.eatWhile(/[^']/);return new n("string",e.eat("'")?t.parent:t,!1)},o=function(e,t){e.eatWhile(/[^']/);return new n("string-2",e.eat("'")?t.parent:t,!1)},f=function(e,t){var i=new n(null,t,!1),a=e.next();if(a==="|"){i.context=t.parent;i.eos=!0} -else{e.eatWhile(/[^|]/);i.name="variable"};return i};return{startState:function(){return new l},token:function(e,t){t.userIndent(e.indentation());if(e.eatSpace()){return null};var n=t.context.next(e,t.context,t);t.context=n.context;t.expectVariable=n.eos;return n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var a=t.context.next===i&&n&&n.charAt(0)==="]"?-1:t.userIndentationDelta;return(t.indentation+a)*e.indentUnit},electricChars:"]"}});e.defineMIME("text/x-stsrc",{name:"smalltalk"})}); -/* ./modules/editor/codemirror/mode/php/php.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../clike/clike'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../clike/clike'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){var r={},s=e.split(' ');for(var t=0;t<s.length;++t)r[s[t]]=!0;return r};function s(e,t,i){if(e.length==0)return r(t);return function(l,n){var o=e[0];for(var a=0;a<o.length;a++)if(l.match(o[a][0])){n.tokenize=s(e.slice(1),t);return o[a][1]};n.tokenize=r(t,i);return'string'}};function r(e,t){return function(r,s){return o(r,s,e,t)}};function o(e,t,i,r){if(r!==!1&&e.match('${',!1)||e.match('{$',!1)){t.tokenize=null;return'string'};if(r!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)){if(e.match('[',!1)){t.tokenize=s([[['[',null]],[[/\d[\w\.]*/,'number'],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,'variable-2'],[/[\w\$]+/,'variable']],[[']',null]]],i,r)};if(e.match(/\-\>\w/,!1)){t.tokenize=s([[['->',null]],[[/[\w]+/,'variable']]],i,r)};return'variable-2'};var l=!1;while(!e.eol()&&(l||r===!1||(!e.match('{$',!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1)))){if(!l&&e.match(i)){t.tokenize=null;t.tokStack.pop();t.tokStack.pop();break};l=e.next()=='\\'&&!l};return'string'};var l='abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally',n='true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__',a='func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count';e.registerHelper('hintWords','php',[l,n,a].join(' ').split(' '));e.registerHelper('wordChars','php',/[\w$]/);var i={name:'clike',helperType:'php',keywords:t(l),blockKeywords:t('catch do else elseif for foreach if switch try while finally'),defKeywords:t('class function interface namespace trait'),atoms:t(n),builtin:t(a),multiLineStrings:!0,hooks:{'$':function(e){e.eatWhile(/[\w\$_]/);return'variable-2'},'<':function(e,t){var l;if(l=e.match(/<<\s*/)){var s=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var i=e.current().slice(l[0].length+(s?2:1));if(s)e.eat(s);if(i){(t.tokStack||(t.tokStack=[])).push(i,0);t.tokenize=r(i,s!='\'');return'string'}};return!1},'#':function(e){while(!e.eol()&&!e.match('?>',!1))e.next();return'comment'},'/':function(e){if(e.eat('/')){while(!e.eol()&&!e.match('?>',!1))e.next();return'comment'};return!1},'"':function(e,t){(t.tokStack||(t.tokStack=[])).push('"',0);t.tokenize=r('"');return'string'},'{':function(e,t){if(t.tokStack&&t.tokStack.length)t.tokStack[t.tokStack.length-1]++;return!1},'}':function(e,t){if(t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]){t.tokenize=r(t.tokStack[t.tokStack.length-2])};return!1}}};e.defineMode('php',function(t,r){var l=e.getMode(t,(r&&r.htmlMode)||'text/html'),s=e.getMode(t,i);function n(r,t){var c=t.curMode==s;if(r.sol()&&t.pending&&t.pending!='"'&&t.pending!='\'')t.pending=null;if(!c){if(r.match(/^<\?\w*/)){t.curMode=s;if(!t.php)t.php=e.startState(s,l.indent(t.html,''));t.curState=t.php;return'meta'};if(t.pending=='"'||t.pending=='\''){while(!r.eol()&&r.next()!=t.pending){};var i='string'} -else if(t.pending&&r.pos<t.pending.end){r.pos=t.pending.end;var i=t.pending.style} -else{var i=l.token(r,t.curState)};if(t.pending)t.pending=null;var n=r.current(),a=n.search(/<\?/),o;if(a!=-1){if(i=='string'&&(o=n.match(/['"]$/))&&!/\?>/.test(n))t.pending=o[0];else t.pending={end:r.pos,style:i};r.backUp(n.length-a)};return i} -else if(c&&t.php.tokenize==null&&r.match('?>')){t.curMode=l;t.curState=t.html;if(!t.php.context.prev)t.php=null;return'meta'} -else{return s.token(r,t.curState)}};return{startState:function(){var t=e.startState(l),i=r.startOpen?e.startState(s):null;return{html:t,php:i,curMode:r.startOpen?s:l,curState:r.startOpen?i:t,pending:null}},copyState:function(t){var o=t.html,i=e.copyState(l,o),n=t.php,a=n&&e.copyState(s,n),r;if(t.curMode==l)r=i;else r=a;return{html:i,php:a,curMode:t.curMode,curState:r,pending:t.pending}},token:n,indent:function(e,t){if((e.curMode!=s&&/^\s*<\//.test(t))||(e.curMode==s&&/^\?>/.test(t)))return l.indent(e.html,t);return e.curMode.indent(e.curState,t)},blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:'//',innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},'htmlmixed','clike');e.defineMIME('application/x-httpd-php','php');e.defineMIME('application/x-httpd-php-open',{name:'php',startOpen:!0});e.defineMIME('text/x-php',i)}); -/* ./modules/editor/codemirror/mode/cobol/cobol.min.js */(function(E){if(typeof exports=="object"&&typeof module=="object")E(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],E);else E(CodeMirror)})(function(E){"use strict";E.defineMode("cobol",function(){var C="builtin",L="comment",A="string",O="atom",D="number",S="keyword",U="header",e="def",P="link";function T(E){var I={},N=E.split(" ");for(var T=0;T<N.length;++T)I[N[T]]=!0;return I};var I=T("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES "),N=T("ACCEPT ACCESS ACQUIRE ADD ADDRESS ADVANCING AFTER ALIAS ALL ALPHABET ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALSO ALTER ALTERNATE AND ANY ARE AREA AREAS ARITHMETIC ASCENDING ASSIGN AT ATTRIBUTE AUTHOR AUTO AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP BEFORE BELL BINARY BIT BITS BLANK BLINK BLOCK BOOLEAN BOTTOM BY CALL CANCEL CD CF CH CHARACTER CHARACTERS CLASS CLOCK-UNITS CLOSE COBOL CODE CODE-SET COL COLLATING COLUMN COMMA COMMIT COMMITMENT COMMON COMMUNICATION COMP COMP-0 COMP-1 COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS CONVERTING COPY CORR CORRESPONDING COUNT CRT CRT-UNDER CURRENCY CURRENT CURSOR DATA DATE DATE-COMPILED DATE-WRITTEN DAY DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION DOWN DROP DUPLICATE DUPLICATES DYNAMIC EBCDIC EGI EJECT ELSE EMI EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT END-UNSTRING END-WRITE END-XML ENTER ENTRY ENVIRONMENT EOP EQUAL EQUALS ERASE ERROR ESI EVALUATE EVERY EXCEEDS EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL FILE-STREAM FILES FILLER FINAL FIND FINISH FIRST FOOTING FOR FOREGROUND-COLOR FOREGROUND-COLOUR FORMAT FREE FROM FULL FUNCTION GENERATE GET GIVING GLOBAL GO GOBACK GREATER GROUP HEADING HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL ID IDENTIFICATION IF IN INDEX INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED INDIC INDICATE INDICATOR INDICATORS INITIAL INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT INSTALLATION INTO INVALID INVOKE IS JUST JUSTIFIED KANJI KEEP KEY LABEL LAST LD LEADING LEFT LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE LOCALE LOCALLY LOCK MEMBER MEMORY MERGE MESSAGE METACLASS MODE MODIFIED MODIFY MODULES MOVE MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE NEXT NO NO-ECHO NONE NOT NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS OF OFF OMITTED ON ONLY OPEN OPTIONAL OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL PADDING PAGE PAGE-COUNTER PARSE PERFORM PF PH PIC PICTURE PLUS POINTER POSITION POSITIVE PREFIX PRESENT PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID PROMPT PROTECTED PURGE QUEUE QUOTE QUOTES RANDOM RD READ READY REALM RECEIVE RECONNECT RECORD RECORD-NAME RECORDS RECURSIVE REDEFINES REEL REFERENCE REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE REMAINDER REMOVAL RENAMES REPEATED REPLACE REPLACING REPORT REPORTING REPORTS REPOSITORY REQUIRED RERUN RESERVE RESET RETAINING RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO REVERSED REWIND REWRITE RF RH RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED RUN SAME SCREEN SD SEARCH SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT SELECT SEND SENTENCE SEPARATE SEQUENCE SEQUENTIAL SET SHARED SIGN SIZE SKIP1 SKIP2 SKIP3 SORT SORT-MERGE SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 START STARTING STATUS STOP STORE STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT TABLE TALLYING TAPE TENANT TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TITLE TO TOP TRAILING TRAILING-SIGN TRANSACTION TYPE TYPEDEF UNDERLINE UNEQUAL UNIT UNSTRING UNTIL UP UPDATE UPON USAGE USAGE-MODE USE USING VALID VALIDATE VALUE VALUES VARYING VLR WAIT WHEN WHEN-COMPILED WITH WITHIN WORDS WORKING-STORAGE WRITE XML XML-CODE XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL "),R=T("- * ** / + < <= = > >= "),E={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};function M(I,T){if(I==="0"&&T.eat(/x/i)){T.eatWhile(E.hex);return!0};if((I=="+"||I=="-")&&(E.digit.test(T.peek()))){T.eat(E.sign);I=T.next()};if(E.digit.test(I)){T.eat(I);T.eatWhile(E.digit);if("."==T.peek()){T.eat(".");T.eatWhile(E.digit)};if(T.eat(E.exponent)){T.eat(E.sign);T.eatWhile(E.digit)};return!0};return!1};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(T,n){if(n.indentStack==null&&T.sol()){n.indentation=6};if(T.eatSpace()){return null};var t=null;switch(n.mode){case"string":var r=!1;while((r=T.next())!=null){if(r=="\""||r=="'"){n.mode=!1;break}};t=A;break;default:var G=T.next();var i=T.column();if(i>=0&&i<=5){t=e} -else if(i>=72&&i<=79){T.skipToEnd();t=U} -else if(G=="*"&&i==6){T.skipToEnd();t=L} -else if(G=="\""||G=="'"){n.mode="string";t=A} -else if(G=="'"&&!(E.digit_or_colon.test(T.peek()))){t=O} -else if(G=="."){t=P} -else if(M(G,T)){t=D} -else{if(T.current().match(E.symbol)){while(i<71){if(T.eat(E.symbol)===undefined){break} -else{i++}}};if(N&&N.propertyIsEnumerable(T.current().toUpperCase())){t=S} -else if(R&&R.propertyIsEnumerable(T.current().toUpperCase())){t=C} -else if(I&&I.propertyIsEnumerable(T.current().toUpperCase())){t=O} -else t=null}};return t},indent:function(E){if(E.indentStack==null)return E.indentation;return E.indentStack.indent}}});E.defineMIME("text/x-cobol","cobol")}); -/* ./modules/editor/codemirror/mode/haskell/haskell.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("haskell",function(e,r){function a(e,r,t){r(t);return t(e,r)};var c=/[a-z_]/,d=/[A-Z]/,n=/\d/,m=/[0-9A-Fa-f]/,h=/[0-7]/,l=/[a-z_A-Z0-9'\xa1-\uffff]/,i=/[-!#$%&*+.\/<=>?@\\^|~:]/,p=/[(),;[\]`{}]/,u=/[ \t\v\f]/;function t(e,t){if(e.eatWhile(u)){return null};var r=e.next();if(p.test(r)){if(r=="{"&&e.eat("-")){var o="comment";if(e.eat("#")){o="meta"};return a(e,t,f(o,1))};return null};if(r=="'"){if(e.eat("\\")){e.next()} -else{e.next()};if(e.eat("'")){return"string"};return"string error"};if(r=="\""){return a(e,t,s)};if(d.test(r)){e.eatWhile(l);if(e.eat(".")){return"qualifier"};return"variable-2"};if(c.test(r)){e.eatWhile(l);return"variable"};if(n.test(r)){if(r=="0"){if(e.eat(/[xX]/)){e.eatWhile(m);return"integer"};if(e.eat(/[oO]/)){e.eatWhile(h);return"number"}};e.eatWhile(n);var o="number";if(e.match(/^\.\d+/)){o="number"};if(e.eat(/[eE]/)){o="number";e.eat(/[-+]/);e.eatWhile(n)};return o};if(r=="."&&e.eat("."))return"keyword";if(i.test(r)){if(r=="-"&&e.eat(/-/)){e.eatWhile(/-/);if(!e.eat(i)){e.skipToEnd();return"comment"}};var o="variable";if(r==":"){o="variable-2"};e.eatWhile(i);return o};return"error"};function f(e,r){if(r==0){return t};return function(n,i){var a=r;while(!n.eol()){var o=n.next();if(o=="{"&&n.eat("-")){++a} -else if(o=="-"&&n.eat("}")){--a;if(a==0){i(t);return e}}};i(f(e,a));return e}};function s(e,r){while(!e.eol()){var n=e.next();if(n=="\""){r(t);return"string"};if(n=="\\"){if(e.eol()||e.eat(u)){r(g);return"string"};if(e.eat("&")){} -else{e.next()}}};r(t);return"string error"};function g(e,r){if(e.eat("\\")){return a(e,r,s)};e.next();r(t);return"error"};var o=(function(){var i={};function e(e){return function(){for(var r=0;r<arguments.length;r++)i[arguments[r]]=e}};e("keyword")("case","class","data","default","deriving","do","else","foreign","if","import","in","infix","infixl","infixr","instance","let","module","newtype","of","then","type","where","_");e("keyword")("\.\.",":","::","=","\\","<-","->","@","~","=>");e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**");e("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True");e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var t=r.overrideKeywords;if(t)for(var n in t)if(t.hasOwnProperty(n))i[n]=t[n];return i})();return{startState:function(){return{f:t}},copyState:function(e){return{f:e.f}},token:function(e,r){var n=r.f(e,function(e){r.f=e}),t=e.current();return o.hasOwnProperty(t)?o[t]:n},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}});e.defineMIME("text/x-haskell","haskell")}); -/* ./modules/editor/codemirror/mode/mathematica/mathematica.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('mathematica',function(e,t){var n='[a-zA-Z\\$][a-zA-Z0-9\\$]*',o='(?:\\d+)',a='(?:\\.\\d+|\\d+\\.\\d*|\\d+)',m='(?:\\.\\w+|\\w+\\.\\w*|\\w+)',i='(?:`(?:`?'+a+')?)',c=new RegExp('(?:'+o+'(?:\\^\\^'+m+i+'?(?:\\*\\^[+-]?\\d+)?))'),f=new RegExp('(?:'+a+i+'?(?:\\*\\^[+-]?\\d+)?)'),u=new RegExp('(?:`?)(?:'+n+')(?:`(?:'+n+'))*(?:`?)');function r(e,t){var r;r=e.next();if(r==='"'){t.tokenize=z;return t.tokenize(e,t)};if(r==='('){if(e.eat('*')){t.commentLevel++;t.tokenize=l;return t.tokenize(e,t)}};e.backUp(1);if(e.match(c,!0,!1)){return'number'};if(e.match(f,!0,!1)){return'number'};if(e.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)){return'atom'};if(e.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/,!0,!1)){return'meta'};if(e.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)){return'string-2'};if(e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)){return'variable-2'};if(e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)){return'variable-2'};if(e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)){return'variable-2'};if(e.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)){return'variable-2'};if(e.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)){return'variable-3'};if(e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)){return'bracket'};if(e.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)){return'variable-2'};if(e.match(u,!0,!1)){return'keyword'};if(e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)){return'operator'};e.next();return'error'};function z(e,t){var a,i=!1,n=!1;while((a=e.next())!=null){if(a==='"'&&!n){i=!0;break};n=!n&&a==='\\'};if(i&&!n){t.tokenize=r};return'string'};function l(t,e){var a,n;while(e.commentLevel>0&&(n=t.next())!=null){if(a==='('&&n==='*')e.commentLevel++;if(a==='*'&&n===')')e.commentLevel--;a=n};if(e.commentLevel<=0){e.tokenize=r};return'comment'};return{startState:function(){return{tokenize:r,commentLevel:0}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)},blockCommentStart:'(*',blockCommentEnd:'*)'}});e.defineMIME('text/x-mathematica',{name:'mathematica'})}); -/* ./modules/editor/codemirror/mode/pug/pug.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../javascript/javascript'),require('../css/css'),require('../htmlmixed/htmlmixed'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../javascript/javascript','../css/css','../htmlmixed/htmlmixed'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('pug',function(e){var i='keyword',p='meta',l='builtin',h='qualifier',s={'{':'}','(':')','[':']'};var n=t.getMode(e,'javascript');function r(){this.javaScriptLine=!1;this.javaScriptLineExcludesColon=!1;this.javaScriptArguments=!1;this.javaScriptArgumentsDepth=0;this.isInterpolating=!1;this.interpolationNesting=0;this.jsState=t.startState(n);this.restOfLine='';this.isIncludeFiltered=!1;this.isEach=!1;this.lastTag='';this.scriptType='';this.isAttrs=!1;this.attrsNest=[];this.inAttributeName=!0;this.attributeIsType=!1;this.attrValue='';this.indentOf=Infinity;this.indentToken='';this.innerMode=null;this.innerState=null;this.innerModeForLine=!1};r.prototype.copy=function(){var e=new r();e.javaScriptLine=this.javaScriptLine;e.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon;e.javaScriptArguments=this.javaScriptArguments;e.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth;e.isInterpolating=this.isInterpolating;e.interpolationNesting=this.interpolationNesting;e.jsState=t.copyState(n,this.jsState);e.innerMode=this.innerMode;if(this.innerMode&&this.innerState){e.innerState=t.copyState(this.innerMode,this.innerState)};e.restOfLine=this.restOfLine;e.isIncludeFiltered=this.isIncludeFiltered;e.isEach=this.isEach;e.lastTag=this.lastTag;e.scriptType=this.scriptType;e.isAttrs=this.isAttrs;e.attrsNest=this.attrsNest.slice();e.inAttributeName=this.inAttributeName;e.attributeIsType=this.attributeIsType;e.attrValue=this.attrValue;e.indentOf=this.indentOf;e.indentToken=this.indentToken;e.innerModeForLine=this.innerModeForLine;return e};function d(t,e){if(t.sol()){e.javaScriptLine=!1;e.javaScriptLineExcludesColon=!1};if(e.javaScriptLine){if(e.javaScriptLineExcludesColon&&t.peek()===':'){e.javaScriptLine=!1;e.javaScriptLineExcludesColon=!1;return};var i=n.token(t,e.jsState);if(t.eol())e.javaScriptLine=!1;return i||!0}};function m(t,e){if(e.javaScriptArguments){if(e.javaScriptArgumentsDepth===0&&t.peek()!=='('){e.javaScriptArguments=!1;return};if(t.peek()==='('){e.javaScriptArgumentsDepth++} -else if(t.peek()===')'){e.javaScriptArgumentsDepth--};if(e.javaScriptArgumentsDepth===0){e.javaScriptArguments=!1;return};var i=n.token(t,e.jsState);return i||!0}};function v(t){if(t.match(/^yield\b/)){return'keyword'}};function S(t){if(t.match(/^(?:doctype) *([^\n]+)?/)){return p}};function c(t,e){if(t.match('#{')){e.isInterpolating=!0;e.interpolationNesting=0;return'punctuation'}};function g(t,e){if(e.isInterpolating){if(t.peek()==='}'){e.interpolationNesting--;if(e.interpolationNesting<0){t.next();e.isInterpolating=!1;return'punctuation'}} -else if(t.peek()==='{'){e.interpolationNesting++};return n.token(t,e.jsState)||!0}};function j(t,e){if(t.match(/^case\b/)){e.javaScriptLine=!0;return i}};function b(t,e){if(t.match(/^when\b/)){e.javaScriptLine=!0;e.javaScriptLineExcludesColon=!0;return i}};function L(t){if(t.match(/^default\b/)){return i}};function A(t,e){if(t.match(/^extends?\b/)){e.restOfLine='string';return i}};function y(t,e){if(t.match(/^append\b/)){e.restOfLine='variable';return i}};function k(t,e){if(t.match(/^prepend\b/)){e.restOfLine='variable';return i}};function M(t,e){if(t.match(/^block\b *(?:(prepend|append)\b)?/)){e.restOfLine='variable';return i}};function T(t,e){if(t.match(/^include\b/)){e.restOfLine='string';return i}};function x(t,e){if(t.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&t.match('include')){e.isIncludeFiltered=!0;return i}};function I(t,e){if(e.isIncludeFiltered){var i=u(t,e);e.isIncludeFiltered=!1;e.restOfLine='string';return i}};function N(t,e){if(t.match(/^mixin\b/)){e.javaScriptLine=!0;return i}};function O(t,e){if(t.match(/^\+([-\w]+)/)){if(!t.match(/^\( *[-\w]+ *=/,!1)){e.javaScriptArguments=!0;e.javaScriptArgumentsDepth=0};return'variable'};if(t.match(/^\+#{/,!1)){t.next();e.mixinCallAfter=!0;return c(t,e)}};function w(t,e){if(e.mixinCallAfter){e.mixinCallAfter=!1;if(!t.match(/^\( *[-\w]+ *=/,!1)){e.javaScriptArguments=!0;e.javaScriptArgumentsDepth=0};return!0}};function E(t,e){if(t.match(/^(if|unless|else if|else)\b/)){e.javaScriptLine=!0;return i}};function C(t,e){if(t.match(/^(- *)?(each|for)\b/)){e.isEach=!0;return i}};function F(t,e){if(e.isEach){if(t.match(/^ in\b/)){e.javaScriptLine=!0;e.isEach=!1;return i} -else if(t.sol()||t.eol()){e.isEach=!1} -else if(t.next()){while(!t.match(/^ in\b/,!1)&&t.next());return'variable'}}};function D(t,e){if(t.match(/^while\b/)){e.javaScriptLine=!0;return i}};function V(t,e){var i;if(i=t.match(/^(\w(?:[-:\w]*\w)?)\/?/)){e.lastTag=i[1].toLowerCase();if(e.lastTag==='script'){e.scriptType='application/javascript'};return'tag'}};function u(i,n){if(i.match(/^:([\w\-]+)/)){var r;if(e&&e.innerModes){r=e.innerModes(i.current().substring(1))};if(!r){r=i.current().substring(1)};if(typeof r==='string'){r=t.getMode(e,r)};a(i,n,r);return'atom'}};function q(t,e){if(t.match(/^(!?=|-)/)){e.javaScriptLine=!0;return'punctuation'}};function U(t){if(t.match(/^#([\w-]+)/)){return l}};function Z(t){if(t.match(/^\.([\w-]+)/)){return h}};function z(t,e){if(t.peek()=='('){t.next();e.isAttrs=!0;e.attrsNest=[];e.inAttributeName=!0;e.attrValue='';e.attributeIsType=!1;return'punctuation'}};function o(e,i){if(i.isAttrs){if(s[e.peek()]){i.attrsNest.push(s[e.peek()])};if(i.attrsNest[i.attrsNest.length-1]===e.peek()){i.attrsNest.pop()} -else if(e.eat(')')){i.isAttrs=!1;return'punctuation'};if(i.inAttributeName&&e.match(/^[^=,\)!]+/)){if(e.peek()==='='||e.peek()==='!'){i.inAttributeName=!1;i.jsState=t.startState(n);if(i.lastTag==='script'&&e.current().trim().toLowerCase()==='type'){i.attributeIsType=!0} -else{i.attributeIsType=!1}};return'attribute'};var r=n.token(e,i.jsState);if(i.attributeIsType&&r==='string'){i.scriptType=e.current().toString()};if(i.attrsNest.length===0&&(r==='string'||r==='variable'||r==='keyword')){try{Function('','var x '+i.attrValue.replace(/,\s*$/,'').replace(/^!/,''));i.inAttributeName=!0;i.attrValue='';e.backUp(e.current().length);return o(e,i)}catch(a){}};i.attrValue+=e.current();return r||!0}};function tt(t,e){if(t.match(/^&attributes\b/)){e.javaScriptArguments=!0;e.javaScriptArgumentsDepth=0;return'keyword'}};function et(t){if(t.sol()&&t.eatSpace()){return'indent'}};function it(t,e){if(t.match(/^ *\/\/(-)?([^\n]*)/)){e.indentOf=t.indentation();e.indentToken='comment';return'comment'}};function nt(t){if(t.match(/^: */)){return'colon'}};function rt(t,e){if(t.match(/^(?:\| ?| )([^\n]+)/)){return'string'};if(t.match(/^(<[^\n]*)/,!1)){a(t,e,'htmlmixed');e.innerModeForLine=!0;return f(t,e,!0)}};function at(t,e){if(t.eat('.')){var i=null;if(e.lastTag==='script'&&e.scriptType.toLowerCase().indexOf('javascript')!=-1){i=e.scriptType.toLowerCase().replace(/"|'/g,'')} -else if(e.lastTag==='style'){i='css'};a(t,e,i);return'dot'}};function st(t){t.next();return null};function a(i,n,r){r=t.mimeModes[r]||r;r=e.innerModes?e.innerModes(r)||r:r;r=t.mimeModes[r]||r;r=t.getMode(e,r);n.indentOf=i.indentation();if(r&&r.name!=='null'){n.innerMode=r} -else{n.indentToken='string'}};function f(e,i,n){if(e.indentation()>i.indentOf||(i.innerModeForLine&&!e.sol())||n){if(i.innerMode){if(!i.innerState){i.innerState=i.innerMode.startState?t.startState(i.innerMode,e.indentation()):{}};return e.hideFirstChars(i.indentOf+2,function(){return i.innerMode.token(e,i.innerState)||!0})} -else{e.skipToEnd();return i.indentToken}} -else if(e.sol()){i.indentOf=Infinity;i.indentToken=null;i.innerMode=null;i.innerState=null}};function ct(t,e){if(t.sol()){e.restOfLine=''};if(e.restOfLine){t.skipToEnd();var i=e.restOfLine;e.restOfLine='';return i}};function ut(){return new r()};function ot(t){return t.copy()};function ft(t,e){var i=f(t,e)||ct(t,e)||g(t,e)||I(t,e)||F(t,e)||o(t,e)||d(t,e)||m(t,e)||w(t,e)||v(t,e)||S(t,e)||c(t,e)||j(t,e)||b(t,e)||L(t,e)||A(t,e)||y(t,e)||k(t,e)||M(t,e)||T(t,e)||x(t,e)||N(t,e)||O(t,e)||E(t,e)||C(t,e)||D(t,e)||V(t,e)||u(t,e)||q(t,e)||U(t,e)||Z(t,e)||z(t,e)||tt(t,e)||et(t,e)||rt(t,e)||it(t,e)||nt(t,e)||at(t,e)||st(t,e);return i===!0?null:i};return{startState:ut,copyState:ot,token:ft}},'javascript','css','htmlmixed');t.defineMIME('text/x-pug','pug');t.defineMIME('text/x-jade','pug')}); -/* ./modules/editor/codemirror/mode/livescript/livescript.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('livescript',function(){var e=function(e,n){var g=n.next||'start';if(g){n.next=n.next;var i=t[g];if(i.splice){for(var o=0;o<i.length;++o){var r=i[o];if(r.regex&&e.match(r.regex)){n.next=r.next||n.next;return r.token}};e.next();return'error'};if(e.match(r=t[g])){if(r.regex&&e.match(r.regex)){n.next=r.next;return r.token} -else{e.next();return'error'}}};e.next();return'error'},r={startState:function(){return{next:'start',lastToken:{style:null,indent:0,content:''}}},token:function(t,r){while(t.pos==t.start)var n=e(t,r);r.lastToken={style:n,indent:t.indentation(),content:t.current()};return n.replace(/\./g,' ')},indent:function(e){var t=e.lastToken.indent;if(e.lastToken.content.match(l)){t+=2};return t}};return r});var g='(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*',l=RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*'+g+')?))\\s*$'),r='(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))',n={token:'string',regex:'.+'};var t={start:[{token:'comment.doc',regex:'/\\*',next:'comment'},{token:'comment',regex:'#.*'},{token:'keyword',regex:'(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)'+r},{token:'constant.language',regex:'(?:true|false|yes|no|on|off|null|void|undefined)'+r},{token:'invalid.illegal',regex:'(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)'+r},{token:'language.support.class',regex:'(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)'+r},{token:'language.support.function',regex:'(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)'+r},{token:'variable.language',regex:'(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)'+r},{token:'identifier',regex:g+'\\s*:(?![:=])'},{token:'variable',regex:g},{token:'keyword.operator',regex:'(?:\\.{3}|\\s+\\?)'},{token:'keyword.variable',regex:'(?:@+|::|\\.\\.)',next:'key'},{token:'keyword.operator',regex:'\\.\\s*',next:'key'},{token:'string',regex:'\\\\\\S[^\\s,;)}\\]]*'},{token:'string.doc',regex:'\'\'\'',next:'qdoc'},{token:'string.doc',regex:'"""',next:'qqdoc'},{token:'string',regex:'\'',next:'qstring'},{token:'string',regex:'"',next:'qqstring'},{token:'string',regex:'`',next:'js'},{token:'string',regex:'<\\[',next:'words'},{token:'string.regex',regex:'//',next:'heregex'},{token:'string.regex',regex:'\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',next:'key'},{token:'constant.numeric',regex:'(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'},{token:'lparen',regex:'[({[]'},{token:'rparen',regex:'[)}\\]]',next:'key'},{token:'keyword.operator',regex:'\\S+'},{token:'text',regex:'\\s+'}],heregex:[{token:'string.regex',regex:'.*?//[gimy$?]{0,4}',next:'start'},{token:'string.regex',regex:'\\s*#{'},{token:'comment.regex',regex:'\\s+(?:#.*)?'},{token:'string.regex',regex:'\\S+'}],key:[{token:'keyword.operator',regex:'[.?@!]+'},{token:'identifier',regex:g,next:'start'},{token:'text',regex:'',next:'start'}],comment:[{token:'comment.doc',regex:'.*?\\*/',next:'start'},{token:'comment.doc',regex:'.+'}],qdoc:[{token:'string',regex:'.*?\'\'\'',next:'key'},n],qqdoc:[{token:'string',regex:'.*?"""',next:'key'},n],qstring:[{token:'string',regex:'[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',next:'key'},n],qqstring:[{token:'string',regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:'key'},n],js:[{token:'string',regex:'[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',next:'key'},n],words:[{token:'string',regex:'.*?\\]>',next:'key'},n]};for(var s in t){var i=t[s];if(i.splice){for(var o=0,a=i.length;o<a;++o){var x=i[o];if(typeof x.regex==='string'){t[s][o].regex=new RegExp('^'+x.regex)}}} -else if(typeof x.regex==='string'){t[s].regex=new RegExp('^'+i.regex)}};e.defineMIME('text/x-livescript','livescript')}); -/* ./modules/editor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../yaml/yaml'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../yaml/yaml'],e);else e(CodeMirror)})(function(e){var n=0,r=1,t=2;e.defineMode('yaml-frontmatter',function(i,f){var o=e.getMode(i,'yaml'),a=e.getMode(i,f&&f.base||'gfm');function u(e){return e.state==t?a:o};return{startState:function(){return{state:n,inner:e.startState(o)}},copyState:function(t){return{state:t.state,inner:e.copyState(u(t),t.inner)}},token:function(i,f){if(f.state==n){if(i.match(/---/,!1)){f.state=r;return o.token(i,f.inner)} -else{f.state=t;f.inner=e.startState(a);return a.token(i,f.inner)}} -else if(f.state==r){var u=i.sol()&&i.match(/---/,!1),s=o.token(i,f.inner);if(u){f.state=t;f.inner=e.startState(a)};return s} -else{return a.token(i,f.inner)}},innerMode:function(e){return{mode:u(e),state:e.inner}},blankLine:function(e){var t=u(e);if(t.blankLine)return t.blankLine(e.inner)}}})}); -/* ./modules/editor/codemirror/mode/stylus/stylus.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('stylus',function(b){var z=b.indentUnit,E='',H=t(i),N=/^(a|b|i|s|col|em)$/i,I=t(o),T=t(l),ee=t(d),te=t(c),re=t(r),ie=f(r),ae=t(n),ne=t(a),oe=t(s),le=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,se=f(u),ce=t(m),A=new RegExp(/^\-(moz|ms|o|webkit)-/i),de=t(p),W='',w={},v,q,M,h;while(E.length<z)E+=' ';function ue(e,t){W=e.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/);t.context.line.firstWord=W?W[0].replace(/^\s*/,''):'';t.context.line.indent=e.indentation();v=e.peek();if(e.match('//')){e.skipToEnd();return['comment','comment']};if(e.match('/*')){t.tokenize=O;return O(e,t)};if(v=='"'||v=='\''){e.next();t.tokenize=R(v);return t.tokenize(e,t)};if(v=='@'){e.next();e.eatWhile(/[\w\\-]/);return['def',e.current()]};if(v=='#'){e.next();if(e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)){return['atom','atom']};if(e.match(/^[a-z][\w-]*/i)){return['builtin','hash']}};if(e.match(A)){return['meta','vendor-prefixes']};if(e.match(/^-?[0-9]?\.?[0-9]/)){e.eatWhile(/[a-z%]/i);return['number','unit']};if(v=='!'){e.next();return[e.match(/^(important|optional)/i)?'keyword':'operator','important']};if(v=='.'&&e.match(/^\.[a-z][\w-]*/i)){return['qualifier','qualifier']};if(e.match(ie)){if(e.peek()=='(')t.tokenize=me;return['property','word']};if(e.match(/^[a-z][\w-]*\(/i)){e.backUp(1);return['keyword','mixin']};if(e.match(/^(\+|-)[a-z][\w-]*\(/i)){e.backUp(1);return['keyword','block-mixin']};if(e.string.match(/^\s*&/)&&e.match(/^[-_]+[a-z][\w-]*/)){return['qualifier','qualifier']};if(e.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)){e.backUp(1);return['variable-3','reference']};if(e.match(/^&{1}\s*$/)){return['variable-3','reference']};if(e.match(se)){return['operator','operator']};if(e.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)){if(e.match(/^(\.|\[)[\w-'"\]]+/i,!1)){if(!x(e.current())){e.match(/\./);return['variable-2','variable-name']}};return['variable-2','word']};if(e.match(le)){return['operator',e.current()]};if(/[:;,{}\[\]\(\)]/.test(v)){e.next();return[null,v]};e.next();return[null,null]};function O(e,t){var i=!1,r;while((r=e.next())!=null){if(i&&r=='/'){t.tokenize=null;break};i=(r=='*')};return['comment','comment']};function R(e){return function(t,r){var i=!1,a;while((a=t.next())!=null){if(a==e&&!i){if(e==')')t.backUp(1);break};i=!i&&a=='\\'};if(a==e||!i&&e!=')')r.tokenize=null;return['string','string']}};function me(e,t){e.next();if(!e.match(/\s*["')]/,!1))t.tokenize=R(')');else t.tokenize=null;return[null,'(']};function S(e,t,r,i){this.type=e;this.indent=t;this.prev=r;this.line=i||{firstWord:'',indent:0}};function e(e,t,r,i){i=i>=0?i:z;e.context=new S(r,t.indentation()+i,e.context);return r};function j(e,t){var r=e.context.indent-z;t=t||!1;e.context=e.context.prev;if(t)e.context.indent=r;return e.context.type};function pe(e,t,r){return w[r.context.type](e,t,r)};function U(e,t,r,i){for(var a=i||1;a>0;a--)r.context=r.context.prev;return pe(e,t,r)};function x(e){return e.toLowerCase()in H};function C(e){e=e.toLowerCase();return e in I||e in oe};function B(e){return e.toLowerCase()in ce};function X(e){return e.toLowerCase().match(A)};function L(e){var r=e.toLowerCase(),t='variable-2';if(x(e))t='tag';else if(B(e))t='block-keyword';else if(C(e))t='property';else if(r in ee||r in de)t='atom';else if(r=='return'||r in te)t='keyword';else if(e.match(/^[A-Z]/))t='string';return t};function Y(e,t){return((k(t)&&(e=='{'||e==']'||e=='hash'||e=='qualifier'))||e=='block-mixin')};function Z(e,t){return e=='{'&&t.match(/^\s*\$?[\w-]+/i,!1)};function F(e,t){return e==':'&&t.match(/^[a-z-]+/,!1)};function P(e){return e.sol()||e.string.match(new RegExp('^\\s*'+g(e.current())))};function k(e){return e.eol()||e.match(/^\s*$/,!1)};function y(e){var t=/^\s*[-_]*[a-z0-9]+[\w-]*/i,r=typeof e=='string'?e.match(t):e.string.match(t);return r?r[0].replace(/^\s*/,''):''};w.block=function(r,t,i){if((r=='comment'&&P(t))||(r==','&&k(t))||r=='mixin'){return e(i,t,'block',0)};if(Z(r,t)){return e(i,t,'interpolation')};if(k(t)&&r==']'){if(!/^\s*(\.|#|:|\[|\*|&)/.test(t.string)&&!x(y(t))){return e(i,t,'block',0)}};if(Y(r,t)){return e(i,t,'block')};if(r=='}'&&k(t)){return e(i,t,'block',0)};if(r=='variable-name'){if(t.string.match(/^\s?\$[\w-\.\[\]'"]+$/)||B(y(t))){return e(i,t,'variableName')} -else{return e(i,t,'variableName',0)}};if(r=='='){if(!k(t)&&!B(y(t))){return e(i,t,'block',0)};return e(i,t,'block')};if(r=='*'){if(k(t)||t.match(/\s*(,|\.|#|\[|:|{)/,!1)){h='tag';return e(i,t,'block')}};if(F(r,t)){return e(i,t,'pseudo')};if(/@(font-face|media|supports|(-moz-)?document)/.test(r)){return e(i,t,k(t)?'block':'atBlock')};if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(r)){return e(i,t,'keyframes')};if(/@extends?/.test(r)){return e(i,t,'extend',0)};if(r&&r.charAt(0)=='@'){if(t.indentation()>0&&C(t.current().slice(1))){h='variable-2';return'block'};if(/(@import|@require|@charset)/.test(r)){return e(i,t,'block',0)};return e(i,t,'block')};if(r=='reference'&&k(t)){return e(i,t,'block')};if(r=='('){return e(i,t,'parens')};if(r=='vendor-prefixes'){return e(i,t,'vendorPrefixes')};if(r=='word'){var a=t.current();h=L(a);if(h=='property'){if(P(t)){return e(i,t,'block',0)} -else{h='atom';return'block'}};if(h=='tag'){if(/embed|menu|pre|progress|sub|table/.test(a)){if(C(y(t))){h='atom';return'block'}};if(t.string.match(new RegExp('\\[\\s*'+a+'|'+a+'\\s*\\]'))){h='atom';return'block'};if(N.test(a)){if((P(t)&&t.string.match(/=/))||(!P(t)&&!t.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!x(y(t)))){h='variable-2';if(B(y(t)))return'block';return e(i,t,'block',0)}};if(k(t))return e(i,t,'block')};if(h=='block-keyword'){h='keyword';if(t.current(/(if|unless)/)&&!P(t)){return'block'};return e(i,t,'block')};if(a=='return')return e(i,t,'block',0);if(h=='variable-2'&&t.string.match(/^\s?\$[\w-\.\[\]'"]+$/)){return e(i,t,'block')}};return i.context.type};w.parens=function(t,r,i){if(t=='(')return e(i,r,'parens');if(t==')'){if(i.context.prev.type=='parens'){return j(i)};if((r.string.match(/^[a-z][\w-]*\(/i)&&k(r))||B(y(r))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(y(r))||(!r.string.match(/^-?[a-z][\w-\.\[\]'"]*\s*=/)&&x(y(r)))){return e(i,r,'block')};if(r.string.match(/^[\$-]?[a-z][\w-\.\[\]'"]*\s*=/)||r.string.match(/^\s*(\(|\)|[0-9])/)||r.string.match(/^\s+[a-z][\w-]*\(/i)||r.string.match(/^\s+[\$-]?[a-z]/i)){return e(i,r,'block',0)};if(k(r))return e(i,r,'block');else return e(i,r,'block',0)};if(t&&t.charAt(0)=='@'&&C(r.current().slice(1))){h='variable-2'};if(t=='word'){var a=r.current();h=L(a);if(h=='tag'&&N.test(a)){h='variable-2'};if(h=='property'||a=='to')h='atom'};if(t=='variable-name'){return e(i,r,'variableName')};if(F(t,r)){return e(i,r,'pseudo')};return i.context.type};w.vendorPrefixes=function(t,r,i){if(t=='word'){h='property';return e(i,r,'block',0)};return j(i)};w.pseudo=function(t,r,i){if(!C(y(r.string))){r.match(/^[a-z-]+/);h='variable-3';if(k(r))return e(i,r,'block');return j(i)};return U(t,r,i)};w.atBlock=function(t,r,i){if(t=='(')return e(i,r,'atBlock_parens');if(Y(t,r)){return e(i,r,'block')};if(Z(t,r)){return e(i,r,'interpolation')};if(t=='word'){var a=r.current().toLowerCase();if(/^(only|not|and|or)$/.test(a))h='keyword';else if(re.hasOwnProperty(a))h='tag';else if(ne.hasOwnProperty(a))h='attribute';else if(ae.hasOwnProperty(a))h='property';else if(T.hasOwnProperty(a))h='string-2';else h=L(r.current());if(h=='tag'&&k(r)){return e(i,r,'block')}};if(t=='operator'&&/^(not|and|or)$/.test(r.current())){h='keyword'};return i.context.type};w.atBlock_parens=function(t,r,i){if(t=='{'||t=='}')return i.context.type;if(t==')'){if(k(r))return e(i,r,'block');else return e(i,r,'atBlock')};if(t=='word'){var a=r.current().toLowerCase();h=L(a);if(/^(max|min)/.test(a))h='property';if(h=='tag'){N.test(a)?h='variable-2':h='atom'};return i.context.type};return w.atBlock(t,r,i)};w.keyframes=function(t,r,i){if(r.indentation()=='0'&&((t=='}'&&P(r))||t==']'||t=='hash'||t=='qualifier'||x(r.current()))){return U(t,r,i)};if(t=='{')return e(i,r,'keyframes');if(t=='}'){if(P(r))return j(i,!0);else return e(i,r,'keyframes')};if(t=='unit'&&/^[0-9]+\%$/.test(r.current())){return e(i,r,'keyframes')};if(t=='word'){h=L(r.current());if(h=='block-keyword'){h='keyword';return e(i,r,'keyframes')}};if(/@(font-face|media|supports|(-moz-)?document)/.test(t)){return e(i,r,k(r)?'block':'atBlock')};if(t=='mixin'){return e(i,r,'block',0)};return i.context.type};w.interpolation=function(t,r,i){if(t=='{')j(i)&&e(i,r,'block');if(t=='}'){if(r.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||(r.string.match(/^\s*[a-z]/i)&&x(y(r)))){return e(i,r,'block')};if(!r.string.match(/^(\{|\s*\&)/)||r.match(/\s*[\w-]/,!1)){return e(i,r,'block',0)};return e(i,r,'block')};if(t=='variable-name'){return e(i,r,'variableName',0)};if(t=='word'){h=L(r.current());if(h=='tag')h='atom'};return i.context.type};w.extend=function(e,t,r){if(e=='['||e=='=')return'extend';if(e==']')return j(r);if(e=='word'){h=L(t.current());return'extend'};return j(r)};w.variableName=function(e,t,r){if(e=='string'||e=='['||e==']'||t.current().match(/^(\.|\$)/)){if(t.current().match(/^\.[\w-]+/i))h='variable-2';return'variableName'};return U(e,t,r)};return{startState:function(e){return{tokenize:null,state:'block',context:new S('block',e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;q=(t.tokenize||ue)(e,t);if(q&&typeof q=='object'){M=q[1];q=q[0]};h=q;t.state=w[t.state](M,e,t);return h},indent:function(e,t,r){var l=e.context,s=t&&t.charAt(0),n=l.indent,c=y(t),o=r.match(/^\s*/)[0].replace(/\t/g,E).length,i=e.context.prev?e.context.prev.line.firstWord:'',a=e.context.prev?e.context.prev.line.indent:o;if(l.prev&&(s=='}'&&(l.type=='block'||l.type=='atBlock'||l.type=='keyframes')||s==')'&&(l.type=='parens'||l.type=='atBlock_parens')||s=='{'&&(l.type=='at'))){n=l.indent-z} -else if(!(/(\})/.test(s))){if(/@|\$|\d/.test(s)||/^\{/.test(t)||/^\s*\/(\/|\*)/.test(t)||/^\s*\/\*/.test(i)||/^\s*[\w-\.\[\]'"]+\s*(\?|:|\+)?=/i.test(t)||/^(\+|-)?[a-z][\w-]*\(/i.test(t)||/^return/.test(t)||B(c)){n=o} -else if(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(s)||x(c)){if(/\,\s*$/.test(i)){n=a} -else if(/^\s+/.test(r)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||x(i))){n=o<=a?a:a+z} -else{n=o}} -else if(!/,\s*$/.test(r)&&(X(c)||C(c))){if(B(i)){n=o<=a?a:a+z} -else if(/^\{/.test(i)){n=o<=a?o:a+z} -else if(X(i)||C(i)){n=o>=a?a:o} -else if(/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(i)||/=\s*$/.test(i)||x(i)||/^\$[\w-\.\[\]'"]/.test(i)){n=a+z} -else{n=o}}};return n},electricChars:'}',lineComment:'//',fold:'indent'}});var i=['a','abbr','address','area','article','aside','audio','b','base','bdi','bdo','bgsound','blockquote','body','br','button','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','keygen','label','legend','li','link','main','map','mark','marquee','menu','menuitem','meta','meter','nav','nobr','noframes','noscript','object','ol','optgroup','option','output','p','param','pre','progress','q','rp','rt','ruby','s','samp','script','section','select','small','source','span','strong','style','sub','summary','sup','table','tbody','td','textarea','tfoot','th','thead','time','tr','track','u','ul','var','video'],r=['domain','regexp','url','url-prefix'],a=['all','aural','braille','handheld','print','projection','screen','tty','tv','embossed'],n=['width','min-width','max-width','height','min-height','max-height','device-width','min-device-width','max-device-width','device-height','min-device-height','max-device-height','aspect-ratio','min-aspect-ratio','max-aspect-ratio','device-aspect-ratio','min-device-aspect-ratio','max-device-aspect-ratio','color','min-color','max-color','color-index','min-color-index','max-color-index','monochrome','min-monochrome','max-monochrome','resolution','min-resolution','max-resolution','scan','grid'],o=['align-content','align-items','align-self','alignment-adjust','alignment-baseline','anchor-point','animation','animation-delay','animation-direction','animation-duration','animation-fill-mode','animation-iteration-count','animation-name','animation-play-state','animation-timing-function','appearance','azimuth','backface-visibility','background','background-attachment','background-clip','background-color','background-image','background-origin','background-position','background-repeat','background-size','baseline-shift','binding','bleed','bookmark-label','bookmark-level','bookmark-state','bookmark-target','border','border-bottom','border-bottom-color','border-bottom-left-radius','border-bottom-right-radius','border-bottom-style','border-bottom-width','border-collapse','border-color','border-image','border-image-outset','border-image-repeat','border-image-slice','border-image-source','border-image-width','border-left','border-left-color','border-left-style','border-left-width','border-radius','border-right','border-right-color','border-right-style','border-right-width','border-spacing','border-style','border-top','border-top-color','border-top-left-radius','border-top-right-radius','border-top-style','border-top-width','border-width','bottom','box-decoration-break','box-shadow','box-sizing','break-after','break-before','break-inside','caption-side','clear','clip','color','color-profile','column-count','column-fill','column-gap','column-rule','column-rule-color','column-rule-style','column-rule-width','column-span','column-width','columns','content','counter-increment','counter-reset','crop','cue','cue-after','cue-before','cursor','direction','display','dominant-baseline','drop-initial-after-adjust','drop-initial-after-align','drop-initial-before-adjust','drop-initial-before-align','drop-initial-size','drop-initial-value','elevation','empty-cells','fit','fit-position','flex','flex-basis','flex-direction','flex-flow','flex-grow','flex-shrink','flex-wrap','float','float-offset','flow-from','flow-into','font','font-feature-settings','font-family','font-kerning','font-language-override','font-size','font-size-adjust','font-stretch','font-style','font-synthesis','font-variant','font-variant-alternates','font-variant-caps','font-variant-east-asian','font-variant-ligatures','font-variant-numeric','font-variant-position','font-weight','grid','grid-area','grid-auto-columns','grid-auto-flow','grid-auto-position','grid-auto-rows','grid-column','grid-column-end','grid-column-start','grid-row','grid-row-end','grid-row-start','grid-template','grid-template-areas','grid-template-columns','grid-template-rows','hanging-punctuation','height','hyphens','icon','image-orientation','image-rendering','image-resolution','inline-box-align','justify-content','left','letter-spacing','line-break','line-height','line-stacking','line-stacking-ruby','line-stacking-shift','line-stacking-strategy','list-style','list-style-image','list-style-position','list-style-type','margin','margin-bottom','margin-left','margin-right','margin-top','marker-offset','marks','marquee-direction','marquee-loop','marquee-play-count','marquee-speed','marquee-style','max-height','max-width','min-height','min-width','move-to','nav-down','nav-index','nav-left','nav-right','nav-up','object-fit','object-position','opacity','order','orphans','outline','outline-color','outline-offset','outline-style','outline-width','overflow','overflow-style','overflow-wrap','overflow-x','overflow-y','padding','padding-bottom','padding-left','padding-right','padding-top','page','page-break-after','page-break-before','page-break-inside','page-policy','pause','pause-after','pause-before','perspective','perspective-origin','pitch','pitch-range','play-during','position','presentation-level','punctuation-trim','quotes','region-break-after','region-break-before','region-break-inside','region-fragment','rendering-intent','resize','rest','rest-after','rest-before','richness','right','rotation','rotation-point','ruby-align','ruby-overhang','ruby-position','ruby-span','shape-image-threshold','shape-inside','shape-margin','shape-outside','size','speak','speak-as','speak-header','speak-numeral','speak-punctuation','speech-rate','stress','string-set','tab-size','table-layout','target','target-name','target-new','target-position','text-align','text-align-last','text-decoration','text-decoration-color','text-decoration-line','text-decoration-skip','text-decoration-style','text-emphasis','text-emphasis-color','text-emphasis-position','text-emphasis-style','text-height','text-indent','text-justify','text-outline','text-overflow','text-shadow','text-size-adjust','text-space-collapse','text-transform','text-underline-position','text-wrap','top','transform','transform-origin','transform-style','transition','transition-delay','transition-duration','transition-property','transition-timing-function','unicode-bidi','vertical-align','visibility','voice-balance','voice-duration','voice-family','voice-pitch','voice-range','voice-rate','voice-stress','voice-volume','volume','white-space','widows','width','will-change','word-break','word-spacing','word-wrap','z-index','clip-path','clip-rule','mask','enable-background','filter','flood-color','flood-opacity','lighting-color','stop-color','stop-opacity','pointer-events','color-interpolation','color-interpolation-filters','color-rendering','fill','fill-opacity','fill-rule','image-rendering','marker','marker-end','marker-mid','marker-start','shape-rendering','stroke','stroke-dasharray','stroke-dashoffset','stroke-linecap','stroke-linejoin','stroke-miterlimit','stroke-opacity','stroke-width','text-rendering','baseline-shift','dominant-baseline','glyph-orientation-horizontal','glyph-orientation-vertical','text-anchor','writing-mode','font-smoothing','osx-font-smoothing'],l=['scrollbar-arrow-color','scrollbar-base-color','scrollbar-dark-shadow-color','scrollbar-face-color','scrollbar-highlight-color','scrollbar-shadow-color','scrollbar-3d-light-color','scrollbar-track-color','shape-inside','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','zoom'],s=['font-family','src','unicode-range','font-variant','font-feature-settings','font-stretch','font-weight','font-style'],c=['aliceblue','antiquewhite','aqua','aquamarine','azure','beige','bisque','black','blanchedalmond','blue','blueviolet','brown','burlywood','cadetblue','chartreuse','chocolate','coral','cornflowerblue','cornsilk','crimson','cyan','darkblue','darkcyan','darkgoldenrod','darkgray','darkgreen','darkkhaki','darkmagenta','darkolivegreen','darkorange','darkorchid','darkred','darksalmon','darkseagreen','darkslateblue','darkslategray','darkturquoise','darkviolet','deeppink','deepskyblue','dimgray','dodgerblue','firebrick','floralwhite','forestgreen','fuchsia','gainsboro','ghostwhite','gold','goldenrod','gray','grey','green','greenyellow','honeydew','hotpink','indianred','indigo','ivory','khaki','lavender','lavenderblush','lawngreen','lemonchiffon','lightblue','lightcoral','lightcyan','lightgoldenrodyellow','lightgray','lightgreen','lightpink','lightsalmon','lightseagreen','lightskyblue','lightslategray','lightsteelblue','lightyellow','lime','limegreen','linen','magenta','maroon','mediumaquamarine','mediumblue','mediumorchid','mediumpurple','mediumseagreen','mediumslateblue','mediumspringgreen','mediumturquoise','mediumvioletred','midnightblue','mintcream','mistyrose','moccasin','navajowhite','navy','oldlace','olive','olivedrab','orange','orangered','orchid','palegoldenrod','palegreen','paleturquoise','palevioletred','papayawhip','peachpuff','peru','pink','plum','powderblue','purple','rebeccapurple','red','rosybrown','royalblue','saddlebrown','salmon','sandybrown','seagreen','seashell','sienna','silver','skyblue','slateblue','slategray','snow','springgreen','steelblue','tan','teal','thistle','tomato','turquoise','violet','wheat','white','whitesmoke','yellow','yellowgreen'],d=['above','absolute','activeborder','additive','activecaption','afar','after-white-space','ahead','alias','all','all-scroll','alphabetic','alternate','always','amharic','amharic-abegede','antialiased','appworkspace','arabic-indic','armenian','asterisks','attr','auto','avoid','avoid-column','avoid-page','avoid-region','background','backwards','baseline','below','bidi-override','binary','bengali','blink','block','block-axis','bold','bolder','border','border-box','both','bottom','break','break-all','break-word','bullets','button','button-bevel','buttonface','buttonhighlight','buttonshadow','buttontext','calc','cambodian','capitalize','caps-lock-indicator','caption','captiontext','caret','cell','center','checkbox','circle','cjk-decimal','cjk-earthly-branch','cjk-heavenly-stem','cjk-ideographic','clear','clip','close-quote','col-resize','collapse','column','compact','condensed','contain','content','contents','content-box','context-menu','continuous','copy','counter','counters','cover','crop','cross','crosshair','currentcolor','cursive','cyclic','dashed','decimal','decimal-leading-zero','default','default-button','destination-atop','destination-in','destination-out','destination-over','devanagari','disc','discard','disclosure-closed','disclosure-open','document','dot-dash','dot-dot-dash','dotted','double','down','e-resize','ease','ease-in','ease-in-out','ease-out','element','ellipse','ellipsis','embed','end','ethiopic','ethiopic-abegede','ethiopic-abegede-am-et','ethiopic-abegede-gez','ethiopic-abegede-ti-er','ethiopic-abegede-ti-et','ethiopic-halehame-aa-er','ethiopic-halehame-aa-et','ethiopic-halehame-am-et','ethiopic-halehame-gez','ethiopic-halehame-om-et','ethiopic-halehame-sid-et','ethiopic-halehame-so-et','ethiopic-halehame-ti-er','ethiopic-halehame-ti-et','ethiopic-halehame-tig','ethiopic-numeric','ew-resize','expanded','extends','extra-condensed','extra-expanded','fantasy','fast','fill','fixed','flat','flex','footnotes','forwards','from','geometricPrecision','georgian','graytext','groove','gujarati','gurmukhi','hand','hangul','hangul-consonant','hebrew','help','hidden','hide','higher','highlight','highlighttext','hiragana','hiragana-iroha','horizontal','hsl','hsla','icon','ignore','inactiveborder','inactivecaption','inactivecaptiontext','infinite','infobackground','infotext','inherit','initial','inline','inline-axis','inline-block','inline-flex','inline-table','inset','inside','intrinsic','invert','italic','japanese-formal','japanese-informal','justify','kannada','katakana','katakana-iroha','keep-all','khmer','korean-hangul-formal','korean-hanja-formal','korean-hanja-informal','landscape','lao','large','larger','left','level','lighter','line-through','linear','linear-gradient','lines','list-item','listbox','listitem','local','logical','loud','lower','lower-alpha','lower-armenian','lower-greek','lower-hexadecimal','lower-latin','lower-norwegian','lower-roman','lowercase','ltr','malayalam','match','matrix','matrix3d','media-controls-background','media-current-time-display','media-fullscreen-button','media-mute-button','media-play-button','media-return-to-realtime-button','media-rewind-button','media-seek-back-button','media-seek-forward-button','media-slider','media-sliderthumb','media-time-remaining-display','media-volume-slider','media-volume-slider-container','media-volume-sliderthumb','medium','menu','menulist','menulist-button','menulist-text','menulist-textfield','menutext','message-box','middle','min-intrinsic','mix','mongolian','monospace','move','multiple','myanmar','n-resize','narrower','ne-resize','nesw-resize','no-close-quote','no-drop','no-open-quote','no-repeat','none','normal','not-allowed','nowrap','ns-resize','numbers','numeric','nw-resize','nwse-resize','oblique','octal','open-quote','optimizeLegibility','optimizeSpeed','oriya','oromo','outset','outside','outside-shape','overlay','overline','padding','padding-box','painted','page','paused','persian','perspective','plus-darker','plus-lighter','pointer','polygon','portrait','pre','pre-line','pre-wrap','preserve-3d','progress','push-button','radial-gradient','radio','read-only','read-write','read-write-plaintext-only','rectangle','region','relative','repeat','repeating-linear-gradient','repeating-radial-gradient','repeat-x','repeat-y','reset','reverse','rgb','rgba','ridge','right','rotate','rotate3d','rotateX','rotateY','rotateZ','round','row-resize','rtl','run-in','running','s-resize','sans-serif','scale','scale3d','scaleX','scaleY','scaleZ','scroll','scrollbar','scroll-position','se-resize','searchfield','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','semi-condensed','semi-expanded','separate','serif','show','sidama','simp-chinese-formal','simp-chinese-informal','single','skew','skewX','skewY','skip-white-space','slide','slider-horizontal','slider-vertical','sliderthumb-horizontal','sliderthumb-vertical','slow','small','small-caps','small-caption','smaller','solid','somali','source-atop','source-in','source-out','source-over','space','spell-out','square','square-button','start','static','status-bar','stretch','stroke','sub','subpixel-antialiased','super','sw-resize','symbolic','symbols','table','table-caption','table-cell','table-column','table-column-group','table-footer-group','table-header-group','table-row','table-row-group','tamil','telugu','text','text-bottom','text-top','textarea','textfield','thai','thick','thin','threeddarkshadow','threedface','threedhighlight','threedlightshadow','threedshadow','tibetan','tigre','tigrinya-er','tigrinya-er-abegede','tigrinya-et','tigrinya-et-abegede','to','top','trad-chinese-formal','trad-chinese-informal','translate','translate3d','translateX','translateY','translateZ','transparent','ultra-condensed','ultra-expanded','underline','up','upper-alpha','upper-armenian','upper-greek','upper-hexadecimal','upper-latin','upper-norwegian','upper-roman','uppercase','urdu','url','var','vertical','vertical-text','visible','visibleFill','visiblePainted','visibleStroke','visual','w-resize','wait','wave','wider','window','windowframe','windowtext','words','x-large','x-small','xor','xx-large','xx-small','bicubic','optimizespeed','grayscale','row','row-reverse','wrap','wrap-reverse','column-reverse','flex-start','flex-end','space-between','space-around','unset'],u=['in','and','or','not','is not','is a','is','isnt','defined','if unless'],m=['for','if','else','unless','from','to'],p=['null','true','false','href','title','type','not-allowed','readonly','disabled'],h=['@font-face','@keyframes','@media','@viewport','@page','@host','@supports','@block','@css'],b=i.concat(r,a,n,o,l,c,d,s,u,m,p,h);function f(e){e=e.sort(function(e,t){return t>e});return new RegExp('^(('+e.join(')|(')+'))\\b')};function t(e){var r={};for(var t=0;t<e.length;++t)r[e[t]]=!0;return r};function g(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,'\\$&')};e.registerHelper('hintWords','stylus',b);e.defineMIME('text/x-styl','stylus')}); -/* ./modules/editor/codemirror/mode/markdown/markdown.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../xml/xml'),require('../meta'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../xml/xml','../meta'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('markdown',function(r,e){var o=t.getMode(r,'text/html'),E=o.name=='null';function w(e){if(t.findModeByName){var i=t.findModeByName(e);if(i)e=i.mime||i.mimes[0]};var n=t.getMode(r,e);return n.name=='null'?null:n};if(e.highlightFormatting===undefined)e.highlightFormatting=!1;if(e.maxBlockquoteDepth===undefined)e.maxBlockquoteDepth=0;if(e.taskLists===undefined)e.taskLists=!1;if(e.strikethrough===undefined)e.strikethrough=!1;if(e.emoji===undefined)e.emoji=!1;if(e.fencedCodeBlockHighlighting===undefined)e.fencedCodeBlockHighlighting=!0;if(e.xml===undefined)e.xml=!0;if(e.tokenTypeOverrides===undefined)e.tokenTypeOverrides={};var i={header:'header',code:'comment',quote:'quote',list1:'variable-2',list2:'variable-3',list3:'keyword',hr:'hr',image:'image',imageAltText:'image-alt-text',imageMarker:'image-marker',formatting:'formatting',linkInline:'link',linkEmail:'link',linkText:'link',linkHref:'string',em:'em',strong:'strong',strikethrough:'strikethrough',emoji:'builtin'};for(var h in i){if(i.hasOwnProperty(h)&&e.tokenTypeOverrides[h]){i[h]=e.tokenTypeOverrides[h]}};var x=/^([*\-_])(?:\s*\1){2,}\s*$/,v=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,L=e.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ *(?:\={1,}|-{1,})\s*$/,q=/^[^#!\[\]*_\\<>` "'(~:]+/,M=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,F=/^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/,l=/[!"#$%&'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/,b=' ';function g(t,e,i){e.f=e.inline=i;return i(t,e)};function d(t,e,i){e.f=e.block=i;return i(t,e)};function y(t){return!t||!/\S/.test(t.string)};function c(t){t.linkTitle=!1;t.em=!1;t.strong=!1;t.strikethrough=!1;t.quote=0;t.indentedCode=!1;if(t.f==s){t.f=a;t.block=f};t.trailingSpace=0;t.trailingSpaceNewLine=!1;t.prevLine=t.thisLine;t.thisLine={stream:null};return null};function f(a,r){var f=a.column()===r.indentation,u=y(r.prevLine.stream),c=r.indentedCode,k=r.prevLine.hr,d=r.list!==!1,o=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var h=r.indentation;if(r.indentationDiff===null){r.indentationDiff=r.indentation;if(d){r.list=null;while(h<r.listStack[r.listStack.length-1]){r.listStack.pop();if(r.listStack.length){r.indentation=r.listStack[r.listStack.length-1]} -else{r.list=!1}};if(r.list!==!1){r.indentationDiff=h-r.listStack[r.listStack.length-1]}}};var S=(!u&&!k&&!r.prevLine.header&&(!d||!c)&&!r.prevLine.fencedCodeEnd),s=(r.list===!1||k||u)&&r.indentation<=o&&a.match(x),l=null;if(r.indentationDiff>=4&&(c||r.prevLine.fencedCodeEnd||r.prevLine.header||u)){a.skipToEnd();r.indentedCode=!0;return i.code} -else if(a.eatSpace()){return null} -else if(f&&r.indentation<=o&&(l=a.match(L))&&l[1].length<=6){r.quote=0;r.header=l[1].length;r.thisLine.header=!0;if(e.highlightFormatting)r.formatting='header';r.f=r.inline;return n(r)} -else if(r.indentation<=o&&a.eat('>')){r.quote=f?1:r.quote+1;if(e.highlightFormatting)r.formatting='quote';a.eatSpace();return n(r)} -else if(!s&&!r.setext&&f&&r.indentation<=o&&(l=a.match(v))){var p=l[1]?'ol':'ul';r.indentation=h+a.current().length;r.list=!0;r.quote=0;r.listStack.push(r.indentation);if(e.taskLists&&a.match(m,!1)){r.taskList=!0};r.f=r.inline;if(e.highlightFormatting)r.formatting=['list','list-'+p];return n(r)} -else if(f&&r.indentation<=o&&(l=a.match(M,!0))){r.quote=0;r.fencedEndRE=new RegExp(l[1]+'+ *$');r.localMode=e.fencedCodeBlockHighlighting&&w(l[2]);if(r.localMode)r.localState=t.startState(r.localMode);r.f=r.block=j;if(e.highlightFormatting)r.formatting='code-block';r.code=-1;return n(r)} -else if(r.setext||((!S||!d)&&!r.quote&&r.list===!1&&!r.code&&!s&&!F.test(a.string)&&(l=a.lookAhead(1))&&(l=l.match(T)))){if(!r.setext){r.header=l[0].charAt(0)=='='?1:2;r.setext=r.header} -else{r.header=r.setext;r.setext=0;a.skipToEnd();if(e.highlightFormatting)r.formatting='header'};r.thisLine.header=!0;r.f=r.inline;return n(r)} -else if(s){a.skipToEnd();r.hr=!0;r.thisLine.hr=!0;return i.hr} -else if(a.peek()==='['){return g(a,r,H)};return g(a,r,r.inline)};function s(e,i){var r=o.token(e,i.htmlState);if(!E){var n=t.innerMode(o,i.htmlState);if((n.mode.name=='xml'&&n.state.tagStart===null&&(!n.state.context&&n.state.tokenize.isInText))||(i.md_inside&&e.current().indexOf('>')>-1)){i.f=a;i.block=f;i.htmlState=null}};return r};function j(r,t){var s=t.listStack[t.listStack.length-1]||0,l=t.indentation<s,h=s+3;if(t.fencedEndRE&&t.indentation<=h&&(l||r.match(t.fencedEndRE))){if(e.highlightFormatting)t.formatting='code-block';var o;if(!l)o=n(t);t.localMode=t.localState=null;t.block=f;t.f=a;t.fencedEndRE=null;t.code=0;t.thisLine.fencedCodeEnd=!0;if(l)return d(r,t,t.block);return o} -else if(t.localMode){return t.localMode.token(r,t.localState)} -else{r.skipToEnd();return i.code}};function n(t){var n=[];if(t.formatting){n.push(i.formatting);if(typeof t.formatting==='string')t.formatting=[t.formatting];for(var r=0;r<t.formatting.length;r++){n.push(i.formatting+'-'+t.formatting[r]);if(t.formatting[r]==='header'){n.push(i.formatting+'-'+t.formatting[r]+'-'+t.header)};if(t.formatting[r]==='quote'){if(!e.maxBlockquoteDepth||e.maxBlockquoteDepth>=t.quote){n.push(i.formatting+'-'+t.formatting[r]+'-'+t.quote)} -else{n.push('error')}}}};if(t.taskOpen){n.push('meta');return n.length?n.join(' '):null};if(t.taskClosed){n.push('property');return n.length?n.join(' '):null};if(t.linkHref){n.push(i.linkHref,'url')} -else{if(t.strong){n.push(i.strong)};if(t.em){n.push(i.em)};if(t.strikethrough){n.push(i.strikethrough)};if(t.emoji){n.push(i.emoji)};if(t.linkText){n.push(i.linkText)};if(t.code){n.push(i.code)};if(t.image){n.push(i.image)};if(t.imageAltText){n.push(i.imageAltText,'link')};if(t.imageMarker){n.push(i.imageMarker)}};if(t.header){n.push(i.header,i.header+'-'+t.header)};if(t.quote){n.push(i.quote);if(!e.maxBlockquoteDepth||e.maxBlockquoteDepth>=t.quote){n.push(i.quote+'-'+t.quote)} -else{n.push(i.quote+'-'+e.maxBlockquoteDepth)}};if(t.list!==!1){var a=(t.listStack.length-1)%3;if(!a){n.push(i.list1)} -else if(a===1){n.push(i.list2)} -else{n.push(i.list3)}};if(t.trailingSpaceNewLine){n.push('trailing-space-new-line')} -else if(t.trailingSpace){n.push('trailing-space-'+(t.trailingSpace%2?'a':'b'))};return n.length?n.join(' '):null};function C(t,e){if(t.match(q,!0)){return n(e)};return undefined};function a(f,r){var w=r.text(f,r);if(typeof w!=='undefined')return w;if(r.list){r.list=null;return n(r)};if(r.taskList){var H=f.match(m,!0)[1]===' ';if(H)r.taskOpen=!0;else r.taskClosed=!0;if(e.highlightFormatting)r.formatting='task';r.taskList=!1;return n(r)};r.taskOpen=!1;r.taskClosed=!1;if(r.header&&f.match(/^#+$/,!0)){if(e.highlightFormatting)r.formatting='header';return n(r)};var h=f.next();if(r.linkTitle){r.linkTitle=!1;var L=h;if(h==='('){L=')'};L=(L+'').replace(/([.?*+^\[\]\\(){}|-])/g,'\\$1');var B='^\\s*(?:[^'+L+'\\\\]+|\\\\\\\\|\\\\.)'+L;if(f.match(new RegExp(B),!0)){return i.linkHref}};if(h==='`'){var C=r.formatting;if(e.highlightFormatting)r.formatting='code';f.eatWhile('`');var F=f.current().length;if(r.code==0&&(!r.quote||F==1)){r.code=F;return n(r)} -else if(F==r.code){var v=n(r);r.code=0;return v} -else{r.formatting=C;return n(r)}} -else if(r.code){return n(r)};if(h==='\\'){f.next();if(e.highlightFormatting){var g=n(r),E=i.formatting+'-escape';return g?g+' '+E:E}};if(h==='!'&&f.match(/\[[^\]]*\] ?(?:\(|\[)/,!1)){r.imageMarker=!0;r.image=!0;if(e.highlightFormatting)r.formatting='image';return n(r)};if(h==='['&&r.imageMarker&&f.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1)){r.imageMarker=!1;r.imageAltText=!0;if(e.highlightFormatting)r.formatting='image';return n(r)};if(h===']'&&r.imageAltText){if(e.highlightFormatting)r.formatting='image';var g=n(r);r.imageAltText=!1;r.image=!1;r.inline=r.f=p;return g};if(h==='['&&!r.image){r.linkText=!0;if(e.highlightFormatting)r.formatting='link';return n(r)};if(h===']'&&r.linkText){if(e.highlightFormatting)r.formatting='link';var g=n(r);r.linkText=!1;r.inline=r.f=f.match(/\(.*?\)| ?\[.*?\]/,!1)?p:a;return g};if(h==='<'&&f.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=k;if(e.highlightFormatting)r.formatting='link';var g=n(r);if(g){g+=' '} -else{g=''};return g+i.linkInline};if(h==='<'&&f.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=k;if(e.highlightFormatting)r.formatting='link';var g=n(r);if(g){g+=' '} -else{g=''};return g+i.linkEmail};if(e.xml&&h==='<'&&f.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var b=f.string.indexOf('>',f.pos);if(b!=-1){var j=f.string.substring(f.start,b);if(/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(j))r.md_inside=!0};f.backUp(1);r.htmlState=t.startState(o);return d(f,r,s)};if(e.xml&&h==='<'&&f.match(/^\/\w*?>/)){r.md_inside=!1;return'tag'} -else if(h==='*'||h==='_'){var M=1,x=f.pos==1?' ':f.string.charAt(f.pos-2);while(M<3&&f.eat(h))M++;var u=f.peek()||' ',T=!/\s/.test(u)&&(!l.test(u)||/\s/.test(x)||l.test(x)),q=!/\s/.test(x)&&(!l.test(x)||/\s/.test(u)||l.test(u)),c=null,S=null;if(M%2){if(!r.em&&T&&(h==='*'||!q||l.test(x)))c=!0;else if(r.em==h&&q&&(h==='*'||!T||l.test(u)))c=!1};if(M>1){if(!r.strong&&T&&(h==='*'||!q||l.test(x)))S=!0;else if(r.strong==h&&q&&(h==='*'||!T||l.test(u)))S=!1};if(S!=null||c!=null){if(e.highlightFormatting)r.formatting=c==null?'strong':S==null?'em':'strong em';if(c===!0)r.em=h;if(S===!0)r.strong=h;var v=n(r);if(c===!1)r.em=!1;if(S===!1)r.strong=!1;return v}} -else if(h===' '){if(f.eat('*')||f.eat('_')){if(f.peek()===' '){return n(r)} -else{f.backUp(1)}}};if(e.strikethrough){if(h==='~'&&f.eatWhile(h)){if(r.strikethrough){if(e.highlightFormatting)r.formatting='strikethrough';var v=n(r);r.strikethrough=!1;return v} -else if(f.match(/^[^\s]/,!1)){r.strikethrough=!0;if(e.highlightFormatting)r.formatting='strikethrough';return n(r)}} -else if(h===' '){if(f.match(/^~~/,!0)){if(f.peek()===' '){return n(r)} -else{f.backUp(2)}}}};if(e.emoji&&h===':'&&f.match(/^[a-z_\d+-]+:/)){r.emoji=!0;if(e.highlightFormatting)r.formatting='emoji';var y=n(r);r.emoji=!1;return y};if(h===' '){if(f.match(/ +$/,!1)){r.trailingSpace++} -else if(r.trailingSpace){r.trailingSpaceNewLine=!0}};return n(r)};function k(t,r){var o=t.next();if(o==='>'){r.f=r.inline=a;if(e.highlightFormatting)r.formatting='link';var l=n(r);if(l){l+=' '} -else{l=''};return l+i.linkInline};t.match(/^[^>]+/,!0);return i.linkInline};function p(t,i){if(t.eatSpace()){return null};var r=t.next();if(r==='('||r==='['){i.f=i.inline=B(r==='('?')':']');if(e.highlightFormatting)i.formatting='link-string';i.linkHref=!0;return n(i)};return'error'};var S={')':/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,']':/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function B(t){return function(i,r){var o=i.next();if(o===t){r.f=r.inline=a;if(e.highlightFormatting)r.formatting='link-string';var l=n(r);r.linkHref=!1;return l};i.match(S[t]);r.linkHref=!0;return n(r)}};function H(t,i){if(t.match(/^([^\]\\]|\\.)*\]:/,!1)){i.f=D;t.next();if(e.highlightFormatting)i.formatting='link';i.linkText=!0;return n(i)};return g(t,i,a)};function D(t,r){if(t.match(/^\]:/,!0)){r.f=r.inline=A;if(e.highlightFormatting)r.formatting='link';var a=n(r);r.linkText=!1;return a};t.match(/^([^\]\\]|\\.)+/,!0);return i.linkText};function A(t,e){if(t.eatSpace()){return null};t.match(/^[^\s]+/,!0);if(t.peek()===undefined){e.linkTitle=!0} -else{t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0)};e.f=e.inline=a;return i.linkHref+' url'};var u={startState:function(){return{f:f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:a,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(o,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){t.formatting=!1;if(e!=t.thisLine.stream){t.header=0;t.hr=!1;if(e.match(/^\s*$/,!0)){c(t);return null};t.prevLine=t.thisLine;t.thisLine={stream:e};t.taskList=!1;t.trailingSpace=0;t.trailingSpaceNewLine=!1;if(!t.localState){t.f=t.block;if(t.f!=s){var i=e.match(/^\s*/,!0)[0].replace(/\t/g,b).length;t.indentation=i;t.indentationDiff=null;if(i>0)return null}}};return t.f(e,t)},innerMode:function(t){if(t.block==s)return{state:t.htmlState,mode:o};if(t.localState)return{state:t.localState,mode:t.localMode};return{state:t,mode:u}},indent:function(e,i,n){if(e.block==s&&o.indent)return o.indent(e.htmlState,i,n);if(e.localState&&e.localMode.indent)return e.localMode.indent(e.localState,i,n);return t.Pass},blankLine:c,getType:n,closeBrackets:'()[]{}\'\'""``',fold:'markdown'};return u},'xml');t.defineMIME('text/x-markdown','markdown')}); -/* ./modules/editor/codemirror/mode/jsx/jsx.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../xml/xml'),require('../javascript/javascript'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../xml/xml','../javascript/javascript'],t);else t(CodeMirror)})(function(t){'use strict';function e(t,e,n,i){this.state=t;this.mode=e;this.depth=n;this.prev=i};function n(i){return new e(t.copyState(i.mode,i.state),i.mode,i.depth,i.prev&&n(i.prev))};t.defineMode('jsx',function(i,s){var r=t.getMode(i,{name:'xml',allowMissing:!0,multilineTagIndentPastTag:!1});var a=t.getMode(i,s&&s.base||'javascript');function o(t){var n=t.tagName;t.tagName=null;var e=r.indent(t,'');t.tagName=n;return e};function c(t,e){if(e.context.mode==r)return f(t,e,e.context);else return p(t,e,e.context)};function f(n,f,s){if(s.depth==2){if(n.match(/^.*?\*\//))s.depth=1;else n.skipToEnd();return'comment'};if(n.peek()=='{'){r.skipAttribute(s.state);var d=o(s.state),p=s.state.context;if(p&&n.match(/^[^>]*>\s*$/,!1)){while(p.prev&&!p.startOfLine)p=p.prev;if(p.startOfLine)d-=i.indentUnit;else if(s.prev.state.lexical)d=s.prev.state.lexical.indented} -else if(s.depth==1){d+=i.indentUnit};f.context=new e(t.startState(a,d),a,0,f.context);return null};if(s.depth==1){if(n.peek()=='<'){r.skipAttribute(s.state);f.context=new e(t.startState(r,o(s.state)),r,0,f.context);return null} -else if(n.match('//')){n.skipToEnd();return'comment'} -else if(n.match('/*')){s.depth=2;return c(n,f)}};var l=r.token(n,s.state),u=n.current(),x;if(/\btag\b/.test(l)){if(/>$/.test(u)){if(s.state.context)s.depth=0;else f.context=f.context.prev} -else if(/^</.test(u)){s.depth=1}} -else if(!l&&(x=u.indexOf('{'))>-1){n.backUp(u.length-x)};return l};function p(n,s,i){if(n.peek()=='<'&&a.expressionAllowed(n,i.state)){a.skipExpression(i.state);s.context=new e(t.startState(r,a.indent(i.state,'')),r,0,s.context);return null};var c=a.token(n,i.state);if(!c&&i.depth!=null){var o=n.current();if(o=='{'){i.depth++} -else if(o=='}'){if(--i.depth==0)s.context=s.context.prev}};return c};return{startState:function(){return{context:new e(t.startState(a),a)}},copyState:function(t){return{context:n(t.context)}},token:c,indent:function(t,e,n){return t.context.mode.indent(t.context.state,e,n)},innerMode:function(t){return t.context}}},'xml','javascript');t.defineMIME('text/jsx','jsx');t.defineMIME('text/typescript-jsx',{name:'jsx',base:{name:'javascript',typescript:!0}})}); -/* ./modules/editor/codemirror/mode/velocity/velocity.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('velocity',function(){function r(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var i=r('#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}'),e=r('#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}'),a=r('$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent'),o=/[+\-*&%=<>!?:\/|]/;function t(e,t,n){t.tokenize=n;return n(e,t)};function n(r,n){var k=n.beforeParams;n.beforeParams=!1;var f=r.next();if((f=='\'')&&!n.inString&&n.inParams){n.lastTokenWasBuiltin=!1;return t(r,n,l(f))} -else if((f=='"')){n.lastTokenWasBuiltin=!1;if(n.inString){n.inString=!1;return'string'} -else if(n.inParams)return t(r,n,l(f))} -else if(/[\[\]{}\(\),;\.]/.test(f)){if(f=='('&&k)n.inParams=!0;else if(f==')'){n.inParams=!1;n.lastTokenWasBuiltin=!0};return null} -else if(/\d/.test(f)){n.lastTokenWasBuiltin=!1;r.eatWhile(/[\w\.]/);return'number'} -else if(f=='#'&&r.eat('*')){n.lastTokenWasBuiltin=!1;return t(r,n,s)} -else if(f=='#'&&r.match(/ *\[ *\[/)){n.lastTokenWasBuiltin=!1;return t(r,n,u)} -else if(f=='#'&&r.eat('#')){n.lastTokenWasBuiltin=!1;r.skipToEnd();return'comment'} -else if(f=='$'){r.eatWhile(/[\w\d\$_\.{}]/);if(a&&a.propertyIsEnumerable(r.current())){return'keyword'} -else{n.lastTokenWasBuiltin=!0;n.beforeParams=!0;return'builtin'}} -else if(o.test(f)){n.lastTokenWasBuiltin=!1;r.eatWhile(o);return'operator'} -else{r.eatWhile(/[\w\$_{}@]/);var c=r.current();if(i&&i.propertyIsEnumerable(c))return'keyword';if(e&&e.propertyIsEnumerable(c)||(r.current().match(/^#@?[a-z0-9_]+ *$/i)&&r.peek()=='(')&&!(e&&e.propertyIsEnumerable(c.toLowerCase()))){n.beforeParams=!0;n.lastTokenWasBuiltin=!1;return'keyword'};if(n.inString){n.lastTokenWasBuiltin=!1;return'string'};if(r.pos>c.length&&r.string.charAt(r.pos-c.length-1)=='.'&&n.lastTokenWasBuiltin)return'builtin';n.lastTokenWasBuiltin=!1;return null}};function l(e){return function(t,r){var i=!1,a,o=!1;while((a=t.next())!=null){if((a==e)&&!i){o=!0;break};if(e=='"'&&t.peek()=='$'&&!i){r.inString=!0;o=!0;break};i=!i&&a=='\\'};if(o)r.tokenize=n;return'string'}};function s(e,t){var i=!1,r;while(r=e.next()){if(r=='#'&&i){t.tokenize=n;break};i=(r=='*')};return'comment'};function u(e,t){var i=0,r;while(r=e.next()){if(r=='#'&&i==2){t.tokenize=n;break};if(r==']')i++;else if(r!=' ')i=0};return'meta'};return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)},blockCommentStart:'#*',blockCommentEnd:'*#',lineComment:'##',fold:'velocity'}});e.defineMIME('text/velocity','velocity')}); -/* ./modules/editor/codemirror/mode/fortran/fortran.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('fortran',function(){function e(e){var n={};for(var t=0;t<e.length;++t){n[e[t]]=!0};return n};var n=e(['abstract','accept','allocatable','allocate','array','assign','asynchronous','backspace','bind','block','byte','call','case','class','close','common','contains','continue','cycle','data','deallocate','decode','deferred','dimension','do','elemental','else','encode','end','endif','entry','enumerator','equivalence','exit','external','extrinsic','final','forall','format','function','generic','go','goto','if','implicit','import','include','inquire','intent','interface','intrinsic','module','namelist','non_intrinsic','non_overridable','none','nopass','nullify','open','optional','options','parameter','pass','pause','pointer','print','private','program','protected','public','pure','read','recursive','result','return','rewind','save','select','sequence','stop','subroutine','target','then','to','type','use','value','volatile','where','while','write']),i=e(['abort','abs','access','achar','acos','adjustl','adjustr','aimag','aint','alarm','all','allocated','alog','amax','amin','amod','and','anint','any','asin','associated','atan','besj','besjn','besy','besyn','bit_size','btest','cabs','ccos','ceiling','cexp','char','chdir','chmod','clog','cmplx','command_argument_count','complex','conjg','cos','cosh','count','cpu_time','cshift','csin','csqrt','ctime','c_funloc','c_loc','c_associated','c_null_ptr','c_null_funptr','c_f_pointer','c_null_char','c_alert','c_backspace','c_form_feed','c_new_line','c_carriage_return','c_horizontal_tab','c_vertical_tab','dabs','dacos','dasin','datan','date_and_time','dbesj','dbesj','dbesjn','dbesy','dbesy','dbesyn','dble','dcos','dcosh','ddim','derf','derfc','dexp','digits','dim','dint','dlog','dlog','dmax','dmin','dmod','dnint','dot_product','dprod','dsign','dsinh','dsin','dsqrt','dtanh','dtan','dtime','eoshift','epsilon','erf','erfc','etime','exit','exp','exponent','extends_type_of','fdate','fget','fgetc','float','floor','flush','fnum','fputc','fput','fraction','fseek','fstat','ftell','gerror','getarg','get_command','get_command_argument','get_environment_variable','getcwd','getenv','getgid','getlog','getpid','getuid','gmtime','hostnm','huge','iabs','iachar','iand','iargc','ibclr','ibits','ibset','ichar','idate','idim','idint','idnint','ieor','ierrno','ifix','imag','imagpart','index','int','ior','irand','isatty','ishft','ishftc','isign','iso_c_binding','is_iostat_end','is_iostat_eor','itime','kill','kind','lbound','len','len_trim','lge','lgt','link','lle','llt','lnblnk','loc','log','logical','long','lshift','lstat','ltime','matmul','max','maxexponent','maxloc','maxval','mclock','merge','move_alloc','min','minexponent','minloc','minval','mod','modulo','mvbits','nearest','new_line','nint','not','or','pack','perror','precision','present','product','radix','rand','random_number','random_seed','range','real','realpart','rename','repeat','reshape','rrspacing','rshift','same_type_as','scale','scan','second','selected_int_kind','selected_real_kind','set_exponent','shape','short','sign','signal','sinh','sin','sleep','sngl','spacing','spread','sqrt','srand','stat','sum','symlnk','system','system_clock','tan','tanh','time','tiny','transfer','transpose','trim','ttynam','ubound','umask','unlink','unpack','verify','xor','zabs','zcos','zexp','zlog','zsin','zsqrt']),r=e(['c_bool','c_char','c_double','c_double_complex','c_float','c_float_complex','c_funptr','c_int','c_int16_t','c_int32_t','c_int64_t','c_int8_t','c_int_fast16_t','c_int_fast32_t','c_int_fast64_t','c_int_fast8_t','c_int_least16_t','c_int_least32_t','c_int_least64_t','c_int_least8_t','c_intmax_t','c_intptr_t','c_long','c_long_double','c_long_double_complex','c_long_long','c_ptr','c_short','c_signed_char','c_size_t','character','complex','double','integer','logical','real']),t=/[+\-*&=<>\/\:]/,a=new RegExp('(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)','i');function o(e,l){if(e.match(a)){return'operator'};var o=e.next();if(o=='!'){e.skipToEnd();return'comment'};if(o=='"'||o=='\''){l.tokenize=c(o);return l.tokenize(e,l)};if(/[\[\]\(\),]/.test(o)){return null};if(/\d/.test(o)){e.eatWhile(/[\w\.]/);return'number'};if(t.test(o)){e.eatWhile(t);return'operator'};e.eatWhile(/[\w\$_]/);var s=e.current().toLowerCase();if(n.hasOwnProperty(s)){return'keyword'};if(i.hasOwnProperty(s)||r.hasOwnProperty(s)){return'builtin'};return'variable'};function c(e){return function(t,i){var n=!1,r,a=!1;while((r=t.next())!=null){if(r==e&&!n){a=!0;break};n=!n&&r=='\\'};if(a||!n)i.tokenize=null;return'string'}};return{startState:function(){return{tokenize:null}},token:function(e,t){if(e.eatSpace())return null;var n=(t.tokenize||o)(e,t);if(n=='comment'||n=='meta')return n;return n}}});e.defineMIME('text/x-fortran','fortran')}); -/* ./modules/editor/codemirror/mode/mirc/mirc.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMIME('text/mirc','mirc');e.defineMode('mirc',function(){function e(e){var r={},t=e.split(' ');for(var i=0;i<t.length;++i)r[t[i]]=!0;return r};var r=e('$! $$ $& $? $+ $abook $abs $active $activecid $activewid $address $addtok $agent $agentname $agentstat $agentver $alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime $asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind $binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes $chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color $com $comcall $comchan $comerr $compact $compress $comval $cos $count $cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight $dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress $deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll $dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error $eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir $finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve $fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt $group $halted $hash $height $hfind $hget $highlight $hnick $hotline $hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil $inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect $insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile $isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive $lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock $lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer $maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext $menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode $modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile $nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly $opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree $pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo $readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex $reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline $sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin $site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname $sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped $syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp $timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel $ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver $version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor'),t=e('abook ajinvite alias aline ame amsg anick aop auser autojoin avoice away background ban bcopy beep bread break breplace bset btrunc bunset bwrite channel clear clearall cline clipboard close cnick color comclose comopen comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver debug dec describe dialog did didtok disable disconnect dlevel dline dll dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable events exit fclose filter findtext finger firewall flash flist flood flush flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear ialmark identd if ignore iline inc invite iuser join kick linesep links list load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice qme qmsg query queryn quit raw reload remini remote remove rename renwin reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini say scid scon server set showmirc signam sline sockaccept sockclose socklist socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs elseif else goto menu nicklist status title icon size option text edit button check radio box scroll list combo link tab item'),n=e('if elseif else and not or eq ne in ni for foreach while switch'),o=/[+\-*&%=<>!?^\/\|]/;function a(e,i,r){i.tokenize=r;return r(e,i)};function i(e,i){var m=i.beforeParams;i.beforeParams=!1;var c=e.next();if(/[\[\]{}\(\),\.]/.test(c)){if(c=='('&&m)i.inParams=!0;else if(c==')')i.inParams=!1;return null} -else if(/\d/.test(c)){e.eatWhile(/[\w\.]/);return'number'} -else if(c=='\\'){e.eat('\\');e.eat(/./);return'number'} -else if(c=='/'&&e.eat('*')){return a(e,i,s)} -else if(c==';'&&e.match(/ *\( *\(/)){return a(e,i,l)} -else if(c==';'&&!i.inParams){e.skipToEnd();return'comment'} -else if(c=='"'){e.eat(/"/);return'keyword'} -else if(c=='$'){e.eatWhile(/[$_a-z0-9A-Z\.:]/);if(r&&r.propertyIsEnumerable(e.current().toLowerCase())){return'keyword'} -else{i.beforeParams=!0;return'builtin'}} -else if(c=='%'){e.eatWhile(/[^,\s()]/);i.beforeParams=!0;return'string'} -else if(o.test(c)){e.eatWhile(o);return'operator'} -else{e.eatWhile(/[\w\$_{}]/);var d=e.current().toLowerCase();if(t&&t.propertyIsEnumerable(d))return'keyword';if(n&&n.propertyIsEnumerable(d)){i.beforeParams=!0;return'keyword'};return null}};function s(e,r){var n=!1,t;while(t=e.next()){if(t=='/'&&n){r.tokenize=i;break};n=(t=='*')};return'comment'};function l(e,r){var n=0,t;while(t=e.next()){if(t==';'&&n==2){r.tokenize=i;break};if(t==')')n++;else if(t!=' ')n=0};return'meta'};return{startState:function(){return{tokenize:i,beforeParams:!1,inParams:!1}},token:function(e,i){if(e.eatSpace())return null;return i.tokenize(e,i)}}})}); -/* ./modules/editor/codemirror/mode/xquery/xquery.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('xquery',function(){var a=function(){function o(e){return{type:e,style:'keyword'}};var u=o('operator'),c={type:'atom',style:'atom'},l={type:'punctuation',style:null},f={type:'axis_specifier',style:'qualifier'};var n={',':l};var r=['after','all','allowing','ancestor','ancestor-or-self','any','array','as','ascending','at','attribute','base-uri','before','boundary-space','by','case','cast','castable','catch','child','collation','comment','construction','contains','content','context','copy','copy-namespaces','count','decimal-format','declare','default','delete','descendant','descendant-or-self','descending','diacritics','different','distance','document','document-node','element','else','empty','empty-sequence','encoding','end','entire','every','exactly','except','external','first','following','following-sibling','for','from','ftand','ftnot','ft-option','ftor','function','fuzzy','greatest','group','if','import','in','inherit','insensitive','insert','instance','intersect','into','invoke','is','item','language','last','lax','least','let','levels','lowercase','map','modify','module','most','namespace','next','no','node','nodes','no-inherit','no-preserve','not','occurs','of','only','option','order','ordered','ordering','paragraph','paragraphs','parent','phrase','preceding','preceding-sibling','preserve','previous','processing-instruction','relationship','rename','replace','return','revalidation','same','satisfies','schema','schema-attribute','schema-element','score','self','sensitive','sentence','sentences','sequence','skip','sliding','some','stable','start','stemming','stop','strict','strip','switch','text','then','thesaurus','times','to','transform','treat','try','tumbling','type','typeswitch','union','unordered','update','updating','uppercase','using','validate','value','variable','version','weight','when','where','wildcards','window','with','without','word','words','xquery'];for(var e=0,t=r.length;e<t;e++){n[r[e]]=o(r[e])};var s=['xs:anyAtomicType','xs:anySimpleType','xs:anyType','xs:anyURI','xs:base64Binary','xs:boolean','xs:byte','xs:date','xs:dateTime','xs:dateTimeStamp','xs:dayTimeDuration','xs:decimal','xs:double','xs:duration','xs:ENTITIES','xs:ENTITY','xs:float','xs:gDay','xs:gMonth','xs:gMonthDay','xs:gYear','xs:gYearMonth','xs:hexBinary','xs:ID','xs:IDREF','xs:IDREFS','xs:int','xs:integer','xs:item','xs:java','xs:language','xs:long','xs:Name','xs:NCName','xs:negativeInteger','xs:NMTOKEN','xs:NMTOKENS','xs:nonNegativeInteger','xs:nonPositiveInteger','xs:normalizedString','xs:NOTATION','xs:numeric','xs:positiveInteger','xs:precisionDecimal','xs:QName','xs:short','xs:string','xs:time','xs:token','xs:unsignedByte','xs:unsignedInt','xs:unsignedLong','xs:unsignedShort','xs:untyped','xs:untypedAtomic','xs:yearMonthDuration'];for(var e=0,t=s.length;e<t;e++){n[s[e]]=c};var a=['eq','ne','lt','le','gt','ge',':=','=','>','>=','<','<=','.','|','?','and','or','div','idiv','mod','*','/','+','-'];for(var e=0,t=a.length;e<t;e++){n[a[e]]=u};var i=['self::','attribute::','child::','descendant::','descendant-or-self::','parent::','ancestor::','ancestor-or-self::','following::','preceding::','following-sibling::','preceding-sibling::'];for(var e=0,t=i.length;e<t;e++){n[i[e]]=f};return n}();function r(e,t,n){t.tokenize=n;return n(e,t)};function t(t,i){var s=t.next(),w=!1,v=y(t);if(s=='<'){if(t.match('!--',!0))return r(t,i,d);if(t.match('![CDATA',!1)){i.tokenize=p;return'tag'};if(t.match('?',!1)){return r(t,i,x)};var I=t.eat('/');t.eatSpace();var k='',b;while((b=t.eat(/[^\s\u00a0=<>"'\/?]/)))k+=b;return r(t,i,m(k,I))} -else if(s=='{'){n(i,{type:'codeblock'});return null} -else if(s=='}'){e(i);return null} -else if(c(i)){if(s=='>')return'tag';else if(s=='/'&&t.eat('>')){e(i);return'tag'} -else return'variable'} -else if(/\d/.test(s)){t.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/);return'atom'} -else if(s==='('&&t.eat(':')){n(i,{type:'comment'});return r(t,i,l)} -else if(!v&&(s==='"'||s==='\''))return r(t,i,o(s));else if(s==='$'){return r(t,i,f)} -else if(s===':'&&t.eat('=')){return'keyword'} -else if(s==='('){n(i,{type:'paren'});return null} -else if(s===')'){e(i);return null} -else if(s==='['){n(i,{type:'bracket'});return null} -else if(s===']'){e(i);return null} -else{var u=a.propertyIsEnumerable(s)&&a[s];if(v&&s==='"')while(t.next()!=='"'){};if(v&&s==='\'')while(t.next()!=='\''){};if(!u)t.eatWhile(/[\w\$_-]/);var z=t.eat(':');if(!t.eat(':')&&z){t.eatWhile(/[\w\$_-]/)};if(t.match(/^[ \t]*\(/,!1)){w=!0};var h=t.current();u=a.propertyIsEnumerable(h)&&a[h];if(w&&!u)u={type:'function_call',style:'variable def'};if(g(i)){e(i);return'variable'};if(h=='element'||h=='attribute'||u.type=='axis_specifier')n(i,{type:'xmlconstructor'});return u?u.style:'variable'}};function l(t,n){var a=!1,s=!1,i=0,r;while(r=t.next()){if(r==')'&&a){if(i>0)i--;else{e(n);break}} -else if(r==':'&&s){i++};a=(r==':');s=(r=='(')};return'comment'};function o(r,a){return function(s,u){var c;if(h(u)&&s.current()==r){e(u);if(a)u.tokenize=a;return'string'};n(u,{type:'string',name:r,tokenize:o(r,a)});if(s.match('{',!1)&&i(u)){u.tokenize=t;return'string'} -while(c=s.next()){if(c==r){e(u);if(a)u.tokenize=a;break} -else{if(s.match('{',!1)&&i(u)){u.tokenize=t;return'string'}}};return'string'}};function f(e,n){var r=/[\w\$_-]/;if(e.eat('"')){while(e.next()!=='"'){};e.eat(':')} -else{e.eatWhile(r);if(!e.match(':=',!1))e.eat(':')};e.eatWhile(r);n.tokenize=t;return'variable'};function m(r,i){return function(a,s){a.eatSpace();if(i&&a.eat('>')){e(s);s.tokenize=t;return'tag'};if(!a.eat('/'))n(s,{type:'tag',name:r,tokenize:t});if(!a.eat('>')){s.tokenize=u;return'tag'} -else{s.tokenize=t};return'tag'}};function u(a,s){var l=a.next();if(l=='/'&&a.eat('>')){if(i(s))e(s);if(c(s))e(s);return'tag'};if(l=='>'){if(i(s))e(s);return'tag'};if(l=='=')return null;if(l=='"'||l=='\'')return r(a,s,o(l,u));if(!i(s))n(s,{type:'attribute',tokenize:u});a.eat(/[a-zA-Z_:]/);a.eatWhile(/[-a-zA-Z0-9_:.]/);a.eatSpace();if(a.match('>',!1)||a.match('/',!1)){e(s);s.tokenize=t};return'attribute'};function d(e,n){var r;while(r=e.next()){if(r=='-'&&e.match('->',!0)){n.tokenize=t;return'comment'}}};function p(e,n){var r;while(r=e.next()){if(r==']'&&e.match(']',!0)){n.tokenize=t;return'comment'}}};function x(e,n){var r;while(r=e.next()){if(r=='?'&&e.match('>',!0)){n.tokenize=t;return'comment meta'}}};function c(e){return s(e,'tag')};function i(e){return s(e,'attribute')};function g(e){return s(e,'xmlconstructor')};function h(e){return s(e,'string')};function y(e){if(e.current()==='"')return e.match(/^[^"]+"\:/,!1);else if(e.current()==='\'')return e.match(/^[^"]+'\:/,!1);else return!1};function s(e,t){return(e.stack.length&&e.stack[e.stack.length-1].type==t)};function n(e,t){e.stack.push(t)};function e(e){e.stack.pop();var n=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=n||t};return{startState:function(){return{tokenize:t,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:'(:',blockCommentEnd:':)'}});e.defineMIME('application/xquery','xquery')}); -/* ./modules/editor/codemirror/mode/elm/elm.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('elm',function(){function n(e,t,r){t(r);return r(e,t)};var l=/[a-z_]/,c=/[A-Z]/,t=/[0-9]/,s=/[0-9A-Fa-f]/,m=/[0-7]/,f=/[a-z_A-Z0-9']/,r=/[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/,h=/[(),;[\]`{}]/,u=/[ \t\v\f]/;function e(){return function(e,v){if(e.eatWhile(u)){return null};var i=e.next();if(h.test(i)){if(i=='{'&&e.eat('-')){var p='comment';if(e.eat('#'))p='meta';return n(e,v,a(p,1))};return null};if(i=='\''){if(e.eat('\\'))e.next();else e.next();if(e.eat('\''))return'string';return'error'};if(i=='"'){return n(e,v,o)};if(c.test(i)){e.eatWhile(f);if(e.eat('.'))return'qualifier';return'variable-2'};if(l.test(i)){var x=e.pos===1;e.eatWhile(f);return x?'type':'variable'};if(t.test(i)){if(i=='0'){if(e.eat(/[xX]/)){e.eatWhile(s);return'integer'};if(e.eat(/[oO]/)){e.eatWhile(m);return'number'}};e.eatWhile(t);var p='number';if(e.eat('.')){p='number';e.eatWhile(t)};if(e.eat(/[eE]/)){p='number';e.eat(/[-+]/);e.eatWhile(t)};return p};if(r.test(i)){if(i=='-'&&e.eat(/-/)){e.eatWhile(/-/);if(!e.eat(r)){e.skipToEnd();return'comment'}};e.eatWhile(r);return'builtin'};return'error'}};function a(t,r){if(r==0){return e()};return function(n,i){var f=r;while(!n.eol()){var u=n.next();if(u=='{'&&n.eat('-')){++f} -else if(u=='-'&&n.eat('}')){--f;if(f==0){i(e());return t}}};i(a(t,f));return t}};function o(t,r){while(!t.eol()){var n=t.next();if(n=='"'){r(e());return'string'};if(n=='\\'){if(t.eol()||t.eat(u)){r(v);return'string'};if(!t.eat('&'))t.next()}};r(e());return'error'};function v(t,r){if(t.eat('\\')){return n(t,r,o)};t.next();r(e());return'error'};var i=(function(){var r={};var t=['case','of','as','if','then','else','let','in','infix','infixl','infixr','type','alias','input','output','foreign','loopback','module','where','import','exposing','_','..','|',':','=','\\','"','->','<-'];for(var e=t.length;e--;)r[t[e]]='keyword';return r})();return{startState:function(){return{f:e()}},copyState:function(e){return{f:e.f}},token:function(e,t){var n=t.f(e,function(e){t.f=e}),r=e.current();return(i.hasOwnProperty(r))?i[r]:n}}});e.defineMIME('text/x-elm','elm')}); -/* ./modules/editor/codemirror/mode/vhdl/vhdl.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";function t(e){var r={},n=e.split(",");for(var t=0;t<n.length;++t){var i=n[t].toUpperCase(),o=n[t].charAt(0).toUpperCase()+n[t].slice(1);r[n[t]]=!0;r[i]=!0;r[o]=!0};return r};function n(e){e.eatWhile(/[\w\$_]/);return"meta"};e.defineMode("vhdl",function(e,i){var u=e.indentUnit,h=i.atoms||t("null"),f=i.hooks||{"`":n,"$":n},c=i.multiLineStrings;var p=t("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block,body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case,end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for,function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage,literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map,postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal,sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"),m=t("architecture,entity,begin,case,port,else,elsif,end,for,function,if"),s=/[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/,r;function a(e,t){var n=e.next();if(f[n]){var o=f[n](e,t);if(o!==!1)return o};if(n=="\""){t.tokenize=b(n);return t.tokenize(e,t)};if(n=="'"){t.tokenize=y(n);return t.tokenize(e,t)};if(/[\[\]{}\(\),;\:\.]/.test(n)){r=n;return null};if(/[\d']/.test(n)){e.eatWhile(/[\w\.']/);return"number"};if(n=="-"){if(e.eat("-")){e.skipToEnd();return"comment"}};if(s.test(n)){e.eatWhile(s);return"operator"};e.eatWhile(/[\w\$_]/);var i=e.current();if(p.propertyIsEnumerable(i.toLowerCase())){if(m.propertyIsEnumerable(i))r="newstatement";return"keyword"};if(h.propertyIsEnumerable(i))return"atom";return"variable"};function y(e){return function(t,n){var r=!1,i,o=!1;while((i=t.next())!=null){if(i==e&&!r){o=!0;break};r=!r&&i=="--"};if(o||!(r||c))n.tokenize=a;return"string"}};function b(e){return function(t,n){var r=!1,i,o=!1;while((i=t.next())!=null){if(i==e&&!r){o=!0;break};r=!r&&i=="--"};if(o||!(r||c))n.tokenize=a;return"string-2"}};function d(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function l(e,t,n){return e.context=new d(e.indented,t,n,null,e.context)};function o(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new d((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()){if(n.align==null)n.align=!1;t.indented=e.indentation();t.startOfLine=!0};if(e.eatSpace())return null;r=null;var i=(t.tokenize||a)(e,t);if(i=="comment"||i=="meta")return i;if(n.align==null)n.align=!0;if((r==";"||r==":")&&n.type=="statement")o(t);else if(r=="{")l(t,e.column(),"}");else if(r=="[")l(t,e.column(),"]");else if(r=="(")l(t,e.column(),")");else if(r=="}"){while(n.type=="statement")n=o(t);if(n.type=="}")n=o(t);while(n.type=="statement")n=o(t)} -else if(r==n.type)o(t);else if(n.type=="}"||n.type=="top"||(n.type=="statement"&&r=="newstatement"))l(t,e.column(),"statement");t.startOfLine=!1;return i},indent:function(e,t){if(e.tokenize!=a&&e.tokenize!=null)return 0;var r=t&&t.charAt(0),n=e.context,i=r==n.type;if(n.type=="statement")return n.indented+(r=="{"?0:u);else if(n.align)return n.column+(i?0:1);else return n.indented+(i?0:u)},electricChars:"{}"}});e.defineMIME("text/x-vhdl","vhdl")}); -/* ./modules/editor/codemirror/mode/verilog/verilog.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("verilog",function(t,n){var f=t.indentUnit,p=n.statementIndentUnit||f,q=n.dontAlignCalls,v=n.noIndentKeywords||[],L=n.multiLineStrings,a=n.hooks||{};function d(e){var n={},i=e.split(" ");for(var t=0;t<i.length;++t)n[i[t]]=!0;return n};var w=d("accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"),x=/[\+\-\*\/!~&|^%=?:]/,I=/[\[\]{}()]/,C=/\d[0-9_]*/,z=/\d*\s*'s?d\s*\d[0-9_]*/i,S=/\d*\s*'s?b\s*[xz01][xz01_]*/i,j=/\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i,E=/\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i,m=/(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i,M=/^((\w+)|[)}\]])/,A=/[)}\]]/,r,l,B=d("case checker class clocking config function generate interface module package primitive program property specify sequence table task"),i={};for(var s in B){i[s]="end"+s};i["begin"]="end";i["casex"]="endcase";i["casez"]="endcase";i["do"]="while";i["fork"]="join;join_any;join_none";i["covergroup"]="endgroup";for(var b in v){var s=v[b];if(i[s]){i[s]=undefined}};var k=d("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while");function c(e,t){var n=e.peek(),s;if(a[n]&&(s=a[n](e,t))!=!1)return s;if(a.tokenBase&&(s=a.tokenBase(e,t))!=!1)return s;if(/[,;:\.]/.test(n)){r=e.next();return null};if(I.test(n)){r=e.next();return"bracket"};if(n=="`"){e.next();if(e.eatWhile(/[\w\$_]/)){return"def"} -else{return null}};if(n=="$"){e.next();if(e.eatWhile(/[\w\$_]/)){return"meta"} -else{return null}};if(n=="#"){e.next();e.eatWhile(/[\d_.]/);return"def"};if(n=="\""){e.next();t.tokenize=T(n);return t.tokenize(e,t)};if(n=="/"){e.next();if(e.eat("*")){t.tokenize=h;return h(e,t)};if(e.eat("/")){e.skipToEnd();return"comment"};e.backUp(1)};if(e.match(m)||e.match(z)||e.match(S)||e.match(j)||e.match(E)||e.match(C)||e.match(m)){return"number"};if(e.eatWhile(x)){return"meta"};if(e.eatWhile(/[\w\$_]/)){var o=e.current();if(w[o]){if(i[o]){r="newblock"};if(k[o]){r="newstatement"};l=o;return"keyword"};return"variable"};e.next();return null};function T(e){return function(t,n){var i=!1,r,a=!1;while((r=t.next())!=null){if(r==e&&!i){a=!0;break};i=!i&&r=="\\"};if(a||!(i||L))n.tokenize=c;return"string"}};function h(e,t){var i=!1,n;while(n=e.next()){if(n=="/"&&i){t.tokenize=c;break};i=(n=="*")};return"comment"};function g(e,t,n,i,r){this.indented=e;this.column=t;this.type=n;this.align=i;this.prev=r};function o(e,t,n){var i=e.indented,r=new g(i,t,n,null,e.context);return e.context=r};function u(e){var t=e.context.type;if(t==")"||t=="]"||t=="}"){e.indented=e.context.indented};return e.context=e.context.prev};function y(e,t){if(e==t){return!0} -else{var n=t.split(";");for(var i in n){if(e==n[i]){return!0}};return!1}};function W(){var n=[];for(var t in i){if(i[t]){var e=i[t].split(";");for(var a in e){n.push(e[a])}}};var r=new RegExp("[{}()\\[\\]]|("+n.join("|")+")$");return r};return{electricInput:W(),startState:function(e){var t={tokenize:null,context:new g((e||0)-f,0,"top",!1),indented:0,startOfLine:!0};if(a.startState)a.startState(t);return t},token:function(e,t){var n=t.context;if(e.sol()){if(n.align==null)n.align=!1;t.indented=e.indentation();t.startOfLine=!0};if(a.token){var s=a.token(e,t);if(s!==undefined){return s}};if(e.eatSpace())return null;r=null;l=null;var s=(t.tokenize||c)(e,t);if(s=="comment"||s=="meta"||s=="variable")return s;if(n.align==null)n.align=!0;if(r==n.type){u(t)} -else if((r==";"&&n.type=="statement")||(n.type&&y(l,n.type))){n=u(t);while(n&&n.type=="statement")n=u(t)} -else if(r=="{"){o(t,e.column(),"}")} -else if(r=="["){o(t,e.column(),"]")} -else if(r=="("){o(t,e.column(),")")} -else if(n&&n.type=="endcase"&&r==":"){o(t,e.column(),"statement")} -else if(r=="newstatement"){o(t,e.column(),"statement")} -else if(r=="newblock"){if(l=="function"&&n&&(n.type=="statement"||n.type=="endgroup")){} -else if(l=="task"&&n&&n.type=="statement"){} -else{var f=i[l];o(t,e.column(),f)}};t.startOfLine=!1;return s},indent:function(t,n){if(t.tokenize!=c&&t.tokenize!=null)return e.Pass;if(a.indent){var s=a.indent(t);if(s>=0)return s};var i=t.context,o=n&&n.charAt(0);if(i.type=="statement"&&o=="}")i=i.prev;var r=!1,l=n.match(M);if(l)r=y(l[0],i.type);if(i.type=="statement")return i.indented+(o=="{"?0:p);else if(A.test(i.type)&&i.align&&!q)return i.column+(r?0:1);else if(i.type==")"&&!r)return i.indented+p;else return i.indented+(r?0:f)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});e.defineMIME("text/x-verilog",{name:"verilog"});e.defineMIME("text/x-systemverilog",{name:"verilog"});var a={"|":"link",">":"property","$":"variable","$$":"variable","?$":"qualifier","?*":"qualifier","-":"hr","/":"property","/-":"property","@":"variable-3","@-":"variable-3","@++":"variable-3","@+=":"variable-3","@+=-":"variable-3","@--":"variable-3","@-=":"variable-3","%+":"tag","%-":"tag","%":"tag",">>":"tag","<<":"tag","<>":"tag","#":"tag","^":"attribute","^^":"attribute","^!":"attribute","*":"variable-2","**":"variable-2","\\":"keyword","\"":"comment"};var o={"/":"beh-hier",">":"beh-hier","-":"phys-hier","|":"pipe","?":"when","@":"stage","\\":"keyword"};var t=3,n=!1,r=/^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/,s=/^[! ] /,c=/^[! ] */,l=/^\/[\/\*]/;function i(e,n,i){var r=n/t;return"tlv-"+e.tlvIndentationStyle[r]+"-"+i};function f(e){var t;return(t=e.match(r,!1))&&t[2].length>0};e.defineMIME("text/x-tlv",{name:"verilog",hooks:{electricInput:!1,token:function(e,d){var u=undefined,m;if(e.sol()&&!d.tlvInBlockComment){if(e.peek()=="\\"){u="def";e.skipToEnd();if(e.string.match(/\\SV/)){d.tlvCodeActive=!1} -else if(e.string.match(/\\TLV/)){d.tlvCodeActive=!0}};if(d.tlvCodeActive&&e.pos==0&&(d.indented==0)&&(m=e.match(c,!1))){d.indented=m[0].length};var h=d.indented,p=h/t;if(p<=d.tlvIndentationStyle.length){var x=e.string.length==h,y=p*t;if(y<e.string.length){var b=e.string.slice(y),g=b[0];if(o[g]&&((m=b.match(r))&&a[m[1]])){h+=t;if(!(g=="\\"&&y>0)){d.tlvIndentationStyle[p]=o[g];if(n){d.statementComment=!1};p++}}};if(!x){while(d.tlvIndentationStyle.length>p){d.tlvIndentationStyle.pop()}}};d.tlvNextIndent=h};if(d.tlvCodeActive){var v=!1;if(n){v=(e.peek()!=" ")&&(u===undefined)&&!d.tlvInBlockComment&&(e.column()==d.tlvIndentationStyle.length*t);if(v){if(d.statementComment){v=!1};d.statementComment=e.match(l,!1)}};var m;if(u!==undefined){u+=" "+i(d,0,"scope-ident")} -else if(((e.pos/t)<d.tlvIndentationStyle.length)&&(m=e.match(e.sol()?s:/^ /))){u="tlv-indent-"+(((e.pos%2)==0)?"even":"odd")+" "+i(d,e.pos-t,"indent");if(m[0].charAt(0)=="!"){u+=" tlv-alert-line-prefix"};if(f(e)){u+=" "+i(d,e.pos,"before-scope-ident")}} -else if(d.tlvInBlockComment){if(e.match(/^.*?\*\//)){d.tlvInBlockComment=!1;if(n&&!e.eol()){d.statementComment=!1}} -else{e.skipToEnd()};u="comment"} -else if((m=e.match(l))&&!d.tlvInBlockComment){if(m[0]=="//"){e.skipToEnd()} -else{d.tlvInBlockComment=!0};u="comment"} -else if(m=e.match(r)){var k=m[1],w=m[2];if(a.hasOwnProperty(k)&&(w.length>0||e.eol())){u=a[k];if(e.column()==d.indented){u+=" "+i(d,e.column(),"scope-ident")}} -else{e.backUp(e.current().length-1);u="tlv-default"}} -else if(e.match(/^\t+/)){u="tlv-tab"} -else if(e.match(/^[\[\]{}\(\);\:]+/)){u="meta"} -else if(m=e.match(/^[mM]4([\+_])?[\w\d_]*/)){u=(m[1]=="+")?"tlv-m4-plus":"tlv-m4"} -else if(e.match(/^ +/)){if(e.eol()){u="error"} -else{u="tlv-default"}} -else if(e.match(/^[\w\d_]+/)){u="number"} -else{e.next();u="tlv-default"};if(v){u+=" tlv-statement"}} -else{if(e.match(/^[mM]4([\w\d_]*)/)){u="tlv-m4"}};return u},indent:function(e){return(e.tlvCodeActive==!0)?e.tlvNextIndent:-1},startState:function(e){e.tlvIndentationStyle=[];e.tlvCodeActive=!0;e.tlvNextIndent=-1;e.tlvInBlockComment=!1;if(n){e.statementComment=!1}}}})}); -/* ./modules/editor/codemirror/mode/spreadsheet/spreadsheet.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('spreadsheet',function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(e,t){if(!e)return;if(t.stack.length===0){if((e.peek()=='"')||(e.peek()=='\'')){t.stringType=e.peek();e.next();t.stack.unshift('string')}};switch(t.stack[0]){case'string':while(t.stack[0]==='string'&&!e.eol()){if(e.peek()===t.stringType){e.next();t.stack.shift()} -else if(e.peek()==='\\'){e.next();e.next()} -else{e.match(/^.[^\\"']*/)}};return'string';case'characterClass':while(t.stack[0]==='characterClass'&&!e.eol()){if(!(e.match(/^[^\]\\]+/)||e.match(/^\\./)))t.stack.shift()};return'operator'};var r=e.peek();switch(r){case'[':e.next();t.stack.unshift('characterClass');return'bracket';case':':e.next();return'operator';case'\\':if(e.match(/\\[a-z]+/))return'string-2';else{e.next();return'atom'};case'.':case',':case';':case'*':case'-':case'+':case'^':case'<':case'/':case'=':e.next();return'atom';case'$':e.next();return'builtin'};if(e.match(/\d+/)){if(e.match(/^\w+/))return'error';return'number'} -else if(e.match(/^[a-zA-Z_]\w*/)){if(e.match(/(?=[\(.])/,!1))return'keyword';return'variable-2'} -else if(['[',']','(',')','{','}'].indexOf(r)!=-1){e.next();return'bracket'} -else if(!e.eatSpace()){e.next()};return null}}});e.defineMIME('text/x-spreadsheet','spreadsheet')}); -/* ./modules/editor/codemirror/mode/coffeescript/coffeescript.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('coffeescript',function(e,t){var f='error';function i(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var m=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,v=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,a=/^[_A-Za-z$][_A-Za-z$0-9]*/,k=/^@[_A-Za-z$][_A-Za-z$0-9]*/,y=i(['and','or','not','is','isnt','in','instanceof','typeof']),r=['for','while','loop','if','unless','else','switch','try','catch','finally','class'],g=['break','by','continue','debugger','delete','do','in','of','new','return','then','this','@','throw','when','until','extends'],b=i(r.concat(g));r=i(r);var u=/^('{3}|"{3}|['"])/,l=/^(\/{3}|\/)/,d=['Infinity','NaN','undefined','null','true','false','on','off','yes','no'],h=i(d);function n(e,t){if(e.sol()){if(t.scope.align===null)t.scope.align=!1;var i=t.scope.offset;if(e.eatSpace()){var o=e.indentation();if(o>i&&t.scope.type=='coffee'){return'indent'} -else if(o<i){return'dedent'};return null} -else{if(i>0){c(e,t)}}};if(e.eatSpace()){return null};var s=e.peek();if(e.match('####')){e.skipToEnd();return'comment'};if(e.match('###')){t.tokenize=z;return t.tokenize(e,t)};if(s==='#'){e.skipToEnd();return'comment'};if(e.match(/^-?[0-9\.]/,!1)){var r=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)){r=!0};if(e.match(/^-?\d+\.\d*/)){r=!0};if(e.match(/^-?\.\d+/)){r=!0};if(r){if(e.peek()=='.'){e.backUp(1)};return'number'};var n=!1;if(e.match(/^-?0x[0-9a-f]+/i)){n=!0};if(e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)){n=!0};if(e.match(/^-?0(?![\dx])/i)){n=!0};if(n){return'number'}};if(e.match(u)){t.tokenize=p(e.current(),!1,'string');return t.tokenize(e,t)};if(e.match(l)){if(e.current()!='/'||e.match(/^.*\//,!1)){t.tokenize=p(e.current(),!0,'string-2');return t.tokenize(e,t)} -else{e.backUp(1)}};if(e.match(m)||e.match(y)){return'operator'};if(e.match(v)){return'punctuation'};if(e.match(h)){return'atom'};if(e.match(k)||t.prop&&e.match(a)){return'property'};if(e.match(b)){return'keyword'};if(e.match(a)){return'variable'};e.next();return f};function p(e,r,i){return function(o,c){while(!o.eol()){o.eatWhile(/[^'"\/\\]/);if(o.eat('\\')){o.next();if(r&&o.eol()){return i}} -else if(o.match(e)){c.tokenize=n;return i} -else{o.eat(/['"\/]/)}};if(r){if(t.singleLineStringErrors){i=f} -else{c.tokenize=n}};return i}};function z(e,t){while(!e.eol()){e.eatWhile(/[^#]/);if(e.match('###')){t.tokenize=n;break};e.eatWhile('#')};return'comment'};function o(t,n,i){i=i||'coffee';var f=0,o=!1,c=null;for(var r=n.scope;r;r=r.prev){if(r.type==='coffee'||r.type=='}'){f=r.offset+e.indentUnit;break}};if(i!=='coffee'){o=null;c=t.column()+t.current().length} -else if(n.scope.align){n.scope.align=!1};n.scope={offset:f,type:i,prev:n.scope,align:o,alignOffset:c}};function c(t,e){if(!e.scope.prev)return;if(e.scope.type==='coffee'){var r=t.indentation(),i=!1;for(var n=e.scope;n;n=n.prev){if(r===n.offset){i=!0;break}};if(!i){return!0} -while(e.scope.prev&&e.scope.offset!==r){e.scope=e.scope.prev};return!1} -else{e.scope=e.scope.prev;return!1}};function x(t,e){var a=e.tokenize(t,e),n=t.current();if(n==='return'){e.dedent=!0};if(((n==='->'||n==='=>')&&t.eol())||a==='indent'){o(t,e)};var i='[({'.indexOf(n);if(i!==-1){o(t,e,'])}'.slice(i,i+1))};if(r.exec(n)){o(t,e)};if(n=='then'){c(t,e)};if(a==='dedent'){if(c(t,e)){return f}};i='])}'.indexOf(n);if(i!==-1){while(e.scope.type=='coffee'&&e.scope.prev)e.scope=e.scope.prev;if(e.scope.type==n)e.scope=e.scope.prev};if(e.dedent&&t.eol()){if(e.scope.type=='coffee'&&e.scope.prev)e.scope=e.scope.prev;e.dedent=!1};return a};var s={startState:function(e){return{tokenize:n,scope:{offset:e||0,type:'coffee',prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var r=t.scope.align===null&&t.scope;if(r&&e.sol())r.align=!1;var n=x(e,t);if(n&&n!='comment'){if(r)r.align=!0;t.prop=n=='punctuation'&&e.current()=='.'};return n},indent:function(e,t){if(e.tokenize!=n)return 0;var r=e.scope,f=t&&'])}'.indexOf(t.charAt(0))>-1;if(f)while(r.type=='coffee'&&r.prev)r=r.prev;var i=f&&r.type===t.charAt(0);if(r.align)return r.alignOffset-(i?1:0);else return(i?r.prev:r).offset},lineComment:'#',fold:'indent'};return s});e.defineMIME('application/vnd.coffeescript','coffeescript');e.defineMIME('text/x-coffeescript','coffeescript');e.defineMIME('text/coffeescript','coffeescript')}); -/* ./modules/editor/codemirror/mode/tiddlywiki/tiddlywiki.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("tiddlywiki",function(){var b={};var s={"allTags":!0,"closeAll":!0,"list":!0,"newJournal":!0,"newTiddler":!0,"permaview":!0,"saveChanges":!0,"search":!0,"slider":!0,"tabs":!0,"tag":!0,"tagging":!0,"tags":!0,"tiddler":!0,"timeline":!0,"today":!0,"version":!0,"option":!0,"with":!0,"filter":!0};var n=/[\w_\-]/i,i=/^\-\-\-\-+$/,u=/^\/\*\*\*$/,o=/^\*\*\*\/$/,a=/^<<<$/,f=/^\/\/\{\{\{$/,c=/^\/\/\}\}\}$/,l=/^<!--\{\{\{-->$/,m=/^<!--\}\}\}-->$/,h=/^\{\{\{$/,k=/^\}\}\}$/,d=/.*?\}\}\}/;function t(e,t,r){t.tokenize=r;return r(e,t)};function e(e,d){var s=e.sol(),k=e.peek();d.block=!1;if(s&&/[<\/\*{}\-]/.test(k)){if(e.match(h)){d.block=!0;return t(e,d,r)};if(e.match(a))return"quote";if(e.match(u)||e.match(o))return"comment";if(e.match(f)||e.match(c)||e.match(l)||e.match(m))return"comment";if(e.match(i))return"hr"};e.next();if(s&&/[\/\*!#;:>|]/.test(k)){if(k=="!"){e.skipToEnd();return"header"};if(k=="*"){e.eatWhile("*");return"comment"};if(k=="#"){e.eatWhile("#");return"comment"};if(k==";"){e.eatWhile(";");return"comment"};if(k==":"){e.eatWhile(":");return"comment"};if(k==">"){e.eatWhile(">");return"quote"};if(k=="|")return"header"};if(k=="{"&&e.match(/\{\{/))return t(e,d,r);if(/[hf]/i.test(k)&&/[ti]/i.test(e.peek())&&e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if(k=="\"")return"string";if(k=="~")return"brace";if(/[\[\]]/.test(k)&&e.match(k))return"brace";if(k=="@"){e.eatWhile(n);return"link"};if(/\d/.test(k)){e.eatWhile(/\d/);return"number"};if(k=="/"){if(e.eat("%")){return t(e,d,p)} -else if(e.eat("/")){return t(e,d,v)}};if(k=="_"&&e.eat("_"))return t(e,d,x);if(k=="-"&&e.eat("-")){if(e.peek()!=" ")return t(e,d,z);if(e.peek()==" ")return"brace"};if(k=="'"&&e.eat("'"))return t(e,d,w);if(k=="<"&&e.eat("<"))return t(e,d,y);e.eatWhile(/[\w\$_]/);return b.propertyIsEnumerable(e.current())?"keyword":null};function p(t,r){var i=!1,n;while(n=t.next()){if(n=="/"&&i){r.tokenize=e;break};i=(n=="%")};return"comment"};function w(t,r){var i=!1,n;while(n=t.next()){if(n=="'"&&i){r.tokenize=e;break};i=(n=="'")};return"strong"};function r(t,r){var n=r.block;if(n&&t.current()){return"comment"};if(!n&&t.match(d)){r.tokenize=e;return"comment"};if(n&&t.sol()&&t.match(k)){r.tokenize=e;return"comment"};t.next();return"comment"};function v(t,r){var i=!1,n;while(n=t.next()){if(n=="/"&&i){r.tokenize=e;break};i=(n=="/")};return"em"};function x(t,r){var i=!1,n;while(n=t.next()){if(n=="_"&&i){r.tokenize=e;break};i=(n=="_")};return"underlined"};function z(t,r){var i=!1,n;while(n=t.next()){if(n=="-"&&i){r.tokenize=e;break};i=(n=="-")};return"strikethrough"};function y(t,r){if(t.current()=="<<"){return"macro"};var n=t.next();if(!n){r.tokenize=e;return null};if(n==">"){if(t.peek()==">"){t.next();r.tokenize=e;return"macro"}};t.eatWhile(/[\w\$_]/);return s.propertyIsEnumerable(t.current())?"keyword":null};return{startState:function(){return{tokenize:e}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r}}});e.defineMIME("text/x-tiddlywiki","tiddlywiki")}); -/* ./modules/editor/codemirror/mode/mumps/mumps.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("mumps",function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")};var t=new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"),r=new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"),n=new RegExp("^[\\.,:]"),i=new RegExp("[()]"),o=new RegExp("^[%A-Za-z][A-Za-z0-9]*"),a=["break","close","do","else","for","goto","halt","hang","if","job","kill","lock","merge","new","open","quit","read","set","tcommit","trollback","tstart","use","view","write","xecute","b","c","d","e","f","g","h","i","j","k","l","m","n","o","q","r","s","tc","tro","ts","u","v","w","x"],c=["\\$ascii","\\$char","\\$data","\\$ecode","\\$estack","\\$etrap","\\$extract","\\$find","\\$fnumber","\\$get","\\$horolog","\\$io","\\$increment","\\$job","\\$justify","\\$length","\\$name","\\$next","\\$order","\\$piece","\\$qlength","\\$qsubscript","\\$query","\\$quit","\\$random","\\$reverse","\\$select","\\$stack","\\$test","\\$text","\\$translate","\\$view","\\$x","\\$y","\\$a","\\$c","\\$d","\\$e","\\$ec","\\$es","\\$et","\\$f","\\$fn","\\$g","\\$h","\\$i","\\$j","\\$l","\\$n","\\$na","\\$o","\\$p","\\$q","\\$ql","\\$qs","\\$r","\\$re","\\$s","\\$st","\\$t","\\$tr","\\$v","\\$z"],m=e(c),d=e(a);function f(e,a){if(e.sol()){a.label=!0;a.commandMode=0};var c=e.peek();if(c==" "||c=="\t"){a.label=!1;if(a.commandMode==0)a.commandMode=1;else if((a.commandMode<0)||(a.commandMode==2))a.commandMode=0} -else if((c!=".")&&(a.commandMode>0)){if(c==":")a.commandMode=-1;else a.commandMode=2};if((c==="(")||(c==="\u0009"))a.label=!1;if(c===";"){e.skipToEnd();return"comment"};if(e.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/))return"number";if(c=="\""){if(e.skipTo("\"")){e.next();return"string"} -else{e.skipToEnd();return"error"}};if(e.match(r)||e.match(t))return"operator";if(e.match(n))return null;if(i.test(c)){e.next();return"bracket"};if(a.commandMode>0&&e.match(d))return"variable-2";if(e.match(m))return"builtin";if(e.match(o))return"variable";if(c==="$"||c==="^"){e.next();return"builtin"};if(c==="@"){e.next();return"string-2"};if(/[\w%]/.test(c)){e.eatWhile(/[\w%]/);return"variable"};e.next();return"error"};return{startState:function(){return{label:!1,commandMode:0}},token:function(e,t){var r=f(e,t);if(t.label)return"tag";return r}}});e.defineMIME("text/x-mumps","mumps")}); -/* ./modules/editor/codemirror/mode/eiffel/eiffel.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('eiffel',function(){function e(e){var r={};for(var t=0,n=e.length;t<n;++t)r[e[t]]=!0;return r};var t=e(['note','across','when','variant','until','unique','undefine','then','strip','select','retry','rescue','require','rename','reference','redefine','prefix','once','old','obsolete','loop','local','like','is','inspect','infix','include','if','frozen','from','external','export','ensure','end','elseif','else','do','creation','create','check','alias','agent','separate','invariant','inherit','indexing','feature','expanded','deferred','class','Void','True','Result','Precursor','False','Current','create','attached','detachable','as','and','implies','not','or']),r=e([':=','and then','and','or','<<','>>']);function n(e,t,r){r.tokenize.push(e);return e(t,r)};function i(e,r){if(e.eatSpace())return null;var t=e.next();if(t=='"'||t=='\''){return n(o(t,'string'),e,r)} -else if(t=='-'&&e.eat('-')){e.skipToEnd();return'comment'} -else if(t==':'&&e.eat('=')){return'operator'} -else if(/[0-9]/.test(t)){e.eatWhile(/[xXbBCc0-9\.]/);e.eat(/[\?\!]/);return'ident'} -else if(/[a-zA-Z_0-9]/.test(t)){e.eatWhile(/[a-zA-Z_0-9]/);e.eat(/[\?\!]/);return'ident'} -else if(/[=+\-\/*^%<>~]/.test(t)){e.eatWhile(/[=+\-\/*^%<>~]/);return'operator'} -else{return null}};function o(e,t,r){return function(n,i){var o=!1,a;while((a=n.next())!=null){if(a==e&&(r||!o)){i.tokenize.pop();break};o=!o&&a=='%'};return t}};return{startState:function(){return{tokenize:[i]}},token:function(e,n){var o=n.tokenize[n.tokenize.length-1](e,n);if(o=='ident'){var i=e.current();o=t.propertyIsEnumerable(e.current())?'keyword':r.propertyIsEnumerable(e.current())?'operator':/^[A-Z][A-Z_0-9]*$/g.test(i)?'tag':/^0[bB][0-1]+$/g.test(i)?'number':/^0[cC][0-7]+$/g.test(i)?'number':/^0[xX][a-fA-F0-9]+$/g.test(i)?'number':/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(i)?'number':/^[0-9]+$/g.test(i)?'number':'variable'};return o},lineComment:'--'}});e.defineMIME('text/x-eiffel','eiffel')}); -/* ./modules/editor/codemirror/mode/webidl/webidl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var n=['Clamp','Constructor','EnforceRange','Exposed','ImplicitThis','Global','PrimaryGlobal','LegacyArrayClass','LegacyUnenumerableNamedProperties','LenientThis','NamedConstructor','NewObject','NoInterfaceObject','OverrideBuiltins','PutForwards','Replaceable','SameObject','TreatNonObjectAsNull','TreatNullAs','EmptyString','Unforgeable','Unscopeable'],g=t(n),i=['unsigned','short','long','unrestricted','float','double','boolean','byte','octet','Promise','ArrayBuffer','DataView','Int8Array','Int16Array','Int32Array','Uint8Array','Uint16Array','Uint32Array','Uint8ClampedArray','Float32Array','Float64Array','ByteString','DOMString','USVString','sequence','object','RegExp','Error','DOMException','FrozenArray','any','void'],D=t(i),a=['attribute','callback','const','deleter','dictionary','enum','getter','implements','inherit','interface','iterable','legacycaller','maplike','partial','required','serializer','setlike','setter','static','stringifier','typedef','optional','readonly','or'],E=t(a),o=['true','false','Infinity','NaN','null'],k=t(o);e.registerHelper('hintWords','webidl',n.concat(i).concat(a).concat(o));var c=['callback','dictionary','enum','interface'],l=t(c),f=['typedef'],m=t(f),u=/^[:<=>?]/,s=/^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/,d=/^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/,r=/^_?[A-Za-z][0-9A-Z_a-z-]*/,b=/^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/,y=/^"[^"]*"/,p=/^\/\*.*?\*\//,h=/^\/\*.*/,A=/^.*?\*\//;function C(e,t){if(e.eatSpace())return null;if(t.inComment){if(e.match(A)){t.inComment=!1;return'comment'};e.skipToEnd();return'comment'};if(e.match('//')){e.skipToEnd();return'comment'};if(e.match(p))return'comment';if(e.match(h)){t.inComment=!0;return'comment'};if(e.match(/^-?[0-9\.]/,!1)){if(e.match(s)||e.match(d))return'number'};if(e.match(y))return'string';if(t.startDef&&e.match(r))return'def';if(t.endDef&&e.match(b)){t.endDef=!1;return'def'};if(e.match(E))return'keyword';if(e.match(D)){var n=t.lastToken,i=(e.match(/^\s*(.+?)\b/,!1)||[])[1];if(n===':'||n==='implements'||i==='implements'||i==='='){return'builtin'} -else{return'variable-3'}};if(e.match(g))return'builtin';if(e.match(k))return'atom';if(e.match(r))return'variable';if(e.match(u))return'operator';e.next();return null};e.defineMode('webidl',function(){return{startState:function(){return{inComment:!1,lastToken:'',startDef:!1,endDef:!1}},token:function(t,e){var n=C(t,e);if(n){var r=t.current();e.lastToken=r;if(n==='keyword'){e.startDef=l.test(r);e.endDef=e.endDef||m.test(r)} -else{e.startDef=!1}};return n}}});e.defineMIME('text/x-webidl','webidl')}); -/* ./modules/editor/codemirror/mode/ebnf/ebnf.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ebnf',function(a){var c={slash:0,parenthesis:1};var t={comment:0,_string:1,characterClass:2};var r=null;if(a.bracesMode)r=e.getMode(a,a.bracesMode);return{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(a,n){if(!a)return;if(n.stack.length===0){if((a.peek()=='"')||(a.peek()=='\'')){n.stringType=a.peek();a.next();n.stack.unshift(t._string)} -else if(a.match(/^\/\*/)){n.stack.unshift(t.comment);n.commentType=c.slash} -else if(a.match(/^\(\*/)){n.stack.unshift(t.comment);n.commentType=c.parenthesis}};switch(n.stack[0]){case t._string:while(n.stack[0]===t._string&&!a.eol()){if(a.peek()===n.stringType){a.next();n.stack.shift()} -else if(a.peek()==='\\'){a.next();a.next()} -else{a.match(/^.[^\\"']*/)}};return n.lhs?'property string':'string';case t.comment:while(n.stack[0]===t.comment&&!a.eol()){if(n.commentType===c.slash&&a.match(/\*\//)){n.stack.shift();n.commentType=null} -else if(n.commentType===c.parenthesis&&a.match(/\*\)/)){n.stack.shift();n.commentType=null} -else{a.match(/^.[^\*]*/)}};return'comment';case t.characterClass:while(n.stack[0]===t.characterClass&&!a.eol()){if(!(a.match(/^[^\]\\]+/)||a.match(/^\\./))){n.stack.shift()}};return'operator'};var f=a.peek();if(r!==null&&(n.braced||f==='{')){if(n.localState===null)n.localState=e.startState(r);var i=r.token(a,n.localState),l=a.current();if(!i){for(var s=0;s<l.length;s++){if(l[s]==='{'){if(n.braced===0){i='matchingbracket'};n.braced++} -else if(l[s]==='}'){n.braced--;if(n.braced===0){i='matchingbracket'}}}};return i};switch(f){case'[':a.next();n.stack.unshift(t.characterClass);return'bracket';case':':case'|':case';':a.next();return'operator';case'%':if(a.match('%%')){return'header'} -else if(a.match(/[%][A-Za-z]+/)){return'keyword'} -else if(a.match(/[%][}]/)){return'matchingbracket'};break;case'/':if(a.match(/[\/][A-Za-z]+/)){return'keyword'};case'\\':if(a.match(/[\][a-z]+/)){return'string-2'};case'.':if(a.match('.')){return'atom'};case'*':case'-':case'+':case'^':if(a.match(f)){return'atom'};case'$':if(a.match('$$')){return'builtin'} -else if(a.match(/[$][0-9]+/)){return'variable-3'};case'<':if(a.match(/<<[a-zA-Z_]+>>/)){return'builtin'}};if(a.match(/^\/\//)){a.skipToEnd();return'comment'} -else if(a.match(/return/)){return'operator'} -else if(a.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)){if(a.match(/(?=[\(.])/)){return'variable'} -else if(a.match(/(?=[\s\n]*[:=])/)){return'def'};return'variable-2'} -else if(['[',']','(',')'].indexOf(a.peek())!=-1){a.next();return'bracket'} -else if(!a.eatSpace()){a.next()};return null}}});e.defineMIME('text/x-ebnf','ebnf')}); -/* ./modules/editor/codemirror/mode/http/http.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('http',function(){function r(r,t){r.skipToEnd();t.cur=e;return'error'};function n(e,t){if(e.match(/^HTTP\/\d\.\d/)){t.cur=i;return'keyword'} -else if(e.match(/^[A-Z]+/)&&/[ \t]/.test(e.peek())){t.cur=o;return'keyword'} -else{return r(e,t)}};function i(e,n){var i=e.match(/^\d+/);if(!i)return r(e,n);n.cur=u;var t=Number(i[0]);if(t>=100&&t<200){return'positive informational'} -else if(t>=200&&t<300){return'positive success'} -else if(t>=300&&t<400){return'positive redirect'} -else if(t>=400&&t<500){return'negative client-error'} -else if(t>=500&&t<600){return'negative server-error'} -else{return'error'}};function u(r,t){r.skipToEnd();t.cur=e;return null};function o(e,r){e.eatWhile(/\S/);r.cur=c;return'string-2'};function c(t,n){if(t.match(/^HTTP\/\d\.\d$/)){n.cur=e;return'keyword'} -else{return r(t,n)}};function e(e){if(e.sol()&&!e.eat(/[ \t]/)){if(e.match(/^.*?:/)){return'atom'} -else{e.skipToEnd();return'error'}} -else{e.skipToEnd();return'string'}};function t(e){e.skipToEnd();return null};return{token:function(r,n){var i=n.cur;if(i!=e&&i!=t&&r.eatSpace())return null;return i(r,n)},blankLine:function(e){e.cur=t},startState:function(){return{cur:n}}}});e.defineMIME('message/http','http')}); -/* ./modules/editor/codemirror/mode/textile/textile.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object'){e(require('../../lib/codemirror'))} -else if(typeof define=='function'&&define.amd){define(['../../lib/codemirror'],e)} -else{e(CodeMirror)}})(function(i){'use strict';var r={addition:'positive',attributes:'attribute',bold:'strong',cite:'keyword',code:'atom',definitionList:'number',deletion:'negative',div:'punctuation',em:'em',footnote:'variable',footCite:'qualifier',header:'header',html:'comment',image:'string',italic:'em',link:'link',linkDefinition:'link',list1:'variable-2',list2:'variable-3',list3:'keyword',notextile:'string-2',pre:'operator',p:'property',quote:'bracket',span:'quote',specialChar:'tag',strong:'strong',sub:'builtin',sup:'builtin',table:'variable-3',tableHeading:'operator'};function f(e,i){i.mode=n.newLayout;i.tableHeading=!1;if(i.layoutType==='definitionList'&&i.spanningLayout&&e.match(t('definitionListEnd'),!1))i.spanningLayout=!1};function s(e,t,i){if(i==='_'){if(e.eat('_'))return l(e,t,'italic',/__/,2);else return l(e,t,'em',/_/,1)};if(i==='*'){if(e.eat('*')){return l(e,t,'bold',/\*\*/,2)};return l(e,t,'strong',/\*/,1)};if(i==='['){if(e.match(/\d+\]/))t.footCite=!0;return a(t)};if(i==='('){var u=e.match(/^(r|tm|c)\)/);if(u)return o(t,r.specialChar)};if(i==='<'&&e.match(/(\w+)[^>]+>[^<]+<\/\1>/))return o(t,r.html);if(i==='?'&&e.eat('?'))return l(e,t,'cite',/\?\?/,2);if(i==='='&&e.eat('='))return l(e,t,'notextile',/==/,2);if(i==='-'&&!e.eat('-'))return l(e,t,'deletion',/-/,1);if(i==='+')return l(e,t,'addition',/\+/,1);if(i==='~')return l(e,t,'sub',/~/,1);if(i==='^')return l(e,t,'sup',/\^/,1);if(i==='%')return l(e,t,'span',/%/,1);if(i==='@')return l(e,t,'code',/@/,1);if(i==='!'){var n=l(e,t,'image',/(?:\([^\)]+\))?!/,1);e.match(/^:\S+/);return n};return a(t)};function l(e,t,i,u,o){var r=e.pos>o?e.string.charAt(e.pos-o-1):null,l=e.peek();if(t[i]){if((!l||/\W/.test(l))&&r&&/\S/.test(r)){var s=a(t);t[i]=!1;return s}} -else if((!r||/\W/.test(r))&&l&&/\S/.test(l)&&e.match(new RegExp('^.*\\S'+u.source+'(?:\\W|$)'),!1)){t[i]=!0;t.mode=n.attributes};return a(t)};function a(e){var i=u(e);if(i)return i;var t=[];if(e.layoutType)t.push(r[e.layoutType]);t=t.concat(c(e,'addition','bold','cite','code','deletion','em','footCite','image','italic','link','span','strong','sub','sup','table','tableHeading'));if(e.layoutType==='header')t.push(r.header+'-'+e.header);return t.length?t.join(' '):null};function u(e){var t=e.layoutType;switch(t){case'notextile':case'code':case'pre':return r[t];default:if(e.notextile)return r.notextile+(t?(' '+r[t]):'');return null}};function o(e,t){var n=u(e);if(n)return n;var i=a(e);if(t)return i?(i+' '+t):t;else return i};function c(e){var i=[];for(var t=1;t<arguments.length;++t){if(e[arguments[t]])i.push(r[arguments[t]])};return i};function d(e){var i=e.spanningLayout,a=e.layoutType;for(var t in e)if(e.hasOwnProperty(t))delete e[t];e.mode=n.newLayout;if(i){e.layoutType=a;e.spanningLayout=!0}};var e={cache:{},single:{bc:'bc',bq:'bq',definitionList:/- .*?:=+/,definitionListEnd:/.*=:\s*$/,div:'div',drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:'notextile',para:'p',pre:'pre',table:'table',tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(i){switch(i){case'drawTable':return e.makeRe('^',e.single.drawTable,'$');case'html':return e.makeRe('^',e.single.html,'(?:',e.single.html,')*','$');case'linkDefinition':return e.makeRe('^',e.single.linkDefinition,'$');case'listLayout':return e.makeRe('^',e.single.list,t('allAttributes'),'*\\s+');case'tableCellAttributes':return e.makeRe('^',e.choiceRe(e.single.tableCellAttributes,t('allAttributes')),'+\\.');case'type':return e.makeRe('^',t('allTypes'));case'typeLayout':return e.makeRe('^',t('allTypes'),t('allAttributes'),'*\\.\\.?','(\\s+|$)');case'attributes':return e.makeRe('^',t('allAttributes'),'+');case'allTypes':return e.choiceRe(e.single.div,e.single.foot,e.single.header,e.single.bc,e.single.bq,e.single.notextile,e.single.pre,e.single.table,e.single.para);case'allAttributes':return e.choiceRe(e.attributes.selector,e.attributes.css,e.attributes.lang,e.attributes.align,e.attributes.pad);default:return e.makeRe('^',e.single[i])}},makeRe:function(){var i='';for(var t=0;t<arguments.length;++t){var e=arguments[t];i+=(typeof e==='string')?e:e.source};return new RegExp(i)},choiceRe:function(){var i=[arguments[0]];for(var t=1;t<arguments.length;++t){i[t*2-1]='|';i[t*2]=arguments[t]};i.unshift('(?:');i.push(')');return e.makeRe.apply(null,i)}};function t(t){return(e.cache[t]||(e.cache[t]=e.createRe(t)))};var n={newLayout:function(e,i){if(e.match(t('typeLayout'),!1)){i.spanningLayout=!1;return(i.mode=n.blockType)(e,i)};var a;if(!u(i)){if(e.match(t('listLayout'),!1))a=n.list;else if(e.match(t('drawTable'),!1))a=n.table;else if(e.match(t('linkDefinition'),!1))a=n.linkDefinition;else if(e.match(t('definitionList')))a=n.definitionList;else if(e.match(t('html'),!1))a=n.html};return(i.mode=(a||n.text))(e,i)},blockType:function(i,e){var l,r;e.layoutType=null;if(l=i.match(t('type')))r=l[0];else return(e.mode=n.text)(i,e);if(l=r.match(t('header'))){e.layoutType='header';e.header=parseInt(l[0][1])} -else if(r.match(t('bq'))){e.layoutType='quote'} -else if(r.match(t('bc'))){e.layoutType='code'} -else if(r.match(t('foot'))){e.layoutType='footnote'} -else if(r.match(t('notextile'))){e.layoutType='notextile'} -else if(r.match(t('pre'))){e.layoutType='pre'} -else if(r.match(t('div'))){e.layoutType='div'} -else if(r.match(t('table'))){e.layoutType='table'};e.mode=n.attributes;return a(e)},text:function(e,i){if(e.match(t('text')))return a(i);var r=e.next();if(r==='"')return(i.mode=n.link)(e,i);return s(e,i,r)},attributes:function(e,i){i.mode=n.layoutLength;if(e.match(t('attributes')))return o(i,r.attributes);else return a(i)},layoutLength:function(e,t){if(e.eat('.')&&e.eat('.'))t.spanningLayout=!0;t.mode=n.text;return a(t)},list:function(e,i){var l=e.match(t('list'));i.listDepth=l[0].length;var r=(i.listDepth-1)%3;if(!r)i.layoutType='list1';else if(r===1)i.layoutType='list2';else i.layoutType='list3';i.mode=n.attributes;return a(i)},link:function(e,i){i.mode=n.text;if(e.match(t('link'))){e.match(/\S+/);return o(i,r.link)};return a(i)},linkDefinition:function(e,t){e.skipToEnd();return o(t,r.linkDefinition)},definitionList:function(e,i){e.match(t('definitionList'));i.layoutType='definitionList';if(e.match(/\s*$/))i.spanningLayout=!0;else i.mode=n.attributes;return a(i)},html:function(e,t){e.skipToEnd();return o(t,r.html)},table:function(e,t){t.layoutType='table';return(t.mode=n.tableCell)(e,t)},tableCell:function(e,i){if(e.match(t('tableHeading')))i.tableHeading=!0;else e.eat('|');i.mode=n.tableCellAttributes;return a(i)},tableCellAttributes:function(e,i){i.mode=n.tableText;if(e.match(t('tableCellAttributes')))return o(i,r.attributes);else return a(i)},tableText:function(e,i){if(e.match(t('tableText')))return a(i);if(e.peek()==='|'){i.mode=n.tableCell;return a(i)};return s(e,i,e.next())}};i.defineMode('textile',function(){return{startState:function(){return{mode:n.newLayout}},token:function(e,t){if(e.sol())f(e,t);return t.mode(e,t)},blankLine:d}});i.defineMIME('text/x-textile','textile')}); -/* ./modules/editor/codemirror/mode/r/r.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.registerHelper('wordChars','r',/[\w.]/);e.defineMode('r',function(e){function r(e){var r=e.split(' '),n={};for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var s=r('NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_'),d=r('list quote bquote eval return call parse deparse'),p=r('if else repeat while function for in next break'),m=r('if else repeat while function for'),u=/[+\-*\/^<>=!&|~$:]/,t;function a(e,n){t=null;var r=e.next();if(r=='#'){e.skipToEnd();return'comment'} -else if(r=='0'&&e.eat('x')){e.eatWhile(/[\da-f]/i);return'number'} -else if(r=='.'&&e.eat(/\d/)){e.match(/\d*(?:e[+\-]?\d+)?/);return'number'} -else if(/\d/.test(r)){e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/);return'number'} -else if(r=='\''||r=='"'){n.tokenize=x(r);return'string'} -else if(r=='`'){e.match(/[^`]+`/);return'variable-3'} -else if(r=='.'&&e.match(/.[.\d]+/)){return'keyword'} -else if(/[\w\.]/.test(r)&&r!='_'){e.eatWhile(/[\w\.]/);var i=e.current();if(s.propertyIsEnumerable(i))return'atom';if(p.propertyIsEnumerable(i)){if(m.propertyIsEnumerable(i)&&!e.match(/\s*if(\s+|$)/,!1))t='block';return'keyword'};if(d.propertyIsEnumerable(i))return'builtin';return'variable'} -else if(r=='%'){if(e.skipTo('%'))e.next();return'operator variable-2'} -else if((r=='<'&&e.eat('-'))||(r=='<'&&e.match('<-'))||(r=='-'&&e.match(/>>?/))){return'operator arrow'} -else if(r=='='&&n.ctx.argList){return'arg-is'} -else if(u.test(r)){if(r=='$')return'operator dollar';e.eatWhile(u);return'operator'} -else if(/[\(\){}\[\];]/.test(r)){t=r;if(r==';')return'semi';return null} -else{return null}};function x(e){return function(t,r){if(t.eat('\\')){var n=t.next();if(n=='x')t.match(/^[a-f0-9]{2}/i);else if((n=='u'||n=='U')&&t.eat('{')&&t.skipTo('}'))t.next();else if(n=='u')t.match(/^[a-f0-9]{4}/i);else if(n=='U')t.match(/^[a-f0-9]{8}/i);else if(/[0-7]/.test(n))t.match(/^[0-7]{1,2}/);return'string-2'} -else{var i;while((i=t.next())!=null){if(i==e){r.tokenize=a;break};if(i=='\\'){t.backUp(1);break}};return'string'}}};var o=1,i=2,f=4;function n(e,t,r){e.ctx={type:t,indent:e.indent,flags:0,column:r.column(),prev:e.ctx}};function c(e,t){var r=e.ctx;e.ctx={type:r.type,indent:r.indent,flags:r.flags|t,column:r.column,prev:r.prev}};function l(e){e.indent=e.ctx.indent;e.ctx=e.ctx.prev};return{startState:function(){return{tokenize:a,ctx:{type:'top',indent:-e.indentUnit,flags:i},indent:0,afterIdent:!1}},token:function(r,e){if(r.sol()){if((e.ctx.flags&3)==0)e.ctx.flags|=i;if(e.ctx.flags&f)l(e);e.indent=r.indentation()};if(r.eatSpace())return null;var a=e.tokenize(r,e);if(a!='comment'&&(e.ctx.flags&i)==0)c(e,o);if((t==';'||t=='{'||t=='}')&&e.ctx.type=='block')l(e);if(t=='{')n(e,'}',r);else if(t=='('){n(e,')',r);if(e.afterIdent)e.ctx.argList=!0} -else if(t=='[')n(e,']',r);else if(t=='block')n(e,'block',r);else if(t==e.ctx.type)l(e);else if(e.ctx.type=='block'&&a!='comment')c(e,f);e.afterIdent=a=='variable'||a=='keyword';return a},indent:function(t,n){if(t.tokenize!=a)return 0;var i=n&&n.charAt(0),r=t.ctx,l=i==r.type;if(r.flags&f)r=r.prev;if(r.type=='block')return r.indent+(i=='{'?0:e.indentUnit);else if(r.flags&o)return r.column+(l?0:1);else return r.indent+(l?0:e.indentUnit)},lineComment:'#'}});e.defineMIME('text/x-rsrc','r')}); -/* ./modules/editor/codemirror/mode/haml/haml.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../ruby/ruby'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../ruby/ruby'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('haml',function(t){var r=e.getMode(t,{name:'htmlmixed'});var i=e.getMode(t,'ruby');function u(e){return function(t,i){var r=t.peek();if(r==e&&i.rubyState.tokenize.length==1){t.next();i.tokenize=o;return'closeAttributeTag'} -else{return n(t,i)}}};function n(e,t){if(e.match('-#')){e.skipToEnd();return'comment'};return i.token(e,t.rubyState)};function o(t,e){var i=t.peek();if(e.previousToken.style=='comment'){if(e.indented>e.previousToken.indented){t.skipToEnd();return'commentLine'}};if(e.startOfLine){if(i=='!'&&t.match('!!')){t.skipToEnd();return'tag'} -else if(t.match(/^%[\w:#\.]+=/)){e.tokenize=n;return'hamlTag'} -else if(t.match(/^%[\w:]+/)){return'hamlTag'} -else if(i=='/'){t.skipToEnd();return'comment'}};if(e.startOfLine||e.previousToken.style=='hamlTag'){if(i=='#'||i=='.'){t.match(/[\w-#\.]*/);return'hamlAttribute'}};if(e.startOfLine&&!t.match('-->',!1)&&(i=='='||i=='-')){e.tokenize=n;return e.tokenize(t,e)};if(e.previousToken.style=='hamlTag'||e.previousToken.style=='closeAttributeTag'||e.previousToken.style=='hamlAttribute'){if(i=='('){e.tokenize=u(')');return e.tokenize(t,e)} -else if(i=='{'){if(!t.match(/^\{%.*/)){e.tokenize=u('}');return e.tokenize(t,e)}}};return r.token(t,e.htmlState)};return{startState:function(){var t=e.startState(r),n=e.startState(i);return{htmlState:t,rubyState:n,indented:0,previousToken:{style:null,indented:0},tokenize:o}},copyState:function(t){return{htmlState:e.copyState(r,t.htmlState),rubyState:e.copyState(i,t.rubyState),indented:t.indented,previousToken:t.previousToken,tokenize:t.tokenize}},token:function(e,t){if(e.sol()){t.indented=e.indentation();t.startOfLine=!0};if(e.eatSpace())return null;var i=t.tokenize(e,t);t.startOfLine=!1;if(i&&i!='commentLine'){t.previousToken={style:i,indented:t.indented}};if(e.eol()&&t.tokenize==n){e.backUp(1);var r=e.peek();e.next();if(r&&r!=','){t.tokenize=o}};if(i=='hamlTag'){i='tag'} -else if(i=='commentLine'){i='comment'} -else if(i=='hamlAttribute'){i='attribute'} -else if(i=='closeAttributeTag'){i=null};return i}}},'htmlmixed','ruby');e.defineMIME('text/x-haml','haml')}); -/* ./modules/editor/codemirror/mode/ecl/ecl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ecl',function(t){function n(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};function v(e,t){if(!t.startOfLine)return!1;e.skipToEnd();return'meta'};var l=t.indentUnit,p=n('abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode'),m=n('apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait'),h=n('__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath'),c=n('ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode'),y=n('checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when'),r=n('catch class do else finally for if switch try while'),b=n('true false null'),u={'#':v};var s=/[+\-*&%=<>!?|\/]/,e;function o(t,i){var o=t.next();if(u[o]){var f=u[o](t,i);if(f!==!1)return f};if(o=='"'||o=='\''){i.tokenize=g(o);return i.tokenize(t,i)};if(/[\[\]{}\(\),;\:\.]/.test(o)){e=o;return null};if(/\d/.test(o)){t.eatWhile(/[\w\.]/);return'number'};if(o=='/'){if(t.eat('*')){i.tokenize=d;return d(t,i)};if(t.eat('/')){t.skipToEnd();return'comment'}};if(s.test(o)){t.eatWhile(s);return'operator'};t.eatWhile(/[\w\$_]/);var n=t.current().toLowerCase();if(p.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'keyword'} -else if(m.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'variable'} -else if(h.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'variable-2'} -else if(c.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'variable-3'} -else if(y.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'builtin'} -else{var a=n.length-1;while(a>=0&&(!isNaN(n[a])||n[a]=='_'))--a;if(a>0){var l=n.substr(0,a+1);if(c.propertyIsEnumerable(l)){if(r.propertyIsEnumerable(l))e='newstatement';return'variable-3'}}};if(b.propertyIsEnumerable(n))return'atom';return null};function g(e){return function(t,n){var r=!1,i,a=!1;while((i=t.next())!=null){if(i==e&&!r){a=!0;break};r=!r&&i=='\\'};if(a||!r)n.tokenize=o;return'string'}};function d(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=o;break};r=(n=='*')};return'comment'};function f(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function a(e,t,n){return e.context=new f(e.indented,t,n,null,e.context)};function i(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new f((e||0)-l,0,'top',!1),indented:0,startOfLine:!0}},token:function(t,n){var r=n.context;if(t.sol()){if(r.align==null)r.align=!1;n.indented=t.indentation();n.startOfLine=!0};if(t.eatSpace())return null;e=null;var l=(n.tokenize||o)(t,n);if(l=='comment'||l=='meta')return l;if(r.align==null)r.align=!0;if((e==';'||e==':')&&r.type=='statement')i(n);else if(e=='{')a(n,t.column(),'}');else if(e=='[')a(n,t.column(),']');else if(e=='(')a(n,t.column(),')');else if(e=='}'){while(r.type=='statement')r=i(n);if(r.type=='}')r=i(n);while(r.type=='statement')r=i(n)} -else if(e==r.type)i(n);else if(r.type=='}'||r.type=='top'||(r.type=='statement'&&e=='newstatement'))a(n,t.column(),'statement');n.startOfLine=!1;return l},indent:function(e,t){if(e.tokenize!=o&&e.tokenize!=null)return 0;var n=e.context,r=t&&t.charAt(0);if(n.type=='statement'&&r=='}')n=n.prev;var i=r==n.type;if(n.type=='statement')return n.indented+(r=='{'?0:l);else if(n.align)return n.column+(i?0:1);else return n.indented+(i?0:l)},electricChars:'{}'}});e.defineMIME('text/x-ecl','ecl')}); -/* ./modules/editor/codemirror/mode/cypher/cypher.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var t=function(e){return new RegExp('^(?:'+e.join('|')+')$','i')};e.defineMode('cypher',function(n){var c=function(e){var t=e.next();if(t==='"'){e.match(/.*?"/);return'string'};if(t==='\''){e.match(/.*?'/);return'string'};if(/[{}\(\),\.;\[\]]/.test(t)){r=t;return'node'} -else if(t==='/'&&e.eat('/')){e.skipToEnd();return'comment'} -else if(a.test(t)){e.eatWhile(a);return null} -else{e.eatWhile(/[_\w\d]/);if(e.eat(':')){e.eatWhile(/[\w\d_\-]/);return'atom'};var n=e.current();if(l.test(n))return'builtin';if(d.test(n))return'def';if(u.test(n))return'keyword';return'variable'}},i=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},o=function(e){e.indent=e.context.indent;return e.context=e.context.prev},s=n.indentUnit,r,l=t(['abs','acos','allShortestPaths','asin','atan','atan2','avg','ceil','coalesce','collect','cos','cot','count','degrees','e','endnode','exp','extract','filter','floor','haversin','head','id','keys','labels','last','left','length','log','log10','lower','ltrim','max','min','node','nodes','percentileCont','percentileDisc','pi','radians','rand','range','reduce','rel','relationship','relationships','replace','reverse','right','round','rtrim','shortestPath','sign','sin','size','split','sqrt','startnode','stdev','stdevp','str','substring','sum','tail','tan','timestamp','toFloat','toInt','toString','trim','type','upper']),d=t(['all','and','any','contains','exists','has','in','none','not','or','single','xor']),u=t(['as','asc','ascending','assert','by','case','commit','constraint','create','csv','cypher','delete','desc','descending','detach','distinct','drop','else','end','ends','explain','false','fieldterminator','foreach','from','headers','in','index','is','join','limit','load','match','merge','null','on','optional','order','periodic','profile','remove','return','scan','set','skip','start','starts','then','true','union','unique','unwind','using','when','where','with','call','yield']),a=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()){if(e.context&&(e.context.align==null)){e.context.align=!1};e.indent=t.indentation()};if(t.eatSpace()){return null};var n=e.tokenize(t,e);if(n!=='comment'&&e.context&&(e.context.align==null)&&e.context.type!=='pattern'){e.context.align=!0};if(r==='('){i(e,')',t.column())} -else if(r==='['){i(e,']',t.column())} -else if(r==='{'){i(e,'}',t.column())} -else if(/[\]\}\)]/.test(r)){while(e.context&&e.context.type==='pattern'){o(e)};if(e.context&&r===e.context.type){o(e)}} -else if(r==='.'&&e.context&&e.context.type==='pattern'){o(e)} -else if(/atom|string|variable/.test(n)&&e.context){if(/[\}\]]/.test(e.context.type)){i(e,'pattern',t.column())} -else if(e.context.type==='pattern'&&!e.context.align){e.context.align=!0;e.context.col=t.column()}};return n},indent:function(n,r){var o=r&&r.charAt(0),t=n.context;if(/[\]\}]/.test(o)){while(t&&t.type==='pattern'){t=t.prev}};var i=t&&o===t.type;if(!t)return 0;if(t.type==='keywords')return e.commands.newlineAndIndent;if(t.align)return t.col+(i?0:1);return t.indent+(i?0:s)}}});e.modeExtensions['cypher']={autoFormatLineBreaks:function(e){var t,n,r,n=e.split('\n'),r=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g;for(var t=0;t<n.length;t++)n[t]=n[t].replace(r,' \n$1 ').trim();return n.join('\n')}};e.defineMIME('application/x-cypher-query','cypher')}); -/* ./modules/editor/codemirror/mode/sieve/sieve.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sieve',function(e){function t(e){var t={},r=e.split(' ');for(var n=0;n<r.length;++n)t[r[n]]=!0;return t};var i=t('if elsif else stop require'),u=t('true false not'),o=e.indentUnit;function n(e,n){var t=e.next();if(t=='/'&&e.eat('*')){n.tokenize=r;return r(e,n)};if(t==='#'){e.skipToEnd();return'comment'};if(t=='"'){n.tokenize=l(t);return n.tokenize(e,n)};if(t=='('){n._indent.push('(');n._indent.push('{');return null};if(t==='{'){n._indent.push('{');return null};if(t==')'){n._indent.pop();n._indent.pop()};if(t==='}'){n._indent.pop();return null};if(t==',')return null;if(t==';')return null;if(/[{}\(\),;]/.test(t))return null;if(/\d/.test(t)){e.eatWhile(/[\d]/);e.eat(/[KkMmGg]/);return'number'};if(t==':'){e.eatWhile(/[a-zA-Z_]/);e.eatWhile(/[a-zA-Z0-9_]/);return'operator'};e.eatWhile(/\w/);var o=e.current();if((o=='text')&&e.eat(':')){n.tokenize=f;return'string'};if(i.propertyIsEnumerable(o))return'keyword';if(u.propertyIsEnumerable(o))return'atom';return null};function f(e,t){t._multiLineString=!0;if(!e.sol()){e.eatSpace();if(e.peek()=='#'){e.skipToEnd();return'comment'};e.skipToEnd();return'string'};if((e.next()=='.')&&(e.eol())){t._multiLineString=!1;t.tokenize=n};return'string'};function r(e,t){var i=!1,r;while((r=e.next())!=null){if(i&&r=='/'){t.tokenize=n;break};i=(r=='*')};return'comment'};function l(e){return function(t,r){var i=!1,u;while((u=t.next())!=null){if(u==e&&!i)break;i=!i&&u=='\\'};if(!i)r.tokenize=n;return'string'}};return{startState:function(e){return{tokenize:n,baseIndent:e||0,_indent:[]}},token:function(e,t){if(e.eatSpace())return null;return(t.tokenize||n)(e,t)},indent:function(e,n){var t=e._indent.length;if(n&&(n[0]=='}'))t--;if(t<0)t=0;return t*o},electricChars:'}'}});e.defineMIME('application/sieve','sieve')}); -/* ./modules/editor/codemirror/mode/soy/soy.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed'],e);else e(CodeMirror)})(function(e){'use strict';var t=['template','literal','msg','fallbackmsg','let','if','elseif','else','switch','case','default','foreach','ifempty','for','call','param','deltemplate','delcall','log'];e.defineMode('soy',function(a){var r=e.getMode(a,'text/plain'),s={html:e.getMode(a,{name:'text/html',multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:r,text:r,uri:r,css:e.getMode(a,'text/css'),js:e.getMode(a,{name:'text/javascript',statementIndent:2*a.indentUnit})};function n(e){return e[e.length-1]};function l(e,t,s){if(e.sol()){for(var i=0;i<t.indent;i++){if(!e.eat(/\s/))break};if(i)return null};var a=e.string,r=s.exec(a.substr(e.pos));if(r){e.string=a.substr(0,e.pos+r.index)};var l=e.hideFirstChars(t.indent,function(){var a=n(t.localStates);return a.mode.token(e,a.state)});e.string=a;return l};function d(e,t){while(e){if(e.element===t)return!0;e=e.next};return!1};function i(e,t){return{element:t,next:e}};function o(e,t,a){return d(e,t)?'variable-2':(a?'variable':'variable-2 error')};function c(e){if(e.scopes){e.variables=e.scopes.element;e.scopes=e.scopes.next}};return{startState:function(){return{kind:[],kindTag:[],soyState:[],templates:null,variables:i(null,'ij'),scopes:null,indent:0,quoteKind:null,localStates:[{mode:s.html,state:e.startState(s.html)}]}},copyState:function(t){return{tag:t.tag,kind:t.kind.concat([]),kindTag:t.kindTag.concat([]),soyState:t.soyState.concat([]),templates:t.templates,variables:t.variables,scopes:t.scopes,indent:t.indent,quoteKind:t.quoteKind,localStates:t.localStates.map(function(t){return{mode:t.mode,state:e.copyState(t.mode,t.state)}})}},token:function(d,r){var u;switch(n(r.soyState)){case'comment':if(d.match(/^.*?\*\//)){r.soyState.pop()} -else{d.skipToEnd()};if(!r.scopes){var h=/@param\??\s+(\S+)/g,g=d.current();for(var u;(u=h.exec(g));){r.variables=i(r.variables,u[1])}};return'comment';case'string':var u=d.match(/^.*?(["']|\\[\s\S])/);if(!u){d.skipToEnd()} -else if(u[1]==r.quoteKind){r.quoteKind=null;r.soyState.pop()};return'string'};if(d.match(/^\/\*/)){r.soyState.push('comment');return'comment'} -else if(d.match(d.sol()||(r.soyState.length&&n(r.soyState)!='literal')?/^\s*\/\/.*/:/^\s+\/\/.*/)){return'comment'};switch(n(r.soyState)){case'templ-def':if(u=d.match(/^\.?([\w]+(?!\.[\w]+)*)/)){r.templates=i(r.templates,u[1]);r.scopes=i(r.scopes,r.variables);r.soyState.pop();return'def'};d.next();return null;case'templ-ref':if(u=d.match(/^\.?([\w]+)/)){r.soyState.pop();if(u[0][0]=='.'){return o(r.templates,u[1],!0)};return'variable'};d.next();return null;case'param-def':if(u=d.match(/^\w+/)){r.variables=i(r.variables,u[0]);r.soyState.pop();r.soyState.push('param-type');return'def'};d.next();return null;case'param-type':if(d.peek()=='}'){r.soyState.pop();return null};if(d.eatWhile(/^[\w]+/)){return'variable-3'};d.next();return null;case'var-def':if(u=d.match(/^\$([\w]+)/)){r.variables=i(r.variables,u[1]);r.soyState.pop();return'def'};d.next();return null;case'tag':if(d.match(/^\/?}/)){if(r.tag=='/template'||r.tag=='/deltemplate'){c(r);r.variables=i(null,'ij');r.indent=0} -else{if(r.tag=='/for'||r.tag=='/foreach'){c(r)};r.indent-=a.indentUnit*(d.current()=='/}'||t.indexOf(r.tag)==-1?2:1)};r.soyState.pop();return'keyword'} -else if(d.match(/^([\w?]+)(?==)/)){if(d.current()=='kind'&&(u=d.match(/^="([^"]+)/,!1))){var p=u[1];r.kind.push(p);r.kindTag.push(r.tag);var f=s[p]||s.html,m=n(r.localStates);if(m.mode.indent){r.indent+=m.mode.indent(m.state,'')};r.localStates.push({mode:f,state:e.startState(f)})};return'attribute'} -else if(u=d.match(/^["']/)){r.soyState.push('string');r.quoteKind=u;return'string'};if(u=d.match(/^\$([\w]+)/)){return o(r.variables,u[1])};if(u=d.match(/^\w+/)){return/^(?:as|and|or|not|in)$/.test(u[0])?'keyword':null};d.next();return null;case'literal':if(d.match(/^(?=\{\/literal})/)){r.indent-=a.indentUnit;r.soyState.pop();return this.token(d,r)};return l(d,r,/\{\/literal}/)};if(d.match(/^\{literal}/)){r.indent+=a.indentUnit;r.soyState.push('literal');return'keyword'} -else if(u=d.match(/^\{([\/@\\]?\w+\??)(?=[\s\}]|\/[/*])/)){if(u[1]!='/switch')r.indent+=(/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(u[1])&&r.tag!='switch'?1:2)*a.indentUnit;r.tag=u[1];if(r.tag=='/'+n(r.kindTag)){r.kind.pop();r.kindTag.pop();r.localStates.pop();var m=n(r.localStates);if(m.mode.indent){r.indent-=m.mode.indent(m.state,'')}};r.soyState.push('tag');if(r.tag=='template'||r.tag=='deltemplate'){r.soyState.push('templ-def')} -else if(r.tag=='call'||r.tag=='delcall'){r.soyState.push('templ-ref')} -else if(r.tag=='let'){r.soyState.push('var-def')} -else if(r.tag=='for'||r.tag=='foreach'){r.scopes=i(r.scopes,r.variables);r.soyState.push('var-def')} -else if(r.tag=='namespace'){if(!r.scopes){r.variables=i(null,'ij')}} -else if(r.tag.match(/^@(?:param\??|inject)/)){r.soyState.push('param-def')};return'keyword'} -else if(d.eat('{')){r.tag='print';r.indent+=2*a.indentUnit;r.soyState.push('tag');return'keyword'};return l(d,r,/\{|\s+\/\/|\/\*/)},indent:function(t,i){var s=t.indent,l=n(t.soyState);if(l=='comment')return e.Pass;if(l=='literal'){if(/^\{\/literal}/.test(i))s-=a.indentUnit} -else{if(/^\s*\{\/(template|deltemplate)\b/.test(i))return 0;if(/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(i))s-=a.indentUnit;if(t.tag!='switch'&&/^\{(case|default)\b/.test(i))s-=a.indentUnit;if(/^\{\/switch\b/.test(i))s-=a.indentUnit};var r=n(t.localStates);if(s&&r.mode.indent){s+=r.mode.indent(r.state,i)};return s},innerMode:function(e){if(e.soyState.length&&n(e.soyState)!='literal')return null;else return n(e.localStates)},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:'//',blockCommentStart:'/*',blockCommentEnd:'*/',blockCommentContinue:' * ',useInnerComments:!1,fold:'indent'}},'htmlmixed');e.registerHelper('hintWords','soy',t.concat(['delpackage','namespace','alias','print','css','debugger']));e.defineMIME('text/x-soy','soy')}); -/* ./modules/editor/codemirror/mode/pig/pig.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('pig',function(e,O){var E=O.keywords,t=O.builtins,I=O.types,A=O.multiLineStrings,T=/[*+\-%<>=&?:\/!|]/;function N(e,O,T){O.tokenize=T;return T(e,O)};function n(e,O){var E=!1,T;while(T=e.next()){if(T=='/'&&E){O.tokenize=r;break};E=(T=='*')};return'comment'};function R(e){return function(O,T){var E=!1,t,I=!1;while((t=O.next())!=null){if(t==e&&!E){I=!0;break};E=!E&&t=='\\'};if(I||!(E||A))T.tokenize=r;return'error'}};function r(e,r){var O=e.next();if(O=='"'||O=='\'')return N(e,r,R(O));else if(/[\[\]{}\(\),;\.]/.test(O))return null;else if(/\d/.test(O)){e.eatWhile(/[\w\.]/);return'number'} -else if(O=='/'){if(e.eat('*')){return N(e,r,n)} -else{e.eatWhile(T);return'operator'}} -else if(O=='-'){if(e.eat('-')){e.skipToEnd();return'comment'} -else{e.eatWhile(T);return'operator'}} -else if(T.test(O)){e.eatWhile(T);return'operator'} -else{e.eatWhile(/[\w\$_]/);if(E&&E.propertyIsEnumerable(e.current().toUpperCase())){if(!e.eat(')')&&!e.eat('.'))return'keyword'};if(t&&t.propertyIsEnumerable(e.current().toUpperCase()))return'variable-2';if(I&&I.propertyIsEnumerable(e.current().toUpperCase()))return'variable-3';return'variable'}};return{startState:function(){return{tokenize:r,startOfLine:!0}},token:function(e,O){if(e.eatSpace())return null;var T=O.tokenize(e,O);return T}}});(function(){function O(e){var T={},r=e.split(' ');for(var O=0;O<r.length;++O)T[r[O]]=!0;return T};var T='ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ',r='VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE NEQ MATCHES TRUE FALSE DUMP',E='BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ';e.defineMIME('text/x-pig',{name:'pig',builtins:O(T),keywords:O(r),types:O(E)});e.registerHelper('hintWords','pig',(T+E+r).split(' '))}())}); -/* ./modules/editor/codemirror/mode/apl/apl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('apl',function(){var a={'.':'innerProduct','\\':'scan','/':'reduce','⌿':'reduce1Axis','⍀':'scan1Axis','¨':'each','⍣':'power'};var e={'+':['conjugate','add'],'−':['negate','subtract'],'×':['signOf','multiply'],'÷':['reciprocal','divide'],'⌈':['ceiling','greaterOf'],'⌊':['floor','lesserOf'],'∣':['absolute','residue'],'⍳':['indexGenerate','indexOf'],'?':['roll','deal'],'⋆':['exponentiate','toThePowerOf'],'⍟':['naturalLog','logToTheBase'],'○':['piTimes','circularFuncs'],'!':['factorial','binomial'],'⌹':['matrixInverse','matrixDivide'],'<':[null,'lessThan'],'≤':[null,'lessThanOrEqual'],'=':[null,'equals'],'>':[null,'greaterThan'],'≥':[null,'greaterThanOrEqual'],'≠':[null,'notEqual'],'≡':['depth','match'],'≢':[null,'notMatch'],'∈':['enlist','membership'],'⍷':[null,'find'],'∪':['unique','union'],'∩':[null,'intersection'],'∼':['not','without'],'∨':[null,'or'],'∧':[null,'and'],'⍱':[null,'nor'],'⍲':[null,'nand'],'⍴':['shapeOf','reshape'],',':['ravel','catenate'],'⍪':[null,'firstAxisCatenate'],'⌽':['reverse','rotate'],'⊖':['axis1Reverse','axis1Rotate'],'⍉':['transpose',null],'↑':['first','take'],'↓':[null,'drop'],'⊂':['enclose','partitionWithAxis'],'⊃':['diclose','pick'],'⌷':[null,'index'],'⍋':['gradeUp',null],'⍒':['gradeDown',null],'⊤':['encode',null],'⊥':['decode',null],'⍕':['format','formatByExample'],'⍎':['execute',null],'⊣':['stop','left'],'⊢':['pass','right']};var n=/[\.\/⌿⍀¨⍣]/,t=/⍬/,r=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,l=/←/,i=/[⍝#].*$/,u=function(e){var n;n=!1;return function(t){n=t;if(t===e){return n==='\\'};return!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(s,f){var o,c;if(s.eatSpace()){return null};o=s.next();if(o==='"'||o==='\''){s.eatWhile(u(o));s.next();f.prev=!0;return'string'};if(/[\[{\(]/.test(o)){f.prev=!1;return null};if(/[\]}\)]/.test(o)){f.prev=!0;return null};if(t.test(o)){f.prev=!1;return'niladic'};if(/[¯\d]/.test(o)){if(f.func){f.func=!1;f.prev=!1} -else{f.prev=!0};s.eatWhile(/[\w\.]/);return'number'};if(n.test(o)){return'operator apl-'+a[o]};if(l.test(o)){return'apl-arrow'};if(r.test(o)){c='apl-';if(e[o]!=null){if(f.prev){c+=e[o][1]} -else{c+=e[o][0]}};f.func=!0;f.prev=!1;return'function '+c};if(i.test(o)){s.skipToEnd();return'comment'};if(o==='∘'&&s.peek()==='.'){s.next();return'function jot-dot'};s.eatWhile(/[\w\$_]/);f.prev=!0;return'keyword'}}});e.defineMIME('text/apl','apl')}); -/* ./modules/editor/codemirror/mode/crystal/crystal.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('crystal',function(e){function r(e,t){return new RegExp((t?'':'^')+'(?:'+e.join('|')+')'+(t?'$':'\\b'))};function t(e,t,n){n.tokenize.push(e);return e(t,n)};var c=/^(?:[-+/%|&^]|\*\*?|[<>]{2})/,s=/^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/,h=/^(?:\[\][?=]?)/,z=/^(?:\.(?:\.{2})?|->|[?:])/,u=/^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/,o=/^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/,b=r(['abstract','alias','as','asm','begin','break','case','class','def','do','else','elsif','end','ensure','enum','extend','for','fun','if','include','instance_sizeof','lib','macro','module','next','of','out','pointerof','private','protected','rescue','return','require','select','sizeof','struct','super','then','type','typeof','uninitialized','union','unless','until','when','while','with','yield','__DIR__','__END_LINE__','__FILE__','__LINE__']),x=r(['true','false','nil','self']),y=['def','fun','macro','class','module','struct','lib','enum','union','do','for'],g=r(y),I=['if','unless','case','while','until','begin','then'],w=r(I),p=['end','else','elsif','rescue','ensure'],v=r(p),d=['\\)','\\}','\\]'],S=new RegExp('^(?:'+d.join('|')+')$'),k={'def':F,'fun':F,'macro':E,'class':i,'module':i,'struct':i,'lib':i,'enum':i,'union':i};var f={'[':']','{':'}','(':')','<':'>'};function l(e,r){if(e.eatSpace()){return null};if(r.lastToken!='\\'&&e.match('{%',!1)){return t(n('%','%'),e,r)};if(r.lastToken!='\\'&&e.match('{{',!1)){return t(n('{','}'),e,r)};if(e.peek()=='#'){e.skipToEnd();return'comment'};var i;if(e.match(u)){e.eat(/[?!]/);i=e.current();if(e.eat(':')){return'atom'} -else if(r.lastToken=='.'){return'property'} -else if(b.test(i)){if(g.test(i)){if(!(i=='fun'&&r.blocks.indexOf('lib')>=0)&&!(i=='def'&&r.lastToken=='abstract')){r.blocks.push(i);r.currentIndent+=1}} -else if((r.lastStyle=='operator'||!r.lastStyle)&&w.test(i)){r.blocks.push(i);r.currentIndent+=1} -else if(i=='end'){r.blocks.pop();r.currentIndent-=1};if(k.hasOwnProperty(i)){r.tokenize.push(k[i])};return'keyword'} -else if(x.test(i)){return'atom'};return'variable'};if(e.eat('@')){if(e.peek()=='['){return t(a('[',']','meta'),e,r)};e.eat('@');e.match(u)||e.match(o);return'variable-2'};if(e.match(o)){return'tag'};if(e.eat(':')){if(e.eat('"')){return t(m('"','atom',!1),e,r)} -else if(e.match(u)||e.match(o)||e.match(c)||e.match(s)||e.match(h)){return'atom'};e.eat(':');return'operator'};if(e.eat('"')){return t(m('"','string',!0),e,r)};if(e.peek()=='%'){var d='string',p=!0,l;if(e.match('%r')){d='string-2';l=e.next()} -else if(e.match('%w')){p=!1;l=e.next()} -else if(e.match('%q')){p=!1;l=e.next()} -else{if(l=e.match(/^%([^\w\s=])/)){l=l[1]} -else if(e.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)){return'meta'} -else{return'operator'}};if(f.hasOwnProperty(l)){l=f[l]};return t(m(l,d,p),e,r)};if(i=e.match(/^<<-('?)([A-Z]\w*)\1/)){return t(A(i[2],!i[1]),e,r)};if(e.eat('\'')){e.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/);e.eat('\'');return'atom'};if(e.eat('0')){if(e.eat('x')){e.match(/^[0-9a-fA-F]+/)} -else if(e.eat('o')){e.match(/^[0-7]+/)} -else if(e.eat('b')){e.match(/^[01]+/)};return'number'};if(e.eat(/^\d/)){e.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/);return'number'};if(e.match(c)){e.eat('=');return'operator'};if(e.match(s)||e.match(z)){return'operator'};if(i=e.match(/[({[]/,!1)){i=i[0];return t(a(i,f[i],null),e,r)};if(e.eat('\\')){e.next();return'meta'};e.next();return null};function a(e,t,n,r){return function(i,u){if(!r&&i.match(e)){u.tokenize[u.tokenize.length-1]=a(e,t,n,!0);u.currentIndent+=1;return n};var o=l(i,u);if(i.current()===t){u.tokenize.pop();u.currentIndent-=1;o=n};return o}};function n(e,t,r){return function(i,u){if(!r&&i.match('{'+e)){u.currentIndent+=1;u.tokenize[u.tokenize.length-1]=n(e,t,!0);return'meta'};if(i.match(t+'}')){u.currentIndent-=1;u.tokenize.pop();return'meta'};return l(i,u)}};function E(e,t){if(e.eatSpace()){return null};var n;if(n=e.match(u)){if(n=='def'){return'keyword'};e.eat(/[?!]/)};t.tokenize.pop();return'def'};function F(e,t){if(e.eatSpace()){return null};if(e.match(u)){e.eat(/[!?]/)} -else{e.match(c)||e.match(s)||e.match(h)};t.tokenize.pop();return'def'};function i(e,t){if(e.eatSpace()){return null};e.match(o);t.tokenize.pop();return'def'};function m(t,e,r){return function(i,u){var o=!1;while(i.peek()){if(!o){if(i.match('{%',!1)){u.tokenize.push(n('%','%'));return e};if(i.match('{{',!1)){u.tokenize.push(n('{','}'));return e};if(r&&i.match('#{',!1)){u.tokenize.push(a('#{','}','meta'));return e};var f=i.next();if(f==t){u.tokenize.pop();return e};o=r&&f=='\\'} -else{i.next();o=!1}};return e}};function A(e,t){return function(r,i){if(r.sol()){r.eatSpace();if(r.match(e)){i.tokenize.pop();return'string'}};var u=!1;while(r.peek()){if(!u){if(r.match('{%',!1)){i.tokenize.push(n('%','%'));return'string'};if(r.match('{{',!1)){i.tokenize.push(n('{','}'));return'string'};if(t&&r.match('#{',!1)){i.tokenize.push(a('#{','}','meta'));return'string'};u=t&&r.next()=='\\'} -else{r.next();u=!1}};return'string'}};return{startState:function(){return{tokenize:[l],currentIndent:0,lastToken:null,lastStyle:null,blocks:[]}},token:function(e,t){var n=t.tokenize[t.tokenize.length-1](e,t),r=e.current();if(n&&n!='comment'){t.lastToken=r;t.lastStyle=n};return n},indent:function(t,n){n=n.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g,'');if(v.test(n)||S.test(n)){return e.indentUnit*(t.currentIndent-1)};return e.indentUnit*t.currentIndent},fold:'indent',electricInput:r(d.concat(p),!0),lineComment:'#'}});e.defineMIME('text/x-crystal','crystal')}); -/* ./modules/editor/codemirror/mode/clike/clike.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(t){'use strict';function d(e,t,n,r,i,a){this.indented=e;this.column=t;this.type=n;this.info=r;this.align=i;this.prev=a};function u(e,t,n,r){var i=e.indented;if(e.context&&e.context.type=='statement'&&n!='statement')i=e.context.indented;return e.context=new d(i,t,n,r,null,e.context)};function l(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};function p(e,t,n){if(t.prevToken=='variable'||t.prevToken=='type')return!0;if(/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n)))return!0;if(t.typeAtEndOfLine&&e.column()==e.indentation())return!0};function m(e){for(;;){if(!e||e.type=='top')return!0;if(e.type=='}'&&e.prev.info!='namespace')return!1;e=e.prev}};t.defineMode('clike',function(n,e){var o=n.indentUnit,c=e.statementIndentUnit||o,k=e.dontAlignCalls,v=e.keywords||{},S=e.types||{},C=e.builtin||{},f=e.blockKeywords||{},T=e.defKeywords||{},M=e.atoms||{},a=e.hooks||{},P=e.multiLineStrings,D=e.indentStatements!==!1,L=e.indentSwitch!==!1,h=e.namespaceSeparator,I=e.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,F=e.numberStart||/[\d\.]/,z=e.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,g=e.isOperatorChar||/[+\-*&%=<>!?|\/]/,y=e.isIdentifierChar||/[\w\$_\xa1-\uffff]/;var r,s;function x(e,t){var n=e.next();if(a[n]){var l=a[n](e,t);if(l!==!1)return l};if(n=='"'||n=='\''){t.tokenize=j(n);return t.tokenize(e,t)};if(I.test(n)){r=n;return null};if(F.test(n)){e.backUp(1);if(e.match(z))return'number';e.next()};if(n=='/'){if(e.eat('*')){t.tokenize=w;return w(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(g.test(n)){while(!e.match(/^\/[\/*]/,!1)&&e.eat(g)){};return'operator'};e.eatWhile(y);if(h)while(e.match(h))e.eatWhile(y);var o=e.current();if(i(v,o)){if(i(f,o))r='newstatement';if(i(T,o))s=!0;return'keyword'};if(i(S,o))return'type';if(i(C,o)){if(i(f,o))r='newstatement';return'builtin'};if(i(M,o))return'atom';return'variable'};function j(e){return function(t,n){var r=!1,i,a=!1;while((i=t.next())!=null){if(i==e&&!r){a=!0;break};r=!r&&i=='\\'};if(a||!(r||P))n.tokenize=null;return'string'}};function w(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='*')};return'comment'};function b(t,n){if(e.typeFirstDefinitions&&t.eol()&&m(n.context))n.typeAtEndOfLine=p(t,n,t.pos)};return{startState:function(e){return{tokenize:null,context:new d((e||0)-o,0,'top',null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(t,n){var i=n.context;if(t.sol()){if(i.align==null)i.align=!1;n.indented=t.indentation();n.startOfLine=!0};if(t.eatSpace()){b(t,n);return null};r=s=null;var o=(n.tokenize||x)(t,n);if(o=='comment'||o=='meta')return o;if(i.align==null)i.align=!0;if(r==';'||r==':'||(r==','&&t.match(/^\s*(?:\/\/.*)?$/,!1)))while(n.context.type=='statement')l(n);else if(r=='{')u(n,t.column(),'}');else if(r=='[')u(n,t.column(),']');else if(r=='(')u(n,t.column(),')');else if(r=='}'){while(i.type=='statement')i=l(n);if(i.type=='}')i=l(n);while(i.type=='statement')i=l(n)} -else if(r==i.type)l(n);else if(D&&(((i.type=='}'||i.type=='top')&&r!=';')||(i.type=='statement'&&r=='newstatement'))){u(n,t.column(),'statement',t.current())};if(o=='variable'&&((n.prevToken=='def'||(e.typeFirstDefinitions&&p(t,n,t.start)&&m(n.context)&&t.match(/^\s*\(/,!1)))))o='def';if(a.token){var c=a.token(t,n,o);if(c!==undefined)o=c};if(o=='def'&&e.styleDefs===!1)o='variable';n.startOfLine=!1;n.prevToken=s?'def':o||r;b(t,n);return o},indent:function(n,r){if(n.tokenize!=x&&n.tokenize!=null||n.typeAtEndOfLine)return t.Pass;var i=n.context,s=r&&r.charAt(0);if(i.type=='statement'&&s=='}')i=i.prev;if(e.dontIndentStatements)while(i.type=='statement'&&e.dontIndentStatements.test(i.info))i=i.prev;if(a.indent){var u=a.indent(n,i,r);if(typeof u=='number')return u};var l=s==i.type,f=i.prev&&i.prev.info=='switch';if(e.allmanIndentation&&/[{(]/.test(s)){while(i.type!='top'&&i.type!='}')i=i.prev;return i.indented};if(i.type=='statement')return i.indented+(s=='{'?0:c);if(i.align&&(!k||i.type!=')'))return i.column+(l?0:1);if(i.type==')'&&!l)return i.indented+c;return i.indented+(l?0:o)+(!l&&f&&!/^(?:case|default)\b/.test(r)?o:0)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:'/*',blockCommentEnd:'*/',blockCommentContinue:' * ',lineComment:'//',fold:'brace'}});function e(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};function i(e,t){if(typeof e==='function'){return e(t)} -else{return e.propertyIsEnumerable(t)}};var c='auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile',o='int long char short double float unsigned signed void size_t ptrdiff_t';function a(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if(n=='\\'&&e.match(/^.$/)){r=a;break} -else if(n=='/'&&e.match(/^\/[\/\*]/,!1)){break};e.next()};t.tokenize=r;return'meta'};function h(e,t){if(t.prevToken=='type')return'type';return!1};function r(e){e.eatWhile(/[\w\.']/);return'number'};function f(e,t){e.backUp(1);if(e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);if(!n){return!1};t.cpp11RawStringDelim=n[1];t.tokenize=y;return y(e,t)};if(e.match(/(u8|u|U|L)/)){if(e.match(/["']/,!1)){return'string'};return!1};e.next();return!1};function w(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]};function g(e,t){var n;while((n=e.next())!=null){if(n=='"'&&!e.eat('"')){t.tokenize=null;break}};return'string'};function y(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,'\\$&'),r=e.match(new RegExp('.*?\\)'+n+'"'));if(r)t.tokenize=null;else e.skipToEnd();return'string'};function n(e,n){if(typeof e=='string')e=[e];var a=[];function r(e){if(e)for(var t in e)if(e.hasOwnProperty(t))a.push(t)};r(n.keywords);r(n.types);r(n.builtin);r(n.atoms);if(a.length){n.helperType=e[0];t.registerHelper('hintWords',e[0],a)};for(var i=0;i<e.length;++i)t.defineMIME(e[i],n)};n(['text/x-csrc','text/x-c','text/x-chdr'],{name:'clike',keywords:e(c),types:e(o+' bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t'),blockKeywords:e('case do else for if switch while struct'),defKeywords:e('struct'),typeFirstDefinitions:!0,atoms:e('null true false'),hooks:{'#':a,'*':h},modeProps:{fold:['brace','include']}});n(['text/x-c++src','text/x-c++hdr'],{name:'clike',keywords:e(c+' asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override'),types:e(o+' bool wchar_t'),blockKeywords:e('catch class do else finally for if struct switch try while'),defKeywords:e('class namespace struct enum union'),typeFirstDefinitions:!0,atoms:e('true false null'),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{'#':a,'*':h,'u':f,'U':f,'L':f,'R':f,'0':r,'1':r,'2':r,'3':r,'4':r,'5':r,'6':r,'7':r,'8':r,'9':r,token:function(e,t,n){if(n=='variable'&&e.peek()=='('&&(t.prevToken==';'||t.prevToken==null||t.prevToken=='}')&&w(e.current()))return'def'}},namespaceSeparator:'::',modeProps:{fold:['brace','include']}});n('text/x-java',{name:'clike',keywords:e('abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface'),types:e('byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void'),blockKeywords:e('catch class do else finally for if switch try while'),defKeywords:e('class interface enum @interface'),typeFirstDefinitions:!0,atoms:e('true false null'),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{'@':function(e){if(e.match('interface',!1))return!1;e.eatWhile(/[\w\$_]/);return'meta'}},modeProps:{fold:['brace','import']}});n('text/x-csharp',{name:'clike',keywords:e('abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield'),types:e('Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong'),blockKeywords:e('catch class do else finally for foreach if struct switch try while'),defKeywords:e('class interface namespace struct var'),typeFirstDefinitions:!0,atoms:e('true false null'),hooks:{'@':function(e,t){if(e.eat('"')){t.tokenize=g;return g(e,t)};e.eatWhile(/[\w\$_]/);return'meta'}}});function b(e,t){var n=!1;while(!e.eol()){if(!n&&e.match('"""')){t.tokenize=null;break};n=e.next()=='\\'&&!n};return'string'};n('text/x-scala',{name:'clike',keywords:e('abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble'),types:e('AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void'),multiLineStrings:!0,blockKeywords:e('catch class enum do else finally for forSome if match switch try while'),defKeywords:e('class enum def object package trait type val var'),atoms:e('true false null'),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{'@':function(e){e.eatWhile(/[\w\$_]/);return'meta'},'"':function(e,t){if(!e.match('""'))return!1;t.tokenize=b;return t.tokenize(e,t)},'\'':function(e){e.eatWhile(/[\w\$_\xa1-\uffff]/);return'atom'},'=':function(e,t){var n=t.context;if(n.type=='}'&&n.align&&e.eat('>')){t.context=new d(n.indented,n.column,n.type,n.info,null,n.prev);return'operator'} -else{return!1}}},modeProps:{closeBrackets:{triples:'"'}}});function k(e){return function(t,n){var r=!1,i,a=!1;while(!t.eol()){if(!e&&!r&&t.match('"')){a=!0;break};if(e&&t.match('"""')){a=!0;break};i=t.next();if(!r&&i=='$'&&t.match('{'))t.skipTo('}');r=!r&&i=='\\'&&!e};if(a||!e)n.tokenize=null;return'string'}};n('text/x-kotlin',{name:'clike',keywords:e('package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend'),types:e('Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void'),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:e('catch class do else finally for if where try while enum'),defKeywords:e('class val var object interface fun'),atoms:e('true false null this'),hooks:{'"':function(e,t){t.tokenize=k(e.match('""'));return t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}});n(['x-shader/x-vertex','x-shader/x-fragment'],{name:'clike',keywords:e('sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout'),types:e('float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4'),blockKeywords:e('for while do if else struct'),builtin:e('radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4'),atoms:e('true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers'),indentSwitch:!1,hooks:{'#':a},modeProps:{fold:['brace','include']}});n('text/x-nesc',{name:'clike',keywords:e(c+'as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends'),types:e(o),blockKeywords:e('case do else for if switch while struct'),atoms:e('null true false'),hooks:{'#':a},modeProps:{fold:['brace','include']}});n('text/x-objectivec',{name:'clike',keywords:e(c+'inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly'),types:e(o),atoms:e('YES NO NULL NILL ON OFF true false'),hooks:{'@':function(e){e.eatWhile(/[\w\$]/);return'keyword'},'#':a,indent:function(e,t,n){if(t.type=='statement'&&/^@\w/.test(n))return t.indented}},modeProps:{fold:'brace'}});n('text/x-squirrel',{name:'clike',keywords:e('base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static'),types:e(o),blockKeywords:e('case catch class else for foreach if switch try while'),defKeywords:e('function local class'),typeFirstDefinitions:!0,atoms:e('true false null'),hooks:{'#':a},modeProps:{fold:['brace','include']}});var s=null;function x(e){return function(t,n){var r=!1,a,i=!1;while(!t.eol()){if(!r&&t.match('"')&&(e=='single'||t.match('""'))){i=!0;break};if(!r&&t.match('``')){s=x(e);i=!0;break};a=t.next();r=e=='single'&&!r&&a=='\\'};if(i)n.tokenize=null;return'string'}};n('text/x-ceylon',{name:'clike',keywords:e('abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while'),types:function(e){var t=e.charAt(0);return(t===t.toUpperCase()&&t!==t.toLowerCase())},blockKeywords:e('case catch class dynamic else finally for function if interface module new object switch try while'),defKeywords:e('class dynamic function interface module object package value'),builtin:e('abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable'),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:e('true false null larger smaller equal empty finished'),indentSwitch:!1,styleDefs:!1,hooks:{'@':function(e){e.eatWhile(/[\w\$_]/);return'meta'},'"':function(e,t){t.tokenize=x(e.match('""')?'triple':'single');return t.tokenize(e,t)},'`':function(e,t){if(!s||!e.match('`'))return!1;t.tokenize=s;s=null;return t.tokenize(e,t)},'\'':function(e){e.eatWhile(/[\w\$_\xa1-\uffff]/);return'atom'},token:function(e,t,n){if((n=='variable'||n=='type')&&t.prevToken=='.'){return'variable-2'}}},modeProps:{fold:['brace','import'],closeBrackets:{triples:'"'}}})}); -/* ./modules/editor/codemirror/mode/oz/oz.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('oz',function(e){function n(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var c=/[\^@!\|<>#~\.\*\-\+\\/,=]/,f=/(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/,s=/(:::)|(\.\.\.)|(=<:)|(>=:)/,r=['in','then','else','of','elseof','elsecase','elseif','catch','finally','with','require','prepare','import','export','define','do'],i=['end'],l=n(['true','false','nil','unit']),d=n(['andthen','at','attr','declare','feat','from','lex','mod','div','mode','orelse','parser','prod','prop','scanner','self','syn','token']),m=n(['local','proc','fun','case','class','if','cond','or','dis','choice','not','thread','try','raise','lock','for','suchthat','meth','functor']),o=n(r),a=n(i);function t(e,t){if(e.eatSpace()){return null};if(e.match(/[{}]/)){return'bracket'};if(e.match(/(\[])/)){return'keyword'};if(e.match(s)||e.match(f)){return'operator'};if(e.match(l)){return'atom'};var r=e.match(m);if(r){if(!t.doInCurrentLine)t.currentIndent++;else t.doInCurrentLine=!1;if(r[0]=='proc'||r[0]=='fun')t.tokenize=p;else if(r[0]=='class')t.tokenize=h;else if(r[0]=='meth')t.tokenize=k;return'keyword'};if(e.match(o)||e.match(d)){return'keyword'};if(e.match(a)){t.currentIndent--;return'keyword'};var n=e.next();if(n=='"'||n=='\''){t.tokenize=z(n);return t.tokenize(e,t)};if(/[~\d]/.test(n)){if(n=='~'){if(!/^[0-9]/.test(e.peek()))return null;else if((e.next()=='0'&&e.match(/^[xX][0-9a-fA-F]+/))||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return'number'};if((n=='0'&&e.match(/^[xX][0-9a-fA-F]+/))||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return'number';return null};if(n=='%'){e.skipToEnd();return'comment'} -else if(n=='/'){if(e.eat('*')){t.tokenize=u;return u(e,t)}};if(c.test(n)){return'operator'};e.eatWhile(/\w/);return'variable'};function h(e,n){if(e.eatSpace()){return null};e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);n.tokenize=t;return'variable-3'};function k(e,n){if(e.eatSpace()){return null};e.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);n.tokenize=t;return'def'};function p(e,n){if(e.eatSpace()){return null};if(!n.hasPassedFirstStage&&e.eat('{')){n.hasPassedFirstStage=!0;return'bracket'} -else if(n.hasPassedFirstStage){e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);n.hasPassedFirstStage=!1;n.tokenize=t;return'def'} -else{n.tokenize=t;return null}};function u(e,n){var i=!1,r;while(r=e.next()){if(r=='/'&&i){n.tokenize=t;break};i=(r=='*')};return'comment'};function z(e){return function(n,r){var i=!1,o,a=!1;while((o=n.next())!=null){if(o==e&&!i){a=!0;break};i=!i&&o=='\\'};if(a||!i)r.tokenize=t;return'string'}};function b(){var e=r.concat(i);return new RegExp('[\\[\\]]|('+e.join('|')+')$')};return{startState:function(){return{tokenize:t,currentIndent:0,doInCurrentLine:!1,hasPassedFirstStage:!1}},token:function(e,t){if(e.sol())t.doInCurrentLine=0;return t.tokenize(e,t)},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,'');if(r.match(a)||r.match(o)||r.match(/(\[])/))return e.indentUnit*(t.currentIndent-1);if(t.currentIndent<0)return 0;return t.currentIndent*e.indentUnit},fold:'indent',electricInput:b(),lineComment:'%',blockCommentStart:'/*',blockCommentEnd:'*/'}});e.defineMIME('text/x-oz','oz')}); -/* ./modules/editor/codemirror/mode/modelica/modelica.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("modelica",function(t,n){var u=t.indentUnit,f=n.keywords||{};var s=n.builtin||{};var a=n.atoms||{};var o=/[;=\(:\),{}.*<>+\-\/^\[\]]/,l=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,i=/[0-9]/,r=/[_a-zA-Z]/;function c(e,t){e.skipToEnd();t.tokenize=null;return"comment"};function p(e,t){var i=!1,n;while(n=e.next()){if(i&&n=="/"){t.tokenize=null;break};i=(n=="*")};return"comment"};function d(e,t){var n=!1,i;while((i=e.next())!=null){if(i=="\""&&!n){t.tokenize=null;t.sol=!1;break};n=!n&&i=="\\"};return"string"};function m(e,t){e.eatWhile(i);while(e.eat(i)||e.eat(r)){};var n=e.current();if(t.sol&&(n=="package"||n=="model"||n=="when"||n=="connector"))t.level++;else if(t.sol&&n=="end"&&t.level>0)t.level--;t.tokenize=null;t.sol=!1;if(f.propertyIsEnumerable(n))return"keyword";else if(s.propertyIsEnumerable(n))return"builtin";else if(a.propertyIsEnumerable(n))return"atom";else return"variable"};function k(e,t){while(e.eat(/[^']/)){};t.tokenize=null;t.sol=!1;if(e.eat("'"))return"variable";else return"error"};function h(e,t){e.eatWhile(i);if(e.eat(".")){e.eatWhile(i)};if(e.eat("e")||e.eat("E")){if(!e.eat("-"))e.eat("+");e.eatWhile(i)};t.tokenize=null;t.sol=!1;return"number"};return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(t,e){if(e.tokenize!=null){return e.tokenize(t,e)};if(t.sol()){e.sol=!0};if(t.eatSpace()){e.tokenize=null;return null};var n=t.next();if(n=="/"&&t.eat("/")){e.tokenize=c} -else if(n=="/"&&t.eat("*")){e.tokenize=p} -else if(l.test(n+t.peek())){t.next();e.tokenize=null;return"operator"} -else if(o.test(n)){e.tokenize=null;return"operator"} -else if(r.test(n)){e.tokenize=m} -else if(n=="'"&&t.peek()&&t.peek()!="'"){e.tokenize=k} -else if(n=="\""){e.tokenize=d} -else if(i.test(n)){e.tokenize=h} -else{e.tokenize=null;return"error"};return e.tokenize(t,e)},indent:function(t,n){if(t.tokenize!=null)return e.Pass;var i=t.level;if(/(algorithm)/.test(n))i--;if(/(equation)/.test(n))i--;if(/(initial algorithm)/.test(n))i--;if(/(initial equation)/.test(n))i--;if(/(end)/.test(n))i--;if(i>0)return u*i;else return 0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});function t(e){var n={},i=e.split(" ");for(var t=0;t<i.length;++t)n[i[t]]=!0;return n};var n="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",i="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",r="Real Boolean Integer String";function o(t,n){if(typeof t=="string")t=[t];var r=[];function o(e){if(e)for(var t in e)if(e.hasOwnProperty(t))r.push(t)};o(n.keywords);o(n.builtin);o(n.atoms);if(r.length){n.helperType=t[0];e.registerHelper("hintWords",t[0],r)};for(var i=0;i<t.length;++i)e.defineMIME(t[i],n)};o(["text/x-modelica"],{name:"modelica",keywords:t(n),builtin:t(i),atoms:t(r)})}); -/* ./modules/editor/codemirror/mode/gherkin/gherkin.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(a,e){if(a.sol()){e.lineNumber++;e.inKeywordLine=!1;if(e.inMultilineTable){e.tableHeaderLine=!1;if(!a.match(/\s*\|/,!1)){e.allowMultilineArgument=!1;e.inMultilineTable=!1}}};a.eatSpace();if(e.allowMultilineArgument){if(e.inMultilineString){if(a.match("\"\"\"")){e.inMultilineString=!1;e.allowMultilineArgument=!1} -else{a.match(/.*/)};return"string"};if(e.inMultilineTable){if(a.match(/\|\s*/)){return"bracket"} -else{a.match(/[^\|]*/);return e.tableHeaderLine?"header":"string"}};if(a.match("\"\"\"")){e.inMultilineString=!0;return"string"} -else if(a.match("|")){e.inMultilineTable=!0;e.tableHeaderLine=!0;return"bracket"}};if(a.match(/#.*/)){return"comment"} -else if(!e.inKeywordLine&&a.match(/@\S+/)){return"tag"} -else if(!e.inKeywordLine&&e.allowFeature&&a.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)){e.allowScenario=!0;e.allowBackground=!0;e.allowPlaceholders=!1;e.allowSteps=!1;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} -else if(!e.inKeywordLine&&e.allowBackground&&a.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)){e.allowPlaceholders=!1;e.allowSteps=!0;e.allowBackground=!1;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} -else if(!e.inKeywordLine&&e.allowScenario&&a.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)){e.allowPlaceholders=!0;e.allowSteps=!0;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} -else if(e.allowScenario&&a.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)){e.allowPlaceholders=!1;e.allowSteps=!0;e.allowBackground=!1;e.allowMultilineArgument=!0;return"keyword"} -else if(!e.inKeywordLine&&e.allowScenario&&a.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)){e.allowPlaceholders=!1;e.allowSteps=!0;e.allowBackground=!1;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} -else if(!e.inKeywordLine&&e.allowSteps&&a.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)){e.inStep=!0;e.allowPlaceholders=!0;e.allowMultilineArgument=!0;e.inKeywordLine=!0;return"keyword"} -else if(a.match(/"[^"]*"?/)){return"string"} -else if(e.allowPlaceholders&&a.match(/<[^>]*>?/)){return"variable"} -else{a.next();a.eatWhile(/[^@"<#]/);return null}}}});e.defineMIME("text/x-feature","gherkin")}); -/* ./modules/editor/codemirror/mode/swift/swift.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){var n={};for(var t=0;t<e.length;t++)n[e[t]]=!0;return n};var i=t(['_','var','let','class','enum','extension','import','protocol','struct','func','typealias','associatedtype','open','public','internal','fileprivate','private','deinit','init','new','override','self','subscript','super','convenience','dynamic','final','indirect','lazy','required','static','unowned','unowned(safe)','unowned(unsafe)','weak','as','is','break','case','continue','default','else','fallthrough','for','guard','if','in','repeat','switch','where','while','defer','return','inout','mutating','nonmutating','catch','do','rethrows','throw','throws','try','didSet','get','set','willSet','assignment','associativity','infix','left','none','operator','postfix','precedence','precedencegroup','prefix','right','Any','AnyObject','Type','dynamicType','Self','Protocol','__COLUMN__','__FILE__','__FUNCTION__','__LINE__']),o=t(['var','let','class','enum','extension','import','protocol','struct','func','typealias','associatedtype','for']),a=t(['true','false','nil','self','super','_']),u=t(['Array','Bool','Character','Dictionary','Double','Float','Int','Int8','Int16','Int32','Int64','Never','Optional','Set','String','UInt8','UInt16','UInt32','UInt64','Void']),c='+-/*%=|&<>~^?!',f=':;,.(){}[]',l=/^\-?0b[01][01_]*/,d=/^\-?0o[0-7][0-7_]*/,s=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,p=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,m=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,h=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,v=/^\#[A-Za-z]+/,x=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function n(e,t,k){if(e.sol())t.indented=e.indentation();if(e.eatSpace())return null;var n=e.peek();if(n=='/'){if(e.match('//')){e.skipToEnd();return'comment'};if(e.match('/*')){t.tokenize.push(r);return r(e,t)}};if(e.match(v))return'builtin';if(e.match(x))return'attribute';if(e.match(l))return'number';if(e.match(d))return'number';if(e.match(s))return'number';if(e.match(p))return'number';if(e.match(h))return'property';if(c.indexOf(n)>-1){e.next();return'operator'};if(f.indexOf(n)>-1){e.next();e.match('..');return'punctuation'};if(n=='"'||n=='\''){e.next();var w=b(n);t.tokenize.push(w);return w(e,t)};if(e.match(m)){var y=e.current();if(u.hasOwnProperty(y))return'variable-2';if(a.hasOwnProperty(y))return'atom';if(i.hasOwnProperty(y)){if(o.hasOwnProperty(y))t.prev='define';return'keyword'};if(k=='define')return'def';return'variable'};e.next();return null};function y(){var e=0;return function(t,r,i){var o=n(t,r,i);if(o=='punctuation'){if(t.current()=='(')++e;else if(t.current()==')'){if(e==0){t.backUp(1);r.tokenize.pop();return r.tokenize[r.tokenize.length-1](t,r)} -else--e}};return o}};function b(e){return function(t,n){var r,i=!1;while(r=t.next()){if(i){if(r=='('){n.tokenize.push(y());return'string'};i=!1} -else if(r==e){break} -else{i=r=='\\'}};n.tokenize.pop();return'string'}};function r(e,t){e.match(/^(?:[^*]|\*(?!\/))*/);if(e.match('*/'))t.tokenize.pop();return'comment'};function k(e,t,n){this.prev=e;this.align=t;this.indented=n};function w(e,t){var n=t.match(/^\s*($|\/[\/\*])/,!1)?null:t.column()+1;e.context=new k(e.context,n,e.indented)};function z(e){if(e.context){e.indented=e.context.indented;e.context=e.context.prev}};e.defineMode('swift',function(e){return{startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(e,t){var o=t.prev;t.prev=null;var a=t.tokenize[t.tokenize.length-1]||n,r=a(e,t,o);if(!r||r=='comment')t.prev=o;else if(!t.prev)t.prev=r;if(r=='punctuation'){var i=/[\(\[\{]|([\]\)\}])/.exec(e.current());if(i)(i[1]?z:w)(t,e)};return r},indent:function(t,n){var r=t.context;if(!r)return 0;var i=/^[\]\}\)]/.test(n);if(r.align!=null)return r.align-(i?1:0);return r.indented+(i?0:e.indentUnit)},electricInput:/^\s*[\)\}\]]$/,lineComment:'//',blockCommentStart:'/*',blockCommentEnd:'*/',fold:'brace',closeBrackets:'()[]{}\'\'""``'}});e.defineMIME('text/x-swift','swift')}); -/* ./modules/editor/codemirror/mode/scheme/scheme.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('scheme',function(){var p='builtin',e='comment',r='string',a='atom',c='number',l='bracket',h=2;function s(e){var i={},n=e.split(' ');for(var t=0;t<n.length;++t)i[n[t]]=!0;return i};var n=s('λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?'),m=s('define let letrec let* lambda');function g(e,t,i){this.indent=e;this.type=t;this.prev=i};function t(e,t,i){e.indentStack=new g(t,i,e.indentStack)};function x(e){e.indentStack=e.indentStack.prev};var o=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),d=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),f=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),u=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function b(e){return e.match(o)};function v(e){return e.match(d)};function i(e,t){if(t===!0){e.backUp(1)};return e.match(u)};function k(e){return e.match(f)};return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(s,o){if(o.indentStack==null&&s.sol()){o.indentation=s.indentation()};if(s.eatSpace()){return null};var d=null;switch(o.mode){case'string':var g,S=!1;while((g=s.next())!=null){if(g=='"'&&!S){o.mode=!1;break};S=!S&&g=='\\'};d=r;break;case'comment':var g,M=!1;while((g=s.next())!=null){if(g=='#'&&M){o.mode=!1;break};M=(g=='|')};d=e;break;case's-expr-comment':o.mode=!1;if(s.peek()=='('||s.peek()=='['){o.sExprComment=0} -else{s.eatWhile(/[^/s]/);d=e;break};default:var f=s.next();if(f=='"'){o.mode='string';d=r} -else if(f=='\''){d=a} -else if(f=='#'){if(s.eat('|')){o.mode='comment';d=e} -else if(s.eat(/[tf]/i)){d=a} -else if(s.eat(';')){o.mode='s-expr-comment';d=e} -else{var u=null,E=!1,C=!0;if(s.eat(/[ei]/i)){E=!0} -else{s.backUp(1)};if(s.match(/^#b/i)){u=b} -else if(s.match(/^#o/i)){u=v} -else if(s.match(/^#x/i)){u=k} -else if(s.match(/^#d/i)){u=i} -else if(s.match(/^[-+0-9.]/,!1)){C=!1;u=i} -else if(!E){s.eat('#')};if(u!=null){if(C&&!E){s.match(/^#[ei]/i)};if(u(s))d=c}}} -else if(/^[-+0-9.]/.test(f)&&i(s,!0)){d=c} -else if(f==';'){s.skipToEnd();d=e} -else if(f=='('||f=='['){var y='',w=s.column(),q;while((q=s.eat(/[^\s\(\[\;\)\]]/))!=null){y+=q};if(y.length>0&&m.propertyIsEnumerable(y)){t(o,w+h,f)} -else{s.eatSpace();if(s.eol()||s.peek()==';'){t(o,w+1,f)} -else{t(o,w+s.current().length,f)}};s.backUp(s.current().length-1);if(typeof o.sExprComment=='number')o.sExprComment++;d=l} -else if(f==')'||f==']'){d=l;if(o.indentStack!=null&&o.indentStack.type==(f==')'?'(':'[')){x(o);if(typeof o.sExprComment=='number'){if(--o.sExprComment==0){d=e;o.sExprComment=!1}}}} -else{s.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);if(n&&n.propertyIsEnumerable(s.current())){d=p} -else d='variable'}};return(typeof o.sExprComment=='number')?e:d},indent:function(e){if(e.indentStack==null)return e.indentation;return e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:';;'}});e.defineMIME('text/x-scheme','scheme')}); -/* ./modules/editor/codemirror/mode/idl/idl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function i(e){return new RegExp('^(('+e.join(')|(')+'))\\b','i')};var t=['a_correlate','abs','acos','adapt_hist_equal','alog','alog2','alog10','amoeba','annotate','app_user_dir','app_user_dir_query','arg_present','array_equal','array_indices','arrow','ascii_template','asin','assoc','atan','axis','axis','bandpass_filter','bandreject_filter','barplot','bar_plot','beseli','beselj','beselk','besely','beta','biginteger','bilinear','bin_date','binary_template','bindgen','binomial','bit_ffs','bit_population','blas_axpy','blk_con','boolarr','boolean','boxplot','box_cursor','breakpoint','broyden','bubbleplot','butterworth','bytarr','byte','byteorder','bytscl','c_correlate','calendar','caldat','call_external','call_function','call_method','call_procedure','canny','catch','cd','cdf','ceil','chebyshev','check_math','chisqr_cvf','chisqr_pdf','choldc','cholsol','cindgen','cir_3pnt','clipboard','close','clust_wts','cluster','cluster_tree','cmyk_convert','code_coverage','color_convert','color_exchange','color_quan','color_range_map','colorbar','colorize_sample','colormap_applicable','colormap_gradient','colormap_rotation','colortable','comfit','command_line_args','common','compile_opt','complex','complexarr','complexround','compute_mesh_normals','cond','congrid','conj','constrained_min','contour','contour','convert_coord','convol','convol_fft','coord2to3','copy_lun','correlate','cos','cosh','cpu','cramer','createboxplotdata','create_cursor','create_struct','create_view','crossp','crvlength','ct_luminance','cti_test','cursor','curvefit','cv_coord','cvttobm','cw_animate','cw_animate_getp','cw_animate_load','cw_animate_run','cw_arcball','cw_bgroup','cw_clr_index','cw_colorsel','cw_defroi','cw_field','cw_filesel','cw_form','cw_fslider','cw_light_editor','cw_light_editor_get','cw_light_editor_set','cw_orient','cw_palette_editor','cw_palette_editor_get','cw_palette_editor_set','cw_pdmenu','cw_rgbslider','cw_tmpl','cw_zoom','db_exists','dblarr','dcindgen','dcomplex','dcomplexarr','define_key','define_msgblk','define_msgblk_from_file','defroi','defsysv','delvar','dendro_plot','dendrogram','deriv','derivsig','determ','device','dfpmin','diag_matrix','dialog_dbconnect','dialog_message','dialog_pickfile','dialog_printersetup','dialog_printjob','dialog_read_image','dialog_write_image','dictionary','digital_filter','dilate','dindgen','dissolve','dist','distance_measure','dlm_load','dlm_register','doc_library','double','draw_roi','edge_dog','efont','eigenql','eigenvec','ellipse','elmhes','emboss','empty','enable_sysrtn','eof','eos','erase','erf','erfc','erfcx','erode','errorplot','errplot','estimator_filter','execute','exit','exp','expand','expand_path','expint','extrac','extract_slice','f_cvf','f_pdf','factorial','fft','file_basename','file_chmod','file_copy','file_delete','file_dirname','file_expand_path','file_gunzip','file_gzip','file_info','file_lines','file_link','file_mkdir','file_move','file_poll_input','file_readlink','file_same','file_search','file_tar','file_test','file_untar','file_unzip','file_which','file_zip','filepath','findgen','finite','fix','flick','float','floor','flow3','fltarr','flush','format_axis_values','forward_function','free_lun','fstat','fulstr','funct','function','fv_test','fx_root','fz_roots','gamma','gamma_ct','gauss_cvf','gauss_pdf','gauss_smooth','gauss2dfit','gaussfit','gaussian_function','gaussint','get_drive_list','get_dxf_objects','get_kbrd','get_login_info','get_lun','get_screen_size','getenv','getwindows','greg2jul','grib','grid_input','grid_tps','grid3','griddata','gs_iter','h_eq_ct','h_eq_int','hanning','hash','hdf','hdf5','heap_free','heap_gc','heap_nosave','heap_refcount','heap_save','help','hilbert','hist_2d','hist_equal','histogram','hls','hough','hqr','hsv','i18n_multibytetoutf8','i18n_multibytetowidechar','i18n_utf8tomultibyte','i18n_widechartomultibyte','ibeta','icontour','iconvertcoord','idelete','identity','idl_base64','idl_container','idl_validname','idlexbr_assistant','idlitsys_createtool','idlunit','iellipse','igamma','igetcurrent','igetdata','igetid','igetproperty','iimage','image','image_cont','image_statistics','image_threshold','imaginary','imap','indgen','int_2d','int_3d','int_tabulated','intarr','interpol','interpolate','interval_volume','invert','ioctl','iopen','ir_filter','iplot','ipolygon','ipolyline','iputdata','iregister','ireset','iresolve','irotate','isa','isave','iscale','isetcurrent','isetproperty','ishft','isocontour','isosurface','isurface','itext','itranslate','ivector','ivolume','izoom','journal','json_parse','json_serialize','jul2greg','julday','keyword_set','krig2d','kurtosis','kw_test','l64indgen','la_choldc','la_cholmprove','la_cholsol','la_determ','la_eigenproblem','la_eigenql','la_eigenvec','la_elmhes','la_gm_linear_model','la_hqr','la_invert','la_least_square_equality','la_least_squares','la_linear_equation','la_ludc','la_lumprove','la_lusol','la_svd','la_tridc','la_trimprove','la_triql','la_trired','la_trisol','label_date','label_region','ladfit','laguerre','lambda','lambdap','lambertw','laplacian','least_squares_filter','leefilt','legend','legendre','linbcg','lindgen','linfit','linkimage','list','ll_arc_distance','lmfit','lmgr','lngamma','lnp_test','loadct','locale_get','logical_and','logical_or','logical_true','lon64arr','lonarr','long','long64','lsode','lu_complex','ludc','lumprove','lusol','m_correlate','machar','make_array','make_dll','make_rt','map','mapcontinents','mapgrid','map_2points','map_continents','map_grid','map_image','map_patch','map_proj_forward','map_proj_image','map_proj_info','map_proj_init','map_proj_inverse','map_set','matrix_multiply','matrix_power','max','md_test','mean','meanabsdev','mean_filter','median','memory','mesh_clip','mesh_decimate','mesh_issolid','mesh_merge','mesh_numtriangles','mesh_obj','mesh_smooth','mesh_surfacearea','mesh_validate','mesh_volume','message','min','min_curve_surf','mk_html_help','modifyct','moment','morph_close','morph_distance','morph_gradient','morph_hitormiss','morph_open','morph_thin','morph_tophat','multi','n_elements','n_params','n_tags','ncdf','newton','noise_hurl','noise_pick','noise_scatter','noise_slur','norm','obj_class','obj_destroy','obj_hasmethod','obj_isa','obj_new','obj_valid','objarr','on_error','on_ioerror','online_help','openr','openu','openw','oplot','oploterr','orderedhash','p_correlate','parse_url','particle_trace','path_cache','path_sep','pcomp','plot','plot3d','plot','plot_3dbox','plot_field','ploterr','plots','polar_contour','polar_surface','polyfill','polyshade','pnt_line','point_lun','polarplot','poly','poly_2d','poly_area','poly_fit','polyfillv','polygon','polyline','polywarp','popd','powell','pref_commit','pref_get','pref_set','prewitt','primes','print','printf','printd','pro','product','profile','profiler','profiles','project_vol','ps_show_fonts','psafm','pseudo','ptr_free','ptr_new','ptr_valid','ptrarr','pushd','qgrid3','qhull','qromb','qromo','qsimp','query_*','query_ascii','query_bmp','query_csv','query_dicom','query_gif','query_image','query_jpeg','query_jpeg2000','query_mrsid','query_pict','query_png','query_ppm','query_srf','query_tiff','query_video','query_wav','r_correlate','r_test','radon','randomn','randomu','ranks','rdpix','read','readf','read_ascii','read_binary','read_bmp','read_csv','read_dicom','read_gif','read_image','read_interfile','read_jpeg','read_jpeg2000','read_mrsid','read_pict','read_png','read_ppm','read_spr','read_srf','read_sylk','read_tiff','read_video','read_wav','read_wave','read_x11_bitmap','read_xwd','reads','readu','real_part','rebin','recall_commands','recon3','reduce_colors','reform','region_grow','register_cursor','regress','replicate','replicate_inplace','resolve_all','resolve_routine','restore','retall','return','reverse','rk4','roberts','rot','rotate','round','routine_filepath','routine_info','rs_test','s_test','save','savgol','scale3','scale3d','scatterplot','scatterplot3d','scope_level','scope_traceback','scope_varfetch','scope_varname','search2d','search3d','sem_create','sem_delete','sem_lock','sem_release','set_plot','set_shading','setenv','sfit','shade_surf','shade_surf_irr','shade_volume','shift','shift_diff','shmdebug','shmmap','shmunmap','shmvar','show3','showfont','signum','simplex','sin','sindgen','sinh','size','skewness','skip_lun','slicer3','slide_image','smooth','sobel','socket','sort','spawn','sph_4pnt','sph_scat','spher_harm','spl_init','spl_interp','spline','spline_p','sprsab','sprsax','sprsin','sprstp','sqrt','standardize','stddev','stop','strarr','strcmp','strcompress','streamline','streamline','stregex','stretch','string','strjoin','strlen','strlowcase','strmatch','strmessage','strmid','strpos','strput','strsplit','strtrim','struct_assign','struct_hide','strupcase','surface','surface','surfr','svdc','svdfit','svsol','swap_endian','swap_endian_inplace','symbol','systime','t_cvf','t_pdf','t3d','tag_names','tan','tanh','tek_color','temporary','terminal_size','tetra_clip','tetra_surface','tetra_volume','text','thin','thread','threed','tic','time_test2','timegen','timer','timestamp','timestamptovalues','tm_test','toc','total','trace','transpose','tri_surf','triangulate','trigrid','triql','trired','trisol','truncate_lun','ts_coef','ts_diff','ts_fcast','ts_smooth','tv','tvcrs','tvlct','tvrd','tvscl','typename','uindgen','uint','uintarr','ul64indgen','ulindgen','ulon64arr','ulonarr','ulong','ulong64','uniq','unsharp_mask','usersym','value_locate','variance','vector','vector_field','vel','velovect','vert_t3d','voigt','volume','voronoi','voxel_proj','wait','warp_tri','watershed','wdelete','wf_draw','where','widget_base','widget_button','widget_combobox','widget_control','widget_displaycontextmenu','widget_draw','widget_droplist','widget_event','widget_info','widget_label','widget_list','widget_propertysheet','widget_slider','widget_tab','widget_table','widget_text','widget_tree','widget_tree_move','widget_window','wiener_filter','window','window','write_bmp','write_csv','write_gif','write_image','write_jpeg','write_jpeg2000','write_nrif','write_pict','write_png','write_ppm','write_spr','write_srf','write_sylk','write_tiff','write_video','write_wav','write_wave','writeu','wset','wshow','wtn','wv_applet','wv_cwt','wv_cw_wavelet','wv_denoise','wv_dwt','wv_fn_coiflet','wv_fn_daubechies','wv_fn_gaussian','wv_fn_haar','wv_fn_morlet','wv_fn_paul','wv_fn_symlet','wv_import_data','wv_import_wavelet','wv_plot3d_wps','wv_plot_multires','wv_pwt','wv_tool_denoise','xbm_edit','xdisplayfile','xdxf','xfont','xinteranimate','xloadct','xmanager','xmng_tmpl','xmtool','xobjview','xobjview_rotate','xobjview_write_image','xpalette','xpcolor','xplot3d','xregistered','xroi','xsq_test','xsurface','xvaredit','xvolume','xvolume_rotate','xvolume_write_image','xyouts','zlib_compress','zlib_uncompress','zoom','zoom_24'],s=i(t),r=['begin','end','endcase','endfor','endwhile','endif','endrep','endforeach','break','case','continue','for','foreach','goto','if','then','else','repeat','until','switch','while','do','pro','function'],n=i(r);e.registerHelper('hintWords','idl',t.concat(r));var a=new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*','i'),o=/[+\-*&=<>\/@#~$]/,l=new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)','i');function d(e){if(e.eatSpace())return null;if(e.match(';')){e.skipToEnd();return'comment'};if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return'number';if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return'number';if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return'number'};if(e.match(/^"([^"]|(""))*"/)){return'string'};if(e.match(/^'([^']|(''))*'/)){return'string'};if(e.match(n)){return'keyword'};if(e.match(s)){return'builtin'};if(e.match(a)){return'variable'};if(e.match(o)||e.match(l)){return'operator'};e.next();return null};e.defineMode('idl',function(){return{token:function(e){return d(e)}}});e.defineMIME('text/x-idl','idl')}); -/* ./modules/editor/codemirror/mode/yaml/yaml.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('yaml',function(){var e=['true','false','on','off','yes','no'],i=new RegExp('\\b(('+e.join(')|(')+'))$','i');return{token:function(t,e){var r=t.peek(),n=e.escaped;e.escaped=!1;if(r=='#'&&(t.pos==0||/\s/.test(t.string.charAt(t.pos-1)))){t.skipToEnd();return'comment'};if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return'string';if(e.literal&&t.indentation()>e.keyCol){t.skipToEnd();return'string'} -else if(e.literal){e.literal=!1};if(t.sol()){e.keyCol=0;e.pair=!1;e.pairStart=!1;if(t.match(/---/)){return'def'};if(t.match(/\.\.\./)){return'def'};if(t.match(/\s*-\s+/)){return'meta'}};if(t.match(/^(\{|\}|\[|\])/)){if(r=='{')e.inlinePairs++;else if(r=='}')e.inlinePairs--;else if(r=='[')e.inlineList++;else e.inlineList--;return'meta'};if(e.inlineList>0&&!n&&r==','){t.next();return'meta'};if(e.inlinePairs>0&&!n&&r==','){e.keyCol=0;e.pair=!1;e.pairStart=!1;t.next();return'meta'};if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/)){e.literal=!0;return'meta'};if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)){return'variable-2'};if(e.inlinePairs==0&&t.match(/^\s*-?[0-9\.\,]+\s?$/)){return'number'};if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)){return'number'};if(t.match(i)){return'keyword'}};if(!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)){e.pair=!0;e.keyCol=t.indentation();return'atom'};if(e.pair&&t.match(/^:\s*/)){e.pairStart=!0;return'meta'};e.pairStart=!1;e.escaped=(r=='\\');t.next();return null},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}});e.defineMIME('text/x-yaml','yaml');e.defineMIME('text/yaml','yaml')}); -/* ./modules/editor/codemirror/mode/vue/vue.min.js */(function(e){'use strict';if(typeof exports==='object'&&typeof module==='object'){e(require('../../lib/codemirror'),require('../../addon/mode/overlay'),require('../xml/xml'),require('../javascript/javascript'),require('../coffeescript/coffeescript'),require('../css/css'),require('../sass/sass'),require('../stylus/stylus'),require('../pug/pug'),require('../handlebars/handlebars'))} -else if(typeof define==='function'&&define.amd){define(['../../lib/codemirror','../../addon/mode/overlay','../xml/xml','../javascript/javascript','../coffeescript/coffeescript','../css/css','../sass/sass','../stylus/stylus','../pug/pug','../handlebars/handlebars'],e)} -else{e(CodeMirror)}})(function(e){var s={script:[['lang',/coffee(script)?/,'coffeescript'],['type',/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,'coffeescript'],['lang',/^babel$/,'javascript'],['type',/^text\/babel$/,'javascript'],['type',/^text\/ecmascript-\d+$/,'javascript']],style:[['lang',/^stylus$/i,'stylus'],['lang',/^sass$/i,'sass'],['lang',/^less$/i,'text/x-less'],['lang',/^scss$/i,'text/x-scss'],['type',/^(text\/)?(x-)?styl(us)?$/i,'stylus'],['type',/^text\/sass/i,'sass'],['type',/^(text\/)?(x-)?scss$/i,'text/x-scss'],['type',/^(text\/)?(x-)?less$/i,'text/x-less']],template:[['lang',/^vue-template$/i,'vue'],['lang',/^pug$/i,'pug'],['lang',/^handlebars$/i,'handlebars'],['type',/^(text\/)?(x-)?pug$/i,'pug'],['type',/^text\/x-handlebars-template$/i,'handlebars'],[null,null,'vue-template']]};e.defineMode('vue-template',function(s,t){var a={token:function(e){if(e.match(/^\{\{.*?\}\}/))return'meta mustache';while(e.next()&&!e.match('{{',!1)){};return null}};return e.overlayMode(e.getMode(s,t.backdrop||'text/html'),a)});e.defineMode('vue',function(t){return e.getMode(t,{name:'htmlmixed',tags:s})},'htmlmixed','xml','javascript','coffeescript','css','sass','stylus','pug','handlebars');e.defineMIME('script/x-vue','vue');e.defineMIME('text/x-vue','vue')}); -/* ./modules/editor/codemirror/mode/twig/twig.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../../addon/mode/multiplex'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../../addon/mode/multiplex'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('twig:inner',function(){var t=['and','as','autoescape','endautoescape','block','do','endblock','else','elseif','extends','for','endfor','embed','endembed','filter','endfilter','flush','from','if','endif','in','is','include','import','not','or','set','spaceless','endspaceless','with','endwith','trans','endtrans','blocktrans','endblocktrans','macro','endmacro','use','verbatim','endverbatim'],i=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,e=['true','false','null','empty','defined','divisibleby','divisible by','even','odd','iterable','sameas','same as'],n=/^(\d[+\-\*\/])?\d+(\.\d+)?/;t=new RegExp('(('+t.join(')|(')+'))\\b');e=new RegExp('(('+e.join(')|(')+'))\\b');function o(o,a){var s=o.peek();if(a.incomment){if(!o.skipTo('#}')){o.skipToEnd()} -else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} -else if(a.intag){if(a.operator){a.operator=!1;if(o.match(e)){return'atom'};if(o.match(n)){return'number'}};if(a.sign){a.sign=!1;if(o.match(e)){return'atom'};if(o.match(n)){return'number'}};if(a.instring){if(s==a.instring){a.instring=!1};o.next();return'string'} -else if(s=='\''||s=='"'){a.instring=s;o.next();return'string'} -else if(o.match(a.intag+'}')||o.eat('-')&&o.match(a.intag+'}')){a.intag=!1;return'tag'} -else if(o.match(i)){a.operator=!0;return'operator'} -else if(o.match(r)){a.sign=!0} -else{if(o.eat(' ')||o.sol()){if(o.match(t)){return'keyword'};if(o.match(e)){return'atom'};if(o.match(n)){return'number'};if(o.sol()){o.next()}} -else{o.next()}};return'variable'} -else if(o.eat('{')){if(o.eat('#')){a.incomment=!0;if(!o.skipTo('#}')){o.skipToEnd()} -else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} -else if(s=o.eat(/\{|%/)){a.intag=s;if(s=='{'){a.intag='}'};o.eat('-');return'tag'}};o.next()};return{startState:function(){return{}},token:function(e,t){return o(e,t)}}});e.defineMode('twig',function(t,n){var i=e.getMode(t,'twig:inner');if(!n||!n.base)return i;return e.multiplexingMode(e.getMode(t,n.base),{open:/\{[{#%]/,close:/[}#%]\}/,mode:i,parseDelimiters:!0})});e.defineMIME('text/x-twig','twig')}); -/* ./modules/editor/codemirror/mode/cmake/cmake.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('cmake',function(){var n=/({)?[a-zA-Z0-9_]+(})?/;function e(e,n){var i,t,r=!1;while(!e.eol()&&(i=e.next())!=n.pending){if(i==='$'&&t!='\\'&&n.pending=='"'){r=!0;break};t=i};if(r){e.backUp(1)};if(i==n.pending){n.continueString=!1} -else{n.continueString=!0};return'string'};function i(i,r){var t=i.next();if(t==='$'){if(i.match(n)){return'variable-2'};return'variable'};if(r.continueString){i.backUp(1);return e(i,r)};if(i.match(/(\s+)?\w+\(/)||i.match(/(\s+)?\w+\ \(/)){i.backUp(1);return'def'};if(t=='#'){i.skipToEnd();return'comment'};if(t=='\''||t=='"'){r.pending=t;return e(i,r)};if(t=='('||t==')'){return'bracket'};if(t.match(/[0-9]/)){return'number'};i.eatWhile(/[\w-]/);return null};return{startState:function(){var e={};e.inDefinition=!1;e.inInclude=!1;e.continueString=!1;e.pending=!1;return e},token:function(e,n){if(e.eatSpace())return null;return i(e,n)}}});e.defineMIME('text/x-cmake','cmake')}); -/* ./modules/editor/codemirror/mode/asciiarmor/asciiarmor.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){var t=e.match(/^\s*\S/);e.skipToEnd();return t?'error':null};e.defineMode('asciiarmor',function(){return{token:function(e,r){var i;if(r.state=='top'){if(e.sol()&&(i=e.match(/^-----BEGIN (.*)?-----\s*$/))){r.state='headers';r.type=i[1];return'tag'};return t(e)} -else if(r.state=='headers'){if(e.sol()&&e.match(/^\w+:/)){r.state='header';return'atom'} -else{var n=t(e);if(n)r.state='body';return n}} -else if(r.state=='header'){e.skipToEnd();r.state='headers';return'string'} -else if(r.state=='body'){if(e.sol()&&(i=e.match(/^-----END (.*)?-----\s*$/))){if(i[1]!=r.type)return'error';r.state='end';return'tag'} -else{if(e.eatWhile(/[A-Za-z0-9+\/=]/)){return null} -else{e.next();return'error'}}} -else if(r.state=='end'){return t(e)}},blankLine:function(e){if(e.state=='headers')e.state='body'},startState:function(){return{state:'top',type:null}}}});e.defineMIME('application/pgp','asciiarmor');e.defineMIME('application/pgp-encrypted','asciiarmor');e.defineMIME('application/pgp-keys','asciiarmor');e.defineMIME('application/pgp-signature','asciiarmor')}); -/* ./modules/editor/codemirror/mode/pegjs/pegjs.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../javascript/javascript'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../javascript/javascript'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('pegjs',function(t){var n=e.getMode(t,'javascript');function i(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)};return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inCharacterClass:!1,braced:0,lhs:!0,localState:null}},token:function(t,r){if(t)if(!r.inString&&!r.inComment&&((t.peek()=='"')||(t.peek()=='\''))){r.stringType=t.peek();t.next();r.inString=!0};if(!r.inString&&!r.inComment&&t.match(/^\/\*/)){r.inComment=!0};if(r.inString){while(r.inString&&!t.eol()){if(t.peek()===r.stringType){t.next();r.inString=!1} -else if(t.peek()==='\\'){t.next();t.next()} -else{t.match(/^.[^\\"']*/)}};return r.lhs?'property string':'string'} -else if(r.inComment){while(r.inComment&&!t.eol()){if(t.match(/\*\//)){r.inComment=!1} -else{t.match(/^.[^\*]*/)}};return'comment'} -else if(r.inCharacterClass){while(r.inCharacterClass&&!t.eol()){if(!(t.match(/^[^\]\\]+/)||t.match(/^\\./))){r.inCharacterClass=!1}}} -else if(t.peek()==='['){t.next();r.inCharacterClass=!0;return'bracket'} -else if(t.match(/^\/\//)){t.skipToEnd();return'comment'} -else if(r.braced||t.peek()==='{'){if(r.localState===null){r.localState=e.startState(n)};var c=n.token(t,r.localState),l=t.current();if(!c){for(var a=0;a<l.length;a++){if(l[a]==='{'){r.braced++} -else if(l[a]==='}'){r.braced--}}};return c} -else if(i(t)){if(t.peek()===':'){return'variable'};return'variable-2'} -else if(['[',']','(',')'].indexOf(t.peek())!=-1){t.next();return'bracket'} -else if(!t.eatSpace()){t.next()};return null}}},'javascript')}); -/* ./modules/editor/codemirror/mode/solr/solr.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('solr',function(){'use strict';var t=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}"\\]/,n=/[\|\!\+\-\*\?\~\^\&]/,i=/^(OR|AND|NOT|TO)$/i;function r(e){return parseFloat(e).toString()===e};function o(t){return function(n,i){var r=!1,o;while((o=n.next())!=null){if(o==t&&!r)break;r=!r&&o=='\\'};if(!r)i.tokenize=e;return'string'}};function f(t){return function(n,i){var r='operator';if(t=='+')r+=' positive';else if(t=='-')r+=' negative';else if(t=='|')n.eat(/\|/);else if(t=='&')n.eat(/\&/);else if(t=='^')r+=' boost';i.tokenize=e;return r}};function u(n){return function(o,f){var u=n;while((n=o.peek())&&n.match(t)!=null){u+=o.next()};f.tokenize=e;if(i.test(u))return'operator';else if(r(u))return'number';else if(o.peek()==':')return'field';else return'string'}};function e(i,r){var l=i.next();if(l=='"')r.tokenize=o(l);else if(n.test(l))r.tokenize=f(l);else if(t.test(l))r.tokenize=u(l);return(r.tokenize!=e)?r.tokenize(i,r):null};return{startState:function(){return{tokenize:e}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)}}});e.defineMIME('text/x-solr','solr')}); -/* ./modules/editor/codemirror/mode/tiki/tiki.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("tiki",function(e){function i(e,t,n){return function(i,u){while(!i.eol()){if(i.match(t)){u.tokenize=r;break};i.next()};if(n)u.tokenize=n;return e}};function a(e){return function(t,n){while(!t.eol()){t.next()};n.tokenize=r;return e}};function r(e,n){function t(t){n.tokenize=t;return t(e,n)};var o=e.sol(),u=e.next();switch(u){case"{":e.eat("/");e.eatSpace();e.eatWhile(/[^\s\u00a0="'\/?(}]/);n.tokenize=s;return"tag";case"_":if(e.eat("_"))return t(i("strong","__",r));break;case"'":if(e.eat("'"))return t(i("em","''",r));break;case"(":if(e.eat("("))return t(i("variable-2","))",r));break;case"[":return t(i("variable-3","]",r));break;case"|":if(e.eat("|"))return t(i("comment","||"));break;case"-":if(e.eat("=")){return t(i("header string","=-",r))} -else if(e.eat("-")){return t(i("error tw-deleted","--",r))};break;case"=":if(e.match("=="))return t(i("tw-underline","===",r));break;case":":if(e.eat(":"))return t(i("comment","::"));break;case"^":return t(i("tw-box","^"));break;case"~":if(e.match("np~"))return t(i("meta","~/np~"));break};if(o){switch(u){case"!":if(e.match("!!!!!")){return t(a("header string"))} -else if(e.match("!!!!")){return t(a("header string"))} -else if(e.match("!!!")){return t(a("header string"))} -else if(e.match("!!")){return t(a("header string"))} -else{return t(a("header string"))};break;case"*":case"#":case"+":return t(a("tw-listitem bracket"));break}};return null};var m=e.indentUnit,c,f;function s(e,t){var n=e.next(),i=e.peek();if(n=="}"){t.tokenize=r;return"tag"} -else if(n=="("||n==")"){return"bracket"} -else if(n=="="){f="equals";if(i==">"){e.next();i=e.peek()};if(!/['"]/.test(i)){t.tokenize=b()};return"operator"} -else if(/['"]/.test(n)){t.tokenize=p(n);return t.tokenize(e,t)} -else{e.eatWhile(/[^\s\u00a0="'\/?]/);return"keyword"}};function p(e){return function(t,n){while(!t.eol()){if(t.next()==e){n.tokenize=s;break}};return"string"}};function b(){return function(e,t){while(!e.eol()){var n=e.next(),r=e.peek();if(n==" "||n==","||/[ )}]/.test(r)){t.tokenize=s;break}};return"string"}};var t,u;function o(){for(var e=arguments.length-1;e>=0;e--)t.cc.push(arguments[e])};function n(){o.apply(null,arguments);return!0};function d(e,n){var r=t.context&&t.context.noIndent;t.context={prev:t.context,pluginName:e,indent:t.indented,startOfLine:n,noIndent:r}};function k(){if(t.context)t.context=t.context.prev};function h(e){if(e=="openPlugin"){t.pluginName=c;return n(l,x(t.startOfLine))} -else if(e=="closePlugin"){var i=!1;if(t.context){i=t.context.pluginName!=c;k()} -else{i=!0};if(i)u="error";return n(v(i))} -else if(e=="string"){if(!t.context||t.context.name!="!cdata")d("!cdata");if(t.tokenize==r)k();return n()} -else return n()};function x(e){return function(r){if(r=="selfclosePlugin"||r=="endPlugin")return n();if(r=="endPlugin"){d(t.pluginName,e);return n()};return n()}};function v(e){return function(t){if(e)u="error";if(t=="endPlugin")return n();return o()}};function l(e){if(e=="keyword"){u="attribute";return n(l)};if(e=="equals")return n(w,l);return o()};function w(e){if(e=="keyword"){u="string";return n()};if(e=="string")return n(g);return o()};function g(e){if(e=="string")return n(g);else return o()};return{startState:function(){return{tokenize:r,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,n){if(e.sol()){n.startOfLine=!0;n.indented=e.indentation()};if(e.eatSpace())return null;u=f=c=null;var r=n.tokenize(e,n);if((r||f)&&r!="comment"){t=n;while(!0){var i=n.cc.pop()||h;if(i(f||r))break}};n.startOfLine=!1;return u||r},indent:function(e,n){var t=e.context;if(t&&t.noIndent)return 0;if(t&&/^{\//.test(n))t=t.prev;while(t&&!t.startOfLine)t=t.prev;if(t)return t.indent+m;else return 0},electricChars:"/"}});e.defineMIME("text/tiki","tiki")}); -/* ./modules/editor/codemirror/mode/slim/slim.min.js */(function(t){if(typeof exports=="object"&&typeof module=="object")t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],t);else t(CodeMirror)})(function(t){"use strict";t.defineMode("slim",function(e){var s=t.getMode(e,{name:"htmlmixed"});var u=t.getMode(e,"ruby"),f={html:s,ruby:u};var h={ruby:"ruby",javascript:"javascript",css:"text/css",sass:"text/x-sass",scss:"text/x-scss",less:"text/x-less",styl:"text/x-styl",coffee:"coffeescript",asciidoc:"text/x-asciidoc",markdown:"text/x-markdown",textile:"text/x-textile",creole:"text/x-creole",wiki:"text/x-wiki",mediawiki:"text/x-mediawiki",rdoc:"text/x-rdoc",builder:"text/x-builder",nokogiri:"text/x-nokogiri",erb:"application/x-erb"};var U=function(t){var e=[];for(var n in t)e.push(n);return new RegExp("^("+e.join("|")+"):")}(h),x={"commentLine":"comment","slimSwitch":"operator special","slimTag":"tag","slimId":"attribute def","slimClass":"attribute qualifier","slimAttribute":"attribute","slimSubmode":"keyword special","closeAttributeTag":null,"slimDoctype":null,"lineContinuation":null};var T={"{":"}","[":"]","(":")"};var c="_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",l=c+"\\-0-9\xB7\u0300-\u036F\u203F-\u2040",C=new RegExp("^[:"+c+"](?::["+l+"]|["+l+"]*)"),D=new RegExp("^[:"+c+"][:\\."+l+"]*(?=\\s*=)"),E=new RegExp("^[:"+c+"][:\\."+l+"]*"),A=/^\.-?[_a-zA-Z]+[\w\-]*/,L=/^#[_a-zA-Z]+[\w\-]*/;function O(t,e,n){var i=function(i,r){r.tokenize=e;if(i.pos<t){i.pos=t;return n};return r.tokenize(i,r)};return function(t,n){n.tokenize=i;return e(t,n)}};function R(t,e,n,r,i){var u=t.current(),o=u.search(n);if(o>-1){e.tokenize=O(t.pos,e.tokenize,i);t.backUp(u.length-o-r)};return i};function k(t,e){t.stack={parent:t.stack,style:"continuation",indented:e,tokenize:t.line};t.line=t.tokenize};function d(t){if(t.line==t.tokenize){t.line=t.stack.tokenize;t.stack=t.stack.parent}};function j(t,e){return function(n,i){d(i);if(n.match(/^\\$/)){k(i,t);return"lineContinuation"};var r=e(n,i);if(n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)){n.backUp(1)};return r}};function I(t,e){return function(n,i){d(i);var r=e(n,i);if(n.eol()&&n.current().match(/,$/)){k(i,t)};return r}};function m(t,e){return function(n,i){var r=n.peek();if(r==t&&i.rubyState.tokenize.length==1){n.next();i.tokenize=e;return"closeAttributeTag"} -else{return o(n,i)}}};function n(e){var n,i=function(t,i){if(i.rubyState.tokenize.length==1&&!i.rubyState.context.prev){t.backUp(1);if(t.eatSpace()){i.rubyState=n;i.tokenize=e;return e(t,i)};t.next()};return o(t,i)};return function(e,r){n=r.rubyState;r.rubyState=t.startState(u);r.tokenize=i;return o(e,r)}};function o(t,e){return u.token(t,e.rubyState)};function P(t,e){if(t.match(/^\\$/)){return"lineContinuation"};return y(t,e)};function y(t,e){if(t.match(/^#\{/)){e.tokenize=m("}",e.tokenize);return null};return R(t,e,/[^\\]#\{/,1,s.token(t,e.htmlState))};function q(t){return function(e,n){var i=P(e,n);if(e.eol())n.tokenize=t;return i}};function S(t,e,n){e.stack={parent:e.stack,style:"html",indented:t.column()+n,tokenize:e.line};e.line=e.tokenize=y;return null};function v(t,e){t.skipToEnd();return e.stack.style};function Z(t,e){e.stack={parent:e.stack,style:"comment",indented:e.indented+1,tokenize:e.line};e.line=v;return v(t,e)};function r(t,e){if(t.eat(e.stack.endQuote)){e.line=e.stack.line;e.tokenize=e.stack.tokenize;e.stack=e.stack.parent;return null};if(t.match(E)){e.tokenize=Q;return"slimAttribute"};t.next();return null};function Q(t,e){if(t.match(/^==?/)){e.tokenize=V;return null};return r(t,e)};function V(t,e){var i=t.peek();if(i=="\""||i=="'"){e.tokenize=g(i,"string",!0,!1,r);t.next();return e.tokenize(t,e)};if(i=="["){return n(r)(t,e)};if(t.match(/^(true|false|nil)\b/)){e.tokenize=r;return"keyword"};return n(r)(t,e)};function B(t,e,n){t.stack={parent:t.stack,style:"wrapper",indented:t.indented+1,tokenize:n,line:t.line,endQuote:e};t.line=t.tokenize=r;return null};function tt(e,n){if(e.match(/^#\{/)){n.tokenize=m("}",n.tokenize);return null};var i=new t.StringStream(e.string.slice(n.stack.indented),e.tabSize);i.pos=e.pos-n.stack.indented;i.start=e.start-n.stack.indented;i.lastColumnPos=e.lastColumnPos-n.stack.indented;i.lastColumnValue=e.lastColumnValue-n.stack.indented;var r=n.subMode.token(i,n.subState);e.pos=i.pos+n.stack.indented;return r};function et(t,e){e.stack.indented=t.column();e.line=e.tokenize=tt;return e.tokenize(t,e)};function nt(n){var i=h[n],u=t.mimeModes[i];if(u){return t.getMode(e,u)};var r=t.modes[i];if(r){return r(e,{name:i})};return t.getMode(e,"null")};function it(t){if(!f.hasOwnProperty(t)){return f[t]=nt(t)};return f[t]};function rt(e,n){var i=it(e),r=t.startState(i);n.subMode=i;n.subState=r;n.stack={parent:n.stack,style:"sub",indented:n.indented+1,tokenize:n.line};n.line=n.tokenize=et;return"slimSubmode"};function ut(t,e){t.skipToEnd();return"slimDoctype"};function ot(t,e){var i=t.peek();if(i=="<"){return(e.tokenize=q(e.tokenize))(t,e)};if(t.match(/^[|']/)){return S(t,e,1)};if(t.match(/^\/(!|\[\w+])?/)){return Z(t,e)};if(t.match(/^(-|==?[<>]?)/)){e.tokenize=j(t.column(),I(t.column(),o));return"slimSwitch"};if(t.match(/^doctype\b/)){e.tokenize=ut;return"keyword"};var n=t.match(U);if(n){return rt(n[1],e)};return z(t,e)};function b(t,e){if(e.startOfLine){return ot(t,e)};return z(t,e)};function z(t,e){if(t.eat("*")){e.tokenize=n(w);return null};if(t.match(C)){e.tokenize=w;return"slimTag"};return a(t,e)};function w(t,e){if(t.match(/^(<>?|><?)/)){e.tokenize=a;return null};return a(t,e)};function a(t,e){if(t.match(L)){e.tokenize=a;return"slimId"};if(t.match(A)){e.tokenize=a;return"slimClass"};return i(t,e)};function i(t,e){if(t.match(/^([\[\{\(])/)){return B(e,T[RegExp.$1],i)};if(t.match(D)){e.tokenize=at;return"slimAttribute"};if(t.peek()=="*"){t.next();e.tokenize=n(F);return null};return F(t,e)};function at(t,e){if(t.match(/^==?/)){e.tokenize=ct;return null};return i(t,e)};function ct(t,e){var r=t.peek();if(r=="\""||r=="'"){e.tokenize=g(r,"string",!0,!1,i);t.next();return e.tokenize(t,e)};if(r=="["){return n(i)(t,e)};if(r==":"){return n(M)(t,e)};if(t.match(/^(true|false|nil)\b/)){e.tokenize=i;return"keyword"};return n(i)(t,e)};function M(t,e){t.backUp(1);if(t.match(/^[^\s],(?=:)/)){e.tokenize=n(M);return null};t.next();return i(t,e)};function g(t,e,n,i,r){return function(u,o){d(o);var l=u.current().length==0;if(u.match(/^\\$/,l)){if(!l)return e;k(o,o.indented);return"lineContinuation"};if(u.match(/^#\{/,l)){if(!l)return e;o.tokenize=m("}",o.tokenize);return null};var a=!1,c;while((c=u.next())!=null){if(c==t&&(i||!a)){o.tokenize=r;break};if(n&&c=="#"&&!a){if(u.eat("{")){u.backUp(2);break}};a=!a&&c=="\\"};if(u.eol()&&a){u.backUp(1)};return e}};function F(t,e){if(t.match(/^==?/)){e.tokenize=o;return"slimSwitch"};if(t.match(/^\/$/)){e.tokenize=b;return null};if(t.match(/^:/)){e.tokenize=z;return"slimSwitch"};S(t,e,0);return e.tokenize(t,e)};var p={startState:function(){var e=t.startState(s),n=t.startState(u);return{htmlState:e,rubyState:n,stack:null,last:null,tokenize:b,line:b,indented:0}},copyState:function(e){return{htmlState:t.copyState(s,e.htmlState),rubyState:t.copyState(u,e.rubyState),subMode:e.subMode,subState:e.subMode&&t.copyState(e.subMode,e.subState),stack:e.stack,last:e.last,tokenize:e.tokenize,line:e.line}},token:function(e,t){if(e.sol()){t.indented=e.indentation();t.startOfLine=!0;t.tokenize=t.line;while(t.stack&&t.stack.indented>t.indented&&t.last!="slimSubmode"){t.line=t.tokenize=t.stack.tokenize;t.stack=t.stack.parent;t.subMode=null;t.subState=null}};if(e.eatSpace())return null;var n=t.tokenize(e,t);t.startOfLine=!1;if(n)t.last=n;return x.hasOwnProperty(n)?x[n]:n},blankLine:function(t){if(t.subMode&&t.subMode.blankLine){return t.subMode.blankLine(t.subState)}},innerMode:function(t){if(t.subMode)return{state:t.subState,mode:t.subMode};return{state:t,mode:p}}};return p},"htmlmixed","ruby");t.defineMIME("text/x-slim","slim");t.defineMIME("application/x-slim","slim")}); -/* ./modules/editor/codemirror/mode/puppet/puppet.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('puppet',function(){var i={};var t=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;function e(e,n){var r=n.split(' ');for(var t=0;t<r.length;t++){i[r[t]]=e}};e('keyword','class define site node include import inherits');e('keyword','case if else in and elsif default or');e('atom','false true running present absent file directory undef');e('builtin','action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool');function n(e,i){var n,t,r=!1;while(!e.eol()&&(n=e.next())!=i.pending){if(n==='$'&&t!='\\'&&i.pending=='"'){r=!0;break};t=n};if(r){e.backUp(1)};if(n==i.pending){i.continueString=!1} -else{i.continueString=!0};return'string'};function r(e,r){var a=e.match(/[\w]+/,!1),s=e.match(/(\s+)?\w+\s+=>.*/,!1),c=e.match(/(\s+)?[\w:_]+(\s+)?{/,!1),u=e.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),o=e.next();if(o==='$'){if(e.match(t)){return r.continueString?'variable-2':'variable'};return'error'};if(r.continueString){e.backUp(1);return n(e,r)};if(r.inDefinition){if(e.match(/(\s+)?[\w:_]+(\s+)?/)){return'def'};e.match(/\s+{/);r.inDefinition=!1};if(r.inInclude){e.match(/(\s+)?\S+(\s+)?/);r.inInclude=!1;return'def'};if(e.match(/(\s+)?\w+\(/)){e.backUp(1);return'def'};if(s){e.match(/(\s+)?\w+/);return'tag'};if(a&&i.hasOwnProperty(a)){e.backUp(1);e.match(/[\w]+/);if(e.match(/\s+\S+\s+{/,!1)){r.inDefinition=!0};if(a=='include'){r.inInclude=!0};return i[a]};if(/(^|\s+)[A-Z][\w:_]+/.test(a)){e.backUp(1);e.match(/(^|\s+)[A-Z][\w:_]+/);return'def'};if(c){e.match(/(\s+)?[\w:_]+/);return'def'};if(u){e.match(/(\s+)?[@]{1,2}/);return'special'};if(o=='#'){e.skipToEnd();return'comment'};if(o=='\''||o=='"'){r.pending=o;return n(e,r)};if(o=='{'||o=='}'){return'bracket'};if(o=='/'){e.match(/.*?\//);return'variable-3'};if(o.match(/[0-9]/)){e.eatWhile(/[0-9]+/);return'number'};if(o=='='){if(e.peek()=='>'){e.next()};return'operator'};e.eatWhile(/[\w-]/);return null};return{startState:function(){var e={};e.inDefinition=!1;e.inInclude=!1;e.continueString=!1;e.pending=!1;return e},token:function(e,i){if(e.eatSpace())return null;return r(e,i)}}});e.defineMIME('text/x-puppet','puppet')}); -/* ./modules/editor/codemirror/mode/meta.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.modeInfo=[{name:'APL',mime:'text/apl',mode:'apl',ext:['dyalog','apl']},{name:'PGP',mimes:['application/pgp','application/pgp-encrypted','application/pgp-keys','application/pgp-signature'],mode:'asciiarmor',ext:['asc','pgp','sig']},{name:'ASN.1',mime:'text/x-ttcn-asn',mode:'asn.1',ext:['asn','asn1']},{name:'Asterisk',mime:'text/x-asterisk',mode:'asterisk',file:/^extensions\.conf$/i},{name:'Brainfuck',mime:'text/x-brainfuck',mode:'brainfuck',ext:['b','bf']},{name:'C',mime:'text/x-csrc',mode:'clike',ext:['c','h']},{name:'C++',mime:'text/x-c++src',mode:'clike',ext:['cpp','c++','cc','cxx','hpp','h++','hh','hxx'],alias:['cpp']},{name:'Cobol',mime:'text/x-cobol',mode:'cobol',ext:['cob','cpy']},{name:'C#',mime:'text/x-csharp',mode:'clike',ext:['cs'],alias:['csharp']},{name:'Clojure',mime:'text/x-clojure',mode:'clojure',ext:['clj','cljc','cljx']},{name:'ClojureScript',mime:'text/x-clojurescript',mode:'clojure',ext:['cljs']},{name:'Closure Stylesheets (GSS)',mime:'text/x-gss',mode:'css',ext:['gss']},{name:'CMake',mime:'text/x-cmake',mode:'cmake',ext:['cmake','cmake.in'],file:/^CMakeLists.txt$/},{name:'CoffeeScript',mimes:['application/vnd.coffeescript','text/coffeescript','text/x-coffeescript'],mode:'coffeescript',ext:['coffee'],alias:['coffee','coffee-script']},{name:'Common Lisp',mime:'text/x-common-lisp',mode:'commonlisp',ext:['cl','lisp','el'],alias:['lisp']},{name:'Cypher',mime:'application/x-cypher-query',mode:'cypher',ext:['cyp','cypher']},{name:'Cython',mime:'text/x-cython',mode:'python',ext:['pyx','pxd','pxi']},{name:'Crystal',mime:'text/x-crystal',mode:'crystal',ext:['cr']},{name:'CSS',mime:'text/css',mode:'css',ext:['css']},{name:'CQL',mime:'text/x-cassandra',mode:'sql',ext:['cql']},{name:'D',mime:'text/x-d',mode:'d',ext:['d']},{name:'Dart',mimes:['application/dart','text/x-dart'],mode:'dart',ext:['dart']},{name:'diff',mime:'text/x-diff',mode:'diff',ext:['diff','patch']},{name:'Django',mime:'text/x-django',mode:'django'},{name:'Dockerfile',mime:'text/x-dockerfile',mode:'dockerfile',file:/^Dockerfile$/},{name:'DTD',mime:'application/xml-dtd',mode:'dtd',ext:['dtd']},{name:'Dylan',mime:'text/x-dylan',mode:'dylan',ext:['dylan','dyl','intr']},{name:'EBNF',mime:'text/x-ebnf',mode:'ebnf'},{name:'ECL',mime:'text/x-ecl',mode:'ecl',ext:['ecl']},{name:'edn',mime:'application/edn',mode:'clojure',ext:['edn']},{name:'Eiffel',mime:'text/x-eiffel',mode:'eiffel',ext:['e']},{name:'Elm',mime:'text/x-elm',mode:'elm',ext:['elm']},{name:'Embedded Javascript',mime:'application/x-ejs',mode:'htmlembedded',ext:['ejs']},{name:'Embedded Ruby',mime:'application/x-erb',mode:'htmlembedded',ext:['erb']},{name:'Erlang',mime:'text/x-erlang',mode:'erlang',ext:['erl']},{name:'Esper',mime:'text/x-esper',mode:'sql'},{name:'Factor',mime:'text/x-factor',mode:'factor',ext:['factor']},{name:'FCL',mime:'text/x-fcl',mode:'fcl'},{name:'Forth',mime:'text/x-forth',mode:'forth',ext:['forth','fth','4th']},{name:'Fortran',mime:'text/x-fortran',mode:'fortran',ext:['f','for','f77','f90']},{name:'F#',mime:'text/x-fsharp',mode:'mllike',ext:['fs'],alias:['fsharp']},{name:'Gas',mime:'text/x-gas',mode:'gas',ext:['s']},{name:'Gherkin',mime:'text/x-feature',mode:'gherkin',ext:['feature']},{name:'GitHub Flavored Markdown',mime:'text/x-gfm',mode:'gfm',file:/^(readme|contributing|history).md$/i},{name:'Go',mime:'text/x-go',mode:'go',ext:['go']},{name:'Groovy',mime:'text/x-groovy',mode:'groovy',ext:['groovy','gradle'],file:/^Jenkinsfile$/},{name:'HAML',mime:'text/x-haml',mode:'haml',ext:['haml']},{name:'Haskell',mime:'text/x-haskell',mode:'haskell',ext:['hs']},{name:'Haskell (Literate)',mime:'text/x-literate-haskell',mode:'haskell-literate',ext:['lhs']},{name:'Haxe',mime:'text/x-haxe',mode:'haxe',ext:['hx']},{name:'HXML',mime:'text/x-hxml',mode:'haxe',ext:['hxml']},{name:'ASP.NET',mime:'application/x-aspx',mode:'htmlembedded',ext:['aspx'],alias:['asp','aspx']},{name:'HTML',mime:'text/html',mode:'htmlmixed',ext:['html','htm'],alias:['xhtml']},{name:'HTTP',mime:'message/http',mode:'http'},{name:'IDL',mime:'text/x-idl',mode:'idl',ext:['pro']},{name:'Pug',mime:'text/x-pug',mode:'pug',ext:['jade','pug'],alias:['jade']},{name:'Java',mime:'text/x-java',mode:'clike',ext:['java']},{name:'Java Server Pages',mime:'application/x-jsp',mode:'htmlembedded',ext:['jsp'],alias:['jsp']},{name:'JavaScript',mimes:['text/javascript','text/ecmascript','application/javascript','application/x-javascript','application/ecmascript'],mode:'javascript',ext:['js'],alias:['ecmascript','js','node']},{name:'JSON',mimes:['application/json','application/x-json'],mode:'javascript',ext:['json','map'],alias:['json5']},{name:'JSON-LD',mime:'application/ld+json',mode:'javascript',ext:['jsonld'],alias:['jsonld']},{name:'JSX',mime:'text/jsx',mode:'jsx',ext:['jsx']},{name:'Jinja2',mime:'null',mode:'jinja2'},{name:'Julia',mime:'text/x-julia',mode:'julia',ext:['jl']},{name:'Kotlin',mime:'text/x-kotlin',mode:'clike',ext:['kt']},{name:'LESS',mime:'text/x-less',mode:'css',ext:['less']},{name:'LiveScript',mime:'text/x-livescript',mode:'livescript',ext:['ls'],alias:['ls']},{name:'Lua',mime:'text/x-lua',mode:'lua',ext:['lua']},{name:'Markdown',mime:'text/x-markdown',mode:'markdown',ext:['markdown','md','mkd']},{name:'mIRC',mime:'text/mirc',mode:'mirc'},{name:'MariaDB SQL',mime:'text/x-mariadb',mode:'sql'},{name:'Mathematica',mime:'text/x-mathematica',mode:'mathematica',ext:['m','nb']},{name:'Modelica',mime:'text/x-modelica',mode:'modelica',ext:['mo']},{name:'MUMPS',mime:'text/x-mumps',mode:'mumps',ext:['mps']},{name:'MS SQL',mime:'text/x-mssql',mode:'sql'},{name:'mbox',mime:'application/mbox',mode:'mbox',ext:['mbox']},{name:'MySQL',mime:'text/x-mysql',mode:'sql'},{name:'Nginx',mime:'text/x-nginx-conf',mode:'nginx',file:/nginx.*\.conf$/i},{name:'NSIS',mime:'text/x-nsis',mode:'nsis',ext:['nsh','nsi']},{name:'NTriples',mimes:['application/n-triples','application/n-quads','text/n-triples'],mode:'ntriples',ext:['nt','nq']},{name:'Objective C',mime:'text/x-objectivec',mode:'clike',ext:['m','mm'],alias:['objective-c','objc']},{name:'OCaml',mime:'text/x-ocaml',mode:'mllike',ext:['ml','mli','mll','mly']},{name:'Octave',mime:'text/x-octave',mode:'octave',ext:['m']},{name:'Oz',mime:'text/x-oz',mode:'oz',ext:['oz']},{name:'Pascal',mime:'text/x-pascal',mode:'pascal',ext:['p','pas']},{name:'PEG.js',mime:'null',mode:'pegjs',ext:['jsonld']},{name:'Perl',mime:'text/x-perl',mode:'perl',ext:['pl','pm']},{name:'PHP',mime:['application/x-httpd-php','text/x-php'],mode:'php',ext:['php','php3','php4','php5','php7','phtml']},{name:'Pig',mime:'text/x-pig',mode:'pig',ext:['pig']},{name:'Plain Text',mime:'text/plain',mode:'null',ext:['txt','text','conf','def','list','log']},{name:'PLSQL',mime:'text/x-plsql',mode:'sql',ext:['pls']},{name:'PowerShell',mime:'application/x-powershell',mode:'powershell',ext:['ps1','psd1','psm1']},{name:'Properties files',mime:'text/x-properties',mode:'properties',ext:['properties','ini','in'],alias:['ini','properties']},{name:'ProtoBuf',mime:'text/x-protobuf',mode:'protobuf',ext:['proto']},{name:'Python',mime:'text/x-python',mode:'python',ext:['BUILD','bzl','py','pyw'],file:/^(BUCK|BUILD)$/},{name:'Puppet',mime:'text/x-puppet',mode:'puppet',ext:['pp']},{name:'Q',mime:'text/x-q',mode:'q',ext:['q']},{name:'R',mime:'text/x-rsrc',mode:'r',ext:['r','R'],alias:['rscript']},{name:'reStructuredText',mime:'text/x-rst',mode:'rst',ext:['rst'],alias:['rst']},{name:'RPM Changes',mime:'text/x-rpm-changes',mode:'rpm'},{name:'RPM Spec',mime:'text/x-rpm-spec',mode:'rpm',ext:['spec']},{name:'Ruby',mime:'text/x-ruby',mode:'ruby',ext:['rb'],alias:['jruby','macruby','rake','rb','rbx']},{name:'Rust',mime:'text/x-rustsrc',mode:'rust',ext:['rs']},{name:'SAS',mime:'text/x-sas',mode:'sas',ext:['sas']},{name:'Sass',mime:'text/x-sass',mode:'sass',ext:['sass']},{name:'Scala',mime:'text/x-scala',mode:'clike',ext:['scala']},{name:'Scheme',mime:'text/x-scheme',mode:'scheme',ext:['scm','ss']},{name:'SCSS',mime:'text/x-scss',mode:'css',ext:['scss']},{name:'Shell',mimes:['text/x-sh','application/x-sh'],mode:'shell',ext:['sh','ksh','bash'],alias:['bash','sh','zsh'],file:/^PKGBUILD$/},{name:'Sieve',mime:'application/sieve',mode:'sieve',ext:['siv','sieve']},{name:'Slim',mimes:['text/x-slim','application/x-slim'],mode:'slim',ext:['slim']},{name:'Smalltalk',mime:'text/x-stsrc',mode:'smalltalk',ext:['st']},{name:'Smarty',mime:'text/x-smarty',mode:'smarty',ext:['tpl']},{name:'Solr',mime:'text/x-solr',mode:'solr'},{name:'Soy',mime:'text/x-soy',mode:'soy',ext:['soy'],alias:['closure template']},{name:'SPARQL',mime:'application/sparql-query',mode:'sparql',ext:['rq','sparql'],alias:['sparul']},{name:'Spreadsheet',mime:'text/x-spreadsheet',mode:'spreadsheet',alias:['excel','formula']},{name:'SQL',mime:'text/x-sql',mode:'sql',ext:['sql']},{name:'SQLite',mime:'text/x-sqlite',mode:'sql'},{name:'Squirrel',mime:'text/x-squirrel',mode:'clike',ext:['nut']},{name:'Stylus',mime:'text/x-styl',mode:'stylus',ext:['styl']},{name:'Swift',mime:'text/x-swift',mode:'swift',ext:['swift']},{name:'sTeX',mime:'text/x-stex',mode:'stex'},{name:'LaTeX',mime:'text/x-latex',mode:'stex',ext:['text','ltx'],alias:['tex']},{name:'SystemVerilog',mime:'text/x-systemverilog',mode:'verilog',ext:['v','sv','svh']},{name:'Tcl',mime:'text/x-tcl',mode:'tcl',ext:['tcl']},{name:'Textile',mime:'text/x-textile',mode:'textile',ext:['textile']},{name:'TiddlyWiki ',mime:'text/x-tiddlywiki',mode:'tiddlywiki'},{name:'Tiki wiki',mime:'text/tiki',mode:'tiki'},{name:'TOML',mime:'text/x-toml',mode:'toml',ext:['toml']},{name:'Tornado',mime:'text/x-tornado',mode:'tornado'},{name:'troff',mime:'text/troff',mode:'troff',ext:['1','2','3','4','5','6','7','8','9']},{name:'TTCN',mime:'text/x-ttcn',mode:'ttcn',ext:['ttcn','ttcn3','ttcnpp']},{name:'TTCN_CFG',mime:'text/x-ttcn-cfg',mode:'ttcn-cfg',ext:['cfg']},{name:'Turtle',mime:'text/turtle',mode:'turtle',ext:['ttl']},{name:'TypeScript',mime:'application/typescript',mode:'javascript',ext:['ts'],alias:['ts']},{name:'TypeScript-JSX',mime:'text/typescript-jsx',mode:'jsx',ext:['tsx'],alias:['tsx']},{name:'Twig',mime:'text/x-twig',mode:'twig'},{name:'Web IDL',mime:'text/x-webidl',mode:'webidl',ext:['webidl']},{name:'VB.NET',mime:'text/x-vb',mode:'vb',ext:['vb']},{name:'VBScript',mime:'text/vbscript',mode:'vbscript',ext:['vbs']},{name:'Velocity',mime:'text/velocity',mode:'velocity',ext:['vtl']},{name:'Verilog',mime:'text/x-verilog',mode:'verilog',ext:['v']},{name:'VHDL',mime:'text/x-vhdl',mode:'vhdl',ext:['vhd','vhdl']},{name:'Vue.js Component',mimes:['script/x-vue','text/x-vue'],mode:'vue',ext:['vue']},{name:'XML',mimes:['application/xml','text/xml'],mode:'xml',ext:['xml','xsl','xsd','svg'],alias:['rss','wsdl','xsd']},{name:'XQuery',mime:'application/xquery',mode:'xquery',ext:['xy','xquery']},{name:'Yacas',mime:'text/x-yacas',mode:'yacas',ext:['ys']},{name:'YAML',mimes:['text/x-yaml','text/yaml'],mode:'yaml',ext:['yaml','yml'],alias:['yml']},{name:'Z80',mime:'text/x-z80',mode:'z80',ext:['z80']},{name:'mscgen',mime:'text/x-mscgen',mode:'mscgen',ext:['mscgen','mscin','msc']},{name:'xu',mime:'text/x-xu',mode:'mscgen',ext:['xu']},{name:'msgenny',mime:'text/x-msgenny',mode:'mscgen',ext:['msgenny']}];for(var t=0;t<e.modeInfo.length;t++){var m=e.modeInfo[t];if(m.mimes)m.mime=m.mimes[0]};e.findModeByMIME=function(m){m=m.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var t=e.modeInfo[i];if(t.mime==m)return t;if(t.mimes)for(var a=0;a<t.mimes.length;a++)if(t.mimes[a]==m)return t};if(/\+xml$/.test(m))return e.findModeByMIME('application/xml');if(/\+json$/.test(m))return e.findModeByMIME('application/json')};e.findModeByExtension=function(m){for(var i=0;i<e.modeInfo.length;i++){var t=e.modeInfo[i];if(t.ext)for(var a=0;a<t.ext.length;a++)if(t.ext[a]==m)return t}};e.findModeByFileName=function(m){for(var a=0;a<e.modeInfo.length;a++){var t=e.modeInfo[a];if(t.file&&t.file.test(m))return t};var i=m.lastIndexOf('.'),x=i>-1&&m.substring(i+1,m.length);if(x)return e.findModeByExtension(x)};e.findModeByName=function(m){m=m.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var t=e.modeInfo[i];if(t.name.toLowerCase()==m)return t;if(t.alias)for(var a=0;a<t.alias.length;a++)if(t.alias[a].toLowerCase()==m)return t}}}); -/* ./modules/editor/codemirror/mode/go/go.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('go',function(t){var a=t.indentUnit,s={'break':!0,'case':!0,'chan':!0,'const':!0,'continue':!0,'default':!0,'defer':!0,'else':!0,'fallthrough':!0,'for':!0,'func':!0,'go':!0,'goto':!0,'if':!0,'import':!0,'interface':!0,'map':!0,'package':!0,'range':!0,'return':!0,'select':!0,'struct':!0,'switch':!0,'type':!0,'var':!0,'bool':!0,'byte':!0,'complex64':!0,'complex128':!0,'float32':!0,'float64':!0,'int8':!0,'int16':!0,'int32':!0,'int64':!0,'string':!0,'uint8':!0,'uint16':!0,'uint32':!0,'uint64':!0,'int':!0,'uint':!0,'uintptr':!0,'error':!0,'rune':!0};var u={'true':!0,'false':!0,'iota':!0,'nil':!0,'append':!0,'cap':!0,'close':!0,'complex':!0,'copy':!0,'delete':!0,'imag':!0,'len':!0,'make':!0,'new':!0,'panic':!0,'print':!0,'println':!0,'real':!0,'recover':!0};var o=/[+\-*&^%:=<>!|\/]/,n;function i(e,t){var i=e.next();if(i=='"'||i=='\''||i=='`'){t.tokenize=d(i);return t.tokenize(e,t)};if(/[\d\.]/.test(i)){if(i=='.'){e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/)} -else if(i=='0'){e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/)} -else{e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/)};return'number'};if(/[\[\]{}\(\),;\:\.]/.test(i)){n=i;return null};if(i=='/'){if(e.eat('*')){t.tokenize=c;return c(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(o.test(i)){e.eatWhile(o);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var r=e.current();if(s.propertyIsEnumerable(r)){if(r=='case'||r=='default')n='case';return'keyword'};if(u.propertyIsEnumerable(r))return'atom';return'variable'};function d(e){return function(t,n){var r=!1,o,a=!1;while((o=t.next())!=null){if(o==e&&!r){a=!0;break};r=!r&&e!='`'&&o=='\\'};if(a||!(r||e=='`'))n.tokenize=i;return'string'}};function c(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=i;break};r=(n=='*')};return'comment'};function f(e,t,n,i,r){this.indented=e;this.column=t;this.type=n;this.align=i;this.prev=r};function r(e,t,n){return e.context=new f(e.indented,t,n,null,e.context)};function l(e){if(!e.context.prev)return;var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new f((e||0)-a,0,'top',!1),indented:0,startOfLine:!0}},token:function(e,t){var o=t.context;if(e.sol()){if(o.align==null)o.align=!1;t.indented=e.indentation();t.startOfLine=!0;if(o.type=='case')o.type='}'};if(e.eatSpace())return null;n=null;var a=(t.tokenize||i)(e,t);if(a=='comment')return a;if(o.align==null)o.align=!0;if(n=='{')r(t,e.column(),'}');else if(n=='[')r(t,e.column(),']');else if(n=='(')r(t,e.column(),')');else if(n=='case')o.type='case';else if(n=='}'&&o.type=='}')l(t);else if(n==o.type)l(t);t.startOfLine=!1;return a},indent:function(t,n){if(t.tokenize!=i&&t.tokenize!=null)return e.Pass;var r=t.context,c=n&&n.charAt(0);if(r.type=='case'&&/^(?:case|default)\b/.test(n)){t.context.type='}';return r.indented};var o=c==r.type;if(r.align)return r.column+(o?0:1);else return r.indented+(o?0:a)},electricChars:'{}):',closeBrackets:'()[]{}\'\'""``',fold:'brace',blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:'//'}});e.defineMIME('text/x-go','go')}); -/* ./modules/editor/codemirror/mode/commonlisp/commonlisp.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('commonlisp',function(t){var o=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,i=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,l=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,u=/[^\s'`,@()\[\]";]/,e;function n(e){var t;while(t=e.next()){if(t=='\\')e.next();else if(!u.test(t)){e.backUp(1);break}};return e.current()};function r(t,u){if(t.eatSpace()){e='ws';return null};if(t.match(l))return'number';var r=t.next();if(r=='\\')r=t.next();if(r=='"')return(u.tokenize=c)(t,u);else if(r=='('){e='open';return'bracket'} -else if(r==')'||r==']'){e='close';return'bracket'} -else if(r==';'){t.skipToEnd();e='ws';return'comment'} -else if(/['`,@]/.test(r))return null;else if(r=='|'){if(t.skipTo('|')){t.next();return'symbol'} -else{t.skipToEnd();return'error'}} -else if(r=='#'){var r=t.next();if(r=='('){e='open';return'bracket'} -else if(/[+\-=\.']/.test(r))return null;else if(/\d/.test(r)&&t.match(/^\d*#/))return null;else if(r=='|')return(u.tokenize=s)(t,u);else if(r==':'){n(t);return'meta'} -else if(r=='\\'){t.next();n(t);return'string-2'} -else return'error'} -else{var f=n(t);if(f=='.')return null;e='symbol';if(f=='nil'||f=='t'||f.charAt(0)==':')return'atom';if(u.lastType=='open'&&(o.test(f)||i.test(f)))return'keyword';if(f.charAt(0)=='&')return'variable-2';return'variable'}};function c(e,t){var n=!1,i;while(i=e.next()){if(i=='"'&&!n){t.tokenize=r;break};n=!n&&i=='\\'};return'string'};function s(t,n){var i,o;while(i=t.next()){if(i=='#'&&o=='|'){n.tokenize=r;break};o=i};e='ws';return'comment'};return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:r}},token:function(r,n){if(r.sol()&&typeof n.ctx.indentTo!='number')n.ctx.indentTo=n.ctx.start+1;e=null;var o=n.tokenize(r,n);if(e!='ws'){if(n.ctx.indentTo==null){if(e=='symbol'&&i.test(r.current()))n.ctx.indentTo=n.ctx.start+t.indentUnit;else n.ctx.indentTo='next'} -else if(n.ctx.indentTo=='next'){n.ctx.indentTo=r.column()};n.lastType=e};if(e=='open')n.ctx={prev:n.ctx,start:r.column(),indentTo:null};else if(e=='close')n.ctx=n.ctx.prev||n.ctx;return o},indent:function(e,t){var n=e.ctx.indentTo;return typeof n=='number'?n:e.ctx.start+1},closeBrackets:{pairs:'()[]{}""'},lineComment:';;',blockCommentStart:'#|',blockCommentEnd:'|#'}});e.defineMIME('text/x-common-lisp','commonlisp')}); -/* ./modules/editor/codemirror/mode/rust/rust.min.js */ -/* ./modules/editor/codemirror/mode/powershell/powershell.min.js */(function(e){'use strict';if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(window.CodeMirror)})(function(e){'use strict';e.defineMode('powershell',function(){function t(e,t){t=t||{};var n=t.prefix!==undefined?t.prefix:'^',i=t.suffix!==undefined?t.suffix:'\\b';for(var r=0;r<e.length;r++){if(e[r]instanceof RegExp){e[r]=e[r].source} -else{e[r]=e[r].replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&')}};return new RegExp(n+'('+e.join('|')+')'+i,'i')};var a='(?=[^A-Za-z\\d\\-_]|$)',n=/[\w\-:]/,k=t([/begin|break|catch|continue|data|default|do|dynamicparam/,/else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/,/param|process|return|switch|throw|trap|try|until|where|while/],{suffix:a});var C=/[\[\]{},;`\.]|@[({]/,h=t(['f',/b?not/,/[ic]?split/,'join',/is(not)?/,'as',/[ic]?(eq|ne|[gl][te])/,/[ic]?(not)?(like|match|contains)/,/[ic]?replace/,/b?(and|or|xor)/],{prefix:'-'});var b=/[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/,g=t([h,b],{suffix:''});var S=/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,d=/^[A-Za-z\_][A-Za-z\-\_\d]*\b/,P=/[A-Z]:|%|\?/i,v=t([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp('Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)'),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp('New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)'),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp('Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)'),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:'',suffix:''});var f=t([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:'\\$',suffix:''});var m=t([P,v,f],{suffix:a});var o={keyword:k,number:S,operator:g,builtin:m,punctuation:C,identifier:d};function e(e,t){var u=t.returnStack[t.returnStack.length-1];if(u&&u.shouldReturnFrom(t)){t.tokenize=u.tokenize;t.returnStack.pop();return t.tokenize(e,t)};if(e.eatSpace()){return null};if(e.eat('(')){t.bracketNesting+=1;return'punctuation'};if(e.eat(')')){t.bracketNesting-=1;return'punctuation'};for(var p in o){if(e.match(o[p])){return p}};var a=e.next();if(a==='\''){return x(e,t)};if(a==='$'){return i(e,t)};if(a==='"'){return s(e,t)};if(a==='<'&&e.eat('#')){t.tokenize=c;return c(e,t)};if(a==='#'){e.skipToEnd();return'comment'};if(a==='@'){var l=e.eat(/["']/);if(l&&e.eol()){t.tokenize=r;t.startQuote=l[0];return r(e,t)} -else if(e.eol()){return'error'} -else if(e.peek().match(/[({]/)){return'punctuation'} -else if(e.peek().match(n)){return i(e,t)}};return'error'};function x(t,r){var n;while((n=t.peek())!=null){t.next();if(n==='\''&&!t.eat('\'')){r.tokenize=e;return'string'}};return'error'};function s(t,r){var n;while((n=t.peek())!=null){if(n==='$'){r.tokenize=E;return'string'};t.next();if(n==='`'){t.next();continue};if(n==='"'&&!t.eat('"')){r.tokenize=e;return'string'}};return'error'};function E(e,t){return u(e,t,s)};function w(e,t){t.tokenize=r;t.startQuote='"';return r(e,t)};function y(e,t){return u(e,t,w)};function u(r,t,n){if(r.match('$(')){var o=t.bracketNesting;t.returnStack.push({shouldReturnFrom:function(e){return e.bracketNesting===o},tokenize:n});t.tokenize=e;t.bracketNesting+=1;return'punctuation'} -else{r.next();t.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:n});t.tokenize=i;return t.tokenize(r,t)}};function c(t,r){var i=!1,n;while((n=t.next())!=null){if(i&&n=='>'){r.tokenize=e;break};i=(n==='#')};return'comment'};function i(t,r){var i=t.peek();if(t.eat('{')){r.tokenize=l;return l(t,r)} -else if(i!=undefined&&i.match(n)){t.eatWhile(n);r.tokenize=e;return'variable-2'} -else{r.tokenize=e;return'error'}};function l(t,r){var n;while((n=t.next())!=null){if(n==='}'){r.tokenize=e;break}};return'variable-2'};function r(t,r){var i=r.startQuote;if(t.sol()&&t.match(new RegExp(i+'@'))){r.tokenize=e} -else if(i==='"'){while(!t.eol()){var n=t.peek();if(n==='$'){r.tokenize=y;return'string'};t.next();if(n==='`'){t.next()}}} -else{t.skipToEnd()};return'string'};var p={startState:function(){return{returnStack:[],bracketNesting:0,tokenize:e}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:'<#',blockCommentEnd:'#>',lineComment:'#',fold:'brace'};return p});e.defineMIME('application/x-powershell','powershell')}); -/* ./modules/editor/codemirror/mode/stex/stex.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('stex',function(){'use strict';function a(t,e){t.cmdState.push(e)};function u(t){if(t.cmdState.length>0){return t.cmdState[t.cmdState.length-1]} -else{return null}};function o(t){var e=t.cmdState.pop();if(e){e.closeBracket()}};function f(t){var r=t.cmdState;for(var e=r.length-1;e>=0;e--){var n=r[e];if(n.name=='DEFAULT'){continue};return n};return{styleIdentifier:function(){return null}}};function r(t,e,n){return function(){this.name=t;this.bracketNo=0;this.style=e;this.styles=n;this.argument=null;this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null};this.openBracket=function(){this.bracketNo++;return'bracket'};this.closeBracket=function(){}}};var t={};t['importmodule']=r('importmodule','tag',['string','builtin']);t['documentclass']=r('documentclass','tag',['','atom']);t['usepackage']=r('usepackage','tag',['atom']);t['begin']=r('begin','tag',['atom']);t['end']=r('end','tag',['atom']);t['DEFAULT']=function(){this.name='DEFAULT';this.style='tag';this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function e(t,e){t.f=e};function n(n,r){var o;if(n.match(/^\\[a-zA-Z@]+/)){var l=n.current().slice(1);o=t[l]||t['DEFAULT'];o=new o();a(r,o);e(r,c);return o.style};if(n.match(/^\\[$&%#{}_]/)){return'tag'};if(n.match(/^\\[,;!\/\\]/)){return'tag'};if(n.match('\\[')){e(r,function(t,e){return i(t,e,'\\]')});return'keyword'};if(n.match('$$')){e(r,function(t,e){return i(t,e,'$$')});return'keyword'};if(n.match('$')){e(r,function(t,e){return i(t,e,'$')});return'keyword'};var s=n.next();if(s=='%'){n.skipToEnd();return'comment'} -else if(s=='}'||s==']'){o=u(r);if(o){o.closeBracket(s);e(r,c)} -else{return'error'};return'bracket'} -else if(s=='{'||s=='['){o=t['DEFAULT'];o=new o();a(r,o);return'bracket'} -else if(/\d/.test(s)){n.eatWhile(/[\w.%]/);return'atom'} -else{n.eatWhile(/[\w\-_]/);o=f(r);if(o.name=='begin'){o.argument=n.current()};return o.styleIdentifier()}};function i(t,r,a){if(t.eatSpace()){return null};if(t.match(a)){e(r,n);return'keyword'};if(t.match(/^\\[a-zA-Z@]+/)){return'tag'};if(t.match(/^[a-zA-Z]+/)){return'variable-2'};if(t.match(/^\\[$&%#{}_]/)){return'tag'};if(t.match(/^\\[,;!\/]/)){return'tag'};if(t.match(/^[\^_&]/)){return'tag'};if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)){return null};if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)){return'number'};var i=t.next();if(i=='{'||i=='}'||i=='['||i==']'||i=='('||i==')'){return'bracket'};if(i=='%'){t.skipToEnd();return'comment'};return'error'};function c(t,r){var i=t.peek(),a;if(i=='{'||i=='['){a=u(r);a.openBracket(i);t.eat(i);e(r,n);return'bracket'};if(/[ \t\r]/.test(i)){t.eat(i);return null};e(r,n);o(r);return n(t,r)};return{startState:function(){return{cmdState:[],f:n}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=n;t.cmdState.length=0},lineComment:'%'}});t.defineMIME('text/x-stex','stex');t.defineMIME('text/x-latex','stex')}); -/* ./modules/editor/codemirror/mode/q/q.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('q',function(e){var o=e.indentUnit,t,s=a(['abs','acos','aj','aj0','all','and','any','asc','asin','asof','atan','attr','avg','avgs','bin','by','ceiling','cols','cor','cos','count','cov','cross','csv','cut','delete','deltas','desc','dev','differ','distinct','div','do','each','ej','enlist','eval','except','exec','exit','exp','fby','fills','first','fkeys','flip','floor','from','get','getenv','group','gtime','hclose','hcount','hdel','hopen','hsym','iasc','idesc','if','ij','in','insert','inter','inv','key','keys','last','like','list','lj','load','log','lower','lsq','ltime','ltrim','mavg','max','maxs','mcount','md5','mdev','med','meta','min','mins','mmax','mmin','mmu','mod','msum','neg','next','not','null','or','over','parse','peach','pj','plist','prd','prds','prev','prior','rand','rank','ratios','raze','read0','read1','reciprocal','reverse','rload','rotate','rsave','rtrim','save','scan','select','set','setenv','show','signum','sin','sqrt','ss','ssr','string','sublist','sum','sums','sv','system','tables','tan','til','trim','txf','type','uj','ungroup','union','update','upper','upsert','value','var','view','views','vs','wavg','where','where','while','within','wj','wj1','wsum','xasc','xbar','xcol','xcols','xdesc','xexp','xgroup','xkey','xlog','xprev','xrank']),c=/[|/&^!+:\\\-*%$=~#;@><,?_'"\[\(\]\)\s{}]/;function a(e){return new RegExp('^('+e.join('|')+')$')};function n(e,i){var a=e.sol(),r=e.next();t=null;if(a)if(r=='/')return(i.tokenize=l)(e,i);else if(r=='\\'){if(e.eol()||/\s/.test(e.peek()))return e.skipToEnd(),/^\\\s*$/.test(e.current())?(i.tokenize=d)(e):i.tokenize=n,'comment';else return i.tokenize=n,'builtin'};if(/\s/.test(r))return e.peek()=='/'?(e.skipToEnd(),'comment'):'whitespace';if(r=='"')return(i.tokenize=f)(e,i);if(r=='`')return e.eatWhile(/[A-Za-z\d_:\/.]/),'symbol';if(('.'==r&&/\d/.test(e.peek()))||/\d/.test(r)){var o=null;e.backUp(1);if(e.match(/^\d{4}\.\d{2}(m|\.\d{2}([DT](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/))o='temporal';else if(e.match(/^0[NwW]{1}/)||e.match(/^0x[\da-fA-F]*/)||e.match(/^[01]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))o='number';return(o&&(!(r=e.peek())||c.test(r)))?o:(e.next(),'error')};if(/[A-Za-z]|\./.test(r))return e.eatWhile(/[A-Za-z._\d]/),s.test(e.current())?'keyword':'variable';if(/[|/&^!+:\\\-*%$=~#;@><\.,?_']/.test(r))return null;if(/[{}\(\[\]\)]/.test(r))return null;return'error'};function l(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=u)(e,t):(t.tokenize=n),'comment'};function u(e,t){var i=e.sol()&&e.peek()=='\\';e.skipToEnd();if(i&&/^\\\s*$/.test(e.current()))t.tokenize=n;return'comment'};function d(e){return e.skipToEnd(),'comment'};function f(e,t){var i=!1,r,o=!1;while((r=e.next())){if(r=='"'&&!i){o=!0;break};i=!i&&r=='\\'};if(o)t.tokenize=n;return'string'};function i(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}};function r(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(n,e){if(n.sol()){if(e.context&&e.context.align==null)e.context.align=!1;e.indent=n.indentation()};var o=e.tokenize(n,e);if(o!='comment'&&e.context&&e.context.align==null&&e.context.type!='pattern'){e.context.align=!0};if(t=='(')i(e,')',n.column());else if(t=='[')i(e,']',n.column());else if(t=='{')i(e,'}',n.column());else if(/[\]\}\)]/.test(t)){while(e.context&&e.context.type=='pattern')r(e);if(e.context&&t==e.context.type)r(e)} -else if(t=='.'&&e.context&&e.context.type=='pattern')r(e);else if(/atom|string|variable/.test(o)&&e.context){if(/[\}\]]/.test(e.context.type))i(e,'pattern',n.column());else if(e.context.type=='pattern'&&!e.context.align){e.context.align=!0;e.context.col=n.column()}};return o},indent:function(e,n){var r=n&&n.charAt(0),t=e.context;if(/[\]\}]/.test(r))while(t&&t.type=='pattern')t=t.prev;var i=t&&r==t.type;if(!t)return 0;else if(t.type=='pattern')return t.col;else if(t.align)return t.col+(i?0:1);else return t.indent+(i?0:o)}}});e.defineMIME('text/x-q','q')}); -/* ./modules/editor/codemirror/mode/htmlembedded/htmlembedded.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../../addon/mode/multiplex'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../../addon/mode/multiplex'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('htmlembedded',function(d,i){return e.multiplexingMode(e.getMode(d,'htmlmixed'),{open:i.open||i.scriptStartRegex||'<%',close:i.close||i.scriptEndRegex||'%>',mode:e.getMode(d,i.scriptingModeSpec)})},'htmlmixed');e.defineMIME('application/x-ejs',{name:'htmlembedded',scriptingModeSpec:'javascript'});e.defineMIME('application/x-aspx',{name:'htmlembedded',scriptingModeSpec:'text/x-csharp'});e.defineMIME('application/x-jsp',{name:'htmlembedded',scriptingModeSpec:'text/x-java'});e.defineMIME('application/x-erb',{name:'htmlembedded',scriptingModeSpec:'ruby'})}); -/* ./modules/editor/codemirror/mode/d/d.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('d',function(t,n){var a=t.indentUnit,p=n.statementIndentUnit||a,h=n.keywords||{},y=n.builtin||{},u=n.blockKeywords||{},b=n.atoms||{},s=n.hooks||{},v=n.multiLineStrings;var l=/[+\-*&%=<>!?|\/]/,r;function f(e,t){var n=e.next();if(s[n]){var o=s[n](e,t);if(o!==!1)return o};if(n=='"'||n=='\''||n=='`'){t.tokenize=w(n);return t.tokenize(e,t)};if(/[\[\]{}\(\),;\:\.]/.test(n)){r=n;return null};if(/\d/.test(n)){e.eatWhile(/[\w\.]/);return'number'};if(n=='/'){if(e.eat('+')){t.tokenize=d;return d(e,t)};if(e.eat('*')){t.tokenize=c;return c(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(l.test(n)){e.eatWhile(l);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var i=e.current();if(h.propertyIsEnumerable(i)){if(u.propertyIsEnumerable(i))r='newstatement';return'keyword'};if(y.propertyIsEnumerable(i)){if(u.propertyIsEnumerable(i))r='newstatement';return'builtin'};if(b.propertyIsEnumerable(i))return'atom';return'variable'};function w(e){return function(t,n){var r=!1,i,o=!1;while((i=t.next())!=null){if(i==e&&!r){o=!0;break};r=!r&&i=='\\'};if(o||!(r||v))n.tokenize=null;return'string'}};function c(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='*')};return'comment'};function d(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='+')};return'comment'};function m(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function o(e,t,n){var r=e.indented;if(e.context&&e.context.type=='statement')r=e.context.indented;return e.context=new m(r,t,n,null,e.context)};function i(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new m((e||0)-a,0,'top',!1),indented:0,startOfLine:!0}},token:function(t,e){var n=e.context;if(t.sol()){if(n.align==null)n.align=!1;e.indented=t.indentation();e.startOfLine=!0};if(t.eatSpace())return null;r=null;var a=(e.tokenize||f)(t,e);if(a=='comment'||a=='meta')return a;if(n.align==null)n.align=!0;if((r==';'||r==':'||r==',')&&n.type=='statement')i(e);else if(r=='{')o(e,t.column(),'}');else if(r=='[')o(e,t.column(),']');else if(r=='(')o(e,t.column(),')');else if(r=='}'){while(n.type=='statement')n=i(e);if(n.type=='}')n=i(e);while(n.type=='statement')n=i(e)} -else if(r==n.type)i(e);else if(((n.type=='}'||n.type=='top')&&r!=';')||(n.type=='statement'&&r=='newstatement'))o(e,t.column(),'statement');e.startOfLine=!1;return a},indent:function(t,n){if(t.tokenize!=f&&t.tokenize!=null)return e.Pass;var r=t.context,i=n&&n.charAt(0);if(r.type=='statement'&&i=='}')r=r.prev;var o=i==r.type;if(r.type=='statement')return r.indented+(i=='{'?0:p);else if(r.align)return r.column+(o?0:1);else return r.indented+(o?0:a)},electricChars:'{}'}});function t(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var n='body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with';e.defineMIME('text/x-d',{name:'d',keywords:t('abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters '+n),blockKeywords:t(n),builtin:t('bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t'),atoms:t('exit failure success true false null'),hooks:{'@':function(e,t){e.eatWhile(/[\w\$_]/);return'meta'}}})}); -/* ./modules/editor/codemirror/mode/protobuf/protobuf.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function i(e){return new RegExp('^(('+e.join(')|(')+'))\\b','i')};var t=['package','message','import','syntax','required','optional','repeated','reserved','default','extensions','packed','bool','bytes','double','enum','float','string','int32','int64','uint32','uint64','sint32','sint64','fixed32','fixed64','sfixed32','sfixed64','option','service','rpc','returns'],n=i(t);e.registerHelper('hintWords','protobuf',t);var r=new RegExp('^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*');function f(e){if(e.eatSpace())return null;if(e.match('//')){e.skipToEnd();return'comment'};if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return'number';if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return'number';if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return'number'};if(e.match(/^"([^"]|(""))*"/)){return'string'};if(e.match(/^'([^']|(''))*'/)){return'string'};if(e.match(n)){return'keyword'};if(e.match(r)){return'variable'};e.next();return null};e.defineMode('protobuf',function(){return{token:f}});e.defineMIME('text/x-protobuf','protobuf')}); -/* ./modules/editor/codemirror/mode/mscgen/mscgen.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';var n={mscgen:{'keywords':['msc'],'options':['hscale','width','arcgradient','wordwraparcs'],'constants':['true','false','on','off'],'attributes':['label','idurl','id','url','linecolor','linecolour','textcolor','textcolour','textbgcolor','textbgcolour','arclinecolor','arclinecolour','arctextcolor','arctextcolour','arctextbgcolor','arctextbgcolour','arcskip'],'brackets':['\\{','\\}'],'arcsWords':['note','abox','rbox','box'],'arcsOthers':['\\|\\|\\|','\\.\\.\\.','---','--','<->','==','<<=>>','<=>','\\.\\.','<<>>','::','<:>','->','=>>','=>','>>',':>','<-','<<=','<=','<<','<:','x-','-x'],'singlecomment':['//','#'],'operators':['=']},xu:{'keywords':['msc','xu'],'options':['hscale','width','arcgradient','wordwraparcs','watermark'],'constants':['true','false','on','off','auto'],'attributes':['label','idurl','id','url','linecolor','linecolour','textcolor','textcolour','textbgcolor','textbgcolour','arclinecolor','arclinecolour','arctextcolor','arctextcolour','arctextbgcolor','arctextbgcolour','arcskip'],'brackets':['\\{','\\}'],'arcsWords':['note','abox','rbox','box','alt','else','opt','break','par','seq','strict','neg','critical','ignore','consider','assert','loop','ref','exc'],'arcsOthers':['\\|\\|\\|','\\.\\.\\.','---','--','<->','==','<<=>>','<=>','\\.\\.','<<>>','::','<:>','->','=>>','=>','>>',':>','<-','<<=','<=','<<','<:','x-','-x'],'singlecomment':['//','#'],'operators':['=']},msgenny:{'keywords':null,'options':['hscale','width','arcgradient','wordwraparcs','watermark'],'constants':['true','false','on','off','auto'],'attributes':null,'brackets':['\\{','\\}'],'arcsWords':['note','abox','rbox','box','alt','else','opt','break','par','seq','strict','neg','critical','ignore','consider','assert','loop','ref','exc'],'arcsOthers':['\\|\\|\\|','\\.\\.\\.','---','--','<->','==','<<=>>','<=>','\\.\\.','<<>>','::','<:>','->','=>>','=>','>>',':>','<-','<<=','<=','<<','<:','x-','-x'],'singlecomment':['//','#'],'operators':['=']}};t.defineMode('mscgen',function(t,r){var e=n[r&&r.language||'mscgen'];return{startState:o,copyState:i,token:c(e),lineComment:'#',blockCommentStart:'/*',blockCommentEnd:'*/'}});t.defineMIME('text/x-mscgen','mscgen');t.defineMIME('text/x-xu',{name:'mscgen',language:'xu'});t.defineMIME('text/x-msgenny',{name:'mscgen',language:'msgenny'});function e(t){return new RegExp('\\b('+t.join('|')+')\\b','i')};function r(t){return new RegExp('('+t.join('|')+')','i')};function o(){return{inComment:!1,inString:!1,inAttributeList:!1,inScript:!1}};function i(t){return{inComment:t.inComment,inString:t.inString,inAttributeList:t.inAttributeList,inScript:t.inScript}};function c(t){return function(n,o){if(n.match(r(t.brackets),!0,!0)){return'bracket'};if(!o.inComment){if(n.match(/\/\*[^\*\/]*/,!0,!0)){o.inComment=!0;return'comment'};if(n.match(r(t.singlecomment),!0,!0)){n.skipToEnd();return'comment'}};if(o.inComment){if(n.match(/[^\*\/]*\*\//,!0,!0))o.inComment=!1;else n.skipToEnd();return'comment'};if(!o.inString&&n.match(/"(\\"|[^"])*/,!0,!0)){o.inString=!0;return'string'};if(o.inString){if(n.match(/[^"]*"/,!0,!0))o.inString=!1;else n.skipToEnd();return'string'};if(!!t.keywords&&n.match(e(t.keywords),!0,!0))return'keyword';if(n.match(e(t.options),!0,!0))return'keyword';if(n.match(e(t.arcsWords),!0,!0))return'keyword';if(n.match(r(t.arcsOthers),!0,!0))return'keyword';if(!!t.operators&&n.match(r(t.operators),!0,!0))return'operator';if(!!t.constants&&n.match(r(t.constants),!0,!0))return'variable';if(!t.inAttributeList&&!!t.attributes&&n.match(/\[/,!0,!0)){t.inAttributeList=!0;return'bracket'};if(t.inAttributeList){if(t.attributes!==null&&n.match(e(t.attributes),!0,!0)){return'attribute'};if(n.match(/]/,!0,!0)){t.inAttributeList=!1;return'bracket'}};n.next();return'base'}}}); -/* ./modules/editor/codemirror/mode/django/django.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('django:inner',function(){var i=['block','endblock','for','endfor','true','false','filter','endfilter','loop','none','self','super','if','elif','endif','as','else','import','with','endwith','without','context','ifequal','endifequal','ifnotequal','endifnotequal','extends','include','load','comment','endcomment','empty','url','static','trans','blocktrans','endblocktrans','now','regroup','lorem','ifchanged','endifchanged','firstof','debug','cycle','csrf_token','autoescape','endautoescape','spaceless','endspaceless','ssi','templatetag','verbatim','endverbatim','widthratio'],e=['add','addslashes','capfirst','center','cut','date','default','default_if_none','dictsort','dictsortreversed','divisibleby','escape','escapejs','filesizeformat','first','floatformat','force_escape','get_digit','iriencode','join','last','length','length_is','linebreaks','linebreaksbr','linenumbers','ljust','lower','make_list','phone2numeric','pluralize','pprint','random','removetags','rjust','safe','safeseq','slice','slugify','stringformat','striptags','time','timesince','timeuntil','title','truncatechars','truncatechars_html','truncatewords','truncatewords_html','unordered_list','upper','urlencode','urlize','urlizetrunc','wordcount','wordwrap','yesno'],n=['==','!=','<','>','<=','>='],o=['in','not','or','and'];i=new RegExp('^\\b('+i.join('|')+')\\b');e=new RegExp('^\\b('+e.join('|')+')\\b');n=new RegExp('^\\b('+n.join('|')+')\\b');o=new RegExp('^\\b('+o.join('|')+')\\b');function t(e,t){if(e.match('{{')){t.tokenize=l;return'tag'} -else if(e.match('{%')){t.tokenize=a;return'tag'} -else if(e.match('{#')){t.tokenize=u;return'comment'} -while(e.next()!=null&&!e.match(/\{[{%#]/,!1)){};return null};function r(e,t){return function(r,i){if(!i.escapeNext&&r.eat(e)){i.tokenize=t} -else{if(i.escapeNext){i.escapeNext=!1};var n=r.next();if(n=='\\'){i.escapeNext=!0}};return'string'}};function l(n,i){if(i.waitDot){i.waitDot=!1;if(n.peek()!='.'){return'null'};if(n.match(/\.\W+/)){return'error'} -else if(n.eat('.')){i.waitProperty=!0;return'null'} -else{throw Error('Unexpected error while waiting for property.')}};if(i.waitPipe){i.waitPipe=!1;if(n.peek()!='|'){return'null'};if(n.match(/\.\W+/)){return'error'} -else if(n.eat('|')){i.waitFilter=!0;return'null'} -else{throw Error('Unexpected error while waiting for filter.')}};if(i.waitProperty){i.waitProperty=!1;if(n.match(/\b(\w+)\b/)){i.waitDot=!0;i.waitPipe=!0;return'property'}};if(i.waitFilter){i.waitFilter=!1;if(n.match(e)){return'variable-2'}};if(n.eatSpace()){i.waitProperty=!1;return'null'};if(n.match(/\b\d+(\.\d+)?\b/)){return'number'};if(n.match('\'')){i.tokenize=r('\'',i.tokenize);return'string'} -else if(n.match('"')){i.tokenize=r('"',i.tokenize);return'string'};if(n.match(/\b(\w+)\b/)&&!i.foundVariable){i.waitDot=!0;i.waitPipe=!0;return'variable'};if(n.match('}}')){i.waitProperty=null;i.waitFilter=null;i.waitDot=null;i.waitPipe=null;i.tokenize=t;return'tag'};n.next();return'null'};function a(l,a){if(a.waitDot){a.waitDot=!1;if(l.peek()!='.'){return'null'};if(l.match(/\.\W+/)){return'error'} -else if(l.eat('.')){a.waitProperty=!0;return'null'} -else{throw Error('Unexpected error while waiting for property.')}};if(a.waitPipe){a.waitPipe=!1;if(l.peek()!='|'){return'null'};if(l.match(/\.\W+/)){return'error'} -else if(l.eat('|')){a.waitFilter=!0;return'null'} -else{throw Error('Unexpected error while waiting for filter.')}};if(a.waitProperty){a.waitProperty=!1;if(l.match(/\b(\w+)\b/)){a.waitDot=!0;a.waitPipe=!0;return'property'}};if(a.waitFilter){a.waitFilter=!1;if(l.match(e)){return'variable-2'}};if(l.eatSpace()){a.waitProperty=!1;return'null'};if(l.match(/\b\d+(\.\d+)?\b/)){return'number'};if(l.match('\'')){a.tokenize=r('\'',a.tokenize);return'string'} -else if(l.match('"')){a.tokenize=r('"',a.tokenize);return'string'};if(l.match(n)){return'operator'};if(l.match(o)){return'keyword'};var u=l.match(i);if(u){if(u[0]=='comment'){a.blockCommentTag=!0};return'keyword'};if(l.match(/\b(\w+)\b/)){a.waitDot=!0;a.waitPipe=!0;return'variable'};if(l.match('%}')){a.waitProperty=null;a.waitFilter=null;a.waitDot=null;a.waitPipe=null;if(a.blockCommentTag){a.blockCommentTag=!1;a.tokenize=f} -else{a.tokenize=t};return'tag'};l.next();return'null'};function u(e,r){if(e.match(/^.*?#\}/))r.tokenize=t;else e.skipToEnd();return'comment'};function f(e,t){if(e.match(/\{%\s*endcomment\s*%\}/,!1)){t.tokenize=a;e.match('{%');return'tag'} -else{e.next();return'comment'}};return{startState:function(){return{tokenize:t}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:'{% comment %}',blockCommentEnd:'{% endcomment %}'}});e.defineMode('django',function(t){var r=e.getMode(t,'text/html'),i=e.getMode(t,'django:inner');return e.overlayMode(r,i)});e.defineMIME('text/x-django','django')}); -/* ./modules/editor/codemirror/mode/toml/toml.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('toml',function(){return{startState:function(){return{inString:!1,stringType:'',lhs:!0,inArray:0}},token:function(e,t){if(!t.inString&&((e.peek()=='"')||(e.peek()=='\''))){t.stringType=e.peek();e.next();t.inString=!0};if(e.sol()&&t.inArray===0){t.lhs=!0};if(t.inString){while(t.inString&&!e.eol()){if(e.peek()===t.stringType){e.next();t.inString=!1} -else if(e.peek()==='\\'){e.next();e.next()} -else{e.match(/^.[^\\"']*/)}};return t.lhs?'property string':'string'} -else if(t.inArray&&e.peek()===']'){e.next();t.inArray--;return'bracket'} -else if(t.lhs&&e.peek()==='['&&e.skipTo(']')){e.next();if(e.peek()===']')e.next();return'atom'} -else if(e.peek()==='#'){e.skipToEnd();return'comment'} -else if(e.eatSpace()){return null} -else if(t.lhs&&e.eatWhile(function(e){return e!='='&&e!=' '})){return'property'} -else if(t.lhs&&e.peek()==='='){e.next();t.lhs=!1;return null} -else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)){return'atom'} -else if(!t.lhs&&(e.match('true')||e.match('false'))){return'atom'} -else if(!t.lhs&&e.peek()==='['){t.inArray++;e.next();return'bracket'} -else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)){return'number'} -else if(!e.eatSpace()){e.next()};return null}}});e.defineMIME('text/x-toml','toml')}); -/* ./modules/editor/codemirror/mode/yacas/yacas.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("yacas",function(t,r){function p(e){var r={},n=e.split(" ");for(var t=0;t<n.length;++t)r[n[t]]=!0;return r};var a=p("Assert BackQuote D Defun Deriv For ForEach FromFile FromString Function Integrate InverseTaylor Limit LocalSymbols Macro MacroRule MacroRulePattern NIntegrate Rule RulePattern Subst TD TExplicitSum TSum Taylor Taylor1 Taylor2 Taylor3 ToFile ToStdout ToString TraceRule Until While"),u="(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)",n="(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)",c=new RegExp(u),l=new RegExp(n),f=new RegExp(n+"?_"+n),s=new RegExp(n+"\\s*\\(");function i(e,t){var r;r=e.next();if(r==="\""){t.tokenize=m;return t.tokenize(e,t)};if(r==="/"){if(e.eat("*")){t.tokenize=d;return t.tokenize(e,t)};if(e.eat("/")){e.skipToEnd();return"comment"}};e.backUp(1);var i=e.match(/^(\w+)\s*\(/,!1);if(i!==null&&a.hasOwnProperty(i[1]))t.scopes.push("bodied");var n=o(t);if(n==="bodied"&&r==="[")t.scopes.pop();if(r==="["||r==="{"||r==="(")t.scopes.push(r);n=o(t);if(n==="["&&r==="]"||n==="{"&&r==="}"||n==="("&&r===")")t.scopes.pop();if(r===";"){while(n==="bodied"){t.scopes.pop();n=o(t)}};if(e.match(/\d+ *#/,!0,!1)){return"qualifier"};if(e.match(c,!0,!1)){return"number"};if(e.match(f,!0,!1)){return"variable-3"};if(e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)){return"bracket"};if(e.match(s,!0,!1)){e.backUp(1);return"variable"};if(e.match(l,!0,!1)){return"variable-2"};if(e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%|#)/,!0,!1)){return"operator"};return"error"};function m(e,t){var n,o=!1,r=!1;while((n=e.next())!=null){if(n==="\""&&!r){o=!0;break};r=!r&&n==="\\"};if(o&&!r){t.tokenize=i};return"string"};function d(e,t){var n,r;while((r=e.next())!=null){if(n==="*"&&r==="/"){t.tokenize=i;break};n=r};return"comment"};function o(e){var t=null;if(e.scopes.length>0)t=e.scopes[e.scopes.length-1];return t};return{startState:function(){return{tokenize:i,scopes:[]}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)},indent:function(r,n){if(r.tokenize!==i&&r.tokenize!==null)return e.Pass;var o=0;if(n==="]"||n==="];"||n==="}"||n==="};"||n===");")o=-1;return(r.scopes.length+o)*t.indentUnit},electricChars:"{}[]();",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});e.defineMIME("text/x-yacas",{name:"yacas"})}); -/* ./modules/editor/codemirror/mode/dockerfile/dockerfile.min.js */ -/* ./modules/editor/codemirror/mode/python/python.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function n(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var o=n(['and','or','not','is']),r=['as','assert','break','class','continue','def','del','elif','else','except','finally','for','from','global','if','import','lambda','pass','raise','return','try','while','with','yield','in'],i=['abs','all','any','bin','bool','bytearray','callable','chr','classmethod','compile','complex','delattr','dict','dir','divmod','enumerate','eval','filter','float','format','frozenset','getattr','globals','hasattr','hash','help','hex','id','input','int','isinstance','issubclass','iter','len','list','locals','map','max','memoryview','min','next','object','oct','open','ord','pow','property','range','repr','reversed','round','set','setattr','slice','sorted','staticmethod','str','sum','super','tuple','type','vars','zip','__import__','NotImplemented','Ellipsis','__debug__'];e.registerHelper('hintWords','python',r.concat(i));function t(e){return e.scopes[e.scopes.length-1]};e.defineMode('python',function(s,a){var c='error',F=a.delimiters||a.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.]/,u=[a.singleOperators,a.doubleOperators,a.doubleDelimiters,a.tripleDelimiters,a.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/];for(var d=0;d<u.length;d++)if(!u[d])u.splice(d--,1);var h=a.hangingIndent||s.indentUnit,l=r,f=i;if(a.extra_keywords!=undefined)l=l.concat(a.extra_keywords);if(a.extra_builtins!=undefined)f=f.concat(a.extra_builtins);var y=!(a.version&&Number(a.version)<3);if(y){var p=a.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;l=l.concat(['nonlocal','False','True','None','async','await']);f=f.concat(['ascii','bytes','exec','print']);var b=new RegExp('^(([rbuf]|(br))?(\'{3}|"{3}|[\'"]))','i')} -else{var p=a.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;l=l.concat(['exec','print']);f=f.concat(['apply','basestring','buffer','cmp','coerce','execfile','file','intern','long','raw_input','reduce','reload','unichr','unicode','xrange','False','True','None']);var b=new RegExp('^(([rubf]|(ur)|(br))?(\'{3}|"{3}|[\'"]))','i')};var w=n(l),z=n(f);function m(e,n){if(e.sol())n.indent=e.indentation();if(e.sol()&&t(n).type=='py'){var r=t(n).offset;if(e.eatSpace()){var a=e.indentation();if(a>r)v(n);else if(a<r&&x(e,n)&&e.peek()!='#')n.errorToken=!0;return null} -else{var i=g(e,n);if(r>0&&x(e,n))i+=' '+c;return i}};return g(e,n)};function g(e,t){if(e.eatSpace())return null;var a=e.peek();if(a=='#'){e.skipToEnd();return'comment'};if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)){r=!0};if(e.match(/^[\d_]+\.\d*/)){r=!0};if(e.match(/^\.\d+/)){r=!0};if(r){e.eat(/J/i);return'number'};var n=!1;if(e.match(/^0x[0-9a-f_]+/i))n=!0;if(e.match(/^0b[01_]+/i))n=!0;if(e.match(/^0o[0-7_]+/i))n=!0;if(e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)){e.eat(/J/i);n=!0};if(e.match(/^0(?![\dx])/i))n=!0;if(n){e.eat(/L/i);return'number'}};if(e.match(b)){t.tokenize=E(e.current());return t.tokenize(e,t)};for(var i=0;i<u.length;i++)if(e.match(u[i]))return'operator';if(e.match(F))return'punctuation';if(t.lastToken=='.'&&e.match(p))return'property';if(e.match(w)||e.match(o))return'keyword';if(e.match(z))return'builtin';if(e.match(/^(self|cls)\b/))return'variable-2';if(e.match(p)){if(t.lastToken=='def'||t.lastToken=='class')return'def';return'variable'};e.next();return c};function E(e){while('rubf'.indexOf(e.charAt(0).toLowerCase())>=0)e=e.substr(1);var n=e.length==1,t='string';function r(r,i){while(!r.eol()){r.eatWhile(/[^'"\\]/);if(r.eat('\\')){r.next();if(n&&r.eol())return t} -else if(r.match(e)){i.tokenize=m;return t} -else{r.eat(/['"]/)}};if(n){if(a.singleLineStringErrors)return c;else i.tokenize=m};return t};r.isString=!0;return r};function v(e){while(t(e).type!='py')e.scopes.pop();e.scopes.push({offset:t(e).offset+s.indentUnit,type:'py',align:null})};function T(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+h,type:n,align:r})};function x(e,n){var r=e.indentation();while(n.scopes.length>1&&t(n).offset>r){if(t(n).type!='py')return!0;n.scopes.pop()};return t(n).offset!=r};function A(n,e){if(n.sol())e.beginningOfLine=!0;var a=e.tokenize(n,e),r=n.current();if(e.beginningOfLine&&r=='@')return n.match(p,!1)?'meta':y?'operator':c;if(/\S/.test(r))e.beginningOfLine=!1;if((a=='variable'||a=='builtin')&&e.lastToken=='meta')a='meta';if(r=='pass'||r=='return')e.dedent+=1;if(r=='lambda')e.lambda=!0;if(r==':'&&!e.lambda&&t(e).type=='py')v(e);var i=r.length==1?'[({'.indexOf(r):-1;if(i!=-1)T(n,e,'])}'.slice(i,i+1));i='])}'.indexOf(r);if(i!=-1){if(t(e).type==r)e.indent=e.scopes.pop().offset-h;else return c};if(e.dedent>0&&n.eol()&&t(e).type=='py'){if(e.scopes.length>1)e.scopes.pop();e.dedent-=1};return a};var k={startState:function(e){return{tokenize:m,scopes:[{offset:e||0,type:'py',align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var r=t.errorToken;if(r)t.errorToken=!1;var n=A(e,t);if(n&&n!='comment')t.lastToken=(n=='keyword'||n=='punctuation')?e.current():n;if(n=='punctuation')n=null;if(e.eol()&&t.lambda)t.lambda=!1;return r?n+' '+c:n},indent:function(n,r){if(n.tokenize!=m)return n.tokenize.isString?e.Pass:0;var i=t(n),a=i.type==r.charAt(0);if(i.align!=null)return i.align-(a?1:0);else return i.offset-(a?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:'\'"'},lineComment:'#',fold:'indent'};return k});e.defineMIME('text/x-python','python');var a=function(e){return e.split(' ')};e.defineMIME('text/x-cython',{name:'python',extra_keywords:a('by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE')})}); -/* ./modules/editor/codemirror/mode/vb/vb.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("vb",function(n,t){var i="error";function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")};var v=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),x=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),w=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),I=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),y=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),u=["class","module","sub","enum","select","while","if","function","get","set","property","try"],f=["else","elseif","case","catch"],d=["next","loop"],l=["and","or","not","xor","in"],E=r(l),s=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],m=["integer","string","double","decimal","boolean","short","char","float","single"],L=r(s),z=r(m),C="\"",R=r(u),h=r(f),p=r(d),b=r(["end"]),F=r(["do"]),M=null;e.registerHelper("hintWords","vb",u.concat(f).concat(d).concat(l).concat(s).concat(m));function a(e,n){n.currentIndent++};function o(e,n){n.currentIndent--};function c(e,n){if(e.eatSpace()){return null};var c=e.peek();if(c==="'"){e.skipToEnd();return"comment"};if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var r=!1;if(e.match(/^\d*\.\d+F?/i)){r=!0} -else if(e.match(/^\d+\.\d*F?/)){r=!0} -else if(e.match(/^\.\d+F?/)){r=!0};if(r){e.eat(/J/i);return"number"};var t=!1;if(e.match(/^&H[0-9a-f]+/i)){t=!0} -else if(e.match(/^&O[0-7]+/i)){t=!0} -else if(e.match(/^[1-9]\d*F?/)){e.eat(/J/i);t=!0} -else if(e.match(/^0(?![\dx])/i)){t=!0};if(t){e.eat(/L/i);return"number"}};if(e.match(C)){n.tokenize=O(e.current());return n.tokenize(e,n)};if(e.match(I)||e.match(w)){return null};if(e.match(g)||e.match(v)||e.match(E)){return"operator"};if(e.match(x)){return null};if(e.match(F)){a(e,n);n.doInCurrentLine=!0;return"keyword"};if(e.match(R)){if(!n.doInCurrentLine)a(e,n);else n.doInCurrentLine=!1;return"keyword"};if(e.match(h)){return"keyword"};if(e.match(b)){o(e,n);o(e,n);return"keyword"};if(e.match(p)){o(e,n);return"keyword"};if(e.match(z)){return"keyword"};if(e.match(L)){return"keyword"};if(e.match(y)){return"variable"};e.next();return i};function O(e){var r=e.length==1,n="string";return function(o,a){while(!o.eol()){o.eatWhile(/[^'"]/);if(o.match(e)){a.tokenize=c;return n} -else{o.eat(/['"]/)}};if(r){if(t.singleLineStringErrors){return i} -else{a.tokenize=c}};return n}};function T(e,n){var r=n.tokenize(e,n),c=e.current();if(c==="."){r=n.tokenize(e,n);if(r==="variable"){return"variable"} -else{return i}};var t="[({".indexOf(c);if(t!==-1){a(e,n)};if(M==="dedent"){if(o(e,n)){return i}};t="])}".indexOf(c);if(t!==-1){if(o(e,n)){return i}};return r};var k={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:c,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){if(e.sol()){n.currentIndent+=n.nextLineIndent;n.nextLineIndent=0;n.doInCurrentLine=0};var t=T(e,n);n.lastToken={style:t,content:e.current()};return t},indent:function(e,t){var r=t.replace(/^\s+|\s+$/g,"");if(r.match(p)||r.match(b)||r.match(h))return n.indentUnit*(e.currentIndent-1);if(e.currentIndent<0)return 0;return e.currentIndent*n.indentUnit},lineComment:"'"};return k});e.defineMIME("text/x-vb","vb")}); -/* ./modules/editor/codemirror/mode/octave/octave.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("octave",function(){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")};var r=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),i=new RegExp("^[\\(\\[\\{\\},:=;]"),o=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),f=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),a=new RegExp("^((>>=)|(<<=))"),u=new RegExp("^[\\]\\)]"),c=new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"),m=n(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),s=n(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);function t(n,t){if(!n.sol()&&n.peek()==="'"){n.next();t.tokenize=e;return"operator"};t.tokenize=e;return e(n,t)};function l(n,t){if(n.match(/^.*%}/)){t.tokenize=e;return"comment"};n.skipToEnd();return"comment"};function e(d,p){if(d.eatSpace())return null;if(d.match("%{")){p.tokenize=l;d.skipToEnd();return"comment"};if(d.match(/^[%#]/)){d.skipToEnd();return"comment"};if(d.match(/^[0-9\.+-]/,!1)){if(d.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)){d.tokenize=e;return"number"};if(d.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)){return"number"};if(d.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)){return"number"}};if(d.match(n(["nan","NaN","inf","Inf"]))){return"number"};var h=d.match(/^"(?:[^"]|"")*("|$)/)||d.match(/^'(?:[^']|'')*('|$)/);if(h){return h[1]?"string":"string error"};if(d.match(s)){return"keyword"};if(d.match(m)){return"builtin"};if(d.match(c)){return"variable"};if(d.match(r)||d.match(o)){return"operator"};if(d.match(i)||d.match(f)||d.match(a)){return null};if(d.match(u)){p.tokenize=t;return null};d.next();return"error"};return{startState:function(){return{tokenize:e}},token:function(e,n){var r=n.tokenize(e,n);if(r==="number"||r==="variable"){n.tokenize=t};return r},lineComment:"%",fold:"indent"}});e.defineMIME("text/x-octave","octave")}); -/* ./modules/editor/codemirror/mode/tcl/tcl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('tcl',function(){function a(e){var t={},n=e.split(' ');for(var r=0;r<n.length;++r)t[n[r]]=!0;return t};var t=a('Tcl safe after append array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd close concat continue dde eof encoding error eval exec exit expr fblocked fconfigure fcopy file fileevent filename filename flush for foreach format gets glob global history http if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lset lsort memory msgcat namespace open package parray pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp registry regsub rename resource return scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest tclvars tell time trace unknown unset update uplevel upvar variable vwait'),n=a('if elseif else and not or eq ne in ni for foreach while switch'),i=/[+\-*&%=<>!?^\/\|]/;function r(e,r,t){r.tokenize=t;return t(e,r)};function e(e,a){var c=a.beforeParams;a.beforeParams=!1;var s=e.next();if((s=='"'||s=='\'')&&a.inParams){return r(e,a,o(s))} -else if(/[\[\]{}\(\),;\.]/.test(s)){if(s=='('&&c)a.inParams=!0;else if(s==')')a.inParams=!1;return null} -else if(/\d/.test(s)){e.eatWhile(/[\w\.]/);return'number'} -else if(s=='#'){if(e.eat('*'))return r(e,a,l);if(s=='#'&&e.match(/ *\[ *\[/))return r(e,a,f);e.skipToEnd();return'comment'} -else if(s=='"'){e.skipTo(/"/);return'comment'} -else if(s=='$'){e.eatWhile(/[$_a-z0-9A-Z\.{:]/);e.eatWhile(/}/);a.beforeParams=!0;return'builtin'} -else if(i.test(s)){e.eatWhile(i);return'comment'} -else{e.eatWhile(/[\w\$_{}\xa1-\uffff]/);var u=e.current().toLowerCase();if(t&&t.propertyIsEnumerable(u))return'keyword';if(n&&n.propertyIsEnumerable(u)){a.beforeParams=!0;return'keyword'};return null}};function o(r){return function(t,n){var i=!1,a,o=!1;while((a=t.next())!=null){if(a==r&&!i){o=!0;break};i=!i&&a=='\\'};if(o)n.tokenize=e;return'string'}};function l(r,t){var i=!1,n;while(n=r.next()){if(n=='#'&&i){t.tokenize=e;break};i=(n=='*')};return'comment'};function f(r,t){var i=0,n;while(n=r.next()){if(n=='#'&&i==2){t.tokenize=e;break};if(n==']')i++;else if(n!=' ')i=0};return'meta'};return{startState:function(){return{tokenize:e,beforeParams:!1,inParams:!1}},token:function(e,r){if(e.eatSpace())return null;return r.tokenize(e,r)}}});e.defineMIME('text/x-tcl','tcl')}); -/* ./modules/editor/codemirror/mode/clojure/clojure.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("clojure",function(t){var f="builtin",u="comment",d="string",p="string-2",r="atom",h="number",c="bracket",m="keyword",y="variable",g=t.indentUnit||2,b=t.indentUnit||2;function n(e){var n={},r=e.split(" ");for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var i=n("true false nil"),o=n("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),s=n("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),l=n("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),e={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/,block_indent:/^(?:def|with)[^\/]+$|\/(?:def|with)/};function k(e,t,n){this.indent=e;this.type=t;this.prev=n};function a(e,t,n){e.indentStack=new k(t,n,e.indentStack)};function v(e){e.indentStack=e.indentStack.prev};function w(n,t){if(n==="0"&&t.eat(/x/i)){t.eatWhile(e.hex);return!0};if((n=="+"||n=="-")&&(e.digit.test(t.peek()))){t.eat(e.sign);n=t.next()};if(e.digit.test(n)){t.eat(n);t.eatWhile(e.digit);if("."==t.peek()){t.eat(".");t.eatWhile(e.digit)} -else if("/"==t.peek()){t.eat("/");t.eatWhile(e.digit)};if(t.eat(e.exponent)){t.eat(e.sign);t.eatWhile(e.digit)};return!0};return!1};function x(e){var t=e.next();if(t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)){return};if(t==="u"){e.match(/[0-9a-z]{4}/i,!0)}};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(t,k){if(k.indentStack==null&&t.sol()){k.indentation=t.indentation()};if(k.mode!="string"&&t.eatSpace()){return null};var q=null;switch(k.mode){case"string":var E,z=!1;while((E=t.next())!=null){if(E=="\""&&!z){k.mode=!1;break};z=!z&&E=="\\"};q=d;break;default:var n=t.next();if(n=="\""){k.mode="string";q=d} -else if(n=="\\"){x(t);q=p} -else if(n=="'"&&!(e.digit_or_colon.test(t.peek()))){q=r} -else if(n==";"){t.skipToEnd();q=u} -else if(w(n,t)){q=h} -else if(n=="("||n=="["||n=="{"){var j="",S=t.column(),M;if(n=="(")while((M=t.eat(e.keyword_char))!=null){j+=M};if(j.length>0&&(l.propertyIsEnumerable(j)||e.block_indent.test(j))){a(k,S+g,n)} -else{t.eatSpace();if(t.eol()||t.peek()==";"){a(k,S+b,n)} -else{a(k,S+t.current().length,n)}};t.backUp(t.current().length-1);q=c} -else if(n==")"||n=="]"||n=="}"){q=c;if(k.indentStack!=null&&k.indentStack.type==(n==")"?"(":(n=="]"?"[":"{"))){v(k)}} -else if(n==":"){t.eatWhile(e.symbol);return r} -else{t.eatWhile(e.symbol);if(o&&o.propertyIsEnumerable(t.current())){q=m} -else if(s&&s.propertyIsEnumerable(t.current())){q=f} -else if(i&&i.propertyIsEnumerable(t.current())){q=r} -else{q=y}}};return q},indent:function(e){if(e.indentStack==null)return e.indentation;return e.indentStack.indent},closeBrackets:{pairs:"()[]{}\"\""},lineComment:";;"}});e.defineMIME("text/x-clojure","clojure");e.defineMIME("text/x-clojurescript","clojure");e.defineMIME("application/edn","clojure")}); -/* ./modules/editor/codemirror/mode/sass/sass.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../css/css'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../css/css'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sass',function(r){var f=e.mimeModes['text/css'],u=f.propertyKeywords||{},x=f.colorKeywords||{},y=f.valueKeywords||{},v=f.fontProperties||{};function z(e){return new RegExp('^'+e.join('|'))};var d=['true','false','null','auto'],a=new RegExp('^'+d.join('|')),k=['\\(','\\)','=','>','<','==','>=','<=','\\+','-','\\!=','/','\\*','%','and','or','not',';','\\{','\\}',':'],c=z(k),w=/^::?[a-zA-Z_][\w\-]*/,n;function t(e){return!e.peek()||e.match(/\s+$/,!1)};function l(e,r){var t=e.peek();if(t===')'){e.next();r.tokenizer=o;return'operator'} -else if(t==='('){e.next();e.eatSpace();return'operator'} -else if(t==='\''||t==='"'){r.tokenizer=s(e.next());return'string'} -else{r.tokenizer=s(')',!1);return'string'}};function p(e,r){return function(t,n){if(t.sol()&&t.indentation()<=e){n.tokenizer=o;return o(t,n)};if(r&&t.skipTo('*/')){t.next();t.next();n.tokenizer=o} -else{t.skipToEnd()};return'comment'}};function s(e,r){if(r==null){r=!0};function n(i,f){var u=i.next(),s=i.peek(),a=i.string.charAt(i.pos-2),c=((u!=='\\'&&s===e)||(u===e&&a!=='\\'));if(c){if(u!==e&&r){i.next()};if(t(i)){f.cursorHalf=0};f.tokenizer=o;return'string'} -else if(u==='#'&&s==='{'){f.tokenizer=h(n);i.next();return'operator'} -else{return'string'}};return n};function h(e){return function(r,t){if(r.peek()==='}'){r.next();t.tokenizer=e;return'operator'} -else{return o(r,t)}}};function i(e){if(e.indentCount==0){e.indentCount++;var t=e.scopes[0].offset,n=t+r.indentUnit;e.scopes.unshift({offset:n})}};function m(e){if(e.scopes.length==1)return;e.scopes.shift()};function o(e,r){var f=e.peek();if(e.match('/*')){r.tokenizer=p(e.indentation(),!0);return r.tokenizer(e,r)};if(e.match('//')){r.tokenizer=p(e.indentation(),!1);return r.tokenizer(e,r)};if(e.match('#{')){r.tokenizer=h(o);return'operator'};if(f==='"'||f==='\''){e.next();r.tokenizer=s(f);return'string'};if(!r.cursorHalf){if(f==='-'){if(e.match(/^-\w+-/)){return'meta'}};if(f==='.'){e.next();if(e.match(/^[\w-]+/)){i(r);return'qualifier'} -else if(e.peek()==='#'){i(r);return'tag'}};if(f==='#'){e.next();if(e.match(/^[\w-]+/)){i(r);return'builtin'};if(e.peek()==='#'){i(r);return'tag'}};if(f==='$'){e.next();e.eatWhile(/[\w-]/);return'variable-2'};if(e.match(/^-?[0-9\.]+/))return'number';if(e.match(/^(px|em|in)\b/))return'unit';if(e.match(a))return'keyword';if(e.match(/^url/)&&e.peek()==='('){r.tokenizer=l;return'atom'};if(f==='='){if(e.match(/^=[\w-]+/)){i(r);return'meta'}};if(f==='+'){if(e.match(/^\+[\w-]+/)){return'variable-3'}};if(f==='@'){if(e.match(/@extend/)){if(!e.match(/\s*[\w]/))m(r)}};if(e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){i(r);return'def'};if(f==='@'){e.next();e.eatWhile(/[\w-]/);return'def'};if(e.eatWhile(/[\w-]/)){if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){n=e.current().toLowerCase();var d=r.prevProp+'-'+n;if(u.hasOwnProperty(d)){return'property'} -else if(u.hasOwnProperty(n)){r.prevProp=n;return'property'} -else if(v.hasOwnProperty(n)){return'property'};return'tag'} -else if(e.match(/ *:/,!1)){i(r);r.cursorHalf=1;r.prevProp=e.current().toLowerCase();return'property'} -else if(e.match(/ *,/,!1)){return'tag'} -else{i(r);return'tag'}};if(f===':'){if(e.match(w)){return'variable-3'};e.next();r.cursorHalf=1;return'operator'}} -else{if(f==='#'){e.next();if(e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){if(t(e)){r.cursorHalf=0};return'number'}};if(e.match(/^-?[0-9\.]+/)){if(t(e)){r.cursorHalf=0};return'number'};if(e.match(/^(px|em|in)\b/)){if(t(e)){r.cursorHalf=0};return'unit'};if(e.match(a)){if(t(e)){r.cursorHalf=0};return'keyword'};if(e.match(/^url/)&&e.peek()==='('){r.tokenizer=l;if(t(e)){r.cursorHalf=0};return'atom'};if(f==='$'){e.next();e.eatWhile(/[\w-]/);if(t(e)){r.cursorHalf=0};return'variable-2'};if(f==='!'){e.next();r.cursorHalf=0;return e.match(/^[\w]+/)?'keyword':'operator'};if(e.match(c)){if(t(e)){r.cursorHalf=0};return'operator'};if(e.eatWhile(/[\w-]/)){if(t(e)){r.cursorHalf=0};n=e.current().toLowerCase();if(y.hasOwnProperty(n)){return'atom'} -else if(x.hasOwnProperty(n)){return'keyword'} -else if(u.hasOwnProperty(n)){r.prevProp=e.current().toLowerCase();return'property'} -else{return'tag'}};if(t(e)){r.cursorHalf=0;return null}};if(e.match(c))return'operator';e.next();return null};function g(e,t){if(e.sol())t.indentCount=0;var u=t.tokenizer(e,t),i=e.current();if(i==='@return'||i==='}'){m(t)};if(u!==null){var s=e.pos-i.length,a=s+(r.indentUnit*t.indentCount),f=[];for(var n=0;n<t.scopes.length;n++){var o=t.scopes[n];if(o.offset<=a)f.push(o)};t.scopes=f};return u};return{startState:function(){return{tokenizer:o,scopes:[{offset:0,type:'sass'}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,r){var t=g(e,r);r.lastToken={style:t,content:e.current()};return t},indent:function(e){return e.scopes[0].offset}}},'css');e.defineMIME('text/x-sass','sass')}); -/* ./modules/editor/codemirror/mode/gas/gas.min.js */(function(i){if(typeof exports=='object'&&typeof module=='object')i(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],i);else i(CodeMirror)})(function(i){'use strict';i.defineMode('gas',function(t,l){'use strict';var r=[],e='',b={'.abort':'builtin','.align':'builtin','.altmacro':'builtin','.ascii':'builtin','.asciz':'builtin','.balign':'builtin','.balignw':'builtin','.balignl':'builtin','.bundle_align_mode':'builtin','.bundle_lock':'builtin','.bundle_unlock':'builtin','.byte':'builtin','.cfi_startproc':'builtin','.comm':'builtin','.data':'builtin','.def':'builtin','.desc':'builtin','.dim':'builtin','.double':'builtin','.eject':'builtin','.else':'builtin','.elseif':'builtin','.end':'builtin','.endef':'builtin','.endfunc':'builtin','.endif':'builtin','.equ':'builtin','.equiv':'builtin','.eqv':'builtin','.err':'builtin','.error':'builtin','.exitm':'builtin','.extern':'builtin','.fail':'builtin','.file':'builtin','.fill':'builtin','.float':'builtin','.func':'builtin','.global':'builtin','.gnu_attribute':'builtin','.hidden':'builtin','.hword':'builtin','.ident':'builtin','.if':'builtin','.incbin':'builtin','.include':'builtin','.int':'builtin','.internal':'builtin','.irp':'builtin','.irpc':'builtin','.lcomm':'builtin','.lflags':'builtin','.line':'builtin','.linkonce':'builtin','.list':'builtin','.ln':'builtin','.loc':'builtin','.loc_mark_labels':'builtin','.local':'builtin','.long':'builtin','.macro':'builtin','.mri':'builtin','.noaltmacro':'builtin','.nolist':'builtin','.octa':'builtin','.offset':'builtin','.org':'builtin','.p2align':'builtin','.popsection':'builtin','.previous':'builtin','.print':'builtin','.protected':'builtin','.psize':'builtin','.purgem':'builtin','.pushsection':'builtin','.quad':'builtin','.reloc':'builtin','.rept':'builtin','.sbttl':'builtin','.scl':'builtin','.section':'builtin','.set':'builtin','.short':'builtin','.single':'builtin','.size':'builtin','.skip':'builtin','.sleb128':'builtin','.space':'builtin','.stab':'builtin','.string':'builtin','.struct':'builtin','.subsection':'builtin','.symver':'builtin','.tag':'builtin','.text':'builtin','.title':'builtin','.type':'builtin','.uleb128':'builtin','.val':'builtin','.version':'builtin','.vtable_entry':'builtin','.vtable_inherit':'builtin','.warning':'builtin','.weak':'builtin','.weakref':'builtin','.word':'builtin'};var i={};function a(t){e='#';i.ax='variable';i.eax='variable-2';i.rax='variable-3';i.bx='variable';i.ebx='variable-2';i.rbx='variable-3';i.cx='variable';i.ecx='variable-2';i.rcx='variable-3';i.dx='variable';i.edx='variable-2';i.rdx='variable-3';i.si='variable';i.esi='variable-2';i.rsi='variable-3';i.di='variable';i.edi='variable-2';i.rdi='variable-3';i.sp='variable';i.esp='variable-2';i.rsp='variable-3';i.bp='variable';i.ebp='variable-2';i.rbp='variable-3';i.ip='variable';i.eip='variable-2';i.rip='variable-3';i.cs='keyword';i.ds='keyword';i.ss='keyword';i.es='keyword';i.fs='keyword';i.gs='keyword'};function o(t){e='@';b.syntax='builtin';i.r0='variable';i.r1='variable';i.r2='variable';i.r3='variable';i.r4='variable';i.r5='variable';i.r6='variable';i.r7='variable';i.r8='variable';i.r9='variable';i.r10='variable';i.r11='variable';i.r12='variable';i.sp='variable-2';i.lr='variable-2';i.pc='variable-2';i.r13=i.sp;i.r14=i.lr;i.r15=i.pc;r.push(function(i,t){if(i==='#'){t.eatWhile(/\w/);return'number'}})};var n=(l.architecture||'x86').toLowerCase();if(n==='x86'){a(l)} -else if(n==='arm'||n==='armv6'){o(l)};function s(i,t){var l=!1,e;while((e=i.next())!=null){if(e===t&&!l){return!1};l=!l&&e==='\\'};return l};function u(i,t){var e=!1,l;while((l=i.next())!=null){if(l==='/'&&e){t.tokenize=null;break};e=(l==='*')};return'comment'};return{startState:function(){return{tokenize:null}},token:function(t,n){if(n.tokenize){return n.tokenize(t,n)};if(t.eatSpace()){return null};var a,o,l=t.next();if(l==='/'){if(t.eat('*')){n.tokenize=u;return u(t,n)}};if(l===e){t.skipToEnd();return'comment'};if(l==='"'){s(t,'"');return'string'};if(l==='.'){t.eatWhile(/\w/);o=t.current().toLowerCase();a=b[o];return a||null};if(l==='='){t.eatWhile(/\w/);return'tag'};if(l==='{'){return'braket'};if(l==='}'){return'braket'};if(/\d/.test(l)){if(l==='0'&&t.eat('x')){t.eatWhile(/[0-9a-fA-F]/);return'number'};t.eatWhile(/\d/);return'number'};if(/\w/.test(l)){t.eatWhile(/\w/);if(t.eat(':')){return'tag'};o=t.current().toLowerCase();a=i[o];return a||null};for(var c=0;c<r.length;c++){a=r[c](l,t,n);if(a){return a}}},lineComment:e,blockCommentStart:'/*',blockCommentEnd:'*/'}})}); -/* ./modules/editor/codemirror/mode/sas/sas.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sas',function(){var e={};var n={eq:'operator',lt:'operator',le:'operator',gt:'operator',ge:'operator','in':'operator',ne:'operator',or:'operator'};var r=/(<=|>=|!=|<>)/,s=/[=\(:\),{}.*<>+\-\/^\[\]]/;function t(t,n,s){if(s){var o=n.split(' ');for(var r=0;r<o.length;r++){e[o[r]]={style:t,state:s}}}};t('def','stack pgm view source debug nesting nolist',['inDataStep']);t('def','if while until for do do; end end; then else cancel',['inDataStep']);t('def','label format _n_ _error_',['inDataStep']);t('def','ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME',['inDataStep']);t('def','filevar finfo finv fipname fipnamel fipstate first firstobs floor',['inDataStep']);t('def','varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday',['inDataStep']);t('def','zipfips zipname zipnamel zipstate',['inDataStep']);t('def','put putc putn',['inDataStep']);t('builtin','data run',['inDataStep']);t('def','data',['inProc']);t('def','%if %end %end; %else %else; %do %do; %then',['inMacro']);t('builtin','proc run; quit; libname filename %macro %mend option options',['ALL']);t('def','footnote title libname ods',['ALL']);t('def','%let %put %global %sysfunc %eval ',['ALL']);t('variable','&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext',['ALL']);t('def','source2 nosource2 page pageno pagesize',['ALL']);t('def','_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max',['inDataStep','inProc']);t('operator','and not ',['inDataStep','inProc']);function o(t,a){var i=t.next();if(i==='/'&&t.eat('*')){a.continueComment=!0;return'comment'} -else if(a.continueComment===!0){if(i==='*'&&t.peek()==='/'){t.next();a.continueComment=!1} -else if(t.skipTo('*')){t.skipTo('*');t.next();if(t.eat('/'))a.continueComment=!1} -else{t.skipToEnd()};return'comment'};if(i=='*'&&t.column()==t.indentation()){t.skipToEnd();return'comment'};var c=i+t.peek();if((i==='"'||i==='\'')&&!a.continueString){a.continueString=i;return'string'} -else if(a.continueString){if(a.continueString==i){a.continueString=null} -else if(t.skipTo(a.continueString)){t.next();a.continueString=null} -else{t.skipToEnd()};return'string'} -else if(a.continueString!==null&&t.eol()){t.skipTo(a.continueString)||t.skipToEnd();return'string'} -else if(/[\d\.]/.test(i)){if(i==='.')t.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);else if(i==='0')t.match(/^[xX][0-9a-fA-F]+/)||t.match(/^0[0-7]+/);else t.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);return'number'} -else if(r.test(i+t.peek())){t.next();return'operator'} -else if(n.hasOwnProperty(c)){t.next();if(t.peek()===' ')return n[c.toLowerCase()]} -else if(s.test(i)){return'operator'};var o;if(t.match(/[%&;\w]+/,!1)!=null){o=i+t.match(/[%&;\w]+/,!0);if(/&/.test(o))return'variable'} -else{o=i};if(a.nextword){t.match(/[\w]+/);if(t.peek()==='.')t.skipTo(' ');a.nextword=!1;return'variable-2'};o=o.toLowerCase();if(a.inDataStep){if(o==='run;'||t.match(/run\s;/)){a.inDataStep=!1;return'builtin'};if((o)&&t.next()==='.'){if(/\w/.test(t.peek()))return'variable-2';else return'variable'};if(o&&e.hasOwnProperty(o)&&(e[o].state.indexOf('inDataStep')!==-1||e[o].state.indexOf('ALL')!==-1)){if(t.start<t.pos)t.backUp(t.pos-t.start);for(var l=0;l<o.length;++l)t.next();return e[o].style}};if(a.inProc){if(o==='run;'||o==='quit;'){a.inProc=!1;return'builtin'};if(o&&e.hasOwnProperty(o)&&(e[o].state.indexOf('inProc')!==-1||e[o].state.indexOf('ALL')!==-1)){t.match(/[\w]+/);return e[o].style}};if(a.inMacro){if(o==='%mend'){if(t.peek()===';')t.next();a.inMacro=!1;return'builtin'};if(o&&e.hasOwnProperty(o)&&(e[o].state.indexOf('inMacro')!==-1||e[o].state.indexOf('ALL')!==-1)){t.match(/[\w]+/);return e[o].style};return'atom'};if(o&&e.hasOwnProperty(o)){t.backUp(1);t.match(/[\w]+/);if(o==='data'&&/=/.test(t.peek())===!1){a.inDataStep=!0;a.nextword=!0;return'builtin'};if(o==='proc'){a.inProc=!0;a.nextword=!0;return'builtin'};if(o==='%macro'){a.inMacro=!0;a.nextword=!0;return'builtin'};if(/title[1-9]/.test(o))return'def';if(o==='footnote'){t.eat(/[1-9]/);return'def'};if(a.inDataStep===!0&&e[o].state.indexOf('inDataStep')!==-1)return e[o].style;if(a.inProc===!0&&e[o].state.indexOf('inProc')!==-1)return e[o].style;if(a.inMacro===!0&&e[o].state.indexOf('inMacro')!==-1)return e[o].style;if(e[o].state.indexOf('ALL')!==-1)return e[o].style;return null};return null};return{startState:function(){return{inDataStep:!1,inProc:!1,inMacro:!1,nextword:!1,continueString:null,continueComment:!1}},token:function(e,t){if(e.eatSpace())return null;return o(e,t)},blockCommentStart:'/*',blockCommentEnd:'*/'}});e.defineMIME('text/x-sas','sas')}); -/* ./modules/editor/codemirror/mode/julia/julia.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('julia',function(e,t){function i(e,t){if(typeof t==='undefined'){t='\\b'};return new RegExp('^(('+e.join(')|(')+'))'+t)};var u='\\\\[0-7]{1,3}',s='\\\\x[A-Fa-f0-9]{1,2}',c='\\\\[abefnrtv0%?\'"\\\\]',l='([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])',m=t.operators||i(['[<>]:','[<>=]=','<<=?','>>>?=?','=>','->','\\/\\/','[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?','\\?','\\$','~',':','\\u00D7','\\u2208','\\u2209','\\u220B','\\u220C','\\u2218','\\u221A','\\u221B','\\u2229','\\u222A','\\u2260','\\u2264','\\u2265','\\u2286','\\u2288','\\u228A','\\u22C5','\\b(in|isa)\\b(?!\.?\\()'],''),h=t.delimiters||/^[;,()[\]{}]/,p=t.identifiers||/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,d=i([u,s,c,l],'\''),v=i(['begin','function','type','struct','immutable','let','macro','for','while','quote','if','else','elseif','try','finally','catch','do']),k=i(['end','else','elseif','catch','finally']),b=i(['if','else','elseif','while','for','begin','let','end','do','try','catch','finally','return','break','continue','global','local','const','export','import','importall','using','function','where','macro','module','baremodule','struct','type','mutable','immutable','quote','typealias','abstract','primitive','bitstype']),F=i(['true','false','nothing','NaN','Inf']),g=/^@[_A-Za-z][\w]*/,x=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,z=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;function a(e){return o(e,'[')};function o(e,t){var n=r(e),i=r(e,1);if(typeof(t)==='undefined'){t='('};if(n===t||(i===t&&n==='for')){return!0};return!1};function r(e,t){if(typeof(t)==='undefined'){t=0};if(e.scopes.length<=t){return null};return e.scopes[e.scopes.length-(t+1)]};function n(e,t){if(e.match(/^#=/,!1)){t.tokenize=E;return t.tokenize(e,t)};var f=t.leavingExpr;if(e.sol()){f=!1};t.leavingExpr=!1;if(f){if(e.match(/^'+/)){return'operator'}};if(e.match(/\.{4,}/)){return'error'} -else if(e.match(/\.{1,3}/)){return'operator'};if(e.eatSpace()){return null};var i=e.peek();if(i==='#'){e.skipToEnd();return'comment'};if(i==='['){t.scopes.push('[')};if(i==='('){t.scopes.push('(')};var s=r(t);if(a(t)&&i===']'){if(s==='for'){t.scopes.pop()};t.scopes.pop();t.leavingExpr=!0};if(o(t)&&i===')'){if(s==='for'){t.scopes.pop()};t.scopes.pop();t.leavingExpr=!0};if(a(t)){if(t.lastToken=='end'&&e.match(/^:/)){return'operator'};if(e.match(/^end/)){return'number'}};var u;if(u=e.match(v,!1)){t.scopes.push(u[0])};if(e.match(k,!1)){t.scopes.pop()};if(e.match(/^::(?![:\$])/)){t.tokenize=y;return t.tokenize(e,t)};if(!f&&e.match(x)||e.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)){return'builtin'};if(e.match(m)){return'operator'};if(e.match(/^\.?\d/,!1)){var l=RegExp(/^im\b/),n=!1;if(e.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)){n=!0};if(e.match(/^\d+\.(?!\.)\d*/)){n=!0};if(e.match(/^\.\d+/)){n=!0};if(e.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)){n=!0};if(e.match(/^0x[0-9a-f]+/i)){n=!0};if(e.match(/^0b[01]+/i)){n=!0};if(e.match(/^0o[0-7]+/i)){n=!0};if(e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)){n=!0};if(e.match(/^0(?![\dx])/i)){n=!0};if(n){e.match(l);t.leavingExpr=!0;return'number'}};if(e.match(/^'/)){t.tokenize=P;return t.tokenize(e,t)};if(e.match(z)){t.tokenize=D(e.current());return t.tokenize(e,t)};if(e.match(g)){return'meta'};if(e.match(h)){return null};if(e.match(b)){return'keyword'};if(e.match(F)){return'builtin'};var c=t.isDefinition||t.lastToken=='function'||t.lastToken=='macro'||t.lastToken=='type'||t.lastToken=='struct'||t.lastToken=='immutable';if(e.match(p)){if(c){if(e.peek()==='.'){t.isDefinition=!0;return'variable'};t.isDefinition=!1;return'def'};if(e.match(/^({[^}]*})*\(/,!1)){t.tokenize=A;return t.tokenize(e,t)};t.leavingExpr=!0;return'variable'};e.next();return'error'};function A(t,e){var i=t.match(/^(\(\s*)/);if(i){if(e.firstParenPos<0)e.firstParenPos=e.scopes.length;e.scopes.push('(');e.charsAdvanced+=i[1].length};if(r(e)=='('&&t.match(/^\)/)){e.scopes.pop();e.charsAdvanced+=1;if(e.scopes.length<=e.firstParenPos){var a=t.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/,!1);t.backUp(e.charsAdvanced);e.firstParenPos=-1;e.charsAdvanced=0;e.tokenize=n;if(a)return'def';return'builtin'}};if(t.match(/^$/g,!1)){t.backUp(e.charsAdvanced);while(e.scopes.length>e.firstParenPos)e.scopes.pop();e.firstParenPos=-1;e.charsAdvanced=0;e.tokenize=n;return'builtin'};e.charsAdvanced+=t.match(/^([^()]*)/)[1].length;return e.tokenize(t,e)};function y(e,t){e.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/);if(e.match(/^{/)){t.nestedLevels++} -else if(e.match(/^}/)){t.nestedLevels--};if(t.nestedLevels>0){e.match(/.*?(?={|})/)||e.next()} -else if(t.nestedLevels==0){t.tokenize=n};return'builtin'};function E(e,t){if(e.match(/^#=/)){t.nestedLevels++};if(!e.match(/.*?(?=(#=|=#))/)){e.skipToEnd()};if(e.match(/^=#/)){t.nestedLevels--;if(t.nestedLevels==0)t.tokenize=n};return'comment'};function P(e,t){var r=!1,a;if(e.match(d)){r=!0} -else if(a=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){var i=parseInt(a[1],16);if(i<=55295||i>=57344){r=!0;e.next()}} -else if(a=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i=parseInt(a[1],16);if(i<=1114111){r=!0;e.next()}};if(r){t.leavingExpr=!0;t.tokenize=n;return'string'};if(!e.match(/^[^']+(?=')/)){e.skipToEnd()};if(e.match(/^'/)){t.tokenize=n};return'error'};function D(e){if(e.substr(-3)==='"""'){e='"""'} -else if(e.substr(-1)==='"'){e='"'};function t(t,i){if(t.eat('\\')){t.next()} -else if(t.match(e)){i.tokenize=n;i.leavingExpr=!0;return'string'} -else{t.eat(/[`"]/)};t.eatWhile(/[^\\`"]/);return'string'};return t};var f={startState:function(){return{tokenize:n,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedLevels:0,charsAdvanced:0,firstParenPos:-1}},token:function(e,t){var n=t.tokenize(e,t),i=e.current();if(i&&n){t.lastToken=i};return n},indent:function(n,t){var i=0;if(t===']'||t===')'||t==='end'||t==='else'||t==='catch'||t==='elseif'||t==='finally'){i=-1};return(n.scopes.length+i)*e.indentUnit},electricInput:/\b(end|else|catch|finally)\b/,blockCommentStart:'#=',blockCommentEnd:'=#',lineComment:'#',fold:'indent'};return f});e.defineMIME('text/x-julia','julia')}); -/* ./modules/editor/codemirror/mode/fcl/fcl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('fcl',function(e){var o=e.indentUnit,l={'term':!0,'method':!0,'accu':!0,'rule':!0,'then':!0,'is':!0,'and':!0,'or':!0,'if':!0,'default':!0};var i={'var_input':!0,'var_output':!0,'fuzzify':!0,'defuzzify':!0,'function_block':!0,'ruleblock':!0};var n={'end_ruleblock':!0,'end_defuzzify':!0,'end_function_block':!0,'end_fuzzify':!0,'end_var':!0};var a={'true':!0,'false':!0,'nan':!0,'real':!0,'min':!0,'max':!0,'cog':!0,'cogs':!0};var r=/[+\-*&^%:=<>!|\/]/;function t(e,t){var o=e.next();if(/[\d\.]/.test(o)){if(o=='.'){e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/)} -else if(o=='0'){e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/)} -else{e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/)};return'number'};if(o=='/'||o=='('){if(e.eat('*')){t.tokenize=u;return u(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(r.test(o)){e.eatWhile(r);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var f=e.current().toLowerCase();if(l.propertyIsEnumerable(f)||i.propertyIsEnumerable(f)||n.propertyIsEnumerable(f)){return'keyword'};if(a.propertyIsEnumerable(f))return'atom';return'variable'};function u(e,n){var i=!1,r;while(r=e.next()){if((r=='/'||r==')')&&i){n.tokenize=t;break};i=(r=='*')};return'comment'};function f(e,n,t,r,i){this.indented=e;this.column=n;this.type=t;this.align=r;this.prev=i};function c(e,n,t){return e.context=new f(e.indented,n,t,null,e.context)};function d(e){if(!e.context.prev)return;var n=e.context.type;if(n=='end_block')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new f((e||0)-o,0,'top',!1),indented:0,startOfLine:!0}},token:function(e,r){var o=r.context;if(e.sol()){if(o.align==null)o.align=!1;r.indented=e.indentation();r.startOfLine=!0};if(e.eatSpace())return null;var u=(r.tokenize||t)(e,r);if(u=='comment')return u;if(o.align==null)o.align=!0;var f=e.current().toLowerCase();if(i.propertyIsEnumerable(f))c(r,e.column(),'end_block');else if(n.propertyIsEnumerable(f))d(r);r.startOfLine=!1;return u},indent:function(e,r){if(e.tokenize!=t&&e.tokenize!=null)return 0;var i=e.context,u=n.propertyIsEnumerable(r);if(i.align)return i.column+(u?0:1);else return i.indented+(u?0:o)},electricChars:'ryk',fold:'brace',blockCommentStart:'(*',blockCommentEnd:'*)',lineComment:'//'}});e.defineMIME('text/x-fcl','fcl')}); -/* ./modules/editor/codemirror/mode/tornado/tornado.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('tornado:inner',function(){var e=['and','as','assert','autoescape','block','break','class','comment','context','continue','datetime','def','del','elif','else','end','escape','except','exec','extends','false','finally','for','from','global','if','import','in','include','is','json_encode','lambda','length','linkify','load','module','none','not','or','pass','print','put','raise','raw','return','self','set','squeeze','super','true','try','url_escape','while','with','without','xhtml_escape','yield'];e=new RegExp('^(('+e.join(')|(')+'))\\b');function t(e,t){e.eatWhile(/[^\{]/);var o=e.next();if(o=='{'){if(o=e.eat(/\{|%|#/)){t.tokenize=n(o);return'tag'}}};function n(n){if(n=='{'){n='}'};return function(o,r){var i=o.next();if((i==n)&&o.eat('}')){r.tokenize=t;return'tag'};if(o.match(e)){return'keyword'};return n=='#'?'comment':'string'}};return{startState:function(){return{tokenize:t}},token:function(e,t){return t.tokenize(e,t)}}});e.defineMode('tornado',function(t){var n=e.getMode(t,'text/html'),o=e.getMode(t,'tornado:inner');return e.overlayMode(n,o)});e.defineMIME('text/x-tornado','tornado')}); -/* ./modules/editor/codemirror/mode/asterisk/asterisk.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('asterisk',function(){var e=['exten','same','include','ignorepat','switch'],t=['#include','#exec'],i=['addqueuemember','adsiprog','aelsub','agentlogin','agentmonitoroutgoing','agi','alarmreceiver','amd','answer','authenticate','background','backgrounddetect','bridge','busy','callcompletioncancel','callcompletionrequest','celgenuserevent','changemonitor','chanisavail','channelredirect','chanspy','clearhash','confbridge','congestion','continuewhile','controlplayback','dahdiacceptr2call','dahdibarge','dahdiras','dahdiscan','dahdisendcallreroutingfacility','dahdisendkeypadfacility','datetime','dbdel','dbdeltree','deadagi','dial','dictate','directory','disa','dumpchan','eagi','echo','endwhile','exec','execif','execiftime','exitwhile','extenspy','externalivr','festival','flash','followme','forkcdr','getcpeid','gosub','gosubif','goto','gotoif','gotoiftime','hangup','iax2provision','ices','importvar','incomplete','ivrdemo','jabberjoin','jabberleave','jabbersend','jabbersendgroup','jabberstatus','jack','log','macro','macroexclusive','macroexit','macroif','mailboxexists','meetme','meetmeadmin','meetmechanneladmin','meetmecount','milliwatt','minivmaccmess','minivmdelete','minivmgreet','minivmmwi','minivmnotify','minivmrecord','mixmonitor','monitor','morsecode','mp3player','mset','musiconhold','nbscat','nocdr','noop','odbc','odbc','odbcfinish','originate','ospauth','ospfinish','osplookup','ospnext','page','park','parkandannounce','parkedcall','pausemonitor','pausequeuemember','pickup','pickupchan','playback','playtones','privacymanager','proceeding','progress','queue','queuelog','raiseexception','read','readexten','readfile','receivefax','receivefax','receivefax','record','removequeuemember','resetcdr','retrydial','return','ringing','sayalpha','saycountedadj','saycountednoun','saycountpl','saydigits','saynumber','sayphonetic','sayunixtime','senddtmf','sendfax','sendfax','sendfax','sendimage','sendtext','sendurl','set','setamaflags','setcallerpres','setmusiconhold','sipaddheader','sipdtmfmode','sipremoveheader','skel','slastation','slatrunk','sms','softhangup','speechactivategrammar','speechbackground','speechcreate','speechdeactivategrammar','speechdestroy','speechloadgrammar','speechprocessingsound','speechstart','speechunloadgrammar','stackpop','startmusiconhold','stopmixmonitor','stopmonitor','stopmusiconhold','stopplaytones','system','testclient','testserver','transfer','tryexec','trysystem','unpausemonitor','unpausequeuemember','userevent','verbose','vmauthenticate','vmsayname','voicemail','voicemailmain','wait','waitexten','waitfornoise','waitforring','waitforsilence','waitmusiconhold','waituntil','while','zapateller'];function n(i,a){var r='',n=i.next();if(n==';'){i.skipToEnd();return'comment'};if(n=='['){i.skipTo(']');i.eat(']');return'header'};if(n=='"'){i.skipTo('"');return'string'};if(n=='\''){i.skipTo('\'');return'string-2'};if(n=='#'){i.eatWhile(/\w/);r=i.current();if(t.indexOf(r)!==-1){i.skipToEnd();return'strong'}};if(n=='$'){var o=i.peek();if(o=='{'){i.skipTo('}');i.eat('}');return'variable-3'}};i.eatWhile(/\w/);r=i.current();if(e.indexOf(r)!==-1){a.extenStart=!0;switch(r){case'same':a.extenSame=!0;break;case'include':case'switch':case'ignorepat':a.extenInclude=!0;break;default:break};return'atom'}};return{startState:function(){return{extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(t,e){var r='';if(t.eatSpace())return null;if(e.extenStart){t.eatWhile(/[^\s]/);r=t.current();if(/^=>?$/.test(r)){e.extenExten=!0;e.extenStart=!1;return'strong'} -else{e.extenStart=!1;t.skipToEnd();return'error'}} -else if(e.extenExten){e.extenExten=!1;e.extenPriority=!0;t.eatWhile(/[^,]/);if(e.extenInclude){t.skipToEnd();e.extenPriority=!1;e.extenInclude=!1};if(e.extenSame){e.extenPriority=!1;e.extenSame=!1;e.extenApplication=!0};return'tag'} -else if(e.extenPriority){e.extenPriority=!1;e.extenApplication=!0;t.next();if(e.extenSame)return null;t.eatWhile(/[^,]/);return'number'} -else if(e.extenApplication){t.eatWhile(/,/);r=t.current();if(r===',')return null;t.eatWhile(/\w/);r=t.current().toLowerCase();e.extenApplication=!1;if(i.indexOf(r)!==-1){return'def strong'}} -else{return n(t,e)};return null}}});e.defineMIME('text/x-asterisk','asterisk')}); -/* ./modules/editor/codemirror/mode/sql/sql.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sql',function(t,r){'use strict';var c=r.client||{},u=r.atoms||{'false':!0,'true':!0,'null':!0},d=r.builtin||{},m=r.keywords||{},s=r.operatorChars||/^[*+\-%<>!=&|~^]/,a=r.support||{},o=r.hooks||{},p=r.dateSQL||{'date':!0,'time':!0,'timestamp':!0};function i(e,r){var t=e.next();if(o[t]){var l=o[t](e,r);if(l!==!1)return l};if(a.hexNumber&&((t=='0'&&e.match(/^[xX][0-9a-fA-F]+/))||(t=='x'||t=='X')&&e.match(/^'[0-9a-fA-F]+'/))){return'number'} -else if(a.binaryNumber&&(((t=='b'||t=='B')&&e.match(/^'[01]+'/))||(t=='0'&&e.match(/^b[01]+/)))){return'number'} -else if(t.charCodeAt(0)>47&&t.charCodeAt(0)<58){e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/);a.decimallessFloat&&e.match(/^\.(?!\.)/);return'number'} -else if(t=='?'&&(e.eatSpace()||e.eol()||e.eat(';'))){return'variable-3'} -else if(t=='\''||(t=='"'&&a.doubleQuote)){r.tokenize=g(t);return r.tokenize(e,r)} -else if((((a.nCharCast&&(t=='n'||t=='N'))||(a.charsetCast&&t=='_'&&e.match(/[a-z][a-z0-9]*/i)))&&(e.peek()=='\''||e.peek()=='"'))){return'keyword'} -else if(/^[\(\),\;\[\]]/.test(t)){return null} -else if(a.commentSlashSlash&&t=='/'&&e.eat('/')){e.skipToEnd();return'comment'} -else if((a.commentHash&&t=='#')||(t=='-'&&e.eat('-')&&(!a.commentSpaceRequired||e.eat(' ')))){e.skipToEnd();return'comment'} -else if(t=='/'&&e.eat('*')){r.tokenize=n(1);return r.tokenize(e,r)} -else if(t=='.'){if(a.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i))return'number';if(e.match(/^\.+/))return null;if(a.ODBCdotTable&&e.match(/^[\w\d_]+/))return'variable-2'} -else if(s.test(t)){e.eatWhile(s);return null} -else if(t=='{'&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))){return'number'} -else{e.eatWhile(/^[_\w\d]/);var i=e.current().toLowerCase();if(p.hasOwnProperty(i)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/)))return'number';if(u.hasOwnProperty(i))return'atom';if(d.hasOwnProperty(i))return'builtin';if(m.hasOwnProperty(i))return'keyword';if(c.hasOwnProperty(i))return'string-2';return null}};function g(e){return function(t,r){var a=!1,n;while((n=t.next())!=null){if(n==e&&!a){r.tokenize=i;break};a=!a&&n=='\\'};return'string'}};function n(e){return function(t,r){var a=t.match(/^.*?(\/\*|\*\/)/);if(!a)t.skipToEnd();else if(a[1]=='/*')r.tokenize=n(e+1);else if(e>1)r.tokenize=n(e-1);else r.tokenize=i;return'comment'}};function l(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}};function h(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:i,context:null}},token:function(e,t){if(e.sol()){if(t.context&&t.context.align==null)t.context.align=!1};if(t.tokenize==i&&e.eatSpace())return null;var a=t.tokenize(e,t);if(a=='comment')return a;if(t.context&&t.context.align==null)t.context.align=!0;var r=e.current();if(r=='(')l(e,t,')');else if(r=='[')l(e,t,']');else if(t.context&&t.context.type==r)h(t);return a},indent:function(r,a){var i=r.context;if(!i)return e.Pass;var n=a.charAt(0)==i.type;if(i.align)return i.col+(n?0:1);else return i.indent+(n?0:t.indentUnit)},blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:a.commentSlashSlash?'//':a.commentHash?'#':'--'}});(function(){'use strict';function i(e){var t;while((t=e.next())!=null){if(t=='`'&&!e.eat('`'))return'variable-2'};e.backUp(e.current().length-1);return e.eatWhile(/\w/)?'variable-2':null};function s(e){var t;while((t=e.next())!=null){if(t=='"'&&!e.eat('"'))return'variable-2'};e.backUp(e.current().length-1);return e.eatWhile(/\w/)?'variable-2':null};function r(e){if(e.eat('@')){e.match(/^session\./);e.match(/^local\./);e.match(/^global\./)};if(e.eat('\'')){e.match(/^.*'/);return'variable-2'} -else if(e.eat('"')){e.match(/^.*"/);return'variable-2'} -else if(e.eat('`')){e.match(/^.*`/);return'variable-2'} -else if(e.match(/^[0-9a-zA-Z$\.\_]+/)){return'variable-2'};return null};function n(e){if(e.eat('N')){return'atom'};return e.match(/^[a-zA-Z.#!?]/)?'variable-2':null};var a='alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ';function t(e){var r={},a=e.split(' ');for(var t=0;t<a.length;++t)r[a[t]]=!0;return r};e.defineMIME('text/x-sql',{name:'sql',keywords:t(a+'begin'),builtin:t('bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable doubleQuote binaryNumber hexNumber')});e.defineMIME('text/x-mssql',{name:'sql',client:t('charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee'),keywords:t(a+'begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec'),builtin:t('bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table '),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=]/,dateSQL:t('date datetimeoffset datetime2 smalldatetime datetime time'),hooks:{'@':r}});e.defineMIME('text/x-mysql',{name:'sql',client:t('charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee'),keywords:t(a+'accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat'),builtin:t('bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired'),hooks:{'@':r,'`':i,'\\':n}});e.defineMIME('text/x-mariadb',{name:'sql',client:t('charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee'),keywords:t(a+'accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat'),builtin:t('bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired'),hooks:{'@':r,'`':i,'\\':n}});e.defineMIME('text/x-sqlite',{name:'sql',client:t('auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width'),keywords:t(a+'abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without'),builtin:t('bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real'),atoms:t('null current_date current_time current_timestamp'),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:t('date time timestamp datetime'),support:t('decimallessFloat zerolessFloat'),identifierQuote:'"',hooks:{'@':r,':':r,'?':r,'$':r,'"':s,'`':i}});e.defineMIME('text/x-cassandra',{name:'sql',client:{},keywords:t('add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime'),builtin:t('ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint'),atoms:t('false true infinity NaN'),operatorChars:/^[<>=]/,dateSQL:{},support:t('commentSlashSlash decimallessFloat'),hooks:{}});e.defineMIME('text/x-plsql',{name:'sql',client:t('appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap'),keywords:t('abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work'),builtin:t('abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml'),operatorChars:/^[*+\-%<>!=~]/,dateSQL:t('date time timestamp'),support:t('doubleQuote nCharCast zerolessFloat binaryNumber hexNumber')});e.defineMIME('text/x-hive',{name:'sql',keywords:t('select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with'),builtin:t('bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=]/,dateSQL:t('date timestamp'),support:t('ODBCdotTable doubleQuote binaryNumber hexNumber')});e.defineMIME('text/x-pgsql',{name:'sql',client:t('source'),keywords:t(a+'a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone'),builtin:t('bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast')});e.defineMIME('text/x-gql',{name:'sql',keywords:t('ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where'),atoms:t('false true'),builtin:t('blob datetime first key __key__ string integer double boolean null'),operatorChars:/^[*+\-%<>!=]/});e.defineMIME('text/x-gpsql',{name:'sql',client:t('source'),keywords:t('abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone'),builtin:t('bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast')});e.defineMIME('text/x-sparksql',{name:'sql',keywords:t('add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with'),builtin:t('tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat'),atoms:t('false true null'),operatorChars:/^[*+\-%<>!=~&|^]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable doubleQuote zerolessFloat')});e.defineMIME('text/x-esper',{name:'sql',client:t('source'),keywords:t('alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window'),builtin:{},atoms:t('false true null'),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:t('time'),support:t('decimallessFloat zerolessFloat binaryNumber hexNumber')})}())}); -/* ./modules/editor/codemirror/mode/gfm/gfm.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../markdown/markdown'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../markdown/markdown','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode('gfm',function(a,n){var r=0;function c(e){e.code=!1;return null};var s={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,a){a.combineTokens=null;if(a.codeBlock){if(e.match(/^```+/)){a.codeBlock=!1;return null};e.skipToEnd();return null};if(e.sol()){a.code=!1};if(e.sol()&&e.match(/^```+/)){e.skipToEnd();a.codeBlock=!0;return null};if(e.peek()==='`'){e.next();var i=e.pos;e.eatWhile('`');var o=1+e.pos-i;if(!a.code){r=o;a.code=!0} -else{if(o===r){a.code=!1}};return null} -else if(a.code){e.next();return null};if(e.eatSpace()){a.ateSpace=!0;return null};if(e.sol()||a.ateSpace){a.ateSpace=!1;if(n.gitHubSpice!==!1){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)){a.combineTokens=!0;return'link'} -else if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)){a.combineTokens=!0;return'link'}}};if(e.match(t)&&e.string.slice(e.start-2,e.start)!=']('&&(e.start==0||/\W/.test(e.string.charAt(e.start-1)))){a.combineTokens=!0;return'link'};e.next();return null},blankLine:c};var o={taskLists:!0,strikethrough:!0,emoji:!0};for(var i in n){o[i]=n[i]};o.name='markdown';return e.overlayMode(e.getMode(a,o),s)},'markdown');e.defineMIME('text/x-gfm','gfm')}); -/* ./modules/editor/codemirror/mode/mllike/mllike.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('mllike',function(r,e){var o={'let':'keyword','rec':'keyword','in':'keyword','of':'keyword','and':'keyword','if':'keyword','then':'keyword','else':'keyword','for':'keyword','to':'keyword','while':'keyword','do':'keyword','done':'keyword','fun':'keyword','function':'keyword','val':'keyword','type':'keyword','mutable':'keyword','match':'keyword','with':'keyword','try':'keyword','open':'builtin','ignore':'builtin','begin':'keyword','end':'keyword'};var i=e.extraWords||{};for(var t in i){if(i.hasOwnProperty(t)){o[t]=e.extraWords[t]}};function n(r,t){var n=r.next();if(n==='"'){t.tokenize=d;return t.tokenize(r,t)};if(n==='('){if(r.eat('*')){t.commentLevel++;t.tokenize=l;return t.tokenize(r,t)}};if(n==='~'){r.eatWhile(/\w/);return'variable-2'};if(n==='`'){r.eatWhile(/\w/);return'quote'};if(n==='/'&&e.slashComments&&r.eat('/')){r.skipToEnd();return'comment'};if(/\d/.test(n)){r.eatWhile(/[\d]/);if(r.eat('.')){r.eatWhile(/[\d]/)};return'number'};if(/[+\-*&%=<>!?|]/.test(n)){return'operator'};if(/[\w\xa1-\uffff]/.test(n)){r.eatWhile(/[\w\xa1-\uffff]/);var i=r.current();return o.hasOwnProperty(i)?o[i]:'variable'};return null};function d(e,r){var o,i=!1,t=!1;while((o=e.next())!=null){if(o==='"'&&!t){i=!0;break};t=!t&&o==='\\'};if(i&&!t){r.tokenize=n};return'string'};function l(r,e){var o,t;while(e.commentLevel>0&&(t=r.next())!=null){if(o==='('&&t==='*')e.commentLevel++;if(o==='*'&&t===')')e.commentLevel--;o=t};if(e.commentLevel<=0){e.tokenize=n};return'comment'};return{startState:function(){return{tokenize:n,commentLevel:0}},token:function(e,r){if(e.eatSpace())return null;return r.tokenize(e,r)},blockCommentStart:'(*',blockCommentEnd:'*)',lineComment:e.slashComments?'//':null}});e.defineMIME('text/x-ocaml',{name:'mllike',extraWords:{'succ':'keyword','trace':'builtin','exit':'builtin','print_string':'builtin','print_endline':'builtin','true':'atom','false':'atom','raise':'keyword'}});e.defineMIME('text/x-fsharp',{name:'mllike',extraWords:{'abstract':'keyword','as':'keyword','assert':'keyword','base':'keyword','class':'keyword','default':'keyword','delegate':'keyword','downcast':'keyword','downto':'keyword','elif':'keyword','exception':'keyword','extern':'keyword','finally':'keyword','global':'keyword','inherit':'keyword','inline':'keyword','interface':'keyword','internal':'keyword','lazy':'keyword','let!':'keyword','member':'keyword','module':'keyword','namespace':'keyword','new':'keyword','null':'keyword','override':'keyword','private':'keyword','public':'keyword','return':'keyword','return!':'keyword','select':'keyword','static':'keyword','struct':'keyword','upcast':'keyword','use':'keyword','use!':'keyword','val':'keyword','when':'keyword','yield':'keyword','yield!':'keyword','List':'builtin','Seq':'builtin','Map':'builtin','Set':'builtin','int':'builtin','string':'builtin','raise':'builtin','failwith':'builtin','not':'builtin','true':'builtin','false':'builtin'},slashComments:!0})}); -/* ./modules/editor/codemirror/mode/rst/rst.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../python/python'),require('../stex/stex'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../python/python','../stex/stex','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('rst',function(t,a){var c=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,n=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,r=/^``[^`\s](?:[^`]*[^`\s])``/,m=/^(?:[\d]+(?:[\.,]\d+)*)/,o=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,f='[Hh][Tt][Tt][Pp][Ss]?://',h='(?:[\\d\\w.-]+)\\.(?:\\w{2,6})',p='(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*',i=new RegExp('^'+f+h+p),u={token:function(e){if(e.match(c)&&e.match(/\W+|$/,!1))return'strong';if(e.match(n)&&e.match(/\W+|$/,!1))return'em';if(e.match(r)&&e.match(/\W+|$/,!1))return'string-2';if(e.match(m))return'number';if(e.match(o))return'positive';if(e.match(s))return'negative';if(e.match(i))return'link';while(e.next()!=null){if(e.match(c,!1))break;if(e.match(n,!1))break;if(e.match(r,!1))break;if(e.match(m,!1))break;if(e.match(o,!1))break;if(e.match(s,!1))break;if(e.match(i,!1))break};return null}};var l=e.getMode(t,a.backdrop||'rst-base');return e.overlayMode(l,u,!0)},'python','stex');e.defineMode('rst-base',function(r){function n(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,a){return typeof t[a]!='undefined'?t[a]:e})};var b=e.getMode(r,'python'),w=e.getMode(r,'stex'),y='\\s+',m='(?:\\s*|\\W|$)',v=new RegExp(n('^{0}',m)),k='(?:[^\\W\\d_](?:[\\w!"#$%&\'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)',S=new RegExp(n('^{0}',k)),j='(?:[^\\W\\d_](?:[\\w\\s!"#$%&\'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)',o=n('(?:{0}|`{1}`)',k,j),M='(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)',g='(?:[^\\`]+)',W=new RegExp(n('^{0}',g)),A=new RegExp('^([!\'#$%&"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$'),C=new RegExp(n('^\\.\\.{0}',y)),E=new RegExp(n('^_{0}:{1}|^__:{1}',o,m)),x=new RegExp(n('^{0}::{1}',o,m)),u=new RegExp(n('^\\|{0}\\|{1}{2}::{3}',M,y,o,m)),H=new RegExp(n('^\\[(?:\\d+|#{0}?|\\*)]{1}',o,m)),P=new RegExp(n('^\\[{0}\\]{1}',o,m)),R=new RegExp(n('^\\|{0}\\|',M)),ee=new RegExp(n('^\\[(?:\\d+|#{0}?|\\*)]_',o)),te=new RegExp(n('^\\[{0}\\]_',o)),ae=new RegExp(n('^{0}__?',o)),p=new RegExp(n('^`{0}`_',g)),i=new RegExp(n('^:{0}:`{1}`{2}',k,g,m)),l=new RegExp(n('^`{1}`:{0}:{2}',k,g,m)),d=new RegExp(n('^:{0}:{1}',k,m)),ce=new RegExp(n('^{0}',o)),ne=new RegExp(n('^::{0}',m)),T=new RegExp(n('^\\|{0}\\|',M)),re=new RegExp(n('^{0}',y)),me=new RegExp(n('^{0}',o)),oe=new RegExp(n('^::{0}',m)),se=new RegExp('^_'),ie=new RegExp(n('^{0}|_',o)),le=new RegExp(n('^:{0}',m)),fe=new RegExp('^::\\s*$'),he=new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');function a(n,r){var m=null;if(n.sol()&&n.match(he,!1)){t(r,q,{mode:b,local:e.startState(b)})} -else if(n.sol()&&n.match(C)){t(r,s);m='meta'} -else if(n.sol()&&n.match(A)){t(r,a);m='header'} -else if(h(r)==i||n.match(i,!1)){switch(f(r)){case 0:t(r,a,c(i,1));n.match(/^:/);m='meta';break;case 1:t(r,a,c(i,2));n.match(S);m='keyword';if(n.current().match(/^(?:math|latex)/)){r.tmp_stex=!0};break;case 2:t(r,a,c(i,3));n.match(/^:`/);m='meta';break;case 3:if(r.tmp_stex){r.tmp_stex=undefined;r.tmp={mode:w,local:e.startState(w)}};if(r.tmp){if(n.peek()=='`'){t(r,a,c(i,4));r.tmp=undefined;break};m=r.tmp.mode.token(n,r.tmp.local);break};t(r,a,c(i,4));n.match(W);m='string';break;case 4:t(r,a,c(i,5));n.match(/^`/);m='meta';break;case 5:t(r,a,c(i,6));n.match(v);break;default:t(r,a)}} -else if(h(r)==l||n.match(l,!1)){switch(f(r)){case 0:t(r,a,c(l,1));n.match(/^`/);m='meta';break;case 1:t(r,a,c(l,2));n.match(W);m='string';break;case 2:t(r,a,c(l,3));n.match(/^`:/);m='meta';break;case 3:t(r,a,c(l,4));n.match(S);m='keyword';break;case 4:t(r,a,c(l,5));n.match(/^:/);m='meta';break;case 5:t(r,a,c(l,6));n.match(v);break;default:t(r,a)}} -else if(h(r)==d||n.match(d,!1)){switch(f(r)){case 0:t(r,a,c(d,1));n.match(/^:/);m='meta';break;case 1:t(r,a,c(d,2));n.match(S);m='keyword';break;case 2:t(r,a,c(d,3));n.match(/^:/);m='meta';break;case 3:t(r,a,c(d,4));n.match(v);break;default:t(r,a)}} -else if(h(r)==R||n.match(R,!1)){switch(f(r)){case 0:t(r,a,c(R,1));n.match(T);m='variable-2';break;case 1:t(r,a,c(R,2));if(n.match(/^_?_?/))m='link';break;default:t(r,a)}} -else if(n.match(ee)){t(r,a);m='quote'} -else if(n.match(te)){t(r,a);m='quote'} -else if(n.match(ae)){t(r,a);if(!n.peek()||n.peek().match(/^\W$/)){m='link'}} -else if(h(r)==p||n.match(p,!1)){switch(f(r)){case 0:if(!n.peek()||n.peek().match(/^\W$/)){t(r,a,c(p,1))} -else{n.match(p)};break;case 1:t(r,a,c(p,2));n.match(/^`/);m='link';break;case 2:t(r,a,c(p,3));n.match(W);break;case 3:t(r,a,c(p,4));n.match(/^`_/);m='link';break;default:t(r,a)}} -else if(n.match(fe)){t(r,ue)} -else{if(n.next())t(r,a)};return m};function s(n,r){var m=null;if(h(r)==u||n.match(u,!1)){switch(f(r)){case 0:t(r,s,c(u,1));n.match(T);m='variable-2';break;case 1:t(r,s,c(u,2));n.match(re);break;case 2:t(r,s,c(u,3));n.match(me);m='keyword';break;case 3:t(r,s,c(u,4));n.match(oe);m='meta';break;default:t(r,a)}} -else if(h(r)==x||n.match(x,!1)){switch(f(r)){case 0:t(r,s,c(x,1));n.match(ce);m='keyword';if(n.current().match(/^(?:math|latex)/))r.tmp_stex=!0;else if(n.current().match(/^python/))r.tmp_py=!0;break;case 1:t(r,s,c(x,2));n.match(ne);m='meta';if(n.match(/^latex\s*$/)||r.tmp_stex){r.tmp_stex=undefined;t(r,q,{mode:w,local:e.startState(w)})};break;case 2:t(r,s,c(x,3));if(n.match(/^python\s*$/)||r.tmp_py){r.tmp_py=undefined;t(r,q,{mode:b,local:e.startState(b)})};break;default:t(r,a)}} -else if(h(r)==E||n.match(E,!1)){switch(f(r)){case 0:t(r,s,c(E,1));n.match(se);n.match(ie);m='link';break;case 1:t(r,s,c(E,2));n.match(le);m='meta';break;default:t(r,a)}} -else if(n.match(H)){t(r,a);m='quote'} -else if(n.match(P)){t(r,a);m='quote'} -else{n.eatSpace();if(n.eol()){t(r,a)} -else{n.skipToEnd();t(r,pe);m='comment'}};return m};function pe(e,t){return I(e,t,'comment')};function ue(e,t){return I(e,t,'meta')};function I(e,c,n){if(e.eol()||e.eatSpace()){e.skipToEnd();return n} -else{t(c,a);return null}};function q(e,c){if(c.ctx.mode&&c.ctx.local){if(e.sol()){if(!e.eatSpace())t(c,a);return null};return c.ctx.mode.token(e,c.ctx.local)};t(c,a);return null};function c(e,t,a,c){return{phase:e,stage:t,mode:a,local:c}};function t(e,t,a){e.tok=t;e.ctx=a||{}};function f(e){return e.ctx.stage||0};function h(e){return e.ctx.phase};return{startState:function(){return{tok:a,ctx:c(undefined,0)}},copyState:function(t){var a=t.ctx,c=t.tmp;if(a.local)a={mode:a.mode,local:e.copyState(a.mode,a.local)};if(c)c={mode:c.mode,local:e.copyState(c.mode,c.local)};return{tok:t.tok,ctx:a,tmp:c}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},'python','stex');e.defineMIME('text/x-rst','rst')}); -/* ./modules/editor/codemirror/mode/ntriples/ntriples.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ntriples',function(){var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};function i(t,r){var i=t.location,n;if(i==e.PRE_SUBJECT&&r=='<')n=e.WRITING_SUB_URI;else if(i==e.PRE_SUBJECT&&r=='_')n=e.WRITING_BNODE_URI;else if(i==e.PRE_PRED&&r=='<')n=e.WRITING_PRED_URI;else if(i==e.PRE_OBJ&&r=='<')n=e.WRITING_OBJ_URI;else if(i==e.PRE_OBJ&&r=='_')n=e.WRITING_OBJ_BNODE;else if(i==e.PRE_OBJ&&r=='"')n=e.WRITING_OBJ_LITERAL;else if(i==e.WRITING_SUB_URI&&r=='>')n=e.PRE_PRED;else if(i==e.WRITING_BNODE_URI&&r==' ')n=e.PRE_PRED;else if(i==e.WRITING_PRED_URI&&r=='>')n=e.PRE_OBJ;else if(i==e.WRITING_OBJ_URI&&r=='>')n=e.POST_OBJ;else if(i==e.WRITING_OBJ_BNODE&&r==' ')n=e.POST_OBJ;else if(i==e.WRITING_OBJ_LITERAL&&r=='"')n=e.POST_OBJ;else if(i==e.WRITING_LIT_LANG&&r==' ')n=e.POST_OBJ;else if(i==e.WRITING_LIT_TYPE&&r=='>')n=e.POST_OBJ;else if(i==e.WRITING_OBJ_LITERAL&&r=='@')n=e.WRITING_LIT_LANG;else if(i==e.WRITING_OBJ_LITERAL&&r=='^')n=e.WRITING_LIT_TYPE;else if(r==' '&&(i==e.PRE_SUBJECT||i==e.PRE_PRED||i==e.PRE_OBJ||i==e.POST_OBJ))n=i;else if(i==e.POST_OBJ&&r=='.')n=e.PRE_SUBJECT;else n=e.ERROR;t.location=n};return{startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,n){var r=e.next();if(r=='<'){i(n,r);var T='';e.eatWhile(function(e){if(e!='#'&&e!='>'){T+=e;return!0};return!1});n.uris.push(T);if(e.match('#',!1))return'variable';e.next();i(n,'>');return'variable'};if(r=='#'){var f='';e.eatWhile(function(e){if(e!='>'&&e!=' '){f+=e;return!0};return!1});n.anchors.push(f);return'variable-2'};if(r=='>'){i(n,'>');return'variable'};if(r=='_'){i(n,r);var R='';e.eatWhile(function(e){if(e!=' '){R+=e;return!0};return!1});n.bnodes.push(R);e.next();i(n,' ');return'builtin'};if(r=='"'){i(n,r);e.eatWhile(function(e){return e!='"'});e.next();if(e.peek()!='@'&&e.peek()!='^'){i(n,'"')};return'string'};if(r=='@'){i(n,'@');var I='';e.eatWhile(function(e){if(e!=' '){I+=e;return!0};return!1});n.langs.push(I);e.next();i(n,' ');return'string-2'};if(r=='^'){e.next();i(n,'^');var t='';e.eatWhile(function(e){if(e!='>'){t+=e;return!0};return!1});n.types.push(t);e.next();i(n,'>');return'variable'};if(r==' '){i(n,r)};if(r=='.'){i(n,r)}}}});e.defineMIME('application/n-triples','ntriples');e.defineMIME('application/n-quads','ntriples');e.defineMIME('text/n-triples','ntriples')}); -/* ./modules/editor/codemirror/mode/sparql/sparql.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sparql',function(e){var l=e.indentUnit,t;function o(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var s=o(['str','lang','langmatches','datatype','bound','sameterm','isiri','isuri','iri','uri','bnode','count','sum','min','max','avg','sample','group_concat','rand','abs','ceil','floor','round','concat','substr','strlen','replace','ucase','lcase','encode_for_uri','contains','strstarts','strends','strbefore','strafter','year','month','day','hours','minutes','seconds','timezone','tz','now','uuid','struuid','md5','sha1','sha256','sha384','sha512','coalesce','if','strlang','strdt','isnumeric','regex','exists','isblank','isliteral','a','bind']),c=o(['base','prefix','select','distinct','reduced','construct','describe','ask','from','named','where','order','limit','offset','filter','optional','graph','by','asc','desc','as','having','undef','values','group','minus','in','not','service','silent','using','insert','delete','union','true','false','with','data','copy','to','move','add','create','drop','clear','load']),i=/[*+\-<>=&|\^\/!\?]/;function a(e,r){var n=e.next();t=null;if(n=='$'||n=='?'){if(n=='?'&&e.match(/\s/,!1)){return'operator'};e.match(/^[\w\d]*/);return'variable-2'} -else if(n=='<'&&!e.match(/^[\s\u00a0=]/,!1)){e.match(/^[^\s\u00a0>]*>?/);return'atom'} -else if(n=='"'||n=='\''){r.tokenize=u(n);return r.tokenize(e,r)} -else if(/[{}\(\),\.;\[\]]/.test(n)){t=n;return'bracket'} -else if(n=='#'){e.skipToEnd();return'comment'} -else if(i.test(n)){e.eatWhile(i);return'operator'} -else if(n==':'){e.eatWhile(/[\w\d\._\-]/);return'atom'} -else if(n=='@'){e.eatWhile(/[a-z\d\-]/i);return'meta'} -else{e.eatWhile(/[_\w\d]/);if(e.eat(':')){e.eatWhile(/[\w\d_\-]/);return'atom'};var o=e.current();if(s.test(o))return'builtin';else if(c.test(o))return'keyword';else return'variable'}};function u(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=a;break};r=!r&&i=='\\'};return'string'}};function n(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}};function r(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:a,context:null,indent:0,col:0}},token:function(i,e){if(i.sol()){if(e.context&&e.context.align==null)e.context.align=!1;e.indent=i.indentation()};if(i.eatSpace())return null;var o=e.tokenize(i,e);if(o!='comment'&&e.context&&e.context.align==null&&e.context.type!='pattern'){e.context.align=!0};if(t=='(')n(e,')',i.column());else if(t=='[')n(e,']',i.column());else if(t=='{')n(e,'}',i.column());else if(/[\]\}\)]/.test(t)){while(e.context&&e.context.type=='pattern')r(e);if(e.context&&t==e.context.type){r(e);if(t=='}'&&e.context&&e.context.type=='pattern')r(e)}} -else if(t=='.'&&e.context&&e.context.type=='pattern')r(e);else if(/atom|string|variable/.test(o)&&e.context){if(/[\}\]]/.test(e.context.type))n(e,'pattern',i.column());else if(e.context.type=='pattern'&&!e.context.align){e.context.align=!0;e.context.col=i.column()}};return o},indent:function(t,n){var i=n&&n.charAt(0),e=t.context;if(/[\]\}]/.test(i))while(e&&e.type=='pattern')e=e.prev;var r=e&&i==e.type;if(!e)return 0;else if(e.type=='pattern')return e.col;else if(e.align)return e.col+(r?0:1);else return e.indent+(r?0:l)},lineComment:'#'}});e.defineMIME('application/sparql-query','sparql')}); -/* ./modules/editor/codemirror/mode/properties/properties.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('properties',function(){return{token:function(i,e){var n=i.sol()||e.afterSection,o=i.eol();e.afterSection=!1;if(n){if(e.nextMultiline){e.inMultiline=!0;e.nextMultiline=!1} -else{e.position='def'}};if(o&&!e.nextMultiline){e.inMultiline=!1;e.position='def'};if(n){while(i.eatSpace()){}};var t=i.next();if(n&&(t==='#'||t==='!'||t===';')){e.position='comment';i.skipToEnd();return'comment'} -else if(n&&t==='['){e.afterSection=!0;i.skipTo(']');i.eat(']');return'header'} -else if(t==='='||t===':'){e.position='quote';return null} -else if(t==='\\'&&e.position==='quote'){if(i.eol()){e.nextMultiline=!0}};return e.position},startState:function(){return{position:'def',nextMultiline:!1,inMultiline:!1,afterSection:!1}}}});e.defineMIME('text/x-properties','properties');e.defineMIME('text/x-ini','properties')}); -/* ./modules/editor/codemirror/mode/rpm/rpm.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('rpm-changes',function(){var e=/^-+$/,r=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,t=/^[\w+.-]+@[\w.-]+/;return{token:function(n){if(n.sol()){if(n.match(e)){return'tag'};if(n.match(r)){return'tag'}};if(n.match(t)){return'string'};n.next();return null}}});e.defineMIME('text/x-rpm-changes','rpm-changes');e.defineMode('rpm-spec',function(){var e=/^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,r=/^[a-zA-Z0-9()]+:/,t=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/,n=/^%(ifnarch|ifarch|if)/,i=/^%(else|endif)/,o=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(a,c){var f=a.peek();if(f=='#'){a.skipToEnd();return'comment'};if(a.sol()){if(a.match(r)){return'header'};if(a.match(t)){return'atom'}};if(a.match(/^\$\w+/)){return'def'};if(a.match(/^\$\{\w+\}/)){return'def'};if(a.match(i)){return'keyword'};if(a.match(n)){c.controlFlow=!0;return'keyword'};if(c.controlFlow){if(a.match(o)){return'operator'};if(a.match(/^(\d+)/)){return'number'};if(a.eol()){c.controlFlow=!1}};if(a.match(e)){if(a.eol()){c.controlFlow=!1};return'number'};if(a.match(/^%[\w]+/)){if(a.match(/^\(/)){c.macroParameters=!0};return'keyword'};if(c.macroParameters){if(a.match(/^\d+/)){return'number'};if(a.match(/^\)/)){c.macroParameters=!1;return'keyword'}};if(a.match(/^%\{\??[\w \-\:\!]+\}/)){if(a.eol()){c.controlFlow=!1};return'def'};a.next();return null}}});e.defineMIME('text/x-rpm-spec','rpm-spec')}); -/* ./modules/editor/codemirror/mode/htmlmixed/htmlmixed.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../xml/xml'),require('../javascript/javascript'),require('../css/css'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../xml/xml','../javascript/javascript','../css/css'],t);else t(CodeMirror)})(function(t){'use strict';var l={script:[['lang',/(javascript|babel)/i,'javascript'],['type',/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,'javascript'],['type',/./,'text/plain'],[null,null,'javascript']],style:[['lang',/^css$/i,'css'],['type',/^(text\/)?(x-)?(stylesheet|css)$/i,'css'],['type',/./,'text/plain'],[null,null,'css']]};function r(t,e,n){var a=t.current(),l=a.search(e);if(l>-1){t.backUp(a.length-l)} -else if(a.match(/<\/?$/)){t.backUp(a.length);if(!t.match(e,!1))t.match(a)};return n};var e={};function i(t){var a=e[t];if(a)return a;return e[t]=new RegExp('\\s+'+t+'\\s*=\\s*(\'|")?([^\'"]+)(\'|")?\\s*')};function o(t,e){var a=t.match(i(e));return a?/^\s*(.*?)\s*$/.exec(a[2])[1]:''};function a(t,e){return new RegExp((e?'^':'')+'<\/\s*'+t+'\s*>','i')};function n(t,e){for(var n in t){var r=e[n]||(e[n]=[]),l=t[n];for(var a=l.length-1;a>=0;a--)r.unshift(l[a])}};function c(t,e){for(var n=0;n<t.length;n++){var a=t[n];if(!a[0]||a[1].test(o(e,a[0])))return a[2]}};t.defineMode('htmlmixed',function(e,i){var o=t.getMode(e,{name:'xml',htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag});var s={};var m=i&&i.tags,f=i&&i.scriptTypes;n(l,s);if(m)n(m,s);if(f)for(var u=f.length-1;u>=0;u--)s.script.unshift(['type',f[u].matches,f[u].mode]);function d(l,n){var m=o.token(l,n.htmlState),p=/\btag\b/.test(m),u;if(p&&!/[<>\s\/]/.test(l.current())&&(u=n.htmlState.tagName&&n.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(u)){n.inTag=u+' '} -else if(n.inTag&&p&&/>$/.test(l.current())){var i=/^([\S]+) (.*)/.exec(n.inTag);n.inTag=null;var g=l.current()=='>'&&c(s[i[1]],i[2]),f=t.getMode(e,g),h=a(i[1],!0),v=a(i[1],!1);n.token=function(t,e){if(t.match(h,!1)){e.token=d;e.localState=e.localMode=null;return null};return r(t,v,e.localMode.token(t,e.localState))};n.localMode=f;n.localState=t.startState(f,o.indent(n.htmlState,''))} -else if(n.inTag){n.inTag+=l.current();if(l.eol())n.inTag+=' '};return m};return{startState:function(){var e=t.startState(o);return{token:d,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(e){var a;if(e.localState){a=t.copyState(e.localMode,e.localState)};return{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:a,htmlState:t.copyState(o,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,a,n){if(!e.localMode||/^\s*<\//.test(a))return o.indent(e.htmlState,a);else if(e.localMode.indent)return e.localMode.indent(e.localState,a,n);else return t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||o}}}},'xml','javascript','css');t.defineMIME('text/html','htmlmixed')}); -/* ./modules/editor/codemirror/mode/xml/xml.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var r={autoSelfClosers:{'area':!0,'base':!0,'br':!0,'col':!0,'command':!0,'embed':!0,'frame':!0,'hr':!0,'img':!0,'input':!0,'keygen':!0,'link':!0,'meta':!0,'param':!0,'source':!0,'track':!0,'wbr':!0,'menuitem':!0},implicitlyClosed:{'dd':!0,'li':!0,'optgroup':!0,'option':!0,'p':!0,'rp':!0,'rt':!0,'tbody':!0,'td':!0,'tfoot':!0,'th':!0,'tr':!0},contextGrabbers:{'dd':{'dd':!0,'dt':!0},'dt':{'dd':!0,'dt':!0},'li':{'li':!0},'option':{'option':!0,'optgroup':!0},'optgroup':{'optgroup':!0},'p':{'address':!0,'article':!0,'aside':!0,'blockquote':!0,'dir':!0,'div':!0,'dl':!0,'fieldset':!0,'footer':!0,'form':!0,'h1':!0,'h2':!0,'h3':!0,'h4':!0,'h5':!0,'h6':!0,'header':!0,'hgroup':!0,'hr':!0,'menu':!0,'nav':!0,'ol':!0,'p':!0,'pre':!0,'section':!0,'table':!0,'ul':!0},'rp':{'rp':!0,'rt':!0},'rt':{'rp':!0,'rt':!0},'tbody':{'tbody':!0,'tfoot':!0},'td':{'td':!0,'th':!0},'tfoot':{'tbody':!0},'th':{'td':!0,'th':!0},'thead':{'tbody':!0,'tfoot':!0},'tr':{'tr':!0}},doNotIndent:{'pre':!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0};var t={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode('xml',function(n,i){var c=n.indentUnit,o={};var x=i.htmlMode?r:t;for(var f in x)o[f]=x[f];for(var f in i)o[f]=i[f];var s,a;function l(e,t){function n(r){t.tokenize=r;return r(e,t)};var i=e.next();if(i=='<'){if(e.eat('!')){if(e.eat('[')){if(e.match('CDATA['))return n(g('atom',']]>'));else return null} -else if(e.match('--')){return n(g('comment','-->'))} -else if(e.match('DOCTYPE',!0,!0)){e.eatWhile(/[\w\._\-]/);return n(h(1))} -else{return null}} -else if(e.eat('?')){e.eatWhile(/[\w\._\-]/);t.tokenize=g('meta','?>');return'meta'} -else{s=e.eat('/')?'closeTag':'openTag';t.tokenize=m;return'tag bracket'}} -else if(i=='&'){var r;if(e.eat('#')){if(e.eat('x')){r=e.eatWhile(/[a-fA-F\d]/)&&e.eat(';')} -else{r=e.eatWhile(/[\d]/)&&e.eat(';')}} -else{r=e.eatWhile(/[\w\.\-:]/)&&e.eat(';')};return r?'atom':'error'} -else{e.eatWhile(/[^&<]/);return null}};l.isInText=!0;function m(e,t){var r=e.next();if(r=='>'||(r=='/'&&e.eat('>'))){t.tokenize=l;s=r=='>'?'endTag':'selfcloseTag';return'tag bracket'} -else if(r=='='){s='equals';return null} -else if(r=='<'){t.tokenize=l;t.state=d;t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+' tag error':'tag error'} -else if(/['"]/.test(r)){t.tokenize=N(r);t.stringStartCol=e.column();return t.tokenize(e,t)} -else{e.match(/^[^\s\u00a0=<>"']*[^\s\u00a0=<>"'\/]/);return'word'}};function N(e){var t=function(t,r){while(!t.eol()){if(t.next()==e){r.tokenize=m;break}};return'string'};t.isInAttribute=!0;return t};function g(e,t){return function(r,n){while(!r.eol()){if(r.match(t)){n.tokenize=l;break};r.next()};return e}};function h(e){return function(t,r){var n;while((n=t.next())!=null){if(n=='<'){r.tokenize=h(e+1);return r.tokenize(t,r)} -else if(n=='>'){if(e==1){r.tokenize=l;break} -else{r.tokenize=h(e-1);return r.tokenize(t,r)}}};return'meta'}};function T(e,t,r){this.prev=e.context;this.tagName=t;this.indent=e.indented;this.startOfLine=r;if(o.doNotIndent.hasOwnProperty(t)||(e.context&&e.context.noIndent))this.noIndent=!0};function p(e){if(e.context)e.context=e.context.prev};function k(e,t){var r;while(!0){if(!e.context){return};r=e.context.tagName;if(!o.contextGrabbers.hasOwnProperty(r)||!o.contextGrabbers[r].hasOwnProperty(t)){return};p(e)}};function d(e,t,r){if(e=='openTag'){r.tagStart=t.column();return w} -else if(e=='closeTag'){return C} -else{return d}};function w(e,t,r){if(e=='word'){r.tagName=t.current();a='tag';return u} -else{a='error';return w}};function C(e,t,r){if(e=='word'){var n=t.current();if(r.context&&r.context.tagName!=n&&o.implicitlyClosed.hasOwnProperty(r.context.tagName))p(r);if((r.context&&r.context.tagName==n)||o.matchClosing===!1){a='tag';return b} -else{a='tag error';return v}} -else{a='error';return v}};function b(e,t,r){if(e!='endTag'){a='error';return b};p(r);return d};function v(e,t,r){a='error';return b(e,t,r)};function u(e,t,r){if(e=='word'){a='attribute';return I} -else if(e=='endTag'||e=='selfcloseTag'){var n=r.tagName,i=r.tagStart;r.tagName=r.tagStart=null;if(e=='selfcloseTag'||o.autoSelfClosers.hasOwnProperty(n)){k(r,n)} -else{k(r,n);r.context=new T(r,n,i==r.indented)};return d};a='error';return u};function I(e,t,r){if(e=='equals')return y;if(!o.allowMissing)a='error';return u(e,t,r)};function y(e,t,r){if(e=='string')return z;if(e=='word'&&o.allowUnquoted){a='string';return u};a='error';return u(e,t,r)};function z(e,t,r){if(e=='string')return z;return u(e,t,r)};return{startState:function(e){var t={tokenize:l,state:d,indented:e||0,tagName:null,tagStart:null,context:null};if(e!=null)t.baseIndent=e;return t},token:function(e,t){if(!t.tagName&&e.sol())t.indented=e.indentation();if(e.eatSpace())return null;s=null;var r=t.tokenize(e,t);if((r||s)&&r!='comment'){a=null;t.state=t.state(s||r,e,t);if(a)r=a=='error'?r+' error':a};return r},indent:function(t,r,i){var n=t.context;if(t.tokenize.isInAttribute){if(t.tagStart==t.indented)return t.stringStartCol+1;else return t.indented+c};if(n&&n.noIndent)return e.Pass;if(t.tokenize!=m&&t.tokenize!=l)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName){if(o.multilineTagIndentPastTag!==!1)return t.tagStart+t.tagName.length+2;else return t.tagStart+c*(o.multilineTagIndentFactor||1)};if(o.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var a=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(a&&a[1]){while(n){if(n.tagName==a[2]){n=n.prev;break} -else if(o.implicitlyClosed.hasOwnProperty(n.tagName)){n=n.prev} -else{break}}} -else if(a){while(n){var u=o.contextGrabbers[n.tagName];if(u&&u.hasOwnProperty(a[2]))n=n.prev;else break}} -while(n&&n.prev&&!n.startOfLine)n=n.prev;if(n)return n.indent+c;else return t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:'<!--',blockCommentEnd:'-->',configuration:o.htmlMode?'html':'xml',helperType:o.htmlMode?'html':'xml',skipAttribute:function(e){if(e.state==y)e.state=u}}});e.defineMIME('text/xml','xml');e.defineMIME('application/xml','xml');if(!e.mimeModes.hasOwnProperty('text/html'))e.defineMIME('text/html',{name:'xml',htmlMode:!0})}); -/* ./modules/editor/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ttcn-cfg',function(e,n){var C=e.indentUnit,N=n.keywords||{},o=n.fileNCtrlMaskOptions||{},I=n.externalCommands||{},l=n.multiLineStrings,A=n.indentStatements!==!1;var i=/[\|]/,t;function U(e,T){var n=e.next();if(n=='"'||n=='\''){T.tokenize=O(n);return T.tokenize(e,T)};if(/[:=]/.test(n)){t=n;return'punctuation'};if(n=='#'){e.skipToEnd();return'comment'};if(/\d/.test(n)){e.eatWhile(/[\w\.]/);return'number'};if(i.test(n)){e.eatWhile(i);return'operator'};if(n=='['){e.eatWhile(/[\w_\]]/);return'number sectionTitle'};e.eatWhile(/[\w\$_]/);var E=e.current();if(N.propertyIsEnumerable(E))return'keyword';if(o.propertyIsEnumerable(E))return'negative fileNCtrlMaskOptions';if(I.propertyIsEnumerable(E))return'negative externalCommands';return'variable'};function O(e){return function(t,n){var E=!1,i,r=!1;while((i=t.next())!=null){if(i==e&&!E){var T=t.peek();if(T){T=T.toLowerCase();if(T=='b'||T=='h'||T=='o')t.next()};r=!0;break};E=!E&&i=='\\'};if(r||!(E||l))n.tokenize=null;return'string'}};function r(e,t,n,T,E){this.indented=e;this.column=t;this.type=n;this.align=T;this.prev=E};function E(e,t,n){var T=e.indented;if(e.context&&e.context.type=='statement')T=e.context.indented;return e.context=new r(T,t,n,null,e.context)};function T(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new r((e||0)-C,0,'top',!1),indented:0,startOfLine:!0}},token:function(n,e){var i=e.context;if(n.sol()){if(i.align==null)i.align=!1;e.indented=n.indentation();e.startOfLine=!0};if(n.eatSpace())return null;t=null;var r=(e.tokenize||U)(n,e);if(r=='comment')return r;if(i.align==null)i.align=!0;if((t==';'||t==':'||t==',')&&i.type=='statement'){T(e)} -else if(t=='{')E(e,n.column(),'}');else if(t=='[')E(e,n.column(),']');else if(t=='(')E(e,n.column(),')');else if(t=='}'){while(i.type=='statement')i=T(e);if(i.type=='}')i=T(e);while(i.type=='statement')i=T(e)} -else if(t==i.type)T(e);else if(A&&(((i.type=='}'||i.type=='top')&&t!=';')||(i.type=='statement'&&t=='newstatement')))E(e,n.column(),'statement');e.startOfLine=!1;return r},electricChars:'{}',lineComment:'#',fold:'brace'}});function t(e){var n={},T=e.split(' ');for(var t=0;t<T.length;++t)n[T[t]]=!0;return n};e.defineMIME('text/x-ttcn-cfg',{name:'ttcn-cfg',keywords:t('Yes No LogFile FileMask ConsoleMask AppendFile TimeStampFormat LogEventTypes SourceInfoFormat LogEntityName LogSourceInfo DiskFullAction LogFileNumber LogFileSize MatchingHints Detailed Compact SubCategories Stack Single None Seconds DateTime Time Stop Error Retry Delete TCPPort KillTimer NumHCs UnixSocketsEnabled LocalAddress'),fileNCtrlMaskOptions:t('TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION TTCN_USER TTCN_FUNCTION TTCN_STATISTICS TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG EXECUTOR ERROR WARNING PORTEVENT TIMEROP VERDICTOP DEFAULTOP TESTCASE ACTION USER FUNCTION STATISTICS PARALLEL MATCHING DEBUG LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED DEBUG_ENCDEC DEBUG_TESTPORT DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED FUNCTION_RND FUNCTION_UNQUALIFIED MATCHING_DONE MATCHING_MCSUCCESS MATCHING_MCUNSUCC MATCHING_MMSUCCESS MATCHING_MMUNSUCC MATCHING_PCSUCCESS MATCHING_PCUNSUCC MATCHING_PMSUCCESS MATCHING_PMUNSUCC MATCHING_PROBLEM MATCHING_TIMEOUT MATCHING_UNQUALIFIED PARALLEL_PORTCONN PARALLEL_PORTMAP PARALLEL_PTC PARALLEL_UNQUALIFIED PORTEVENT_DUALRECV PORTEVENT_DUALSEND PORTEVENT_MCRECV PORTEVENT_MCSEND PORTEVENT_MMRECV PORTEVENT_MMSEND PORTEVENT_MQUEUE PORTEVENT_PCIN PORTEVENT_PCOUT PORTEVENT_PMIN PORTEVENT_PMOUT PORTEVENT_PQUEUE PORTEVENT_STATE PORTEVENT_UNQUALIFIED STATISTICS_UNQUALIFIED STATISTICS_VERDICT TESTCASE_FINISH TESTCASE_START TESTCASE_UNQUALIFIED TIMEROP_GUARD TIMEROP_READ TIMEROP_START TIMEROP_STOP TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED USER_UNQUALIFIED VERDICTOP_FINAL VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED'),externalCommands:t('BeginControlPart EndControlPart BeginTestCase EndTestCase'),multiLineStrings:!0})}); -/* ./modules/editor/codemirror/mode/ttcn/ttcn.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ttcn',function(t,e){var l=t.indentUnit,c=e.keywords||{},u=e.builtin||{},p=e.timerOps||{},f=e.portOps||{},d=e.configOps||{},m=e.verdictOps||{},b=e.sutOps||{},h=e.functionOps||{},y=e.verdictConsts||{},v=e.booleanConsts||{},x=e.otherConsts||{},g=e.types||{},k=e.visibilityModifiers||{},O=e.templateMatch||{},w=e.multiLineStrings,E=e.indentStatements!==!1;var o=/[+\-*&@=<>!\/]/,n;function C(e,r){var i=e.next();if(i=='"'||i=='\''){r.tokenize=I(i);return r.tokenize(e,r)};if(/[\[\]{}\(\),;\\:\?\.]/.test(i)){n=i;return'punctuation'};if(i=='#'){e.skipToEnd();return'atom preprocessor'};if(i=='%'){e.eatWhile(/\b/);return'atom ttcn3Macros'};if(/\d/.test(i)){e.eatWhile(/[\w\.]/);return'number'};if(i=='/'){if(e.eat('*')){r.tokenize=s;return s(e,r)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(o.test(i)){if(i=='@'){if(e.match('try')||e.match('catch')||e.match('lazy')){return'keyword'}};e.eatWhile(o);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var t=e.current();if(c.propertyIsEnumerable(t))return'keyword';if(u.propertyIsEnumerable(t))return'builtin';if(p.propertyIsEnumerable(t))return'def timerOps';if(d.propertyIsEnumerable(t))return'def configOps';if(m.propertyIsEnumerable(t))return'def verdictOps';if(f.propertyIsEnumerable(t))return'def portOps';if(b.propertyIsEnumerable(t))return'def sutOps';if(h.propertyIsEnumerable(t))return'def functionOps';if(y.propertyIsEnumerable(t))return'string verdictConsts';if(v.propertyIsEnumerable(t))return'string booleanConsts';if(x.propertyIsEnumerable(t))return'string otherConsts';if(g.propertyIsEnumerable(t))return'builtin types';if(k.propertyIsEnumerable(t))return'builtin visibilityModifiers';if(O.propertyIsEnumerable(t))return'atom templateMatch';return'variable'};function I(e){return function(t,n){var i=!1,o,s=!1;while((o=t.next())!=null){if(o==e&&!i){var r=t.peek();if(r){r=r.toLowerCase();if(r=='b'||r=='h'||r=='o')t.next()};s=!0;break};i=!i&&o=='\\'};if(s||!(i||w))n.tokenize=null;return'string'}};function s(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='*')};return'comment'};function a(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function i(e,t,n){var r=e.indented;if(e.context&&e.context.type=='statement')r=e.context.indented;return e.context=new a(r,t,n,null,e.context)};function r(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new a((e||0)-l,0,'top',!1),indented:0,startOfLine:!0}},token:function(e,t){var o=t.context;if(e.sol()){if(o.align==null)o.align=!1;t.indented=e.indentation();t.startOfLine=!0};if(e.eatSpace())return null;n=null;var s=(t.tokenize||C)(e,t);if(s=='comment')return s;if(o.align==null)o.align=!0;if((n==';'||n==':'||n==',')&&o.type=='statement'){r(t)} -else if(n=='{')i(t,e.column(),'}');else if(n=='[')i(t,e.column(),']');else if(n=='(')i(t,e.column(),')');else if(n=='}'){while(o.type=='statement')o=r(t);if(o.type=='}')o=r(t);while(o.type=='statement')o=r(t)} -else if(n==o.type)r(t);else if(E&&(((o.type=='}'||o.type=='top')&&n!=';')||(o.type=='statement'&&n=='newstatement')))i(t,e.column(),'statement');t.startOfLine=!1;return s},electricChars:'{}',blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:'//',fold:'brace'}});function t(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};function n(t,n){if(typeof t=='string')t=[t];var o=[];function r(e){if(e)for(var t in e)if(e.hasOwnProperty(t))o.push(t)};r(n.keywords);r(n.builtin);r(n.timerOps);r(n.portOps);if(o.length){n.helperType=t[0];e.registerHelper('hintWords',t[0],o)};for(var i=0;i<t.length;++i)e.defineMIME(t[i],n)};n(['text/x-ttcn','text/x-ttcn3','text/x-ttcnpp'],{name:'ttcn',keywords:t('activate address alive all alt altstep and and4b any break case component const continue control deactivate display do else encode enumerated except exception execute extends extension external for from function goto group if import in infinity inout interleave label language length log match message mixed mod modifies module modulepar mtc noblock not not4b nowait of on optional or or4b out override param pattern port procedure record recursive rem repeat return runs select self sender set signature system template testcase to type union value valueof var variant while with xor xor4b'),builtin:t('bit2hex bit2int bit2oct bit2str char2int char2oct encvalue decomp decvalue float2int float2str hex2bit hex2int hex2oct hex2str int2bit int2char int2float int2hex int2oct int2str int2unichar isbound ischosen ispresent isvalue lengthof log2str oct2bit oct2char oct2hex oct2int oct2str regexp replace rnd sizeof str2bit str2float str2hex str2int str2oct substr unichar2int unichar2char enum2int'),types:t('anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer'),timerOps:t('read running start stop timeout'),portOps:t('call catch check clear getcall getreply halt raise receive reply send trigger'),configOps:t('create connect disconnect done kill killed map unmap'),verdictOps:t('getverdict setverdict'),sutOps:t('action'),functionOps:t('apply derefers refers'),verdictConsts:t('error fail inconc none pass'),booleanConsts:t('true false'),otherConsts:t('null NULL omit'),visibilityModifiers:t('private public friend'),templateMatch:t('complement ifpresent subset superset permutation'),multiLineStrings:!0})}); -/* ./modules/editor/codemirror/mode/z80/z80.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('z80',function(e,i){var l=i.ez80,t,r;if(l){t=/^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i;r=/^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i} -else{t=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i;r=/^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i};var s=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,o=/^(n?[zc]|p[oe]?|m)\b/i,c=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,n=/^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;return{startState:function(){return{context:0}},token:function(e,i){if(!e.column())i.context=0;if(e.eatSpace())return null;var a;if(e.eatWhile(/\w/)){if(l&&e.eat('.')){e.eatWhile(/\w/)};a=e.current();if(e.indentation()){if((i.context==1||i.context==4)&&s.test(a)){i.context=4;return'var2'};if(i.context==2&&o.test(a)){i.context=4;return'var3'};if(t.test(a)){i.context=1;return'keyword'} -else if(r.test(a)){i.context=2;return'keyword'} -else if(i.context==4&&n.test(a)){return'number'};if(c.test(a))return'error'} -else if(e.match(n)){return'number'} -else{return null}} -else if(e.eat(';')){e.skipToEnd();return'comment'} -else if(e.eat('"')){while(a=e.next()){if(a=='"')break;if(a=='\\')e.next()};return'string'} -else if(e.eat('\'')){if(e.match(/\\?.'/))return'number'} -else if(e.eat('.')||e.sol()&&e.eat('#')){i.context=5;if(e.eatWhile(/\w/))return'def'} -else if(e.eat('$')){if(e.eatWhile(/[\da-f]/i))return'number'} -else if(e.eat('%')){if(e.eatWhile(/[01]/))return'number'} -else{e.next()};return null}}});e.defineMIME('text/x-z80','z80');e.defineMIME('text/x-ez80',{name:'z80',ez80:!0})}); -/* ./modules/editor/codemirror/mode/brainfuck/brainfuck.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var n='><+-.,[]'.split('');e.defineMode('brainfuck',function(){return{startState:function(){return{commentLine:!1,left:0,right:0,commentLoop:!1}},token:function(t,i){if(t.eatSpace())return null;if(t.sol()){i.commentLine=!1};var e=t.next().toString();if(n.indexOf(e)!==-1){if(i.commentLine===!0){if(t.eol()){i.commentLine=!1};return'comment'};if(e===']'||e==='['){if(e==='['){i.left++} -else{i.right++};return'bracket'} -else if(e==='+'||e==='-'){return'keyword'} -else if(e==='<'||e==='>'){return'atom'} -else if(e==='.'||e===','){return'def'}} -else{i.commentLine=!0;if(t.eol()){i.commentLine=!1};return'comment'};if(t.eol()){i.commentLine=!1}}}});e.defineMIME('text/x-brainfuck','brainfuck')}); -/* ./modules/editor/codemirror/mode/forth/forth.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';function e(t){var e=[];t.split(' ').forEach(function(t){e.push({name:t})});return e};var E=e('INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL'),i=e('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE');t.defineMode('forth',function(){function t(t,E){var e;for(e=t.length-1;e>=0;e--){if(t[e].name===E.toUpperCase()){return t[e]}};return undefined};return{startState:function(){return{state:'',base:10,coreWordList:E,immediateWordList:i,wordList:[]}},token:function(e,E){var i;if(e.eatSpace()){return null};if(E.state===''){if(e.match(/^(\]|:NONAME)(\s|$)/i)){E.state=' compilation';return'builtin compilation'};i=e.match(/^(\:)\s+(\S+)(\s|$)+/);if(i){E.wordList.push({name:i[2].toUpperCase()});E.state=' compilation';return'def'+E.state};i=e.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i);if(i){E.wordList.push({name:i[2].toUpperCase()});return'def'+E.state};i=e.match(/^('|\['\])\s+(\S+)(\s|$)+/);if(i){return'builtin'+E.state}} -else{if(e.match(/^(\;|\[)(\s)/)){E.state='';e.backUp(1);return'builtin compilation'};if(e.match(/^(\;|\[)($)/)){E.state='';return'builtin compilation'};if(e.match(/^(POSTPONE)\s+\S+(\s|$)+/)){return'builtin'}};i=e.match(/^(\S+)(\s+|$)/);if(i){if(t(E.wordList,i[1])!==undefined){return'variable'+E.state};if(i[1]==='\\'){e.skipToEnd();return'comment'+E.state};if(t(E.coreWordList,i[1])!==undefined){return'builtin'+E.state};if(t(E.immediateWordList,i[1])!==undefined){return'keyword'+E.state};if(i[1]==='('){e.eatWhile(function(t){return t!==')'});e.eat(')');return'comment'+E.state};if(i[1]==='.('){e.eatWhile(function(t){return t!==')'});e.eat(')');return'string'+E.state};if(i[1]==='S"'||i[1]==='."'||i[1]==='C"'){e.eatWhile(function(t){return t!=='"'});e.eat('"');return'string'+E.state};if(i[1]-0xfffffffff){return'number'+E.state};return'atom'+E.state}}}});t.defineMIME('text/x-forth','forth')}); -/* ./modules/editor/codemirror/mode/nginx/nginx.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('nginx',function(e){function s(e){var i={},r=e.split(' ');for(var t=0;t<r.length;++t)i[r[t]]=!0;return i};var n=s('break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23'),c=s('http mail events server types location upstream charset_map limit_except if geo map'),l=s('include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files'),p=e.indentUnit,i;function t(e,t){i=t;return e};function r(e,r){e.eatWhile(/[\w\$_]/);var s=e.current();if(n.propertyIsEnumerable(s)){return'keyword'} -else if(c.propertyIsEnumerable(s)){return'variable-2'} -else if(l.propertyIsEnumerable(s)){return'string-2'};var i=e.next();if(i=='@'){e.eatWhile(/[\w\\\-]/);return t('meta',e.current())} -else if(i=='/'&&e.eat('*')){r.tokenize=a;return a(e,r)} -else if(i=='<'&&e.eat('!')){r.tokenize=o;return o(e,r)} -else if(i=='=')t(null,'compare');else if((i=='~'||i=='|')&&e.eat('='))return t(null,'compare');else if(i=='"'||i=='\''){r.tokenize=u(i);return r.tokenize(e,r)} -else if(i=='#'){e.skipToEnd();return t('comment','comment')} -else if(i=='!'){e.match(/^\s*\w*/);return t('keyword','important')} -else if(/\d/.test(i)){e.eatWhile(/[\w.%]/);return t('number','unit')} -else if(/[,.+>*\/]/.test(i)){return t(null,'select-op')} -else if(/[;{}:\[\]]/.test(i)){return t(null,i)} -else{e.eatWhile(/[\w\\\-]/);return t('variable','variable')}};function a(e,i){var a=!1,s;while((s=e.next())!=null){if(a&&s=='/'){i.tokenize=r;break};a=(s=='*')};return t('comment','comment')};function o(e,i){var s=0,a;while((a=e.next())!=null){if(s>=2&&a=='>'){i.tokenize=r;break};s=(a=='-')?s+1:0};return t('comment','comment')};function u(e){return function(i,s){var a=!1,o;while((o=i.next())!=null){if(o==e&&!a)break;a=!a&&o=='\\'};if(!a)s.tokenize=r;return t('string','string')}};return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;i=null;var s=e.tokenize(t,e),r=e.stack[e.stack.length-1];if(i=='hash'&&r=='rule')s='atom';else if(s=='variable'){if(r=='rule')s='number';else if(!r||r=='@media{')s='tag'};if(r=='rule'&&/^[\{\};]$/.test(i))e.stack.pop();if(i=='{'){if(r=='@media')e.stack[e.stack.length-1]='@media{';else e.stack.push('{')} -else if(i=='}')e.stack.pop();else if(i=='@media')e.stack.push('@media');else if(r=='{'&&i!='comment')e.stack.push('rule');return s},indent:function(e,t){var i=e.stack.length;if(/^\}/.test(t))i-=e.stack[e.stack.length-1]=='rule'?2:1;return e.baseIndent+i*p},electricChars:'}'}});e.defineMIME('text/x-nginx-conf','nginx')}); -/* ./modules/editor/codemirror/mode/javascript/javascript.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('javascript',function(t,i){var M=t.indentUnit,ce=i.statementIndent,P=i.jsonld,b=i.json||P,d=i.typescript,ne=i.wordCharacters||/[\w$\xa1-\uffff]/,de=function(){function e(e){return{type:e,style:'keyword'}};var l=e('keyword a'),i=e('keyword b'),r=e('keyword c'),a=e('keyword d'),f=e('operator'),t={type:'atom',style:'atom'};var s={'if':e('if'),'while':l,'with':l,'else':i,'do':i,'try':i,'finally':i,'return':a,'break':a,'continue':a,'new':e('new'),'delete':r,'void':r,'throw':r,'debugger':e('debugger'),'var':e('var'),'const':e('var'),'let':e('var'),'function':e('function'),'catch':e('catch'),'for':e('for'),'switch':e('switch'),'case':e('case'),'default':e('default'),'in':f,'typeof':f,'instanceof':f,'true':t,'false':t,'null':t,'undefined':t,'NaN':t,'Infinity':t,'this':e('this'),'class':e('class'),'super':e('atom'),'yield':r,'export':e('export'),'import':e('import'),'extends':r,'await':r};if(d){var n={type:'variable',style:'type'};var o={'interface':e('class'),'implements':r,'namespace':r,'public':e('modifier'),'private':e('modifier'),'protected':e('modifier'),'abstract':e('modifier'),'readonly':e('modifier'),'string':n,'number':n,'boolean':n,'any':n};for(var u in o){s[u]=o[u]}};return s}(),pe=/[+\-*&%=<>!?|~^@]/,ze=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Te(e){var n=!1,r,t=!1;while((r=e.next())!=null){if(!n){if(r=='/'&&!t)return;if(r=='[')t=!0;else if(t&&r==']')t=!1};n=!n&&r=='\\'}};var A,q;function l(e,r,t){A=e;q=t;return r};function w(e,r){var t=e.next();if(t=='"'||t=='\''){r.tokenize=Ce(t);return r.tokenize(e,r)} -else if(t=='.'&&e.match(/^\d+(?:[eE][+\-]?\d+)?/)){return l('number','number')} -else if(t=='.'&&e.match('..')){return l('spread','meta')} -else if(/[\[\]{}\(\),;\:\.]/.test(t)){return l(t)} -else if(t=='='&&e.eat('>')){return l('=>','operator')} -else if(t=='0'&&e.eat(/x/i)){e.eatWhile(/[\da-f]/i);return l('number','number')} -else if(t=='0'&&e.eat(/o/i)){e.eatWhile(/[0-7]/i);return l('number','number')} -else if(t=='0'&&e.eat(/b/i)){e.eatWhile(/[01]/i);return l('number','number')} -else if(/\d/.test(t)){e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return l('number','number')} -else if(t=='/'){if(e.eat('*')){r.tokenize=S;return S(e,r)} -else if(e.eat('/')){e.skipToEnd();return l('comment','comment')} -else if(Ve(e,r,1)){Te(e);e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return l('regexp','string-2')} -else{e.eat('=');return l('operator','operator',e.current())}} -else if(t=='`'){r.tokenize=ie;return ie(e,r)} -else if(t=='#'){e.skipToEnd();return l('error','error')} -else if(pe.test(t)){if(t!='>'||!r.lexical||r.lexical.type!='>'){if(e.eat('=')){if(t=='!'||t=='=')e.eat('=')} -else if(/[<>*+\-]/.test(t)){e.eat(t);if(t=='>')e.eat(t)}};return l('operator','operator',e.current())} -else if(ne.test(t)){e.eatWhile(ne);var n=e.current();if(r.lastType!='.'){if(de.propertyIsEnumerable(n)){var i=de[n];return l(i.type,i.style,n)};if(n=='async'&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return l('async','keyword',n)};return l('variable','variable',n)}};function Ce(e){return function(r,t){var n=!1,i;if(P&&r.peek()=='@'&&r.match(ze)){t.tokenize=w;return l('jsonld-keyword','meta')} -while((i=r.next())!=null){if(i==e&&!n)break;n=!n&&i=='\\'};if(!n)t.tokenize=w;return l('string','string')}};function S(e,r){var n=!1,t;while(t=e.next()){if(t=='/'&&n){r.tokenize=w;break};n=(t=='*')};return l('comment','comment')};function ie(e,r){var n=!1,t;while((t=e.next())!=null){if(!n&&(t=='`'||t=='$'&&e.eat('{'))){r.tokenize=w;break};n=!n&&t=='\\'};return l('quasi','string-2',e.current())};var Ie='([{}])';function ae(e,r){if(r.fatArrowAt)r.fatArrowAt=null;var u=e.string.indexOf('=>',e.start);if(u<0)return;if(d){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,u));if(o)u=o.index};var n=0,f=!1;for(var t=u-1;t>=0;--t){var i=e.string.charAt(t),a=Ie.indexOf(i);if(a>=0&&a<3){if(!n){++t;break};if(--n==0){if(i=='(')f=!0;break}} -else if(a>=3&&a<6){++n} -else if(ne.test(i)){f=!0} -else if(/["'\/]/.test(i)){return} -else if(f&&!n){++t;break}};if(f&&!n)r.fatArrowAt=t};var Ee={'atom':!0,'number':!0,'variable':!0,'string':!0,'regexp':!0,'this':!0,'jsonld-keyword':!0};function me(e,r,t,n,i,a){this.indented=e;this.column=r;this.type=t;this.prev=i;this.info=a;if(n!=null)this.align=n};function Oe(e,r){for(var t=e.localVars;t;t=t.next)if(t.name==r)return!0;for(var n=e.context;n;n=n.prev){for(var t=n.vars;t;t=t.next)if(t.name==r)return!0}};function qe(e,r,t,a,f){var i=e.cc;n.state=e;n.stream=f;n.marked=null,n.cc=i;n.style=r;if(!e.lexical.hasOwnProperty('align'))e.lexical.align=!0;while(!0){var u=i.length?i.pop():b?s:p;if(u(t,a)){while(i.length&&i[i.length-1].lex)i.pop()();if(n.marked)return n.marked;if(t=='variable'&&Oe(e,a))return'variable-2';return r}}};var n={state:null,column:null,marked:null,cc:null};function o(){for(var e=arguments.length-1;e>=0;e--)n.cc.push(arguments[e])};function r(){o.apply(null,arguments);return!0};function E(e){function t(r){for(var t=r;t;t=t.next)if(t.name==e)return!0;return!1};var r=n.state;n.marked='def';if(r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}} -else{if(t(r.globalVars))return;if(i.globalVars)r.globalVars={name:e,next:r.globalVars}}};var Ae={name:'this',next:{name:'arguments'}};function I(){n.state.context={prev:n.state.context,vars:n.state.localVars};n.state.localVars=Ae};function z(){n.state.localVars=n.state.context.vars;n.state.context=n.state.context.prev};function f(e,r){var t=function(){var i=n.state,a=i.indented;if(i.lexical.type=='stat')a=i.lexical.indented;else for(var t=i.lexical;t&&t.type==')'&&t.align;t=t.prev)a=t.indented;i.lexical=new me(a,n.stream.column(),e,null,i.lexical,r)};t.lex=!0;return t};function a(){var e=n.state;if(e.lexical.prev){if(e.lexical.type==')')e.indented=e.lexical.indented;e.lexical=e.lexical.prev}};a.lex=!0;function u(e){function t(n){if(n==e)return r();else if(e==';')return o();else return r(t)};return t};function p(e,t){if(e=='var')return r(f('vardef',t.length),oe,u(';'),a);if(e=='keyword a')return r(f('form'),fe,p,a);if(e=='keyword b')return r(f('form'),p,a);if(e=='keyword d')return n.stream.match(/^\s*$/,!1)?r():r(f('stat'),ue,u(';'),a);if(e=='debugger')return r(u(';'));if(e=='{')return r(f('}'),U,a);if(e==';')return r();if(e=='if'){if(n.state.lexical.info=='else'&&n.state.cc[n.state.cc.length-1]==a)n.state.cc.pop()();return r(f('form'),fe,p,a,he)};if(e=='function')return r(y);if(e=='for')return r(f('form'),ur,p,a);if(e=='variable'){if(d&&t=='type'){n.marked='keyword';return r(c,u('operator'),c,u(';'))} -else if(d&&t=='declare'){n.marked='keyword';return r(p)} -else if(d&&(t=='module'||t=='enum')&&n.stream.match(/^\s*\w/,!1)){n.marked='keyword';return r(f('form'),k,u('{'),f('}'),U,a,a)} -else{return r(f('stat'),Ue)}};if(e=='switch')return r(f('form'),fe,u('{'),f('}','switch'),U,a,a);if(e=='case')return r(s,u(':'));if(e=='default')return r(u(':'));if(e=='catch')return r(f('form'),I,u('('),O,u(')'),p,a,z);if(e=='class')return r(f('form'),ge,a);if(e=='export')return r(f('stat'),cr,a);if(e=='import')return r(f('stat'),dr,a);if(e=='async')return r(p);if(t=='@')return r(s,p);return o(f('stat'),s,u(';'),a)};function s(e){return ve(e,!1)};function m(e){return ve(e,!0)};function fe(e){if(e!='(')return o();return r(f(')'),s,u(')'),a)};function ve(e,t){if(n.state.fatArrowAt==n.stream.start){var l=t?ke:ye;if(e=='(')return r(I,f(')'),v(O,')'),a,u('=>'),l,z);else if(e=='variable')return o(I,k,u('=>'),l,z)};var i=t?V:h;if(Ee.hasOwnProperty(e))return r(i);if(e=='function')return r(y,i);if(e=='class')return r(f('form'),lr,a);if(e=='keyword c'||e=='async')return r(t?m:s);if(e=='(')return r(f(')'),ue,u(')'),a,i);if(e=='operator'||e=='spread')return r(t?m:s);if(e=='[')return r(f(']'),mr,a,i);if(e=='{')return T(N,'}',null,i);if(e=='quasi')return o(W,i);if(e=='new')return r(Se(t));return r()};function ue(e){if(e.match(/[;\}\)\],]/))return o();return o(s)};function h(e,t){if(e==',')return r(s);return V(e,t,!1)};function V(e,t,i){var l=i==!1?h:V,p=i==!1?s:m;if(e=='=>')return r(I,i?ke:ye,z);if(e=='operator'){if(/\+\+|--/.test(t)||d&&t=='!')return r(l);if(d&&t=='<'&&n.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1))return r(f('>'),v(c,'>'),a,l);if(t=='?')return r(s,u(':'),p);return r(p)};if(e=='quasi'){return o(W,l)};if(e==';')return;if(e=='(')return T(m,')','call',l);if(e=='.')return r(Be,l);if(e=='[')return r(f(']'),ue,u(']'),a,l);if(d&&t=='as'){n.marked='keyword';return r(c,l)};if(e=='regexp'){n.state.lastType=n.marked='operator';n.stream.backUp(n.stream.pos-n.stream.start-1);return r(p)}};function W(e,t){if(e!='quasi')return o();if(t.slice(t.length-2)!='${')return r(W);return r(s,Pe)};function Pe(e){if(e=='}'){n.marked='string-2';n.state.tokenize=ie;return r(W)}};function ye(e){ae(n.stream,n.state);return o(e=='{'?p:s)};function ke(e){ae(n.stream,n.state);return o(e=='{'?p:m)};function Se(e){return function(t){if(t=='.')return r(e?Ne:We);else if(t=='variable'&&d)return r(nr,e?V:h);else return o(e?m:s)}};function We(e,t){if(t=='target'){n.marked='keyword';return r(h)}};function Ne(e,t){if(t=='target'){n.marked='keyword';return r(V)}};function Ue(e){if(e==':')return r(a,p);return o(h,u(';'),a)};function Be(e){if(e=='variable'){n.marked='property';return r()}};function N(e,t){if(e=='async'){n.marked='property';return r(N)} -else if(e=='variable'||n.style=='keyword'){n.marked='property';if(t=='get'||t=='set')return r(He);var i;if(d&&n.state.fatArrowAt==n.stream.start&&(i=n.stream.match(/^\s*:\s*/,!1)))n.state.fatArrowAt=n.stream.pos+i[0].length;return r(x)} -else if(e=='number'||e=='string'){n.marked=P?'property':(n.style+' property');return r(x)} -else if(e=='jsonld-keyword'){return r(x)} -else if(e=='modifier'){return r(N)} -else if(e=='['){return r(s,u(']'),x)} -else if(e=='spread'){return r(m,x)} -else if(t=='*'){n.marked='keyword';return r(N)} -else if(e==':'){return o(x)}};function He(e){if(e!='variable')return o(x);n.marked='property';return r(y)};function x(e){if(e==':')return r(m);if(e=='(')return o(y)};function v(e,t,i){function a(f,s){if(i?i.indexOf(f)>-1:f==','){var l=n.state.lexical;if(l.info=='call')l.pos=(l.pos||0)+1;return r(function(r,n){if(r==t||n==t)return o();return o(e)},a)};if(f==t||s==t)return r();return r(u(t))};return function(n,i){if(n==t||i==t)return r();return o(e,a)}};function T(e,t,i){for(var u=3;u<arguments.length;u++)n.cc.push(arguments[u]);return r(f(t,i),v(e,t),a)};function U(e){if(e=='}')return r();return o(p,U)};function B(e,t){if(d){if(e==':')return r(c);if(t=='?')return r(B)}};function er(e){if(d&&e==':'){if(n.stream.match(/^\s*\w+\s+is\b/,!1))return r(s,rr,c);else return r(c)}};function rr(e,t){if(t=='is'){n.marked='keyword';return r()}};function c(e,t){if(e=='variable'||t=='void'){if(t=='keyof'){n.marked='keyword';return r(c)} -else{n.marked='type';return r(g)}};if(e=='string'||e=='number'||e=='atom')return r(g);if(e=='[')return r(f(']'),v(c,']',','),a,g);if(e=='{')return r(f('}'),v(H,'}',',;'),a,g);if(e=='(')return r(v(be,')'),tr)};function tr(e){if(e=='=>')return r(c)};function H(e,t){if(e=='variable'||n.style=='keyword'){n.marked='property';return r(H)} -else if(t=='?'){return r(H)} -else if(e==':'){return r(c)} -else if(e=='['){return r(s,B,u(']'),H)}};function be(e){if(e=='variable')return r(be);else if(e==':')return r(c)};function g(e,t){if(t=='<')return r(f('>'),v(c,'>'),a,g);if(t=='|'||e=='.')return r(c);if(e=='[')return r(u(']'),g);if(t=='extends')return r(c)};function nr(e,t){if(t=='<')return r(f('>'),v(c,'>'),a,g)};function we(){return o(c,ir)};function ir(e,t){if(t=='=')return r(c)};function oe(){return o(k,B,C,fr)};function k(e,t){if(e=='modifier')return r(k);if(e=='variable'){E(t);return r()};if(e=='spread')return r(k);if(e=='[')return T(k,']');if(e=='{')return T(ar,'}')};function ar(e,t){if(e=='variable'&&!n.stream.match(/^\s*:/,!1)){E(t);return r(C)};if(e=='variable')n.marked='property';if(e=='spread')return r(k);if(e=='}')return o();return r(u(':'),k,C)};function C(e,t){if(t=='=')return r(m)};function fr(e){if(e==',')return r(oe)};function he(e,t){if(e=='keyword b'&&t=='else')return r(f('form','else'),p,a)};function ur(e){if(e=='(')return r(f(')'),or,u(')'),a)};function or(e){if(e=='var')return r(oe,u(';'),ee);if(e==';')return r(ee);if(e=='variable')return r(sr);return o(s,u(';'),ee)};function sr(e,t){if(t=='in'||t=='of'){n.marked='keyword';return r(s)};return r(h,ee)};function ee(e,t){if(e==';')return r(xe);if(t=='in'||t=='of'){n.marked='keyword';return r(s)};return o(s,u(';'),xe)};function xe(e){if(e!=')')r(s)};function y(e,t){if(t=='*'){n.marked='keyword';return r(y)};if(e=='variable'){E(t);return r(y)};if(e=='(')return r(I,f(')'),v(O,')'),a,er,p,z);if(d&&t=='<')return r(f('>'),v(we,'>'),a,y)};function O(e,t){if(t=='@')r(s,O);if(e=='spread'||e=='modifier')return r(O);return o(k,B,C)};function lr(e,r){if(e=='variable')return ge(e,r);return re(e,r)};function ge(e,t){if(e=='variable'){E(t);return r(re)}};function re(e,t){if(t=='<')return r(f('>'),v(we,'>'),a,re);if(t=='extends'||t=='implements'||(d&&e==','))return r(d?c:s,re);if(e=='{')return r(f('}'),j,a)};function j(e,t){if(e=='modifier'||e=='async'||(e=='variable'&&(t=='static'||t=='get'||t=='set')&&n.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))){n.marked='keyword';return r(j)};if(e=='variable'||n.style=='keyword'){n.marked='property';return r(d?se:y,j)};if(e=='[')return r(s,u(']'),d?se:y,j);if(t=='*'){n.marked='keyword';return r(j)};if(e==';')return r(j);if(e=='}')return r();if(t=='@')return r(s,j)};function se(e,t){if(t=='?')return r(se);if(e==':')return r(c,C);if(t=='=')return r(m);return o(y)};function cr(e,t){if(t=='*'){n.marked='keyword';return r(le,u(';'))};if(t=='default'){n.marked='keyword';return r(s,u(';'))};if(e=='{')return r(v(je,'}'),le,u(';'));return o(p)};function je(e,t){if(t=='as'){n.marked='keyword';return r(u('variable'))};if(e=='variable')return o(m,je)};function dr(e){if(e=='string')return r();return o(te,Me,le)};function te(e,t){if(e=='{')return T(te,'}');if(e=='variable')E(t);if(t=='*')n.marked='keyword';return r(pr)};function Me(e){if(e==',')return r(te,Me)};function pr(e,t){if(t=='as'){n.marked='keyword';return r(te)}};function le(e,t){if(t=='from'){n.marked='keyword';return r(s)}};function mr(e){if(e==']')return r();return o(v(m,']'))};function vr(e,r){return e.lastType=='operator'||e.lastType==','||pe.test(r.charAt(0))||/[,.]/.test(r.charAt(0))};function Ve(e,r,t){return r.tokenize==w&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(r.lastType)||(r.lastType=='quasi'&&/\{\s*$/.test(e.string.slice(0,e.pos-(t||0))))};return{startState:function(e){var r={tokenize:w,lastType:'sof',cc:[],lexical:new me((e||0)-M,0,'block',!1),localVars:i.localVars,context:i.localVars&&{vars:i.localVars},indented:e||0};if(i.globalVars&&typeof i.globalVars=='object')r.globalVars=i.globalVars;return r},token:function(e,r){if(e.sol()){if(!r.lexical.hasOwnProperty('align'))r.lexical.align=!1;r.indented=e.indentation();ae(e,r)};if(r.tokenize!=S&&e.eatSpace())return null;var t=r.tokenize(e,r);if(A=='comment')return t;r.lastType=A=='operator'&&(q=='++'||q=='--')?'incdec':A;return qe(r,t,A,q,e)},indent:function(r,t){if(r.tokenize==S)return e.Pass;if(r.tokenize!=w)return 0;var s=t&&t.charAt(0),n=r.lexical,l;if(!/^\s*else\b/.test(t))for(var o=r.cc.length-1;o>=0;--o){var c=r.cc[o];if(c==a)n=n.prev;else if(c!=he)break} -while((n.type=='stat'||n.type=='form')&&(s=='}'||((l=r.cc[r.cc.length-1])&&(l==h||l==V)&&!/^[,\.=+\-*:?[\(]/.test(t))))n=n.prev;if(ce&&n.type==')'&&n.prev.type=='stat')n=n.prev;var f=n.type,u=s==f;if(f=='vardef')return n.indented+(r.lastType=='operator'||r.lastType==','?n.info+1:0);else if(f=='form'&&s=='{')return n.indented;else if(f=='form')return n.indented+M;else if(f=='stat')return n.indented+(vr(r,t)?ce||M:0);else if(n.info=='switch'&&!u&&i.doubleIndentSwitch!=!1)return n.indented+(/^(?:case|default)\b/.test(t)?M:2*M);else if(n.align)return n.column+(u?0:1);else return n.indented+(u?0:M)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:b?null:'/*',blockCommentEnd:b?null:'*/',blockCommentContinue:b?null:' * ',lineComment:b?null:'//',fold:'brace',closeBrackets:'()[]{}\'\'""``',helperType:b?'json':'javascript',jsonldMode:P,jsonMode:b,expressionAllowed:Ve,skipExpression:function(e){var r=e.cc[e.cc.length-1];if(r==s||r==m)e.cc.pop()}}});e.registerHelper('wordChars','javascript',/[\w$]/);e.defineMIME('text/javascript','javascript');e.defineMIME('text/ecmascript','javascript');e.defineMIME('application/javascript','javascript');e.defineMIME('application/x-javascript','javascript');e.defineMIME('application/ecmascript','javascript');e.defineMIME('application/json',{name:'javascript',json:!0});e.defineMIME('application/x-json',{name:'javascript',json:!0});e.defineMIME('application/ld+json',{name:'javascript',jsonld:!0});e.defineMIME('text/typescript',{name:'javascript',typescript:!0});e.defineMIME('application/typescript',{name:'javascript',typescript:!0})}); -/* ./modules/editor/codemirror/mode/pascal/pascal.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('pascal',function(){function i(e){var t={},n=e.split(' ');for(var r=0;r<n.length;++r)t[n[r]]=!0;return t};var t=i('and array begin case const div do downto else end file for forward integer boolean char function goto if in label mod nil not of or packed procedure program record repeat set string then to type until var while with'),n={'null':!0};var e=/[+\-*&%=<>!?|\/]/;function o(i,o){var u=i.next();if(u=='#'&&o.startOfLine){i.skipToEnd();return'meta'};if(u=='"'||u=='\''){o.tokenize=a(u);return o.tokenize(i,o)};if(u=='('&&i.eat('*')){o.tokenize=r;return r(i,o)};if(/[\[\]{}\(\),;\:\.]/.test(u)){return null};if(/\d/.test(u)){i.eatWhile(/[\w\.]/);return'number'};if(u=='/'){if(i.eat('/')){i.skipToEnd();return'comment'}};if(e.test(u)){i.eatWhile(e);return'operator'};i.eatWhile(/[\w\$_]/);var f=i.current();if(t.propertyIsEnumerable(f))return'keyword';if(n.propertyIsEnumerable(f))return'atom';return'variable'};function a(e){return function(r,t){var n=!1,i,o=!1;while((i=r.next())!=null){if(i==e&&!n){o=!0;break};n=!n&&i=='\\'};if(o||!n)t.tokenize=null;return'string'}};function r(e,r){var n=!1,t;while(t=e.next()){if(t==')'&&n){r.tokenize=null;break};n=(t=='*')};return'comment'};return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var t=(r.tokenize||o)(e,r);if(t=='comment'||t=='meta')return t;return t},electricChars:'{}'}});e.defineMIME('text/x-pascal','pascal')}); -/* ./modules/editor/codemirror/mode/haxe/haxe.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("haxe",function(t,r){var b=t.indentUnit;function a(e){return{type:e,style:"keyword"}};var O=a("keyword a"),A=a("keyword b"),v=a("keyword c"),ne=a("operator"),S={type:"atom",style:"atom"},h={type:"attribute",style:"attribute"};var f=a("typedef"),I={"if":O,"while":O,"else":A,"do":A,"try":A,"return":v,"break":v,"continue":v,"new":v,"throw":v,"var":a("var"),"inline":h,"static":h,"using":a("import"),"public":h,"private":h,"cast":a("cast"),"import":a("import"),"macro":a("macro"),"function":a("function"),"catch":a("catch"),"untyped":a("untyped"),"callback":a("cb"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":ne,"never":a("property_access"),"trace":a("trace"),"class":f,"abstract":f,"enum":f,"interface":f,"typedef":f,"extends":f,"implements":f,"dynamic":f,"true":S,"false":S,"null":S};var V=/[+\-*&%=<>!?|]/;function P(e,t,r){t.tokenize=r;return r(e,t)};function D(e,t){var r=!1,n;while((n=e.next())!=null){if(n==t&&!r)return!0;r=!r&&n=="\\"}};var f,Z;function o(e,t,r){f=e;Z=r;return t};function x(e,t){var r=e.next();if(r=="\""||r=="'"){return P(e,t,ie(r))} -else if(/[\[\]{}\(\),;\:\.]/.test(r)){return o(r)} -else if(r=="0"&&e.eat(/x/i)){e.eatWhile(/[\da-f]/i);return o("number","number")} -else if(/\d/.test(r)||r=="-"&&e.eat(/\d/)){e.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/);return o("number","number")} -else if(t.reAllowed&&(r=="~"&&e.eat(/\//))){D(e,"/");e.eatWhile(/[gimsu]/);return o("regexp","string-2")} -else if(r=="/"){if(e.eat("*")){return P(e,t,ae)} -else if(e.eat("/")){e.skipToEnd();return o("comment","comment")} -else{e.eatWhile(V);return o("operator",null,e.current())}} -else if(r=="#"){e.skipToEnd();return o("conditional","meta")} -else if(r=="@"){e.eat(/:/);e.eatWhile(/[\w_]/);return o("metadata","meta")} -else if(V.test(r)){e.eatWhile(V);return o("operator",null,e.current())} -else{var n;if(/[A-Z]/.test(r)){e.eatWhile(/[\w_<>]/);n=e.current();return o("type","variable-3",n)} -else{e.eatWhile(/[\w_]/);var n=e.current(),i=I.propertyIsEnumerable(n)&&I[n];return(i&&t.kwAllowed)?o(i.type,i.style,n):o("variable","variable",n)}}};function ie(e){return function(t,r){if(D(t,e))r.tokenize=x;return o("string","string")}};function ae(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=x;break};n=(r=="*")};return o("comment","comment")};var T={"atom":!0,"number":!0,"variable":!0,"string":!0,"regexp":!0};function j(e,t,r,n,i,a){this.indented=e;this.column=t;this.type=r;this.prev=i;this.info=a;if(n!=null)this.align=n};function ue(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0};function fe(e,t,i,a,u){var r=e.cc;n.state=e;n.stream=u;n.marked=null,n.cc=r;if(!e.lexical.hasOwnProperty("align"))e.lexical.align=!0;while(!0){var f=r.length?r.pop():m;if(f(i,a)){while(r.length&&r[r.length-1].lex)r.pop()();if(n.marked)return n.marked;if(i=="variable"&&ue(e,a))return"variable-2";if(i=="variable"&&le(e,a))return"variable-3";return t}}};function le(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;var n=e.importedtypes.length;for(var r=0;r<n;r++)if(e.importedtypes[r]==t)return!0};function B(e){var r=n.state;for(var t=r.importedtypes;t;t=t.next)if(t.name==e)return;r.importedtypes={name:e,next:r.importedtypes}};var n={state:null,column:null,marked:null,cc:null};function d(){for(var e=arguments.length-1;e>=0;e--)n.cc.push(arguments[e])};function e(){d.apply(null,arguments);return!0};function F(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1};function k(e){var t=n.state;if(t.context){n.marked="def";if(F(e,t.localVars))return;t.localVars={name:e,next:t.localVars}} -else if(t.globalVars){if(F(e,t.globalVars))return;t.globalVars={name:e,next:t.globalVars}}};var re={name:"this",next:null};function E(){if(!n.state.context)n.state.localVars=re;n.state.context={prev:n.state.context,vars:n.state.localVars}};function w(){n.state.localVars=n.state.context.vars;n.state.context=n.state.context.prev};w.lex=!0;function u(e,t){var r=function(){var r=n.state;r.lexical=new j(r.indented,n.stream.column(),e,null,r.lexical,t)};r.lex=!0;return r};function i(){var e=n.state;if(e.lexical.prev){if(e.lexical.type==")")e.indented=e.lexical.indented;e.lexical=e.lexical.prev}};i.lex=!0;function l(t){function r(n){if(n==t)return e();else if(t==";")return d();else return e(r)};return r};function m(t){if(t=="@")return e(M);if(t=="var")return e(u("vardef"),C,l(";"),i);if(t=="keyword a")return e(u("form"),c,m,i);if(t=="keyword b")return e(u("form"),m,i);if(t=="{")return e(u("}"),E,z,i,w);if(t==";")return e();if(t=="attribute")return e(U);if(t=="function")return e(y);if(t=="for")return e(u("form"),l("("),u(")"),pe,l(")"),i,m,i);if(t=="variable")return e(u("stat"),se);if(t=="switch")return e(u("form"),c,u("}","switch"),l("{"),z,i,i);if(t=="case")return e(c,l(":"));if(t=="default")return e(l(":"));if(t=="catch")return e(u("form"),E,l("("),te,l(")"),m,i,w);if(t=="import")return e(q,l(";"));if(t=="typedef")return e(ce);return d(u("stat"),c,l(";"),i)};function c(t){if(T.hasOwnProperty(t))return e(s);if(t=="type")return e(s);if(t=="function")return e(y);if(t=="keyword c")return e(W);if(t=="(")return e(u(")"),W,l(")"),i,s);if(t=="operator")return e(c);if(t=="[")return e(u("]"),p(W,"]"),i,s);if(t=="{")return e(u("}"),p(me,"}"),i,s);return e()};function W(e){if(e.match(/[;\}\)\],]/))return d();return d(c)};function s(t,r){if(t=="operator"&&/\+\+|--/.test(r))return e(s);if(t=="operator"||t==":")return e(c);if(t==";")return;if(t=="(")return e(u(")"),p(c,")"),i,s);if(t==".")return e(de,s);if(t=="[")return e(u("]"),c,l("]"),i,s)};function U(t){if(t=="attribute")return e(U);if(t=="function")return e(y);if(t=="var")return e(C)};function M(t){if(t==":")return e(M);if(t=="variable")return e(M);if(t=="(")return e(u(")"),p(oe,")"),i,m)};function oe(t){if(t=="variable")return e()};function q(t,r){if(t=="variable"&&/[A-Z]/.test(r.charAt(0))){B(r);return e()} -else if(t=="variable"||t=="property"||t=="."||r=="*")return e(q)};function ce(t,r){if(t=="variable"&&/[A-Z]/.test(r.charAt(0))){B(r);return e()} -else if(t=="type"&&/[A-Z]/.test(r.charAt(0))){return e()}};function se(t){if(t==":")return e(i,m);return d(s,l(";"),i)};function de(t){if(t=="variable"){n.marked="property";return e()}};function me(t){if(t=="variable")n.marked="property";if(T.hasOwnProperty(t))return e(l(":"),c)};function p(t,r){function n(i){if(i==",")return e(t,n);if(i==r)return e();return e(l(r))};return function(i){if(i==r)return e();else return d(t,n)}};function z(t){if(t=="}")return e();return d(m,z)};function C(t,r){if(t=="variable"){k(r);return e(g,ee)};return e()};function ee(t,r){if(r=="=")return e(c,ee);if(t==",")return e(C)};function pe(t,r){if(t=="variable"){k(r);return e(ve,c)} -else{return d()}};function ve(t,r){if(r=="in")return e()};function y(t,r){if(t=="variable"||t=="type"){k(r);return e(y)};if(r=="new")return e(y);if(t=="(")return e(u(")"),E,p(te,")"),i,g,m,w)};function g(t){if(t==":")return e(be)};function be(t){if(t=="type")return e();if(t=="variable")return e();if(t=="{")return e(u("}"),p(ye,"}"),i)};function ye(t){if(t=="variable")return e(g)};function te(t,r){if(t=="variable"){k(r);return e(g)}};return{startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"],t={tokenize:x,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new j((e||0)-b,0,"block",!1),localVars:r.localVars,importedtypes:n,context:r.localVars&&{vars:r.localVars},indented:0};if(r.globalVars&&typeof r.globalVars=="object")t.globalVars=r.globalVars;return t},token:function(e,t){if(e.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=!1;t.indented=e.indentation()};if(e.eatSpace())return null;var r=t.tokenize(e,t);if(f=="comment")return r;t.reAllowed=!!(f=="operator"||f=="keyword c"||f.match(/^[\[{}\(,;:]$/));t.kwAllowed=f!=".";return fe(t,r,f,Z,e)},indent:function(e,t){if(e.tokenize!=x)return 0;var a=t&&t.charAt(0),r=e.lexical;if(r.type=="stat"&&a=="}")r=r.prev;var n=r.type,i=a==n;if(n=="vardef")return r.indented+4;else if(n=="form"&&a=="{")return r.indented;else if(n=="stat"||n=="form")return r.indented+b;else if(r.info=="switch"&&!i)return r.indented+(/^(?:case|default)\b/.test(t)?b:2*b);else if(r.align)return r.column+(i?0:1);else return r.indented+(i?0:b)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});e.defineMIME("text/x-haxe","haxe");e.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(e,t){var r=e.peek(),i=e.sol();if(r=="#"){e.skipToEnd();return"comment"};if(i&&r=="-"){var n="variable-2";e.eat(/-/);if(e.peek()=="-"){e.eat(/-/);n="keyword a"};if(e.peek()=="D"){e.eat(/[D]/);n="keyword c";t.define=!0};e.eatWhile(/[A-Z]/i);return n};var r=e.peek();if(t.inString==!1&&r=="'"){t.inString=!0;e.next()};if(t.inString==!0){if(e.skipTo("'")){} -else{e.skipToEnd()};if(e.peek()=="'"){e.next();t.inString=!1};return"string"};e.next();return null},lineComment:"#"}});e.defineMIME("text/x-hxml","hxml")}); -/* ./modules/editor/codemirror/mode/perl/perl.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(r){'use strict';r.defineMode('perl',function(){var a={'->':4,'++':4,'--':4,'**':4,'=~':4,'!~':4,'*':4,'/':4,'%':4,'x':4,'+':4,'-':4,'.':4,'<<':4,'>>':4,'<':4,'>':4,'<=':4,'>=':4,'lt':4,'gt':4,'le':4,'ge':4,'==':4,'!=':4,'<=>':4,'eq':4,'ne':4,'cmp':4,'~~':4,'&':4,'|':4,'^':4,'&&':4,'||':4,'//':4,'..':4,'...':4,'?':4,':':4,'=':4,'+=':4,'-=':4,'*=':4,',':4,'=>':4,'::':4,'not':4,'and':4,'or':4,'xor':4,'BEGIN':[5,1],'END':[5,1],'PRINT':[5,1],'PRINTF':[5,1],'GETC':[5,1],'READ':[5,1],'READLINE':[5,1],'DESTROY':[5,1],'TIE':[5,1],'TIEHANDLE':[5,1],'UNTIE':[5,1],'STDIN':5,'STDIN_TOP':5,'STDOUT':5,'STDOUT_TOP':5,'STDERR':5,'STDERR_TOP':5,'$ARG':5,'$_':5,'@ARG':5,'@_':5,'$LIST_SEPARATOR':5,'$"':5,'$PROCESS_ID':5,'$PID':5,'$$':5,'$REAL_GROUP_ID':5,'$GID':5,'$(':5,'$EFFECTIVE_GROUP_ID':5,'$EGID':5,'$)':5,'$PROGRAM_NAME':5,'$0':5,'$SUBSCRIPT_SEPARATOR':5,'$SUBSEP':5,'$;':5,'$REAL_USER_ID':5,'$UID':5,'$<':5,'$EFFECTIVE_USER_ID':5,'$EUID':5,'$>':5,'$a':5,'$b':5,'$COMPILING':5,'$^C':5,'$DEBUGGING':5,'$^D':5,'${^ENCODING}':5,'$ENV':5,'%ENV':5,'$SYSTEM_FD_MAX':5,'$^F':5,'@F':5,'${^GLOBAL_PHASE}':5,'$^H':5,'%^H':5,'@INC':5,'%INC':5,'$INPLACE_EDIT':5,'$^I':5,'$^M':5,'$OSNAME':5,'$^O':5,'${^OPEN}':5,'$PERLDB':5,'$^P':5,'$SIG':5,'%SIG':5,'$BASETIME':5,'$^T':5,'${^TAINT}':5,'${^UNICODE}':5,'${^UTF8CACHE}':5,'${^UTF8LOCALE}':5,'$PERL_VERSION':5,'$^V':5,'${^WIN32_SLOPPY_STAT}':5,'$EXECUTABLE_NAME':5,'$^X':5,'$1':5,'$MATCH':5,'$&':5,'${^MATCH}':5,'$PREMATCH':5,'$`':5,'${^PREMATCH}':5,'$POSTMATCH':5,'$\'':5,'${^POSTMATCH}':5,'$LAST_PAREN_MATCH':5,'$+':5,'$LAST_SUBMATCH_RESULT':5,'$^N':5,'@LAST_MATCH_END':5,'@+':5,'%LAST_PAREN_MATCH':5,'%+':5,'@LAST_MATCH_START':5,'@-':5,'%LAST_MATCH_START':5,'%-':5,'$LAST_REGEXP_CODE_RESULT':5,'$^R':5,'${^RE_DEBUG_FLAGS}':5,'${^RE_TRIE_MAXBUF}':5,'$ARGV':5,'@ARGV':5,'ARGV':5,'ARGVOUT':5,'$OUTPUT_FIELD_SEPARATOR':5,'$OFS':5,'$,':5,'$INPUT_LINE_NUMBER':5,'$NR':5,'$.':5,'$INPUT_RECORD_SEPARATOR':5,'$RS':5,'$/':5,'$OUTPUT_RECORD_SEPARATOR':5,'$ORS':5,'$\\':5,'$OUTPUT_AUTOFLUSH':5,'$|':5,'$ACCUMULATOR':5,'$^A':5,'$FORMAT_FORMFEED':5,'$^L':5,'$FORMAT_PAGE_NUMBER':5,'$%':5,'$FORMAT_LINES_LEFT':5,'$-':5,'$FORMAT_LINE_BREAK_CHARACTERS':5,'$:':5,'$FORMAT_LINES_PER_PAGE':5,'$=':5,'$FORMAT_TOP_NAME':5,'$^':5,'$FORMAT_NAME':5,'$~':5,'${^CHILD_ERROR_NATIVE}':5,'$EXTENDED_OS_ERROR':5,'$^E':5,'$EXCEPTIONS_BEING_CAUGHT':5,'$^S':5,'$WARNING':5,'$^W':5,'${^WARNING_BITS}':5,'$OS_ERROR':5,'$ERRNO':5,'$!':5,'%OS_ERROR':5,'%ERRNO':5,'%!':5,'$CHILD_ERROR':5,'$?':5,'$EVAL_ERROR':5,'$@':5,'$OFMT':5,'$#':5,'$*':5,'$ARRAY_BASE':5,'$[':5,'$OLD_PERL_VERSION':5,'$]':5,'if':[1,1],elsif:[1,1],'else':[1,1],'while':[1,1],unless:[1,1],'for':[1,1],foreach:[1,1],'abs':1,accept:1,alarm:1,'atan2':1,bind:1,binmode:1,bless:1,bootstrap:1,'break':1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,'continue':[1,1],'cos':1,crypt:1,dbmclose:1,dbmopen:1,'default':1,defined:1,'delete':1,die:1,'do':1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,'eval':1,'exec':1,exists:1,exit:1,'exp':1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,'goto':1,grep:1,hex:1,'import':1,index:1,'int':1,ioctl:1,'join':1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,'link':1,listen:1,local:2,localtime:1,lock:1,'log':1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,'new':1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,'package':1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,'return':1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,'sin':1,sleep:1,socket:1,socketpair:1,'sort':1,splice:1,'split':1,sprintf:1,'sqrt':1,srand:1,stat:1,state:1,study:1,'sub':1,'substr':1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null};var s='string-2',u=/[goseximacplud]/;function r(t,e,r,n,i){e.chain=null;e.style=null;e.tail=null;e.tokenize=function(e,t){var s=!1,u,a=0;while(u=e.next()){if(u===r[a]&&!s){if(r[++a]!==undefined){t.chain=r[a];t.style=n;t.tail=i} -else if(i)e.eatWhile(i);t.tokenize=f;return n};s=!s&&u=='\\'};return n};return e.tokenize(t,e)};function l(e,t,r){t.tokenize=function(e,t){if(e.string==r)t.tokenize=f;e.skipToEnd();return'string'};return t.tokenize(e,t)};function f(f,E){if(f.eatSpace())return null;if(E.chain)return r(f,E,E.chain,E.style,E.tail);if(f.match(/^\-?[\d\.]/,!1))if(f.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return'number';if(f.match(/^<<(?=\w)/)){f.eatWhile(/\w/);return l(f,E,f.current().substr(2))};if(f.sol()&&f.match(/^\=item(?!\w)/)){return l(f,E,'=cut')};var R=f.next();if(R=='"'||R=='\''){if(i(f,3)=='<<'+R){var c=f.pos;f.eatWhile(/\w/);var T=f.current().substr(1);if(T&&f.eat(R))return l(f,E,T);f.pos=c};return r(f,E,[R],'string')};if(R=='q'){var o=t(f,-2);if(!(o&&/\w/.test(o))){o=t(f,0);if(o=='x'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],s,u)};if(o=='['){e(f,2);return r(f,E,[']'],s,u)};if(o=='{'){e(f,2);return r(f,E,['}'],s,u)};if(o=='<'){e(f,2);return r(f,E,['>'],s,u)};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],s,u)}} -else if(o=='q'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],'string')};if(o=='['){e(f,2);return r(f,E,[']'],'string')};if(o=='{'){e(f,2);return r(f,E,['}'],'string')};if(o=='<'){e(f,2);return r(f,E,['>'],'string')};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],'string')}} -else if(o=='w'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],'bracket')};if(o=='['){e(f,2);return r(f,E,[']'],'bracket')};if(o=='{'){e(f,2);return r(f,E,['}'],'bracket')};if(o=='<'){e(f,2);return r(f,E,['>'],'bracket')};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],'bracket')}} -else if(o=='r'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],s,u)};if(o=='['){e(f,2);return r(f,E,[']'],s,u)};if(o=='{'){e(f,2);return r(f,E,['}'],s,u)};if(o=='<'){e(f,2);return r(f,E,['>'],s,u)};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],s,u)}} -else if(/[\^'"!~\/(\[{<]/.test(o)){if(o=='('){e(f,1);return r(f,E,[')'],'string')};if(o=='['){e(f,1);return r(f,E,[']'],'string')};if(o=='{'){e(f,1);return r(f,E,['}'],'string')};if(o=='<'){e(f,1);return r(f,E,['>'],'string')};if(/[\^'"!~\/]/.test(o)){return r(f,E,[f.eat(o)],'string')}}}};if(R=='m'){var o=t(f,-2);if(!(o&&/\w/.test(o))){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(/[\^'"!~\/]/.test(o)){return r(f,E,[o],s,u)};if(o=='('){return r(f,E,[')'],s,u)};if(o=='['){return r(f,E,[']'],s,u)};if(o=='{'){return r(f,E,['}'],s,u)};if(o=='<'){return r(f,E,['>'],s,u)}}}};if(R=='s'){var o=/[\/>\]})\w]/.test(t(f,-2));if(!o){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(o=='[')return r(f,E,[']',']'],s,u);if(o=='{')return r(f,E,['}','}'],s,u);if(o=='<')return r(f,E,['>','>'],s,u);if(o=='(')return r(f,E,[')',')'],s,u);return r(f,E,[o,o],s,u)}}};if(R=='y'){var o=/[\/>\]})\w]/.test(t(f,-2));if(!o){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(o=='[')return r(f,E,[']',']'],s,u);if(o=='{')return r(f,E,['}','}'],s,u);if(o=='<')return r(f,E,['>','>'],s,u);if(o=='(')return r(f,E,[')',')'],s,u);return r(f,E,[o,o],s,u)}}};if(R=='t'){var o=/[\/>\]})\w]/.test(t(f,-2));if(!o){o=f.eat('r');if(o){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(o=='[')return r(f,E,[']',']'],s,u);if(o=='{')return r(f,E,['}','}'],s,u);if(o=='<')return r(f,E,['>','>'],s,u);if(o=='(')return r(f,E,[')',')'],s,u);return r(f,E,[o,o],s,u)}}}};if(R=='`'){return r(f,E,[R],'variable-2')};if(R=='/'){if(!/~\s*$/.test(i(f)))return'operator';else return r(f,E,[R],s,u)};if(R=='$'){var c=f.pos;if(f.eatWhile(/\d/)||f.eat('{')&&f.eatWhile(/\d/)&&f.eat('}'))return'variable-2';else f.pos=c};if(/[$@%]/.test(R)){var c=f.pos;if(f.eat('^')&&f.eat(/[A-Z]/)||!/[@$%&]/.test(t(f,-2))&&f.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=f.current();if(a[o])return'variable-2'};f.pos=c};if(/[$@%&]/.test(R)){if(f.eatWhile(/[\w$\[\]]/)||f.eat('{')&&f.eatWhile(/[\w$\[\]]/)&&f.eat('}')){var o=f.current();if(a[o])return'variable-2';else return'variable'}};if(R=='#'){if(t(f,-2)!='$'){f.skipToEnd();return'comment'}};if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(R)){var c=f.pos;f.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(a[f.current()])return'operator';else f.pos=c};if(R=='_'){if(f.pos==1){if(n(f,6)=='_END__'){return r(f,E,['\0'],'comment')} -else if(n(f,7)=='_DATA__'){return r(f,E,['\0'],'variable-2')} -else if(n(f,7)=='_C__'){return r(f,E,['\0'],'string')}}};if(/\w/.test(R)){var c=f.pos;if(t(f,-2)=='{'&&(t(f,0)=='}'||f.eatWhile(/\w/)&&t(f,0)=='}'))return'string';else f.pos=c};if(/[A-Z]/.test(R)){var p=t(f,-2),c=f.pos;f.eatWhile(/[A-Z_]/);if(/[\da-z]/.test(t(f,0))){f.pos=c} -else{var o=a[f.current()];if(!o)return'meta';if(o[1])o=o[0];if(p!=':'){if(o==1)return'keyword';else if(o==2)return'def';else if(o==3)return'atom';else if(o==4)return'operator';else if(o==5)return'variable-2';else return'meta'} -else return'meta'}};if(/[a-zA-Z_]/.test(R)){var p=t(f,-2);f.eatWhile(/\w/);var o=a[f.current()];if(!o)return'meta';if(o[1])o=o[0];if(p!=':'){if(o==1)return'keyword';else if(o==2)return'def';else if(o==3)return'atom';else if(o==4)return'operator';else if(o==5)return'variable-2';else return'meta'} -else return'meta'};return null};return{startState:function(){return{tokenize:f,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||f)(e,t)},lineComment:'#'}});r.registerHelper('wordChars','perl',/[\w$]/);r.defineMIME('text/x-perl','perl');function t(e,t){return e.string.charAt(e.pos+(t||0))};function i(e,t){if(t){var r=e.pos-t;return e.string.substr((r>=0?r:0),t)} -else{return e.string.substr(0,e.pos-1)}};function n(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,(t&&t<r?t:n))};function e(e,t){var r=e.pos+t,n;if(r<=0)e.pos=0;else if(r>=(n=e.string.length-1))e.pos=n;else e.pos=r}}); -/* ./modules/editor/codemirror/mode/factor/factor.min.js */ -/* ./modules/editor/codemirror/mode/smarty/smarty.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('smarty',function(r,i){var s=i.rightDelimiter||'}',a=i.leftDelimiter||'{',u=i.version||2,o=e.getMode(r,i.baseMode||'null'),d=['debug','extends','function','include','literal'],n={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/};var f;function t(e,t){f=t;return e};function p(e,t,r){t.tokenize=r;return r(e,t)};function h(e,t){if(t==null)t=e.pos;return u===3&&a=='{'&&(t==e.string.length||/\s/.test(e.string.charAt(t)))};function l(e,t){var i=e.string;for(var n=e.pos;;){var r=i.indexOf(a,n);n=r+a.length;if(r==-1||!h(e,r+a.length))break};if(r==e.pos){e.match(a);if(e.eat('*')){return p(e,t,k('comment','*'+s))} -else{t.depth++;t.tokenize=c;f='startTag';return'tag'}};if(r>-1)e.string=i.slice(0,r);var l=o.token(e,t.base);if(r>-1)e.string=i;return l};function c(e,r){if(e.match(s,!0)){if(u===3){r.depth--;if(r.depth<=0){r.tokenize=l}} -else{r.tokenize=l};return t('tag',null)};if(e.match(a,!0)){r.depth++;return t('tag','startTag')};var i=e.next();if(i=='$'){e.eatWhile(n.validIdentifier);return t('variable-2','variable')} -else if(i=='|'){return t('operator','pipe')} -else if(i=='.'){return t('operator','property')} -else if(n.stringChar.test(i)){r.tokenize=b(i);return t('string','string')} -else if(n.operatorChars.test(i)){e.eatWhile(n.operatorChars);return t('operator','operator')} -else if(i=='['||i==']'){return t('bracket','bracket')} -else if(i=='('||i==')'){return t('bracket','operator')} -else if(/\d/.test(i)){e.eatWhile(/\d/);return t('number','number')} -else{if(r.last=='variable'){if(i=='@'){e.eatWhile(n.validIdentifier);return t('property','property')} -else if(i=='|'){e.eatWhile(n.validIdentifier);return t('qualifier','modifier')}} -else if(r.last=='pipe'){e.eatWhile(n.validIdentifier);return t('qualifier','modifier')} -else if(r.last=='whitespace'){e.eatWhile(n.validIdentifier);return t('attribute','modifier')};if(r.last=='property'){e.eatWhile(n.validIdentifier);return t('property',null)} -else if(/\s/.test(i)){f='whitespace';return null};var c='';if(i!='/'){c+=i};var p=null;while(p=e.eat(n.validIdentifier)){c+=p};for(var o=0,h=d.length;o<h;o++){if(d[o]==c){return t('keyword','keyword')}};if(/\s/.test(i)){return null};return t('tag','tag')}};function b(e){return function(t,r){var i=null,n=null;while(!t.eol()){n=t.peek();if(t.next()==e&&i!=='\\'){r.tokenize=c;break};i=n};return'string'}};function k(e,t){return function(r,i){while(!r.eol()){if(r.match(t)){i.tokenize=l;break};r.next()};return e}};return{startState:function(){return{base:e.startState(o),tokenize:l,last:null,depth:0}},copyState:function(t){return{base:e.copyState(o,t.base),tokenize:t.tokenize,last:t.last,depth:t.depth}},innerMode:function(e){if(e.tokenize==l)return{mode:o,state:e.base}},token:function(e,t){var r=t.tokenize(e,t);t.last=f;return r},indent:function(t,r){if(t.tokenize==l&&o.indent)return o.indent(t.base,r);else return e.Pass},blockCommentStart:a+'*',blockCommentEnd:'*'+s}});e.defineMIME('text/x-smarty','smarty')}); -/* ./modules/editor/codemirror/mode/vbscript/vbscript.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('vbscript',function(e,r){var a='error';function t(e){return new RegExp('^(('+e.join(')|(')+'))\\b','i')};var I=new RegExp('^[\\+\\-\\*/&\\\\\\^<>=]'),C=new RegExp('^((<>)|(<=)|(>=))'),L=new RegExp('^[\\.,]'),E=new RegExp('^[\\(\\)]'),D=new RegExp('^[A-Za-z][_A-Za-z0-9]*'),S=['class','sub','select','while','if','function','property','with','for'],T=['else','elseif','case'],O=['next','loop','wend'],j=t(['and','or','not','xor','is','mod','eqv','imp']),F=['dim','redim','then','until','randomize','byval','byref','new','property','exit','in','const','private','public','get','set','let','stop','on error resume next','on error goto 0','option explicit','call','me'],R=['true','false','nothing','empty','null'],z=['abs','array','asc','atn','cbool','cbyte','ccur','cdate','cdbl','chr','cint','clng','cos','csng','cstr','date','dateadd','datediff','datepart','dateserial','datevalue','day','escape','eval','execute','exp','filter','formatcurrency','formatdatetime','formatnumber','formatpercent','getlocale','getobject','getref','hex','hour','inputbox','instr','instrrev','int','fix','isarray','isdate','isempty','isnull','isnumeric','isobject','join','lbound','lcase','left','len','loadpicture','log','ltrim','rtrim','trim','maths','mid','minute','month','monthname','msgbox','now','oct','replace','rgb','right','rnd','round','scriptengine','scriptenginebuildversion','scriptenginemajorversion','scriptengineminorversion','second','setlocale','sgn','sin','space','split','sqr','strcomp','string','strreverse','tan','time','timer','timeserial','timevalue','typename','ubound','ucase','unescape','vartype','weekday','weekdayname','year'],B=['vbBlack','vbRed','vbGreen','vbYellow','vbBlue','vbMagenta','vbCyan','vbWhite','vbBinaryCompare','vbTextCompare','vbSunday','vbMonday','vbTuesday','vbWednesday','vbThursday','vbFriday','vbSaturday','vbUseSystemDayOfWeek','vbFirstJan1','vbFirstFourDays','vbFirstFullWeek','vbGeneralDate','vbLongDate','vbShortDate','vbLongTime','vbShortTime','vbObjectError','vbOKOnly','vbOKCancel','vbAbortRetryIgnore','vbYesNoCancel','vbYesNo','vbRetryCancel','vbCritical','vbQuestion','vbExclamation','vbInformation','vbDefaultButton1','vbDefaultButton2','vbDefaultButton3','vbDefaultButton4','vbApplicationModal','vbSystemModal','vbOK','vbCancel','vbAbort','vbRetry','vbIgnore','vbYes','vbNo','vbCr','VbCrLf','vbFormFeed','vbLf','vbNewLine','vbNullChar','vbNullString','vbTab','vbVerticalTab','vbUseDefault','vbTrue','vbFalse','vbEmpty','vbNull','vbInteger','vbLong','vbSingle','vbDouble','vbCurrency','vbDate','vbString','vbObject','vbError','vbBoolean','vbVariant','vbDataObject','vbDecimal','vbByte','vbArray'],n=['WScript','err','debug','RegExp'],M=['description','firstindex','global','helpcontext','helpfile','ignorecase','length','number','pattern','source','value','count'],A=['clear','execute','raise','replace','test','write','writeline','close','open','state','eof','update','addnew','end','createobject','quit'],N=['server','response','request','session','application'],W=['buffer','cachecontrol','charset','contenttype','expires','expiresabsolute','isclientconnected','pics','status','clientcertificate','cookies','form','querystring','servervariables','totalbytes','contents','staticobjects','codepage','lcid','sessionid','timeout','scripttimeout'],q=['addheader','appendtolog','binarywrite','end','flush','redirect','binaryread','remove','removeall','lock','unlock','abandon','getlasterror','htmlencode','mappath','transfer','urlencode'],i=A.concat(M);n=n.concat(B);if(e.isASP){n=n.concat(N);i=i.concat(q,W)};var v=t(F),f=t(R),m=t(z),p=t(n),h=t(i),y='"',g=t(S),u=t(T),s=t(O),l=t(['end']),x=t(['do']),k=t(['on error resume next','exit']),w=t(['rem']);function b(e,t){t.currentIndent++};function o(e,t){t.currentIndent--};function c(e,t){if(e.eatSpace()){return'space'};var i=e.peek();if(i==='\''){e.skipToEnd();return'comment'};if(e.match(w)){e.skipToEnd();return'comment'};if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var n=!1;if(e.match(/^\d*\.\d+/i)){n=!0} -else if(e.match(/^\d+\.\d*/)){n=!0} -else if(e.match(/^\.\d+/)){n=!0};if(n){e.eat(/J/i);return'number'};var r=!1;if(e.match(/^&H[0-9a-f]+/i)){r=!0} -else if(e.match(/^&O[0-7]+/i)){r=!0} -else if(e.match(/^[1-9]\d*F?/)){e.eat(/J/i);r=!0} -else if(e.match(/^0(?![\dx])/i)){r=!0};if(r){e.eat(/L/i);return'number'}};if(e.match(y)){t.tokenize=K(e.current());return t.tokenize(e,t)};if(e.match(C)||e.match(I)||e.match(j)){return'operator'};if(e.match(L)){return null};if(e.match(E)){return'bracket'};if(e.match(k)){t.doInCurrentLine=!0;return'keyword'};if(e.match(x)){b(e,t);t.doInCurrentLine=!0;return'keyword'};if(e.match(g)){if(!t.doInCurrentLine)b(e,t);else t.doInCurrentLine=!1;return'keyword'};if(e.match(u)){return'keyword'};if(e.match(l)){o(e,t);o(e,t);return'keyword'};if(e.match(s)){if(!t.doInCurrentLine)o(e,t);else t.doInCurrentLine=!1;return'keyword'};if(e.match(v)){return'keyword'};if(e.match(f)){return'atom'};if(e.match(h)){return'variable-2'};if(e.match(m)){return'builtin'};if(e.match(p)){return'variable-2'};if(e.match(D)){return'variable'};e.next();return a};function K(e){var n=e.length==1,t='string';return function(i,o){while(!i.eol()){i.eatWhile(/[^'"]/);if(i.match(e)){o.tokenize=c;return t} -else{i.eat(/['"]/)}};if(n){if(r.singleLineStringErrors){return a} -else{o.tokenize=c}};return t}};function U(e,t){var r=t.tokenize(e,t),n=e.current();if(n==='.'){r=t.tokenize(e,t);n=e.current();if(r&&(r.substr(0,8)==='variable'||r==='builtin'||r==='keyword')){if(r==='builtin'||r==='keyword')r='variable';if(i.indexOf(n.substr(1))>-1)r='variable-2';return r} -else{return a}};return r};var d={electricChars:'dDpPtTfFeE ',startState:function(){return{tokenize:c,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){if(e.sol()){t.currentIndent+=t.nextLineIndent;t.nextLineIndent=0;t.doInCurrentLine=0};var r=U(e,t);t.lastToken={style:r,content:e.current()};if(r==='space')r=null;return r},indent:function(t,r){var n=r.replace(/^\s+|\s+$/g,'');if(n.match(s)||n.match(l)||n.match(u))return e.indentUnit*(t.currentIndent-1);if(t.currentIndent<0)return 0;return t.currentIndent*e.indentUnit}};return d});e.defineMIME('text/vbscript','vbscript')}); -/* ./modules/editor/codemirror/mode/dylan/dylan.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function n(e,n){for(var t=0;t<e.length;t++)n(e[t],t)};function t(e,n){for(var t=0;t<e.length;t++)if(n(e[t],t))return!0;return!1};e.defineMode('dylan',function(i){var e={unnamedDefinition:['interface'],namedDefinition:['module','library','macro','C-struct','C-union','C-function','C-callable-wrapper'],typeParameterizedDefinition:['class','C-subtype','C-mapped-subtype'],otherParameterizedDefinition:['method','function','C-variable','C-address'],constantSimpleDefinition:['constant'],variableSimpleDefinition:['variable'],otherSimpleDefinition:['generic','domain','C-pointer-type','table'],statement:['if','block','begin','method','case','for','select','when','unless','until','while','iterate','profiling','dynamic-bind'],separator:['finally','exception','cleanup','else','elseif','afterwards'],other:['above','below','by','from','handler','in','instance','let','local','otherwise','slot','subclass','then','to','keyed-by','virtual'],signalingCalls:['signal','error','cerror','break','check-type','abort']};e['otherDefinition']=e['unnamedDefinition'].concat(e['namedDefinition']).concat(e['otherParameterizedDefinition']);e['definition']=e['typeParameterizedDefinition'].concat(e['otherDefinition']);e['parameterizedDefinition']=e['typeParameterizedDefinition'].concat(e['otherParameterizedDefinition']);e['simpleDefinition']=e['constantSimpleDefinition'].concat(e['variableSimpleDefinition']).concat(e['otherSimpleDefinition']);e['keyword']=e['statement'].concat(e['separator']).concat(e['other']);var a='[-_a-zA-Z?!*@<>$%]+',p=new RegExp('^'+a),r={symbolKeyword:a+':',symbolClass:'<'+a+'>',symbolGlobal:'\\*'+a+'\\*',symbolConstant:'\\$'+a};var d={symbolKeyword:'atom',symbolClass:'tag',symbolGlobal:'variable-2',symbolConstant:'variable-3'};for(var l in r)if(r.hasOwnProperty(l))r[l]=new RegExp('^'+r[l]);r['keyword']=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var o={};o['keyword']='keyword';o['definition']='def';o['simpleDefinition']='def';o['signalingCalls']='builtin';var c={};var u={};n(['keyword','definition','simpleDefinition','signalingCalls'],function(t){n(e[t],function(e){c[e]=t;u[e]=o[t]})});function f(e,n,t){n.tokenize=t;return t(e,n)};function s(e,i){var n=e.peek();if(n=='\''||n=='"'){e.next();return f(e,i,m(n,'string'))} -else if(n=='/'){e.next();if(e.eat('*')){return f(e,i,b)} -else if(e.eat('/')){e.skipToEnd();return'comment'};e.backUp(1)} -else if(/[+\-\d\.]/.test(n)){if(e.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i)||e.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i)||e.match(/^[+-]?\d+/)){return'number'}} -else if(n=='#'){e.next();n=e.peek();if(n=='"'){e.next();return f(e,i,m('"','string'))} -else if(n=='b'){e.next();e.eatWhile(/[01]/);return'number'} -else if(n=='x'){e.next();e.eatWhile(/[\da-f]/i);return'number'} -else if(n=='o'){e.next();e.eatWhile(/[0-7]/);return'number'} -else if(n=='#'){e.next();return'punctuation'} -else if((n=='[')||(n=='(')){e.next();return'bracket'} -else if(e.match(/f|t|all-keys|include|key|next|rest/i)){return'atom'} -else{e.eatWhile(/[-a-zA-Z]/);return'error'}} -else if(n=='~'){e.next();n=e.peek();if(n=='='){e.next();n=e.peek();if(n=='='){e.next();return'operator'};return'operator'};return'operator'} -else if(n==':'){e.next();n=e.peek();if(n=='='){e.next();return'operator'} -else if(n==':'){e.next();return'punctuation'}} -else if('[](){}'.indexOf(n)!=-1){e.next();return'bracket'} -else if('.,'.indexOf(n)!=-1){e.next();return'punctuation'} -else if(e.match('end')){return'keyword'};for(var a in r){if(r.hasOwnProperty(a)){var o=r[a];if((o instanceof Array&&t(o,function(n){return e.match(n)}))||e.match(o))return d[a]}};if(/[+\-*\/^=<>&|]/.test(n)){e.next();return'operator'};if(e.match('define')){return'def'} -else{e.eatWhile(/[\w\-]/);if(c.hasOwnProperty(e.current())){return u[e.current()]} -else if(e.current().match(p)){return'variable'} -else{e.next();return'variable-2'}}};function b(e,n){var r=!1,o=!1,i=0,t;while((t=e.next())){if(t=='/'&&r){if(i>0){i--} -else{n.tokenize=s;break}} -else if(t=='*'&&o){i++};r=(t=='*');o=(t=='/')};return'comment'};function m(e,n){return function(t,i){var r=!1,o,a=!1;while((o=t.next())!=null){if(o==e&&!r){a=!0;break};r=!r&&o=='\\'};if(a||!r){i.tokenize=s};return n}};return{startState:function(){return{tokenize:s,currentIndent:0}},token:function(e,n){if(e.eatSpace())return null;var t=n.tokenize(e,n);return t},blockCommentStart:'/*',blockCommentEnd:'*/'}});e.defineMIME('text/x-dylan','dylan')}); -/* ./modules/editor/codemirror/mode/asn.1/asn.1.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('asn.1',function(t,e){var a=t.indentUnit,s=e.keywords||{},I=e.cmipVerbs||{},T=e.compareTypes||{},u=e.status||{},l=e.tags||{},S=e.storage||{},f=e.modifier||{},c=e.accessTypes||{},A=e.multiLineStrings,p=e.indentStatements!==!1;var o=/[\|\^]/,n;function N(e,t){var i=e.next();if(i=='"'||i=='\''){t.tokenize=m(i);return t.tokenize(e,t)};if(/[\[\]\(\){}:=,;]/.test(i)){n=i;return'punctuation'};if(i=='-'){if(e.eat('-')){e.skipToEnd();return'comment'}};if(/\d/.test(i)){e.eatWhile(/[\w\.]/);return'number'};if(o.test(i)){e.eatWhile(o);return'operator'};e.eatWhile(/[\w\-]/);var r=e.current();if(s.propertyIsEnumerable(r))return'keyword';if(I.propertyIsEnumerable(r))return'variable cmipVerbs';if(T.propertyIsEnumerable(r))return'atom compareTypes';if(u.propertyIsEnumerable(r))return'comment status';if(l.propertyIsEnumerable(r))return'variable-3 tags';if(S.propertyIsEnumerable(r))return'builtin storage';if(f.propertyIsEnumerable(r))return'string-2 modifier';if(c.propertyIsEnumerable(r))return'atom accessTypes';return'variable'};function m(e){return function(t,n){var i=!1,o,E=!1;while((o=t.next())!=null){if(o==e&&!i){var r=t.peek();if(r){r=r.toLowerCase();if(r=='b'||r=='h'||r=='o')t.next()};E=!0;break};i=!i&&o=='\\'};if(E||!(i||A))n.tokenize=null;return'string'}};function E(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function i(e,t,n){var r=e.indented;if(e.context&&e.context.type=='statement')r=e.context.indented;return e.context=new E(r,t,n,null,e.context)};function r(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new E((e||0)-a,0,'top',!1),indented:0,startOfLine:!0}},token:function(t,e){var o=e.context;if(t.sol()){if(o.align==null)o.align=!1;e.indented=t.indentation();e.startOfLine=!0};if(t.eatSpace())return null;n=null;var E=(e.tokenize||N)(t,e);if(E=='comment')return E;if(o.align==null)o.align=!0;if((n==';'||n==':'||n==',')&&o.type=='statement'){r(e)} -else if(n=='{')i(e,t.column(),'}');else if(n=='[')i(e,t.column(),']');else if(n=='(')i(e,t.column(),')');else if(n=='}'){while(o.type=='statement')o=r(e);if(o.type=='}')o=r(e);while(o.type=='statement')o=r(e)} -else if(n==o.type)r(e);else if(p&&(((o.type=='}'||o.type=='top')&&n!=';')||(o.type=='statement'&&n=='newstatement')))i(e,t.column(),'statement');e.startOfLine=!1;return E},electricChars:'{}',lineComment:'--',fold:'brace'}});function t(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};e.defineMIME('text/x-ttcn-asn',{name:'asn.1',keywords:t('DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS'),cmipVerbs:t('ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE'),compareTypes:t('OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION'),status:t('current deprecated mandatory obsolete'),tags:t('APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL'),storage:t('BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminAtring TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64'),modifier:t('ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED'),accessTypes:t('not-accessible accessible-for-notify read-only read-create read-write'),multiLineStrings:!0})}); -/* ./modules/editor/codemirror/mode/ruby/ruby.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ruby',function(e){function a(e){var n={};for(var t=0,i=e.length;t<i;++t)n[e[t]]=!0;return n};var l=a(['alias','and','BEGIN','begin','break','case','class','def','defined?','do','else','elsif','END','end','ensure','false','for','if','in','module','next','not','or','redo','rescue','retry','return','self','super','then','true','undef','unless','until','when','while','yield','nil','raise','throw','catch','fail','loop','callcc','caller','lambda','proc','public','protected','private','require','load','require_relative','extend','autoload','__END__','__FILE__','__LINE__','__dir__']),u=a(['def','class','case','for','while','until','module','then','catch','loop','proc','begin']),s=a(['end','until']),o={'[':']','{':'}','(':')'};var t;function n(e,t,n){n.tokenize.push(e);return e(t,n)};function r(e,a){if(e.sol()&&e.match('=begin')&&e.eol()){a.tokenize.push(k);return'comment'};if(e.eatSpace())return null;var r=e.next(),s;if(r=='`'||r=='\''||r=='"'){return n(i(r,'string',r=='"'||r=='`'),e,a)} -else if(r=='/'){if(d(e))return n(i(r,'string-2',!0),e,a);else return'operator'} -else if(r=='%'){var l='string',u=!0;if(e.eat('s'))l='atom';else if(e.eat(/[WQ]/))l='string';else if(e.eat(/[r]/))l='string-2';else if(e.eat(/[wxq]/)){l='string';u=!1};var f=e.eat(/[^\w\s=]/);if(!f)return'operator';if(o.propertyIsEnumerable(f))f=o[f];return n(i(f,l,u,!0),e,a)} -else if(r=='#'){e.skipToEnd();return'comment'} -else if(r=='<'&&(s=e.match(/^<-?[\`"']?([a-zA-Z_?]\w*)[\`"']?(?:;|$)/))){return n(p(s[1]),e,a)} -else if(r=='0'){if(e.eat('x'))e.eatWhile(/[\da-fA-F]/);else if(e.eat('b'))e.eatWhile(/[01]/);else e.eatWhile(/[0-7]/);return'number'} -else if(/\d/.test(r)){e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);return'number'} -else if(r=='?'){while(e.match(/^\\[CM]-/)){};if(e.eat('\\'))e.eatWhile(/\w/);else e.next();return'string'} -else if(r==':'){if(e.eat('\''))return n(i('\'','atom',!1),e,a);if(e.eat('"'))return n(i('"','atom',!0),e,a);if(e.eat(/[\<\>]/)){e.eat(/[\<\>]/);return'atom'};if(e.eat(/[\+\-\*\/\&\|\:\!]/)){return'atom'};if(e.eat(/[a-zA-Z$@_\xa1-\uffff]/)){e.eatWhile(/[\w$\xa1-\uffff]/);e.eat(/[\?\!\=]/);return'atom'};return'operator'} -else if(r=='@'&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/)){e.eat('@');e.eatWhile(/[\w\xa1-\uffff]/);return'variable-2'} -else if(r=='$'){if(e.eat(/[a-zA-Z_]/)){e.eatWhile(/[\w]/)} -else if(e.eat(/\d/)){e.eat(/\d/)} -else{e.next()};return'variable-3'} -else if(/[a-zA-Z_\xa1-\uffff]/.test(r)){e.eatWhile(/[\w\xa1-\uffff]/);e.eat(/[\?\!]/);if(e.eat(':'))return'atom';return'ident'} -else if(r=='|'&&(a.varList||a.lastTok=='{'||a.lastTok=='do')){t='|';return null} -else if(/[\(\)\[\]{}\\;]/.test(r)){t=r;return null} -else if(r=='-'&&e.eat('>')){return'arrow'} -else if(/[=+\-\/*:\.^%<>~|]/.test(r)){var c=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);if(r=='.'&&!c)t='.';return'operator'} -else{return null}};function d(e){var o=e.pos,n=0,t,r=!1,i=!1;while((t=e.next())!=null){if(!i){if('[{('.indexOf(t)>-1){n++} -else if(']})'.indexOf(t)>-1){n--;if(n<0)break} -else if(t=='/'&&n==0){r=!0;break};i=t=='\\'} -else{i=!1}};e.backUp(e.pos-o);return r};function f(e){if(!e)e=1;return function(t,n){if(t.peek()=='}'){if(e==1){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)} -else{n.tokenize[n.tokenize.length-1]=f(e-1)}} -else if(t.peek()=='{'){n.tokenize[n.tokenize.length-1]=f(e+1)};return r(t,n)}};function c(){var e=!1;return function(t,n){if(e){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)};e=!0;return r(t,n)}};function i(e,t,n,i){return function(r,o){var a=!1,l;if(o.context.type==='read-quoted-paused'){o.context=o.context.prev;r.eat('}')} -while((l=r.next())!=null){if(l==e&&(i||!a)){o.tokenize.pop();break};if(n&&l=='#'&&!a){if(r.eat('{')){if(e=='}'){o.context={prev:o.context,type:'read-quoted-paused'}};o.tokenize.push(f());break} -else if(/[@\$]/.test(r.peek())){o.tokenize.push(c());break}};a=!a&&l=='\\'};return t}};function p(e){return function(t,n){if(t.match(e))n.tokenize.pop();else t.skipToEnd();return'string'}};function k(e,t){if(e.sol()&&e.match('=end')&&e.eol())t.tokenize.pop();e.skipToEnd();return'comment'};return{startState:function(){return{tokenize:[r],indented:0,context:{type:'top',indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(n,e){t=null;if(n.sol())e.indented=n.indentation();var i=e.tokenize[e.tokenize.length-1](n,e),o,a=t;if(i=='ident'){var r=n.current();i=e.lastTok=='.'?'property':l.propertyIsEnumerable(n.current())?'keyword':/^[A-Z]/.test(r)?'tag':(e.lastTok=='def'||e.lastTok=='class'||e.varList)?'def':'variable';if(i=='keyword'){a=r;if(u.propertyIsEnumerable(r))o='indent';else if(s.propertyIsEnumerable(r))o='dedent';else if((r=='if'||r=='unless')&&n.column()==n.indentation())o='indent';else if(r=='do'&&e.context.indented<e.indented)o='indent'}};if(t||(i&&i!='comment'))e.lastTok=a;if(t=='|')e.varList=!e.varList;if(o=='indent'||/[\(\[\{]/.test(t))e.context={prev:e.context,type:t||i,indented:e.indented};else if((o=='dedent'||/[\)\]\}]/.test(t))&&e.context.prev)e.context=e.context.prev;if(n.eol())e.continuedLine=(t=='\\'||i=='operator');return i},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var a=n&&n.charAt(0),i=t.context,f=i.type==o[a]||i.type=='keyword'&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return i.indented+(f?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:'#',fold:'indent'}});e.defineMIME('text/x-ruby','ruby')}); -/* ./modules/editor/codemirror/mode/nsis/nsis.min.js */ -/* ./modules/editor/codemirror/mode/css/css.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('css',function(r,t){var y=t.inline;if(!t.propertyKeywords)t=e.resolveMode('text/css');var p=r.indentUnit,m=t.tokenHooks,x=t.documentTypes||{},z=t.mediaTypes||{},j=t.mediaFeatures||{},P=t.mediaValueKeywords||{},f=t.propertyKeywords||{},h=t.nonStandardPropertyKeywords||{},q=t.fontProperties||{},K=t.counterDescriptors||{},g=t.colorKeywords||{},b=t.valueKeywords||{},c=t.allowNested,C=t.lineComment,B=t.supportsAtComponent===!0;var u,i;function n(e,t){u=t;return e};function T(e,t){var r=e.next();if(m[r]){var i=m[r](e,t);if(i!==!1)return i};if(r=='@'){e.eatWhile(/[\w\\\-]/);return n('def',e.current())} -else if(r=='='||(r=='~'||r=='|')&&e.eat('=')){return n(null,'compare')} -else if(r=='"'||r=='\''){t.tokenize=w(r);return t.tokenize(e,t)} -else if(r=='#'){e.eatWhile(/[\w\\\-]/);return n('atom','hash')} -else if(r=='!'){e.match(/^\s*\w*/);return n('keyword','important')} -else if(/\d/.test(r)||r=='.'&&e.eat(/\d/)){e.eatWhile(/[\w.%]/);return n('number','unit')} -else if(r==='-'){if(/[\d.]/.test(e.peek())){e.eatWhile(/[\w.%]/);return n('number','unit')} -else if(e.match(/^-[\w\\\-]+/)){e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,!1))return n('variable-2','variable-definition');return n('variable-2','variable')} -else if(e.match(/^\w+-/)){return n('meta','meta')}} -else if(/[,+>*\/]/.test(r)){return n(null,'select-op')} -else if(r=='.'&&e.match(/^-?[_a-z][_a-z0-9-]*/i)){return n('qualifier','qualifier')} -else if(/[:;{}\[\]\(\)]/.test(r)){return n(null,r)} -else if((r=='u'&&e.match(/rl(-prefix)?\(/))||(r=='d'&&e.match('omain('))||(r=='r'&&e.match('egexp('))){e.backUp(1);t.tokenize=O;return n('property','word')} -else if(/[\w\\\-]/.test(r)){e.eatWhile(/[\w\\\-]/);return n('property','word')} -else{return n(null,null)}};function w(e){return function(t,r){var i=!1,o;while((o=t.next())!=null){if(o==e&&!i){if(e==')')t.backUp(1);break};i=!i&&o=='\\'};if(o==e||!i&&e!=')')r.tokenize=null;return n('string','string')}};function O(e,t){e.next();if(!e.match(/\s*["')]/,!1))t.tokenize=w(')');else t.tokenize=null;return n(null,'(')};function k(e,t,r){this.type=e;this.indent=t;this.prev=r};function a(e,t,r,i){e.context=new k(r,t.indentation()+(i===!1?0:p),e.context);return r};function l(e){if(e.context.prev)e.context=e.context.prev;return e.context.type};function d(e,t,r){return o[r.context.type](e,t,r)};function s(e,t,r,i){for(var o=i||1;o>0;o--)r.context=r.context.prev;return d(e,t,r)};function v(e){var t=e.current().toLowerCase();if(b.hasOwnProperty(t))i='atom';else if(g.hasOwnProperty(t))i='keyword';else i='variable'};var o={};o.top=function(e,t,r){if(e=='{'){return a(r,t,'block')} -else if(e=='}'&&r.context.prev){return l(r)} -else if(B&&/@component/.test(e)){return a(r,t,'atComponentBlock')} -else if(/^@(-moz-)?document$/.test(e)){return a(r,t,'documentTypes')} -else if(/^@(media|supports|(-moz-)?document|import)$/.test(e)){return a(r,t,'atBlock')} -else if(/^@(font-face|counter-style)/.test(e)){r.stateArg=e;return'restricted_atBlock_before'} -else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e)){return'keyframes'} -else if(e&&e.charAt(0)=='@'){return a(r,t,'at')} -else if(e=='hash'){i='builtin'} -else if(e=='word'){i='tag'} -else if(e=='variable-definition'){return'maybeprop'} -else if(e=='interpolation'){return a(r,t,'interpolation')} -else if(e==':'){return'pseudo'} -else if(c&&e=='('){return a(r,t,'parens')};return r.context.type};o.block=function(e,t,r){if(e=='word'){var a=t.current().toLowerCase();if(f.hasOwnProperty(a)){i='property';return'maybeprop'} -else if(h.hasOwnProperty(a)){i='string-2';return'maybeprop'} -else if(c){i=t.match(/^\s*:(?:\s|$)/,!1)?'property':'tag';return'block'} -else{i+=' error';return'maybeprop'}} -else if(e=='meta'){return'block'} -else if(!c&&(e=='hash'||e=='qualifier')){i='error';return'block'} -else{return o.top(e,t,r)}};o.maybeprop=function(e,t,r){if(e==':')return a(r,t,'prop');return d(e,t,r)};o.prop=function(e,t,r){if(e==';')return l(r);if(e=='{'&&c)return a(r,t,'propBlock');if(e=='}'||e=='{')return s(e,t,r);if(e=='(')return a(r,t,'parens');if(e=='hash'&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){i+=' error'} -else if(e=='word'){v(t)} -else if(e=='interpolation'){return a(r,t,'interpolation')};return'prop'};o.propBlock=function(e,t,r){if(e=='}')return l(r);if(e=='word'){i='property';return'maybeprop'};return r.context.type};o.parens=function(e,t,r){if(e=='{'||e=='}')return s(e,t,r);if(e==')')return l(r);if(e=='(')return a(r,t,'parens');if(e=='interpolation')return a(r,t,'interpolation');if(e=='word')v(t);return'parens'};o.pseudo=function(e,t,r){if(e=='meta')return'pseudo';if(e=='word'){i='variable-3';return r.context.type};return d(e,t,r)};o.documentTypes=function(e,t,r){if(e=='word'&&x.hasOwnProperty(t.current())){i='tag';return r.context.type} -else{return o.atBlock(e,t,r)}};o.atBlock=function(e,t,r){if(e=='(')return a(r,t,'atBlock_parens');if(e=='}'||e==';')return s(e,t,r);if(e=='{')return l(r)&&a(r,t,c?'block':'top');if(e=='interpolation')return a(r,t,'interpolation');if(e=='word'){var o=t.current().toLowerCase();if(o=='only'||o=='not'||o=='and'||o=='or')i='keyword';else if(z.hasOwnProperty(o))i='attribute';else if(j.hasOwnProperty(o))i='property';else if(P.hasOwnProperty(o))i='keyword';else if(f.hasOwnProperty(o))i='property';else if(h.hasOwnProperty(o))i='string-2';else if(b.hasOwnProperty(o))i='atom';else if(g.hasOwnProperty(o))i='keyword';else i='error'};return r.context.type};o.atComponentBlock=function(e,t,r){if(e=='}')return s(e,t,r);if(e=='{')return l(r)&&a(r,t,c?'block':'top',!1);if(e=='word')i='error';return r.context.type};o.atBlock_parens=function(e,t,r){if(e==')')return l(r);if(e=='{'||e=='}')return s(e,t,r,2);return o.atBlock(e,t,r)};o.restricted_atBlock_before=function(e,t,r){if(e=='{')return a(r,t,'restricted_atBlock');if(e=='word'&&r.stateArg=='@counter-style'){i='variable';return'restricted_atBlock_before'};return d(e,t,r)};o.restricted_atBlock=function(e,t,r){if(e=='}'){r.stateArg=null;return l(r)};if(e=='word'){if((r.stateArg=='@font-face'&&!q.hasOwnProperty(t.current().toLowerCase()))||(r.stateArg=='@counter-style'&&!K.hasOwnProperty(t.current().toLowerCase())))i='error';else i='property';return'maybeprop'};return'restricted_atBlock'};o.keyframes=function(e,t,r){if(e=='word'){i='variable';return'keyframes'};if(e=='{')return a(r,t,'top');return d(e,t,r)};o.at=function(e,t,r){if(e==';')return l(r);if(e=='{'||e=='}')return s(e,t,r);if(e=='word')i='tag';else if(e=='hash')i='builtin';return'at'};o.interpolation=function(e,t,r){if(e=='}')return l(r);if(e=='{'||e==';')return s(e,t,r);if(e=='word')i='variable';else if(e!='variable'&&e!='('&&e!=')')i='error';return'interpolation'};return{startState:function(e){return{tokenize:null,state:y?'block':'top',stateArg:null,context:new k(y?'block':'top',e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||T)(e,t);if(r&&typeof r=='object'){u=r[1];r=r[0]};i=r;if(u!='comment')t.state=o[t.state](u,e,t);return i},indent:function(e,t){var r=e.context,i=t&&t.charAt(0),o=r.indent;if(r.type=='prop'&&(i=='}'||i==')'))r=r.prev;if(r.prev){if(i=='}'&&(r.type=='block'||r.type=='top'||r.type=='interpolation'||r.type=='restricted_atBlock')){r=r.prev;o=r.indent} -else if(i==')'&&(r.type=='parens'||r.type=='atBlock_parens')||i=='{'&&(r.type=='at'||r.type=='atBlock')){o=Math.max(0,r.indent-p)}};return o},electricChars:'}',blockCommentStart:'/*',blockCommentEnd:'*/',blockCommentContinue:' * ',lineComment:C,fold:'brace'}});function t(e){var r={};for(var t=0;t<e.length;++t){r[e[t].toLowerCase()]=!0};return r};var u=['domain','regexp','url','url-prefix'],p=t(u),m=['all','aural','braille','handheld','print','projection','screen','tty','tv','embossed'],i=t(m),f=['width','min-width','max-width','height','min-height','max-height','device-width','min-device-width','max-device-width','device-height','min-device-height','max-device-height','aspect-ratio','min-aspect-ratio','max-aspect-ratio','device-aspect-ratio','min-device-aspect-ratio','max-device-aspect-ratio','color','min-color','max-color','color-index','min-color-index','max-color-index','monochrome','min-monochrome','max-monochrome','resolution','min-resolution','max-resolution','scan','grid','orientation','device-pixel-ratio','min-device-pixel-ratio','max-device-pixel-ratio','pointer','any-pointer','hover','any-hover'],o=t(f),h=['landscape','portrait','none','coarse','fine','on-demand','hover','interlace','progressive'],d=t(h),g=['align-content','align-items','align-self','alignment-adjust','alignment-baseline','anchor-point','animation','animation-delay','animation-direction','animation-duration','animation-fill-mode','animation-iteration-count','animation-name','animation-play-state','animation-timing-function','appearance','azimuth','backface-visibility','background','background-attachment','background-blend-mode','background-clip','background-color','background-image','background-origin','background-position','background-repeat','background-size','baseline-shift','binding','bleed','bookmark-label','bookmark-level','bookmark-state','bookmark-target','border','border-bottom','border-bottom-color','border-bottom-left-radius','border-bottom-right-radius','border-bottom-style','border-bottom-width','border-collapse','border-color','border-image','border-image-outset','border-image-repeat','border-image-slice','border-image-source','border-image-width','border-left','border-left-color','border-left-style','border-left-width','border-radius','border-right','border-right-color','border-right-style','border-right-width','border-spacing','border-style','border-top','border-top-color','border-top-left-radius','border-top-right-radius','border-top-style','border-top-width','border-width','bottom','box-decoration-break','box-shadow','box-sizing','break-after','break-before','break-inside','caption-side','caret-color','clear','clip','color','color-profile','column-count','column-fill','column-gap','column-rule','column-rule-color','column-rule-style','column-rule-width','column-span','column-width','columns','content','counter-increment','counter-reset','crop','cue','cue-after','cue-before','cursor','direction','display','dominant-baseline','drop-initial-after-adjust','drop-initial-after-align','drop-initial-before-adjust','drop-initial-before-align','drop-initial-size','drop-initial-value','elevation','empty-cells','fit','fit-position','flex','flex-basis','flex-direction','flex-flow','flex-grow','flex-shrink','flex-wrap','float','float-offset','flow-from','flow-into','font','font-feature-settings','font-family','font-kerning','font-language-override','font-size','font-size-adjust','font-stretch','font-style','font-synthesis','font-variant','font-variant-alternates','font-variant-caps','font-variant-east-asian','font-variant-ligatures','font-variant-numeric','font-variant-position','font-weight','grid','grid-area','grid-auto-columns','grid-auto-flow','grid-auto-rows','grid-column','grid-column-end','grid-column-gap','grid-column-start','grid-gap','grid-row','grid-row-end','grid-row-gap','grid-row-start','grid-template','grid-template-areas','grid-template-columns','grid-template-rows','hanging-punctuation','height','hyphens','icon','image-orientation','image-rendering','image-resolution','inline-box-align','justify-content','justify-items','justify-self','left','letter-spacing','line-break','line-height','line-stacking','line-stacking-ruby','line-stacking-shift','line-stacking-strategy','list-style','list-style-image','list-style-position','list-style-type','margin','margin-bottom','margin-left','margin-right','margin-top','marks','marquee-direction','marquee-loop','marquee-play-count','marquee-speed','marquee-style','max-height','max-width','min-height','min-width','move-to','nav-down','nav-index','nav-left','nav-right','nav-up','object-fit','object-position','opacity','order','orphans','outline','outline-color','outline-offset','outline-style','outline-width','overflow','overflow-style','overflow-wrap','overflow-x','overflow-y','padding','padding-bottom','padding-left','padding-right','padding-top','page','page-break-after','page-break-before','page-break-inside','page-policy','pause','pause-after','pause-before','perspective','perspective-origin','pitch','pitch-range','place-content','place-items','place-self','play-during','position','presentation-level','punctuation-trim','quotes','region-break-after','region-break-before','region-break-inside','region-fragment','rendering-intent','resize','rest','rest-after','rest-before','richness','right','rotation','rotation-point','ruby-align','ruby-overhang','ruby-position','ruby-span','shape-image-threshold','shape-inside','shape-margin','shape-outside','size','speak','speak-as','speak-header','speak-numeral','speak-punctuation','speech-rate','stress','string-set','tab-size','table-layout','target','target-name','target-new','target-position','text-align','text-align-last','text-decoration','text-decoration-color','text-decoration-line','text-decoration-skip','text-decoration-style','text-emphasis','text-emphasis-color','text-emphasis-position','text-emphasis-style','text-height','text-indent','text-justify','text-outline','text-overflow','text-shadow','text-size-adjust','text-space-collapse','text-transform','text-underline-position','text-wrap','top','transform','transform-origin','transform-style','transition','transition-delay','transition-duration','transition-property','transition-timing-function','unicode-bidi','user-select','vertical-align','visibility','voice-balance','voice-duration','voice-family','voice-pitch','voice-range','voice-rate','voice-stress','voice-volume','volume','white-space','widows','width','will-change','word-break','word-spacing','word-wrap','z-index','clip-path','clip-rule','mask','enable-background','filter','flood-color','flood-opacity','lighting-color','stop-color','stop-opacity','pointer-events','color-interpolation','color-interpolation-filters','color-rendering','fill','fill-opacity','fill-rule','image-rendering','marker','marker-end','marker-mid','marker-start','shape-rendering','stroke','stroke-dasharray','stroke-dashoffset','stroke-linecap','stroke-linejoin','stroke-miterlimit','stroke-opacity','stroke-width','text-rendering','baseline-shift','dominant-baseline','glyph-orientation-horizontal','glyph-orientation-vertical','text-anchor','writing-mode'],a=t(g),b=['scrollbar-arrow-color','scrollbar-base-color','scrollbar-dark-shadow-color','scrollbar-face-color','scrollbar-highlight-color','scrollbar-shadow-color','scrollbar-3d-light-color','scrollbar-track-color','shape-inside','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','zoom'],n=t(b),v=['font-family','src','unicode-range','font-variant','font-feature-settings','font-stretch','font-weight','font-style'],l=t(v),x=['additive-symbols','fallback','negative','pad','prefix','range','speak-as','suffix','symbols','system'],y=t(x),w=['aliceblue','antiquewhite','aqua','aquamarine','azure','beige','bisque','black','blanchedalmond','blue','blueviolet','brown','burlywood','cadetblue','chartreuse','chocolate','coral','cornflowerblue','cornsilk','crimson','cyan','darkblue','darkcyan','darkgoldenrod','darkgray','darkgreen','darkkhaki','darkmagenta','darkolivegreen','darkorange','darkorchid','darkred','darksalmon','darkseagreen','darkslateblue','darkslategray','darkturquoise','darkviolet','deeppink','deepskyblue','dimgray','dodgerblue','firebrick','floralwhite','forestgreen','fuchsia','gainsboro','ghostwhite','gold','goldenrod','gray','grey','green','greenyellow','honeydew','hotpink','indianred','indigo','ivory','khaki','lavender','lavenderblush','lawngreen','lemonchiffon','lightblue','lightcoral','lightcyan','lightgoldenrodyellow','lightgray','lightgreen','lightpink','lightsalmon','lightseagreen','lightskyblue','lightslategray','lightsteelblue','lightyellow','lime','limegreen','linen','magenta','maroon','mediumaquamarine','mediumblue','mediumorchid','mediumpurple','mediumseagreen','mediumslateblue','mediumspringgreen','mediumturquoise','mediumvioletred','midnightblue','mintcream','mistyrose','moccasin','navajowhite','navy','oldlace','olive','olivedrab','orange','orangered','orchid','palegoldenrod','palegreen','paleturquoise','palevioletred','papayawhip','peachpuff','peru','pink','plum','powderblue','purple','rebeccapurple','red','rosybrown','royalblue','saddlebrown','salmon','sandybrown','seagreen','seashell','sienna','silver','skyblue','slateblue','slategray','snow','springgreen','steelblue','tan','teal','thistle','tomato','turquoise','violet','wheat','white','whitesmoke','yellow','yellowgreen'],s=t(w),k=['above','absolute','activeborder','additive','activecaption','afar','after-white-space','ahead','alias','all','all-scroll','alphabetic','alternate','always','amharic','amharic-abegede','antialiased','appworkspace','arabic-indic','armenian','asterisks','attr','auto','auto-flow','avoid','avoid-column','avoid-page','avoid-region','background','backwards','baseline','below','bidi-override','binary','bengali','blink','block','block-axis','bold','bolder','border','border-box','both','bottom','break','break-all','break-word','bullets','button','button-bevel','buttonface','buttonhighlight','buttonshadow','buttontext','calc','cambodian','capitalize','caps-lock-indicator','caption','captiontext','caret','cell','center','checkbox','circle','cjk-decimal','cjk-earthly-branch','cjk-heavenly-stem','cjk-ideographic','clear','clip','close-quote','col-resize','collapse','color','color-burn','color-dodge','column','column-reverse','compact','condensed','contain','content','contents','content-box','context-menu','continuous','copy','counter','counters','cover','crop','cross','crosshair','currentcolor','cursive','cyclic','darken','dashed','decimal','decimal-leading-zero','default','default-button','dense','destination-atop','destination-in','destination-out','destination-over','devanagari','difference','disc','discard','disclosure-closed','disclosure-open','document','dot-dash','dot-dot-dash','dotted','double','down','e-resize','ease','ease-in','ease-in-out','ease-out','element','ellipse','ellipsis','embed','end','ethiopic','ethiopic-abegede','ethiopic-abegede-am-et','ethiopic-abegede-gez','ethiopic-abegede-ti-er','ethiopic-abegede-ti-et','ethiopic-halehame-aa-er','ethiopic-halehame-aa-et','ethiopic-halehame-am-et','ethiopic-halehame-gez','ethiopic-halehame-om-et','ethiopic-halehame-sid-et','ethiopic-halehame-so-et','ethiopic-halehame-ti-er','ethiopic-halehame-ti-et','ethiopic-halehame-tig','ethiopic-numeric','ew-resize','exclusion','expanded','extends','extra-condensed','extra-expanded','fantasy','fast','fill','fixed','flat','flex','flex-end','flex-start','footnotes','forwards','from','geometricPrecision','georgian','graytext','grid','groove','gujarati','gurmukhi','hand','hangul','hangul-consonant','hard-light','hebrew','help','hidden','hide','higher','highlight','highlighttext','hiragana','hiragana-iroha','horizontal','hsl','hsla','hue','icon','ignore','inactiveborder','inactivecaption','inactivecaptiontext','infinite','infobackground','infotext','inherit','initial','inline','inline-axis','inline-block','inline-flex','inline-grid','inline-table','inset','inside','intrinsic','invert','italic','japanese-formal','japanese-informal','justify','kannada','katakana','katakana-iroha','keep-all','khmer','korean-hangul-formal','korean-hanja-formal','korean-hanja-informal','landscape','lao','large','larger','left','level','lighter','lighten','line-through','linear','linear-gradient','lines','list-item','listbox','listitem','local','logical','loud','lower','lower-alpha','lower-armenian','lower-greek','lower-hexadecimal','lower-latin','lower-norwegian','lower-roman','lowercase','ltr','luminosity','malayalam','match','matrix','matrix3d','media-controls-background','media-current-time-display','media-fullscreen-button','media-mute-button','media-play-button','media-return-to-realtime-button','media-rewind-button','media-seek-back-button','media-seek-forward-button','media-slider','media-sliderthumb','media-time-remaining-display','media-volume-slider','media-volume-slider-container','media-volume-sliderthumb','medium','menu','menulist','menulist-button','menulist-text','menulist-textfield','menutext','message-box','middle','min-intrinsic','mix','mongolian','monospace','move','multiple','multiply','myanmar','n-resize','narrower','ne-resize','nesw-resize','no-close-quote','no-drop','no-open-quote','no-repeat','none','normal','not-allowed','nowrap','ns-resize','numbers','numeric','nw-resize','nwse-resize','oblique','octal','opacity','open-quote','optimizeLegibility','optimizeSpeed','oriya','oromo','outset','outside','outside-shape','overlay','overline','padding','padding-box','painted','page','paused','persian','perspective','plus-darker','plus-lighter','pointer','polygon','portrait','pre','pre-line','pre-wrap','preserve-3d','progress','push-button','radial-gradient','radio','read-only','read-write','read-write-plaintext-only','rectangle','region','relative','repeat','repeating-linear-gradient','repeating-radial-gradient','repeat-x','repeat-y','reset','reverse','rgb','rgba','ridge','right','rotate','rotate3d','rotateX','rotateY','rotateZ','round','row','row-resize','row-reverse','rtl','run-in','running','s-resize','sans-serif','saturation','scale','scale3d','scaleX','scaleY','scaleZ','screen','scroll','scrollbar','scroll-position','se-resize','searchfield','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','self-start','self-end','semi-condensed','semi-expanded','separate','serif','show','sidama','simp-chinese-formal','simp-chinese-informal','single','skew','skewX','skewY','skip-white-space','slide','slider-horizontal','slider-vertical','sliderthumb-horizontal','sliderthumb-vertical','slow','small','small-caps','small-caption','smaller','soft-light','solid','somali','source-atop','source-in','source-out','source-over','space','space-around','space-between','space-evenly','spell-out','square','square-button','start','static','status-bar','stretch','stroke','sub','subpixel-antialiased','super','sw-resize','symbolic','symbols','system-ui','table','table-caption','table-cell','table-column','table-column-group','table-footer-group','table-header-group','table-row','table-row-group','tamil','telugu','text','text-bottom','text-top','textarea','textfield','thai','thick','thin','threeddarkshadow','threedface','threedhighlight','threedlightshadow','threedshadow','tibetan','tigre','tigrinya-er','tigrinya-er-abegede','tigrinya-et','tigrinya-et-abegede','to','top','trad-chinese-formal','trad-chinese-informal','transform','translate','translate3d','translateX','translateY','translateZ','transparent','ultra-condensed','ultra-expanded','underline','unset','up','upper-alpha','upper-armenian','upper-greek','upper-hexadecimal','upper-latin','upper-norwegian','upper-roman','uppercase','urdu','url','var','vertical','vertical-text','visible','visibleFill','visiblePainted','visibleStroke','visual','w-resize','wait','wave','wider','window','windowframe','windowtext','words','wrap','wrap-reverse','x-large','x-small','xor','xx-large','xx-small'],c=t(k),z=u.concat(m).concat(f).concat(h).concat(g).concat(b).concat(w).concat(k);e.registerHelper('hintWords','css',z);function r(e,t){var i=!1,r;while((r=e.next())!=null){if(i&&r=='/'){t.tokenize=null;break};i=(r=='*')};return['comment','comment']};e.defineMIME('text/css',{documentTypes:p,mediaTypes:i,mediaFeatures:o,mediaValueKeywords:d,propertyKeywords:a,nonStandardPropertyKeywords:n,fontProperties:l,counterDescriptors:y,colorKeywords:s,valueKeywords:c,tokenHooks:{'/':function(e,t){if(!e.eat('*'))return!1;t.tokenize=r;return r(e,t)}},name:'css'});e.defineMIME('text/x-scss',{mediaTypes:i,mediaFeatures:o,mediaValueKeywords:d,propertyKeywords:a,nonStandardPropertyKeywords:n,colorKeywords:s,valueKeywords:c,fontProperties:l,allowNested:!0,lineComment:'//',tokenHooks:{'/':function(e,t){if(e.eat('/')){e.skipToEnd();return['comment','comment']} -else if(e.eat('*')){t.tokenize=r;return r(e,t)} -else{return['operator','operator']}},':':function(e){if(e.match(/\s*\{/,!1))return[null,null];return!1},'$':function(e){e.match(/^[\w-]+/);if(e.match(/^\s*:/,!1))return['variable-2','variable-definition'];return['variable-2','variable']},'#':function(e){if(!e.eat('{'))return!1;return[null,'interpolation']}},name:'css',helperType:'scss'});e.defineMIME('text/x-less',{mediaTypes:i,mediaFeatures:o,mediaValueKeywords:d,propertyKeywords:a,nonStandardPropertyKeywords:n,colorKeywords:s,valueKeywords:c,fontProperties:l,allowNested:!0,lineComment:'//',tokenHooks:{'/':function(e,t){if(e.eat('/')){e.skipToEnd();return['comment','comment']} -else if(e.eat('*')){t.tokenize=r;return r(e,t)} -else{return['operator','operator']}},'@':function(e){if(e.eat('{'))return[null,'interpolation'];if(e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1))return!1;e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,!1))return['variable-2','variable-definition'];return['variable-2','variable']},'&':function(){return['atom','atom']}},name:'css',helperType:'less'});e.defineMIME('text/x-gss',{documentTypes:p,mediaTypes:i,mediaFeatures:o,propertyKeywords:a,nonStandardPropertyKeywords:n,fontProperties:l,counterDescriptors:y,colorKeywords:s,valueKeywords:c,supportsAtComponent:!0,tokenHooks:{'/':function(e,t){if(!e.eat('*'))return!1;t.tokenize=r;return r(e,t)}},name:'css',helperType:'gss'})}); -/* ./modules/editor/codemirror/mode/haskell-literate/haskell-literate.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../haskell/haskell'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../haskell/haskell'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('haskell-literate',function(t,n){var i=e.getMode(t,(n&&n.base)||'haskell');return{startState:function(){return{inCode:!1,baseState:e.startState(i)}},token:function(e,t){if(e.sol()){if(t.inCode=e.eat('>'))return'meta'};if(t.inCode){return i.token(e,t.baseState)} -else{e.skipToEnd();return'comment'}},innerMode:function(e){return e.inCode?{state:e.baseState,mode:i}:null}}},'haskell');e.defineMIME('text/x-literate-haskell','haskell-literate')}); -/* ./modules/editor/codemirror/mode/mbox/mbox.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var r=['From','Sender','Reply-To','To','Cc','Bcc','Message-ID','In-Reply-To','References','Resent-From','Resent-Sender','Resent-To','Resent-Cc','Resent-Bcc','Resent-Message-ID','Return-Path','Received'],n=['Date','Subject','Comments','Keywords','Resent-Date'];e.registerHelper('hintWords','mbox',r.concat(n));var t=/^[ \t]/,i=/^From /,a=new RegExp('^('+r.join('|')+'): '),o=new RegExp('^('+n.join('|')+'): '),d=/^[^:]+:/,c=/^[^ ]+@[^ ]+/,m=/^.*?(?=[^ ]+?@[^ ]+)/,s=/^<.*?>/,u=/^.*?(?=<.*>)/;function f(e){if(e==='Subject')return'header';return'string'};function l(r,e){if(r.sol()){e.inSeparator=!1;if(e.inHeader&&r.match(t)){return null} -else{e.inHeader=!1;e.header=null};if(r.match(i)){e.inHeaders=!0;e.inSeparator=!0;return'atom'};var n,p=!1;if((n=r.match(o))||(p=!0)&&(n=r.match(a))){e.inHeaders=!0;e.inHeader=!0;e.emailPermitted=p;e.header=n[1];return'atom'};if(e.inHeaders&&(n=r.match(d))){e.inHeader=!0;e.emailPermitted=!0;e.header=n[1];return'atom'};e.inHeaders=!1;r.skipToEnd();return null};if(e.inSeparator){if(r.match(c))return'link';if(r.match(m))return'atom';r.skipToEnd();return'atom'};if(e.inHeader){var l=f(e.header);if(e.emailPermitted){if(r.match(s))return l+' link';if(r.match(u))return l};r.skipToEnd();return l};r.skipToEnd();return null};e.defineMode('mbox',function(){return{startState:function(){return{inSeparator:!1,inHeader:!1,emailPermitted:!1,header:null,inHeaders:!1}},token:l,blankLine:function(e){e.inHeaders=e.inSeparator=e.inHeader=!1}}});e.defineMIME('application/mbox','mbox')}); -/* ./modules/editor/codemirror/mode/dtd/dtd.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('dtd',function(t){var l=t.indentUnit,e;function n(t,n){e=n;return t};function r(e,r){var t=e.next();if(t=='<'&&e.eat('!')){if(e.eatWhile(/[\-]/)){r.tokenize=i;return i(e,r)} -else if(e.eatWhile(/[\w]/))return n('keyword','doindent')} -else if(t=='<'&&e.eat('?')){r.tokenize=s('meta','?>');return n('meta',t)} -else if(t=='#'&&e.eatWhile(/[\w]/))return n('atom','tag');else if(t=='|')return n('keyword','seperator');else if(t.match(/[\(\)\[\]\-\.,\+\?>]/))return n(null,t);else if(t.match(/[\[\]]/))return n('rule',t);else if(t=='"'||t=='\''){r.tokenize=u(t);return r.tokenize(e,r)} -else if(e.eatWhile(/[a-zA-Z\?\+\d]/)){var l=e.current();if(l.substr(l.length-1,l.length).match(/\?|\+/)!==null)e.backUp(1);return n('tag','tag')} -else if(t=='%'||t=='*')return n('number','number');else{e.eatWhile(/[\w\\\-_%.{,]/);return n(null,null)}};function i(e,t){var i=0,l;while((l=e.next())!=null){if(i>=2&&l=='>'){t.tokenize=r;break};i=(l=='-')?i+1:0};return n('comment','comment')};function u(e){return function(t,i){var l=!1,u;while((u=t.next())!=null){if(u==e&&!l){i.tokenize=r;break};l=!l&&u=='\\'};return n('string','tag')}};function s(e,t){return function(n,i){while(!n.eol()){if(n.match(t)){i.tokenize=r;break};n.next()};return e}};return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(t,n){if(t.eatSpace())return null;var r=n.tokenize(t,n),i=n.stack[n.stack.length-1];if(t.current()=='['||e==='doindent'||e=='[')n.stack.push('rule');else if(e==='endtag')n.stack[n.stack.length-1]='endtag';else if(t.current()==']'||e==']'||(e=='>'&&i=='rule'))n.stack.pop();else if(e=='[')n.stack.push('[');return r},indent:function(t,n){var r=t.stack.length;if(n.match(/\]\s+|\]/))r=r-1;else if(n.substr(n.length-1,n.length)==='>'){if(n.substr(0,1)==='<'){} -else if(e=='doindent'&&n.length>1){} -else if(e=='doindent')r--;else if(e=='>'&&n.length>1){} -else if(e=='tag'&&n!=='>'){} -else if(e=='tag'&&t.stack[t.stack.length-1]=='rule')r--;else if(e=='tag')r++;else if(n==='>'&&t.stack[t.stack.length-1]=='rule'&&e==='>')r--;else if(n==='>'&&t.stack[t.stack.length-1]=='rule'){} -else if(n.substr(0,1)!=='<'&&n.substr(0,1)==='>')r=r-1;else if(n==='>'){} -else r=r-1;if(e==null||e==']')r--};return t.baseIndent+r*l},electricChars:']>'}});e.defineMIME('application/xml-dtd','dtd')}); -/* ./modules/editor/codemirror/mode/erlang/erlang.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMIME('text/x-erlang','erlang');e.defineMode('erlang',function(r){'use strict';var h=['-type','-spec','-export_type','-opaque'],y=['after','begin','catch','case','cond','end','fun','if','let','of','query','receive','try','when'],v=/[\->,;]/,w=['->',';',','],x=['and','andalso','band','bnot','bor','bsl','bsr','bxor','div','not','or','orelse','rem','xor'],S=/[\+\-\*\/<>=\|:!]/,z=['=','+','-','*','/','>','>=','<','=<','=:=','==','=/=','/=','||','<-','!'],W=/[<\(\[\{]/,c=['<<','(','[','{'],U=/[>\)\]\}]/,f=['}',']',')','>>'],E=['is_atom','is_binary','is_bitstring','is_boolean','is_float','is_function','is_integer','is_list','is_number','is_pid','is_port','is_record','is_reference','is_tuple','atom','binary','bitstring','boolean','function','integer','list','number','pid','port','record','reference','tuple'],A=['abs','adler32','adler32_combine','alive','apply','atom_to_binary','atom_to_list','binary_to_atom','binary_to_existing_atom','binary_to_list','binary_to_term','bit_size','bitstring_to_list','byte_size','check_process_code','contact_binary','crc32','crc32_combine','date','decode_packet','delete_module','disconnect_node','element','erase','exit','float','float_to_list','garbage_collect','get','get_keys','group_leader','halt','hd','integer_to_list','internal_bif','iolist_size','iolist_to_binary','is_alive','is_atom','is_binary','is_bitstring','is_boolean','is_float','is_function','is_integer','is_list','is_number','is_pid','is_port','is_process_alive','is_record','is_reference','is_tuple','length','link','list_to_atom','list_to_binary','list_to_bitstring','list_to_existing_atom','list_to_float','list_to_integer','list_to_pid','list_to_tuple','load_module','make_ref','module_loaded','monitor_node','node','node_link','node_unlink','nodes','notalive','now','open_port','pid_to_list','port_close','port_command','port_connect','port_control','pre_loaded','process_flag','process_info','processes','purge_module','put','register','registered','round','self','setelement','size','spawn','spawn_link','spawn_monitor','spawn_opt','split_binary','statistics','term_to_binary','time','throw','tl','trunc','tuple_size','tuple_to_list','unlink','unregister','whereis'],u=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,Z=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;function M(e,r){if(r.in_string){r.in_string=(!d(e));return t(r,e,'string')};if(r.in_atom){r.in_atom=(!b(e));return t(r,e,'atom')};if(e.eatSpace()){return t(r,e,'whitespace')};if(!a(r)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)){if(n(e.current(),h)){return t(r,e,'type')} -else{return t(r,e,'attribute')}};var i=e.next();if(i=='%'){e.skipToEnd();return t(r,e,'comment')};if(i==':'){return t(r,e,'colon')};if(i=='?'){e.eatSpace();e.eatWhile(u);return t(r,e,'macro')};if(i=='#'){e.eatSpace();e.eatWhile(u);return t(r,e,'record')};if(i=='$'){if(e.next()=='\\'&&!e.match(Z)){return t(r,e,'error')};return t(r,e,'number')};if(i=='.'){return t(r,e,'dot')};if(i=='\''){if(!(r.in_atom=(!b(e)))){if(e.match(/\s*\/\s*[0-9]/,!1)){e.match(/\s*\/\s*[0-9]/,!0);return t(r,e,'fun')};if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1)){return t(r,e,'function')}};return t(r,e,'atom')};if(i=='"'){r.in_string=(!d(e));return t(r,e,'string')};if(/[A-Z_Ø-ÞÀ-Ö]/.test(i)){e.eatWhile(u);return t(r,e,'variable')};if(/[a-z_ß-öø-ÿ]/.test(i)){e.eatWhile(u);if(e.match(/\s*\/\s*[0-9]/,!1)){e.match(/\s*\/\s*[0-9]/,!0);return t(r,e,'fun')};var o=e.current();if(n(o,y)){return t(r,e,'keyword')} -else if(n(o,x)){return t(r,e,'operator')} -else if(e.match(/\s*\(/,!1)){if(n(o,A)&&((a(r).token!=':')||(a(r,2).token=='erlang'))){return t(r,e,'builtin')} -else if(n(o,E)){return t(r,e,'guard')} -else{return t(r,e,'function')}} -else if(P(e)==':'){if(o=='erlang'){return t(r,e,'builtin')} -else{return t(r,e,'function')}} -else if(n(o,['true','false'])){return t(r,e,'boolean')} -else{return t(r,e,'atom')}};var s=/[0-9]/,l=/[0-9a-zA-Z]/;if(s.test(i)){e.eatWhile(s);if(e.eat('#')){if(!e.eatWhile(l)){e.backUp(1)}} -else if(e.eat('.')){if(!e.eatWhile(s)){e.backUp(1)} -else{if(e.eat(/[eE]/)){if(e.eat(/[-+]/)){if(!e.eatWhile(s)){e.backUp(2)}} -else{if(!e.eatWhile(s)){e.backUp(1)}}}}};return t(r,e,'number')};if(p(e,W,c)){return t(r,e,'open_paren')};if(p(e,U,f)){return t(r,e,'close_paren')};if(m(e,v,w)){return t(r,e,'separator')};if(m(e,S,z)){return t(r,e,'operator')};return t(r,e,null)};function p(e,t,r){if(e.current().length==1&&t.test(e.current())){e.backUp(1);while(t.test(e.peek())){e.next();if(n(e.current(),r)){return!0}};e.backUp(e.current().length-1)};return!1};function m(e,t,r){if(e.current().length==1&&t.test(e.current())){while(t.test(e.peek())){e.next()} -while(0<e.current().length){if(n(e.current(),r)){return!0} -else{e.backUp(1)}};e.next()};return!1};function d(e){return g(e,'"','\\')};function b(e){return g(e,'\'','\\')};function g(e,t,r){while(!e.eol()){var n=e.next();if(n==t){return!0} -else if(n==r){e.next()}};return!1};function P(e){var t=e.match(/([\n\s]+|%[^\n]*\n)*(.)/,!1);return t?t.pop():''};function n(e,t){return(-1<t.indexOf(e))};function t(e,t,r){j(e,q(r,t));switch(r){case'atom':return'atom';case'attribute':return'attribute';case'boolean':return'atom';case'builtin':return'builtin';case'close_paren':return null;case'colon':return null;case'comment':return'comment';case'dot':return null;case'error':return'error';case'fun':return'meta';case'function':return'tag';case'guard':return'property';case'keyword':return'keyword';case'macro':return'variable-2';case'number':return'number';case'open_paren':return null;case'operator':return'operator';case'record':return'bracket';case'separator':return null;case'string':return'string';case'type':return'def';case'variable':return'variable';default:return null}};function k(e,t,r,n){return{token:e,column:t,indent:r,type:n}};function q(e,t){return k(t.current(),t.column(),t.indentation(),e)};function C(e){return k(e,0,0,e)};function a(e,t){var r=e.tokenStack.length,n=(t?t:1);if(r<n){return!1} -else{return e.tokenStack[r-n]}};function j(e,t){if(!(t.type=='comment'||t.type=='whitespace')){e.tokenStack=I(e.tokenStack,t);e.tokenStack=O(e.tokenStack)}};function I(e,t){var r=e.length-1;if(0<r&&e[r].type==='record'&&t.type==='dot'){e.pop()} -else if(0<r&&e[r].type==='group'){e.pop();e.push(t)} -else{e.push(t)};return e};function O(e){if(!e.length)return e;var t=e.length-1;if(e[t].type==='dot'){return[]};if(t>1&&e[t].type==='fun'&&e[t-1].token==='fun'){return e.slice(0,t-1)};switch(e[t].token){case'}':return i(e,{g:['{']});case']':return i(e,{i:['[']});case')':return i(e,{i:['(']});case'>>':return i(e,{i:['<<']});case'end':return i(e,{i:['begin','case','fun','if','receive','try']});case',':return i(e,{e:['begin','try','when','->',',','(','[','{','<<']});case'->':return i(e,{r:['when'],m:['try','if','case','receive']});case';':return i(e,{E:['case','fun','if','receive','try','when']});case'catch':return i(e,{e:['try']});case'of':return i(e,{e:['case']});case'after':return i(e,{e:['receive','try']});default:return e}};function i(e,t){for(var a in t){var o=e.length-1,u=t[a];for(var r=o-1;-1<r;r--){if(n(e[r].token,u)){var i=e.slice(0,r);switch(a){case'm':return i.concat(e[r]).concat(e[o]);case'r':return i.concat(e[o]);case'i':return i;case'g':return i.concat(C('group'));case'E':return i.concat(e[r]);case'e':return i.concat(e[r])}}}};return(a=='E'?[]:e)};function T(t,i){var u,p=r.indentUnit,m=ee(i),s=a(t,1),d=a(t,2);if(t.in_string||t.in_atom){return e.Pass} -else if(!d){return 0} -else if(s.token=='when'){return s.column+p} -else if(m==='when'&&d.type==='function'){return d.indent+p} -else if(m==='('&&s.token==='fun'){return s.column+3} -else if(m==='catch'&&(u=l(t,['try']))){return u.column} -else if(n(m,['end','after','of'])){u=l(t,['begin','case','fun','if','receive','try']);return u?u.column:e.Pass} -else if(n(m,f)){u=l(t,c);return u?u.column:e.Pass} -else if(n(s.token,[',','|','||'])||n(m,[',','|','||'])){u=te(t);return u?u.column+u.token.length:p} -else if(s.token=='->'){if(n(d.token,['receive','case','if','try'])){return d.column+p+p} -else{return d.column+p}} -else if(n(s.token,c)){return s.column+s.token.length} -else{u=re(t);return o(u)?u.column+p:0}};function ee(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return o(t)&&(t.index===0)?t[0]:''};function te(e){var t=e.tokenStack.slice(0,-1),r=s(t,'type',['open_paren']);return o(t[r])?t[r]:!1};function re(e){var r=e.tokenStack,t=s(r,'type',['open_paren','separator','keyword']),n=s(r,'type',['operator']);if(o(t)&&o(n)&&t<n){return r[t+1]} -else if(o(t)){return r[t]} -else{return!1}};function l(e,t){var r=e.tokenStack,n=s(r,'token',t);return o(r[n])?r[n]:!1};function s(e,t,r){for(var i=e.length-1;-1<i;i--){if(n(e[i][t],r)){return i}};return!1};function o(e){return(e!==!1)&&(e!=null)};return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return M(e,t)},indent:function(e,t){return T(e,t)},lineComment:'%'}})}); -/* ./modules/editor/codemirror/mode/turtle/turtle.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('turtle',function(e){var f=e.indentUnit,t;function l(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var u=l([]),i=l(['@prefix','@base','a']),o=/[*+\-<>=&|]/;function c(e,r){var n=e.next();t=null;if(n=='<'&&!e.match(/^[\s\u00a0=]/,!1)){e.match(/^[^\s\u00a0>]*>?/);return'atom'} -else if(n=='"'||n=='\''){r.tokenize=a(n);return r.tokenize(e,r)} -else if(/[{}\(\),\.;\[\]]/.test(n)){t=n;return null} -else if(n=='#'){e.skipToEnd();return'comment'} -else if(o.test(n)){e.eatWhile(o);return null} -else if(n==':'){return'operator'} -else{e.eatWhile(/[_\w\d]/);if(e.peek()==':'){return'variable-3'} -else{var l=e.current();if(i.test(l)){return'meta'};if(n>='A'&&n<='Z'){return'comment'} -else{return'keyword'}};var l=e.current();if(u.test(l))return null;else if(i.test(l))return'meta';else return'variable'}};function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=c;break};r=!r&&i=='\\'};return'string'}};function n(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}};function r(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(i,e){if(i.sol()){if(e.context&&e.context.align==null)e.context.align=!1;e.indent=i.indentation()};if(i.eatSpace())return null;var o=e.tokenize(i,e);if(o!='comment'&&e.context&&e.context.align==null&&e.context.type!='pattern'){e.context.align=!0};if(t=='(')n(e,')',i.column());else if(t=='[')n(e,']',i.column());else if(t=='{')n(e,'}',i.column());else if(/[\]\}\)]/.test(t)){while(e.context&&e.context.type=='pattern')r(e);if(e.context&&t==e.context.type)r(e)} -else if(t=='.'&&e.context&&e.context.type=='pattern')r(e);else if(/atom|string|variable/.test(o)&&e.context){if(/[\}\]]/.test(e.context.type))n(e,'pattern',i.column());else if(e.context.type=='pattern'&&!e.context.align){e.context.align=!0;e.context.col=i.column()}};return o},indent:function(t,n){var i=n&&n.charAt(0),e=t.context;if(/[\]\}]/.test(i))while(e&&e.type=='pattern')e=e.prev;var r=e&&i==e.type;if(!e)return 0;else if(e.type=='pattern')return e.col;else if(e.align)return e.col+(r?0:1);else return e.indent+(r?0:f)},lineComment:'#'}});e.defineMIME('text/turtle','turtle')}); -/* ./modules/editor/codemirror/mode/troff/troff.min.js */(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('troff',function(){var t={};function e(e){if(e.eatSpace())return null;var i=e.sol(),r=e.next();if(r==='\\'){if(e.match('fB')||e.match('fR')||e.match('fI')||e.match('u')||e.match('d')||e.match('%')||e.match('&')){return'string'};if(e.match('m[')){e.skipTo(']');e.next();return'string'};if(e.match('s+')||e.match('s-')){e.eatWhile(/[\d-]/);return'string'};if(e.match('\(')||e.match('*\(')){e.eatWhile(/[\w-]/);return'string'};return'string'};if(i&&(r==='.'||r==='\'')){if(e.eat('\\')&&e.eat('"')){e.skipToEnd();return'comment'}};if(i&&r==='.'){if(e.match('B ')||e.match('I ')||e.match('R ')){return'attribute'};if(e.match('TH ')||e.match('SH ')||e.match('SS ')||e.match('HP ')){e.skipToEnd();return'quote'};if((e.match(/[A-Z]/)&&e.match(/[A-Z]/))||(e.match(/[a-z]/)&&e.match(/[a-z]/))){return'attribute'}};e.eatWhile(/[\w-]/);var n=e.current();return t.hasOwnProperty(n)?t[n]:null};function r(t,r){return(r.tokens[0]||e)(t,r)};return{startState:function(){return{tokens:[]}},token:function(t,e){return r(t,e)}}});t.defineMIME('text/troff','troff');t.defineMIME('text/x-troff','troff');t.defineMIME('application/x-troff','troff')}); -/* ./modules/editor/codemirror/mode/jinja2/jinja2.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('jinja2',function(){var n=['and','as','block','endblock','by','cycle','debug','else','elif','extends','filter','endfilter','firstof','for','endfor','if','endif','ifchanged','endifchanged','ifequal','endifequal','ifnotequal','endifnotequal','in','include','load','not','now','or','parsed','regroup','reversed','spaceless','endspaceless','ssi','templatetag','openblock','closeblock','openvariable','closevariable','openbrace','closebrace','opencomment','closecomment','widthratio','url','with','endwith','get_current_language','trans','endtrans','noop','blocktrans','endblocktrans','get_available_languages','get_current_language_bidi','plural'],i=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,e=['true','false'],t=/^(\d[+\-\*\/])?\d+(\.\d+)?/;n=new RegExp('(('+n.join(')|(')+'))\\b');e=new RegExp('(('+e.join(')|(')+'))\\b');function o(o,a){var f=o.peek();if(a.incomment){if(!o.skipTo('#}')){o.skipToEnd()} -else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} -else if(a.intag){if(a.operator){a.operator=!1;if(o.match(e)){return'atom'};if(o.match(t)){return'number'}};if(a.sign){a.sign=!1;if(o.match(e)){return'atom'};if(o.match(t)){return'number'}};if(a.instring){if(f==a.instring){a.instring=!1};o.next();return'string'} -else if(f=='\''||f=='"'){a.instring=f;o.next();return'string'} -else if(o.match(a.intag+'}')||o.eat('-')&&o.match(a.intag+'}')){a.intag=!1;return'tag'} -else if(o.match(i)){a.operator=!0;return'operator'} -else if(o.match(r)){a.sign=!0} -else{if(o.eat(' ')||o.sol()){if(o.match(n)){return'keyword'};if(o.match(e)){return'atom'};if(o.match(t)){return'number'};if(o.sol()){o.next()}} -else{o.next()}};return'variable'} -else if(o.eat('{')){if(o.eat('#')){a.incomment=!0;if(!o.skipTo('#}')){o.skipToEnd()} -else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} -else if(f=o.eat(/\{|%/)){a.intag=f;if(f=='{'){a.intag='}'};o.eat('-');return'tag'}};o.next()};return{startState:function(){return{tokenize:o}},token:function(e,n){return n.tokenize(e,n)}}})}); -/* ./modules/editor/codemirror/mode/diff/diff.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('diff',function(){var e={'+':'positive','-':'negative','@':'meta'};return{token:function(i){var r=i.string.search(/[\t ]+?$/);if(!i.sol()||r===0){i.skipToEnd();return('error '+(e[i.string.charAt(0)]||'')).replace(/ $/,'')};var o=e[i.peek()]||i.skipToEnd();if(r===-1){i.skipToEnd()} -else{i.pos=r};return o}}});e.defineMIME('text/x-diff','diff')}); -/* ./modules/editor/codemirror/mode/dart/dart.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../clike/clike'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../clike/clike'],e);else e(CodeMirror)})(function(e){'use strict';var r=('this super static final const abstract class extends external factory implements get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as').split(' '),c='try catch finally do else for if switch while'.split(' '),o='true false null'.split(' '),a='void bool num int double dynamic var String'.split(' ');function t(e){var n={};for(var t=0;t<e.length;++t)n[e[t]]=!0;return n};function u(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)};function l(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()};function f(e){return e.interpolationStack?e.interpolationStack.length:0};e.defineMIME('application/dart',{name:'clike',keywords:t(r),blockKeywords:t(c),builtin:t(a),atoms:t(o),hooks:{'@':function(e){e.eatWhile(/[\w\$_\.]/);return'meta'},'\'':function(e,t){return n('\'',e,t,!1)},'"':function(e,t){return n('"',e,t,!1)},'r':function(e,t){var i=e.peek();if(i=='\''||i=='"'){return n(e.next(),e,t,!0)};return!1},'}':function(e,t){if(f(t)>0){t.tokenize=l(t);return null};return!1},'/':function(e,t){if(!e.eat('*'))return!1;t.tokenize=i(1);return t.tokenize(e,t)}}});function n(e,t,n,i){var r=!1;if(t.eat(e)){if(t.eat(e))r=!0;else return'string'};function o(t,n){var o=!1;while(!t.eol()){if(!i&&!o&&t.peek()=='$'){u(n);n.tokenize=s;return'string'};var a=t.next();if(a==e&&!o&&(!r||t.match(e+e))){n.tokenize=null;break};o=!i&&!o&&a=='\\'};return'string'};n.tokenize=o;return o(t,n)};function s(e,t){e.eat('$');if(e.eat('{')){t.tokenize=null} -else{t.tokenize=k};return null};function k(e,t){e.eatWhile(/[\w_]/);t.tokenize=l(t);return'variable'};function i(e){return function(t,n){var r;while(r=t.next()){if(r=='*'&&t.eat('/')){if(e==1){n.tokenize=null;break} -else{n.tokenize=i(e-1);return n.tokenize(t,n)}} -else if(r=='/'&&t.eat('*')){n.tokenize=i(e+1);return n.tokenize(t,n)}};return'comment'}};e.registerHelper('hintWords','application/dart',r.concat(o).concat(a));e.defineMode('dart',function(t){return e.getMode(t,'application/dart')},'clike')}); -/* ./modules/editor/codemirror/mode/shell/shell.min.js */(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("shell",function(){var t={};function n(e,n){var i=n.split(" ");for(var r=0;r<i.length;r++){t[i[r]]=e}};n("atom","true false");n("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function");n("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep hg kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo svn tee telnet top touch vi vim wall wc wget who write yes zsh");function o(n,s){if(n.eatSpace())return null;var u=n.sol(),o=n.next();if(o==="\\"){n.next();return null};if(o==="'"||o==="\""||o==="`"){s.tokens.unshift(r(o,o==="`"?"quote":"string"));return e(n,s)};if(o==="#"){if(u&&n.eat("!")){n.skipToEnd();return"meta"};n.skipToEnd();return"comment"};if(o==="$"){s.tokens.unshift(i);return e(n,s)};if(o==="+"||o==="="){return"operator"};if(o==="-"){n.eat("-");n.eatWhile(/\w/);return"attribute"};if(/\d/.test(o)){n.eatWhile(/\d/);if(n.eol()||!/\w/.test(n.peek())){return"number"}};n.eatWhile(/[\w-]/);var f=n.current();if(n.peek()==="="&&/\w+/.test(f))return"def";return t.hasOwnProperty(f)?t[f]:null};function r(t,n){var o=t=="("?")":t=="{"?"}":t;return function(s,f){var l,a=!1,u=!1;while((l=s.next())!=null){if(l===o&&!u){a=!0;break};if(l==="$"&&!u&&t!=="'"){u=!0;s.backUp(1);f.tokens.unshift(i);break};if(!u&&l===t&&t!==o){f.tokens.unshift(r(t,n));return e(s,f)};u=!u&&l==="\\"};if(a)f.tokens.shift();return n}};var i=function(t,n){if(n.tokens.length>1)t.eat("$");var i=t.next();if(/['"({]/.test(i)){n.tokens[0]=r(i,i=="("?"quote":i=="{"?"def":"string");return e(t,n)};if(!/\d/.test(i))t.eatWhile(/\w/);n.tokens.shift();return"def"};function e(e,t){return(t.tokens[0]||o)(e,t)};return{startState:function(){return{tokens:[]}},token:function(t,n){return e(t,n)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}});e.defineMIME("text/x-sh","shell");e.defineMIME("application/x-sh","shell")}); -/* ./modules/editor/codemirror/mode/lua/lua.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('lua',function(e,t){var f=e.indentUnit;function d(e){return new RegExp('^(?:'+e.join('|')+')','i')};function n(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var o=n(t.specials||[]),u=n(['_G','_VERSION','assert','collectgarbage','dofile','error','getfenv','getmetatable','ipairs','load','loadfile','loadstring','module','next','pairs','pcall','print','rawequal','rawget','rawset','require','select','setfenv','setmetatable','tonumber','tostring','type','unpack','xpcall','coroutine.create','coroutine.resume','coroutine.running','coroutine.status','coroutine.wrap','coroutine.yield','debug.debug','debug.getfenv','debug.gethook','debug.getinfo','debug.getlocal','debug.getmetatable','debug.getregistry','debug.getupvalue','debug.setfenv','debug.sethook','debug.setlocal','debug.setmetatable','debug.setupvalue','debug.traceback','close','flush','lines','read','seek','setvbuf','write','io.close','io.flush','io.input','io.lines','io.open','io.output','io.popen','io.read','io.stderr','io.stdin','io.stdout','io.tmpfile','io.type','io.write','math.abs','math.acos','math.asin','math.atan','math.atan2','math.ceil','math.cos','math.cosh','math.deg','math.exp','math.floor','math.fmod','math.frexp','math.huge','math.ldexp','math.log','math.log10','math.max','math.min','math.modf','math.pi','math.pow','math.rad','math.random','math.randomseed','math.sin','math.sinh','math.sqrt','math.tan','math.tanh','os.clock','os.date','os.difftime','os.execute','os.exit','os.getenv','os.remove','os.rename','os.setlocale','os.time','os.tmpname','package.cpath','package.loaded','package.loaders','package.loadlib','package.path','package.preload','package.seeall','string.byte','string.char','string.dump','string.find','string.format','string.gmatch','string.gsub','string.len','string.lower','string.match','string.rep','string.reverse','string.sub','string.upper','table.concat','table.insert','table.maxn','table.remove','table.sort']),l=n(['and','break','elseif','false','nil','not','or','return','true','function','end','if','then','else','do','while','repeat','until','for','in','local']),s=n(['function','if','repeat','do','\\(','{']),c=n(['end','until','\\)','}']),m=d(['end','until','\\)','}','else','elseif']);function i(e){var t=0;while(e.eat('='))++t;e.eat('[');return t};function r(e,t){var n=e.next();if(n=='-'&&e.eat('-')){if(e.eat('[')&&e.eat('['))return(t.cur=a(i(e),'comment'))(e,t);e.skipToEnd();return'comment'};if(n=='"'||n=='\'')return(t.cur=g(n))(e,t);if(n=='['&&/[\[=]/.test(e.peek()))return(t.cur=a(i(e),'string'))(e,t);if(/\d/.test(n)){e.eatWhile(/[\w.%]/);return'number'};if(/[\w_]/.test(n)){e.eatWhile(/[\w\\\-_.]/);return'variable'};return null};function a(e,t){return function(n,i){var a=null,o;while((o=n.next())!=null){if(a==null){if(o==']')a=0} -else if(o=='=')++a;else if(o==']'&&a==e){i.cur=r;break} -else a=null};return t}};function g(e){return function(t,n){var i=!1,a;while((a=t.next())!=null){if(a==e&&!i)break;i=!i&&a=='\\'};if(!i)n.cur=r;return'string'}};return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:r}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();if(n=='variable'){if(l.test(r))n='keyword';else if(u.test(r))n='builtin';else if(o.test(r))n='variable-2'};if((n!='comment')&&(n!='string')){if(s.test(r))++t.indentDepth;else if(c.test(r))--t.indentDepth};return n},indent:function(e,t){var n=m.test(t);return e.basecol+f*(e.indentDepth-(n?1:0))},lineComment:'--',blockCommentStart:'--[[',blockCommentEnd:']]'}});e.defineMIME('text/x-lua','lua')}); -/* ./modules/editor/codemirror/mode/groovy/groovy.min.js */(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('groovy',function(t){function i(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var c=i('abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws trait transient try void volatile while'),p=i('catch class def do else enum finally for if interface switch trait try while'),d=i('return break continue'),m=i('null true false this'),n;function a(e,t){var r=e.next();if(r=='"'||r=='\''){return s(r,e,t)};if(/[\[\]{}\(\),;\:\.]/.test(r)){n=r;return null};if(/\d/.test(r)){e.eatWhile(/[\w\.]/);if(e.eat(/eE/)){e.eat(/\+\-/);e.eatWhile(/\d/)};return'number'};if(r=='/'){if(e.eat('*')){t.tokenize.push(f);return f(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'};if(l(t.lastToken,!1)){return s(r,e,t)}};if(r=='-'&&e.eat('>')){n='->';return null};if(/[+\-*&%=<>!?|\/~]/.test(r)){e.eatWhile(/[+\-*&%=<>|~]/);return'operator'};e.eatWhile(/[\w\$_]/);if(r=='@'){e.eatWhile(/[\w\$_\.]/);return'meta'};if(t.lastToken=='.')return'property';if(e.eat(':')){n='proplabel';return'property'};var i=e.current();if(m.propertyIsEnumerable(i)){return'atom'};if(c.propertyIsEnumerable(i)){if(p.propertyIsEnumerable(i))n='newstatement';else if(d.propertyIsEnumerable(i))n='standalone';return'keyword'};return'variable'};a.isBase=!0;function s(e,t,n){var r=!1;if(e!='/'&&t.eat(e)){if(t.eat(e))r=!0;else return'string'};function i(t,n){var i=!1,o,a=!r;while((o=t.next())!=null){if(o==e&&!i){if(!r){break};if(t.match(e+e)){a=!0;break}};if(e=='"'&&o=='$'&&!i&&t.eat('{')){n.tokenize.push(h());return'string'};i=!i&&o=='\\'};if(a)n.tokenize.pop();return'string'};n.tokenize.push(i);return i(t,n)};function h(){var e=1;function t(t,n){if(t.peek()=='}'){e--;if(e==0){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)}} -else if(t.peek()=='{'){e++};return a(t,n)};t.isBase=!0;return t};function f(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize.pop();break};r=(n=='*')};return'comment'};function l(e,t){return!e||e=='operator'||e=='->'||/[\.\[\{\(,;:]/.test(e)||e=='newstatement'||e=='keyword'||e=='proplabel'||(e=='standalone'&&!t)};function u(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function o(e,t,n){return e.context=new u(e.indented,t,n,null,e.context)};function r(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:[a],context:new u((e||0)-t.indentUnit,0,'top',!1),indented:0,startOfLine:!0,lastToken:null}},token:function(t,e){var i=e.context;if(t.sol()){if(i.align==null)i.align=!1;e.indented=t.indentation();e.startOfLine=!0;if(i.type=='statement'&&!l(e.lastToken,!0)){r(e);i=e.context}};if(t.eatSpace())return null;n=null;var a=e.tokenize[e.tokenize.length-1](t,e);if(a=='comment')return a;if(i.align==null)i.align=!0;if((n==';'||n==':')&&i.type=='statement')r(e);else if(n=='->'&&i.type=='statement'&&i.prev.type=='}'){r(e);e.context.align=!1} -else if(n=='{')o(e,t.column(),'}');else if(n=='[')o(e,t.column(),']');else if(n=='(')o(e,t.column(),')');else if(n=='}'){while(i.type=='statement')i=r(e);if(i.type=='}')i=r(e);while(i.type=='statement')i=r(e)} -else if(n==i.type)r(e);else if(i.type=='}'||i.type=='top'||(i.type=='statement'&&n=='newstatement'))o(e,t.column(),'statement');e.startOfLine=!1;e.lastToken=n||a;return a},indent:function(n,r){if(!n.tokenize[n.tokenize.length-1].isBase)return e.Pass;var a=r&&r.charAt(0),i=n.context;if(i.type=='statement'&&!l(n.lastToken,!0))i=i.prev;var o=a==i.type;if(i.type=='statement')return i.indented+(a=='{'?0:t.indentUnit);else if(i.align)return i.column+(o?0:1);else return i.indented+(o?0:t.indentUnit)},electricChars:'{}',closeBrackets:{triples:'\'"'},fold:'brace'}});e.defineMIME('text/x-groovy','groovy')}); -/* ./modules/editor/simplemde/simplemde.min.js *//** - * simplemde v1.11.2 - * Copyright Next Step Webs, Inc. - * @link https://github.com/NextStepWebs/simplemde-markdown-editor - * @license MIT - */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SimpleMDE=e()}}(function(){var e;return function t(e,n,r){function i(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;n>t;++t)s[t]=e[t],c[e.charCodeAt(t)]=t;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63}function i(e){var t,n,r,i,o,a,l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[l-2]?2:"="===e[l-1]?1:0,a=new u(3*l/4-o),r=o>0?l-4:l;var s=0;for(t=0,n=0;r>t;t+=4,n+=3)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[s++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[s++]=i>>8&255,a[s++]=255&i),a}function o(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,i=[],a=t;n>a;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(o(r));return i.join("")}function l(e){for(var t,n=e.length,r=n%3,i="",o=[],l=16383,c=0,u=n-r;u>c;c+=l)o.push(a(e,c,c+l>u?u:c+l));return 1===r?(t=e[n-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}n.toByteArray=i,n.fromByteArray=l;var s=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?d(e,t,n,r):"string"==typeof t?f(e,t,n):p(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function c(e,t,n,r){return s(t),0>=t?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}function u(e,t){if(s(t),e=o(e,0>t?0:0|m(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function f(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);return e=o(e,r),e.write(t,n),e}function h(e,t){var n=0|m(t.length);e=o(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function d(e,t,n,r){if(t.byteLength,0>n||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=h(e,t),e}function p(e,t){if(a.isBuffer(t)){var n=0|m(t.length);return e=o(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||K(t.length)?o(e,0):h(e,t);if("Buffer"===t.type&&J(t.data))return h(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,t>=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return N(this,t,n);case"ascii":return E(this,t,n);case"binary":return O(this,t,n);case"base64":return M(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,l=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}for(var s=-1,c=0;a>n+c;c++)if(i(e,n+c)===i(t,-1===s?0:c-s)){if(-1===s&&(s=c),c-s+1===l)return(n+s)*o}else-1!==s&&(c-=c-s),s=-1;return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var l=parseInt(t.substr(2*a,2),16);if(isNaN(l))return a;e[n+a]=l}return a}function k(e,t,n,r){return V(q(t,e.length-n),e,n,r)}function S(e,t,n,r){return V(G(t),e,n,r)}function C(e,t,n,r){return S(e,t,n,r)}function L(e,t,n,r){return V($(t),e,n,r)}function T(e,t,n,r){return V(Y(t,e.length-n),e,n,r)}function M(e,t,n){return 0===t&&n===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,n))}function N(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var o=e[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n>=i+l){var s,c,u,f;switch(l){case 1:128>o&&(a=o);break;case 2:s=e[i+1],128===(192&s)&&(f=(31&o)<<6|63&s,f>127&&(a=f));break;case 3:s=e[i+1],c=e[i+2],128===(192&s)&&128===(192&c)&&(f=(15&o)<<12|(63&s)<<6|63&c,f>2047&&(55296>f||f>57343)&&(a=f));break;case 4:s=e[i+1],c=e[i+2],u=e[i+3],128===(192&s)&&128===(192&c)&&128===(192&u)&&(f=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&u,f>65535&&1114112>f&&(a=f))}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=l}return A(r)}function A(e){var t=e.length;if(Q>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Q));return n}function E(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=U(e[o]);return i}function P(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||o>t)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function H(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);o>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function W(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);o>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function _(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,n,r,52,8),n+8}function z(e){if(e=j(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e){return 16>e?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;r>a;a++){if(n=e.charCodeAt(a),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function G(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function Y(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);a++)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function $(e){return X.toByteArray(z(e))}function V(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function K(e){return e!==e}var X=e("base64-js"),Z=e("ieee754"),J=e("isarray");n.Buffer=a,n.SlowBuffer=g,n.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return l(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return c(null,e,t,n)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);o>i;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return r>n?-1:n>r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=a.allocUnsafe(t),i=0;for(n=0;n<e.length;n++){var o=e[n];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)x(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,r,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),0>t||n>e.length||0>r||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,l=n-t,s=Math.min(o,l),c=this.slice(r,i),u=e.slice(t,n),f=0;s>f;++f)if(c[f]!==u[f]){o=c[f],l=u[f];break}return l>o?-1:o>l?1:0},a.prototype.indexOf=function(e,t,n){if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(this,e,t,n);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):b(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return S(this,e,t,n);case"binary":return C(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=a.prototype;else{var i=t-e;r=new a(i,void 0);for(var o=0;i>o;o++)r[o]=this[o+e]}return r},a.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},a.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):W(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=0,a=1,l=0;for(this[t]=255&e;++o<n&&(a*=256);)0>e&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=n-1,a=1,l=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)0>e&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):W(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return _(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return _(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&t>n&&r>t)for(i=o-1;i>=0;i--)e[i+t]=this[i+n];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);256>i&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(t>=n)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;n>o;o++)this[o]=e;else{var l=a.isBuffer(e)?e:q(new a(e,r).toString()),s=l.length;for(o=0;n-t>o;o++)this[o+t]=l[o%s]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:15,isarray:16}],4:[function(e,t,n){"use strict";function r(e){return e=e||{},"function"!=typeof e.codeMirrorInstance||"function"!=typeof e.codeMirrorInstance.defineMode?void console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`"):(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),void e.codeMirrorInstance.defineMode("spell-checker",function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var a='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',l={token:function(e){var t=e.peek(),n="";if(a.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!a.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},s=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(s,l,!0)}))}var i=e("typo-js");r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,t.exports=r},{"typo-js":18}],5:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})})},{"../../lib/codemirror":10}],6:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})})},{"../../lib/codemirror":10}],7:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,f=0!==c.quote,h=i.getLine(s.line),d=t.exec(h);if(!o[l].empty()||!u&&!f||!d)return void i.execCommand("newlineAndIndent");if(n.test(h))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1}),a[l]="\n";else{var p=d[1],m=d[5],g=r.test(d[2])||d[2].indexOf(">")>=0?d[2]:parseInt(d[3],10)+1+d[4];a[l]="\n"+p+g+m}}i.replaceSelections(a)}})},{"../../lib/codemirror":10}],8:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}})},{"../../lib/codemirror":10}],9:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){e.operation(function(){a(e)})}function n(e){e.state.markedSelection.length&&e.operation(function(){i(e)})}function r(e,t,n,r){if(0!=c(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=t.line;;){var u=a==t.line?t:s(a,0),f=a+l,h=f>=n.line,d=h?n:s(f,0),p=e.markText(u,d,{className:o});if(null==r?i.push(p):i.splice(r++,0,p),h)break;a=f}}function i(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function o(e){i(e);for(var t=e.listSelections(),n=0;n<t.length;n++)r(e,t[n].from(),t[n].to())}function a(e){if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),a=e.state.markedSelection;if(!a.length)return r(e,t,n);var s=a[0].find(),u=a[a.length-1].find();if(!s||!u||n.line-t.line<l||c(t,u.to)>=0||c(n,s.from)<=0)return o(e);for(;c(t,s.from)>0;)a.shift().clear(),s=a[0].find();for(c(t,s.from)<0&&(s.to.line-t.line<l?(a.shift().clear(),r(e,t,s.to,0)):r(e,t,s.from,0));c(n,u.to)<0;)a.pop().clear(),u=a[a.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<l?(a.pop().clear(),r(e,u.from,n)):r(e,u.to,n))}e.defineOption("styleSelectedText",!1,function(r,a,l){var s=l&&l!=e.Init;a&&!s?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof a?a:"CodeMirror-selectedtext",o(r),r.on("cursorActivity",t),r.on("change",n)):!a&&s&&(r.off("cursorActivity",t),r.off("change",n),i(r),r.state.markedSelection=r.state.markedSelectionStyle=null)});var l=8,s=e.Pos,c=e.cmpPos})},{"../../lib/codemirror":10}],10:[function(t,n,r){!function(t){if("object"==typeof r&&"object"==typeof n)n.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);(this||window).CodeMirror=t()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Wi(r):{},Wi(ea,r,!1),d(r);var i=r.value;"string"==typeof i&&(i=new Ca(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!Ao&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ei,keySeq:null,specialChars:null};var s=this;xo&&11>bo&&setTimeout(function(){s.display.input.reset(!0)},20),jt(this),Ki(),bt(this),this.curOp.forceUpdate=!0,Xr(this,i),r.autofocus&&!Ao||s.hasFocus()?setTimeout(Bi(vn,this),20):yn(this);for(var u in ta)ta.hasOwnProperty(u)&&ta[u](this,r[u],na);k(this),r.finishInit&&r.finishInit(this);for(var f=0;f<aa.length;++f)aa[f](this);kt(this),wo&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=ji("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=ji("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ji("div",null,"CodeMirror-code"),r.selectionDiv=ji("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=ji("div",null,"CodeMirror-cursors"),r.measure=ji("div",null,"CodeMirror-measure"),r.lineMeasure=ji("div",null,"CodeMirror-measure"),r.lineSpace=ji("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=ji("div",[ji("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=ji("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=ji("div",null,null,"position: absolute; height: "+Da+"px; width: 1px;"),r.gutters=ji("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=ji("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=ji("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),xo&&8>bo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),wo||go&&Ao||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null, -r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,_e(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function i(e){e.options.lineWrapping?(Ja(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Za(e.display.wrapper,"CodeMirror-wrap"),h(e)),a(e),Dt(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(kr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&ei(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lt(e)}function s(e){c(e),Dt(e),setTimeout(function(){w(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Ui(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(ji("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=mr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=gr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function h(e){var t=e.display,n=e.doc;t.maxLine=Zr(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function d(e){var t=Pi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qe(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ye(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=ji("div",[ji("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=ji("div",[ji("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Ea(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ea(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&8>bo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Za(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ea(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Ja(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var n=e.display.barWidth,r=e.display.barHeight;x(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&O(e),x(e,p(e)),n=e.display.barWidth,r=e.display.barHeight}function x(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function b(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Ue(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ni(t,r),a=ni(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ni(t,ri(Zr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ni(t,ri(Zr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function w(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=S(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(ji("div",[ji("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function S(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function L(e,t,n){var r=e.display;this.viewport=t,this.visible=b(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$e(e),this.force=n,this.dims=P(e),this.events=[]}function T(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ye(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ye(e)+"px",t.scrollbarsClipped=!0)}function M(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Wt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zt(e))return!1;k(e)&&(Wt(e),t.dims=P(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Wo&&(o=br(e.doc,o),a=wr(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=ri(Zr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=zt(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Gi();return s>4&&(n.lineDiv.style.display="none"),R(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Gi()!=c&&c.offsetHeight&&c.focus(),Ui(n.cursorDiv),Ui(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,_e(e,400)),n.updateLineNumbers=null,!0}function N(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=$e(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qe(e.display)-Ve(e),n.top)}),t.visible=b(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);r=!1){O(e);var i=p(e);Re(e),y(e,i),E(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new L(e,t);if(M(e,n)){O(e),N(e,n);var r=p(e);Re(e),y(e,r),E(e,r),n.finish()}}function E(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ye(e)+"px"}function O(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(xo&&8>bo){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(ei(o.line,i),I(o.line),o.rest))for(var c=0;c<o.rest.length;c++)I(o.rest[c])}}}function I(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function P(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function R(e,t,n){function r(t){var n=t.nextSibling;return wo&&Eo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var f=s[u];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=r(l);var h=o&&null!=t&&c>=t&&f.lineNumber;f.changes&&(Pi(f.changes,"gutter")>-1&&(h=!1),D(e,f,c,n)),h&&(Ui(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,c)))),l=f.node.nextSibling}else{var d=U(e,f,c,n);a.insertBefore(d,l)}c+=f.size}for(;l;)l=r(l)}function D(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?_(e,t):"gutter"==o?z(e,t,n,r):"class"==o?F(t):"widget"==o&&j(e,t,r)}t.changes=null}function H(e){return e.node==e.text&&(e.node=ji("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),xo&&8>bo&&(e.node.style.zIndex=2)),e.node}function W(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=H(e);e.background=n.insertBefore(ji("div",null,t),n.firstChild)}}function B(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Br(e,t)}function _(e,t){var n=t.text.className,r=B(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,F(t)):n&&(t.text.className=n)}function F(e){W(e),e.line.wrapClass?H(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function z(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=H(t);t.gutterBackground=ji("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=H(t),a=t.gutter=ji("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(ji("div",S(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=o.hasOwnProperty(s)&&o[s];c&&a.appendChild(ji("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function j(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}q(e,t,n)}function U(e,t,n,r){var i=B(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),F(t),z(e,t,n,r),q(e,t,r),t.node}function q(e,t,n){if(G(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)G(e,t.rest[r],t,n,!1)}function G(e,t,n,r,i){if(t.widgets)for(var o=H(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=ji("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Y(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),Ci(s,"redraw")}}function Y(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function $(e){return Bo(e.line,e.ch)}function V(e,t){return _o(e,t)<0?t:e}function K(e,t){return _o(e,t)<0?e:t}function X(e){e.state.focused||(e.display.input.focus(),vn(e))}function Z(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=o.splitLines(t),s=null;if(a&&r.ranges.length>1)if(Fo&&Fo.text.join("\n")==t){if(r.ranges.length%Fo.text.length==0){s=[];for(var c=0;c<Fo.text.length;c++)s.push(o.splitLines(Fo.text[c]))}}else l.length==r.ranges.length&&(s=Ri(l,function(e){return[e]}));for(var c=r.ranges.length-1;c>=0;c--){var u=r.ranges[c],f=u.from(),h=u.to();u.empty()&&(n&&n>0?f=Bo(f.line,f.ch-n):e.state.overwrite&&!a?h=Bo(h.line,Math.min(Zr(o,h.line).text.length,h.ch+Ii(l).length)):Fo&&Fo.lineWise&&Fo.text.join("\n")==t&&(f=h=Bo(f.line,0)));var d=e.curOp.updateInput,p={from:f,to:h,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,p),Ci(e,"inputRead",e,p)}t&&!a&&Q(e,t),Bn(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||At(t,function(){Z(t,n,0,null,"paste")}),!0):void 0}function Q(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Ci(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:Bo(i,0),head:Bo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ne(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ei,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function re(){var e=ji("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=ji("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return wo?e.style.width="1000px":e.setAttribute("wrap","off"),No&&(e.style.border="1px solid black"),te(e),t}function ie(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ei,this.gracePeriod=!1}function oe(e,t){var n=Qe(e,t.line);if(!n||n.hidden)return null;var r=Zr(e.doc,t.line),i=Xe(n,r,t.line),o=ii(r),a="left";if(o){var l=co(o,t.ch);a=l%2?"right":"left"}var s=nt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ae(e,t){return t&&(e.bad=!0),e}function le(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ae(e.clipPos(Bo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return se(o,t,n)}}function se(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=ti(0>i?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),Bo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Va(i,t))return ae(Bo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?Ii(e.rest):e.line;return ae(Bo(ti(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return ae(f,o);for(var h=s.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=r(h,h.firstChild,0))return ae(Bo(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=s.previousSibling,d=n;p;p=p.previousSibling){if(f=r(p,p.firstChild,-1))return ae(Bo(f.line,f.ch+d),o);d+=h.textContent.length}}function ce(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var u,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(Bo(r,0),Bo(i+1,0),o(+f));return void(h.length&&(u=h[0].find())&&(l+=Jr(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)a(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+=c,s=!1),l+=p}}for(var l="",s=!1,c=e.doc.lineSeparator();a(t),t!=n;)t=t.nextSibling;return l}function ue(e,t){this.ranges=e,this.primIndex=t}function fe(e,t){this.anchor=e,this.head=t}function he(e,t){var n=e[t];e.sort(function(e,t){return _o(e.from(),t.from())}),t=Pi(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(_o(o.to(),i.from())>=0){var a=K(o.from(),i.from()),l=V(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(s?l:a,s?a:l))}}return new ue(e,t)}function de(e,t){return new ue([new fe(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.line<e.first)return Bo(e.first,0);var n=e.first+e.size-1;return t.line>n?Bo(n,Zr(e,n).text.length):ge(t,Zr(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Bo(e.line,t):0>n?Bo(e.line,0):e}function ve(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=me(e,t[r]);return n}function xe(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=_o(n,i)<0;o!=_o(r,i)<0?(i=n,n=r):o!=_o(n,r)<0&&(n=r)}return new fe(i,n)}return new fe(r||n,n)}function be(e,t,n,r){Te(e,new ue([xe(e,e.sel.primary(),t,n)],0),r)}function we(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=xe(e,e.sel.ranges[i],t[i],null);var o=he(r,e.sel.primIndex);Te(e,o,n)}function ke(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Te(e,he(i,e.sel.primIndex),r)}function Se(e,t,n,r){Te(e,de(t,n),r)}function Ce(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new fe(me(e,t[n].anchor),me(e,t[n].head))},origin:n&&n.origin};return Pa(e,"beforeSelectionChange",e,r),e.cm&&Pa(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?he(r.ranges,r.ranges.length-1):t}function Le(e,t,n){var r=e.history.done,i=Ii(r);i&&i.ranges?(r[r.length-1]=t,Me(e,t,n)):Te(e,t,n)}function Te(e,t,n){Me(e,t,n),fi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Me(e,t,n){(Ni(e,"beforeSelectionChange")||e.cm&&Ni(e.cm,"beforeSelectionChange"))&&(t=Ce(e,t,n));var r=n&&n.bias||(_o(t.primary().head,e.sel.primary().head)<0?-1:1);Ne(e,Ee(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Bn(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Mi(e.cm)),Ci(e,"cursorActivity",e))}function Ae(e){Ne(e,Ee(e,e.sel,null,!1),Wa)}function Ee(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ie(e,a.anchor,l&&l.anchor,n,r),c=Ie(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new fe(s,c))}return i?he(i,t.primIndex):t}function Oe(e,t,n,r,i){var o=Zr(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Pa(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var c,u=s.find(0>r?1:-1);if((0>r?s.inclusiveRight:s.inclusiveLeft)&&(u=Pe(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=_o(u,n))&&(0>r?0>c:c>0))return Oe(e,u,t,r,i)}var f=s.find(0>r?-1:1);return(0>r?s.inclusiveLeft:s.inclusiveRight)&&(f=Pe(e,f,r,f.line==t.line?o:null)),f?Oe(e,f,t,r,i):null}}return t}function Ie(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,Bo(e.first,0))}function Pe(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,Bo(t.line-1)):null:n>0&&t.ch==(r||Zr(e,t.line)).text.length?t.line<e.first+e.size-1?Bo(t.line+1,0):null:new Bo(t.line,t.ch+n)}function Re(e){e.display.input.showSelection(e.display.input.prepareSelection())}function De(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&He(e,l.head,i),s||We(e,l,o)}}return r}function He(e,t,n){var r=dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(ji("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(ji("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function We(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(ji("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return ht(e,Bo(t,n),"div",f,r)}var l,s,f=Zr(a,t),h=f.text.length;return eo(ii(f),n||0,null==i?h:i,function(e,t,a){var f,d,p,m=o(e,"left");if(e==t)f=m,d=p=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}d=m.left,p=f.right}null==n&&0==e&&(d=c),f.top-m.top>3&&(r(d,m.top,null,m.bottom),d=c,m.bottom<f.top&&r(d,m.bottom,null,f.top)),null==i&&t==h&&(p=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||f.bottom>s.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>d&&(d=c),r(d,f.top,p-d,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ge(e.display),c=s.left,u=Math.max(o.sizerWidth,$e(e)-o.sizer.offsetLeft)-s.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Zr(a,f.line),p=Zr(a,h.line),m=yr(d)==yr(p),g=i(f.line,f.ch,m?d.text.length+1:null).end,v=i(h.line,m?0:null,h.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function Be(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function _e(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Bi(Fe,e))}function Fe(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=sa(t.mode,je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Rr(e,o,l?sa(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(t.frontier),o.stateAfter=l?r:sa(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&Hr(e,o.text,r),o.stateAfter=t.frontier%5==0?sa(t.mode,r):null;return++t.frontier,+new Date>n?(_e(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;t<i.length;t++)Ht(e,i[t],"text")})}}function ze(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Zr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Fa(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function je(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=ze(e,t,n),a=o>r.first&&Zr(r,o-1).stateAfter;return a=a?sa(r.mode,a):ca(r.mode),r.iter(o,t,function(n){Hr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?sa(r.mode,a):null,++o}),n&&(r.frontier=o),a}function Ue(e){return e.lineSpace.offsetTop}function qe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ge(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=qi(e.measure,ji("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ye(e){return Da-e.display.nativeBarWidth}function $e(e){return e.display.scroller.clientWidth-Ye(e)-e.display.barWidth}function Ve(e){return e.display.scroller.clientHeight-Ye(e)-e.display.barHeight}function Ke(e,t,n){var r=e.options.lineWrapping,i=r&&$e(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Xe(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(ti(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ze(e,t){t=yr(t);var n=ti(t),r=e.display.externalMeasured=new Pt(e.doc,t,n);r.lineN=n;var i=r.built=Br(e,r);return r.text=i.pre,qi(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return tt(e,et(e,t),n,r)}function Qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Bt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function et(e,t){var n=ti(t),r=Qe(e,n);r&&!r.text?r=null:r&&r.changes&&(D(e,r,n,P(e)),e.curOp.forceUpdate=!0),r||(r=Ze(e,t));var i=Xe(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ke(e,t.view,t.rect),t.hasHeights=!0),o=rt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function nt(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function rt(e,t,n,r){var i,o=nt(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&zi(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&zi(t.line.text.charAt(o.coverStart+s));)++s;if(xo&&9>bo&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(xo&&e.options.lineWrapping){var f=qa(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:qo}else i=qa(a,l,s).getBoundingClientRect()||qo;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}xo&&11>bo&&(i=it(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(xo&&9>bo&&!l&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}:qo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(d+p)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=d,x.rbottom=p),x}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Qi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function at(e){e.display.externalMeasure=null,Ui(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function lt(e){at(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ct(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Lr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ri(t);if("local"==r?a+=Ue(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:ct());var s=l.left+("window"==r?0:st());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ft(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=st(), -i-=ct();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ht(e,t,n,r,i){return r||(r=Zr(e.doc,t.line)),ut(e,r,Je(e,r,t.ch,i),n)}function dt(e,t,n,r,i,o){function a(t,a){var l=tt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,ut(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==to(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=no(n)-(n.level%2?0:1),r=!0):e==no(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=to(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Zr(e.doc,t.line),i||(i=et(e,r));var s=ii(r),c=t.ch;if(!s)return a(c);var u=co(s,c),f=l(c,u);return null!=al&&(f.other=l(c,al)),f}function pt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Zr(e.doc,t.line),i=ri(r)+Ue(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=Bo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ni(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Zr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Zr(r,i);;){var l=vt(e,a,i,t,n),s=gr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=ti(a=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=dt(e,Bo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-ri(t),l=!1,s=2*e.display.wrapper.clientWidth,c=et(e,t),u=ii(t),f=t.text.length,h=ro(t),d=io(t),p=o(h),m=l,g=o(d),v=l;if(r>g)return mt(n,d,v,1);for(;;){if(u?d==h||d==fo(t,h,1):1>=d-h){for(var y=p>r||g-r>=r-p?h:d,x=r-(y==h?p:g);zi(t.text.charAt(y));)++y;var b=mt(n,y,y==h?m:v,-1>x?-1:x>1?1:0);return b}var w=Math.ceil(f/2),k=h+w;if(u){k=h;for(var S=0;w>S;++S)k=fo(t,k,1)}var C=o(k);C>r?(d=k,g=C,(v=l)&&(g+=1e3),f=w):(h=k,p=C,m=l,f-=w)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==zo){zo=ji("pre");for(var t=0;49>t;++t)zo.appendChild(document.createTextNode("x")),zo.appendChild(ji("br"));zo.appendChild(document.createTextNode("x"))}qi(e.measure,zo);var n=zo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ui(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ji("span","xxxxxxxxxx"),n=ji("pre",[t]);qi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yo},Go?Go.ops.push(e.curOp):e.curOp.ownsGroup=Go={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function kt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{wt(n)}finally{Go=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;St(n)}}function St(e){for(var t=e.ops,n=0;n<t.length;n++)Ct(t[n]);for(var n=0;n<t.length;n++)Lt(t[n]);for(var n=0;n<t.length;n++)Tt(t[n]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var n=0;n<t.length;n++)Nt(t[n])}function Ct(e){var t=e.cm,n=t.display;T(t),e.updateMaxLine&&h(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new L(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ye(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&on(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Gi()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.updatedDisplay&&E(t,e.barMeasure),e.selectionChanged&&Be(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&X(e.cm)}function Nt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&N(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,w(t)),e.scrollToPos){var i=Rn(t,me(r,e.scrollToPos.from),me(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Pn(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Pa(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&Pa(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pa(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();bt(e);try{return t()}finally{kt(e)}}function Et(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bt(e);try{return t.apply(e,arguments)}finally{kt(e)}}}function Ot(e){return function(){if(this.curOp)return e.apply(this,arguments);bt(this);try{return e.apply(this,arguments)}finally{kt(this)}}}function It(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bt(t);try{return e.apply(this,arguments)}finally{kt(t)}}}function Pt(e,t,n){this.line=t,this.rest=xr(t),this.size=this.rest?ti(Ii(this.rest))-n+1:1,this.node=this.text=null,this.hidden=kr(e,t)}function Rt(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new Pt(e.doc,Zr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function Dt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Wo&&br(e.doc,t)<i.viewTo&&Wt(e);else if(n<=i.viewFrom)Wo&&wr(e.doc,n+r)>i.viewFrom?Wt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Wt(e);else if(t<=i.viewFrom){var o=_t(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Wt(e)}else if(n>=i.viewTo){var o=_t(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Wt(e)}else{var a=_t(e,t,t,-1),l=_t(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Rt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Wt(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Ht(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Bt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Pi(a,n)&&a.push(n)}}}function Wt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function _t(e,t,n,r){var i,o=Bt(e,t),a=e.display.view;if(!Wo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;br(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Rt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Bt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Rt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Bt(e,n)))),r.viewTo=n}function zt(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function jt(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;Ea(i.scroller,"mousedown",Et(e,$t)),xo&&11>bo?Ea(i.scroller,"dblclick",Et(e,function(t){if(!Ti(e,t)){var n=Yt(e,t);if(n&&!Jt(e,t)&&!Gt(e.display,t)){Ma(t);var r=e.findWordAt(n);be(e.doc,r.anchor,r.head)}}})):Ea(i.scroller,"dblclick",function(t){Ti(e,t)||Ma(t)}),Do||Ea(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};Ea(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ea(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ea(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Gt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new fe(Bo(l.line,0),me(e.doc,Bo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ma(n)}t()}),Ea(i.scroller,"touchcancel",t),Ea(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rn(e,i.scroller.scrollTop),on(e,i.scroller.scrollLeft,!0),Pa(e,"scroll",e))}),Ea(i.scroller,"mousewheel",function(t){an(e,t)}),Ea(i.scroller,"DOMMouseScroll",function(t){an(e,t)}),Ea(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Aa(t)},over:function(t){Ti(e,t)||(tn(e,t),Aa(t))},start:function(t){en(e,t)},drop:Et(e,Qt),leave:function(t){Ti(e,t)||nn(e)}};var l=i.input.getField();Ea(l,"keyup",function(t){pn.call(e,t)}),Ea(l,"keydown",Et(e,hn)),Ea(l,"keypress",Et(e,mn)),Ea(l,"focus",Bi(vn,e)),Ea(l,"blur",Bi(yn,e))}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Ea:Ia;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function qt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gt(e,t){for(var n=wi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yt(e,t,n,r){var i=e.display;if(!n&&"true"==wi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=gt(e,o,a);if(r&&1==c.xRel&&(s=Zr(e.doc,c.line).text).length==c.ch){var u=Fa(s,s.length,e.options.tabSize)-s.length;c=Bo(c.line,Math.max(0,Math.round((o-Ge(e.display).left)/xt(e.display))-u))}return c}function $t(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Gt(n,e))return void(wo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(t,e)){var r=Yt(t,e);switch(window.focus(),ki(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Vt(t,e,r):wi(e)==n.scroller&&Ma(e);break;case 2:wo&&(t.state.lastMiddleDown=+new Date),r&&be(t.doc,r),setTimeout(function(){n.input.focus()},20),Ma(e);break;case 3:Do?xn(t,e):gn(t)}}}}function Vt(e,t,n){xo?setTimeout(Bi(X,e),0):e.curOp.focus=Gi();var r,i=+new Date;Uo&&Uo.time>i-400&&0==_o(Uo.pos,n)?r="triple":jo&&jo.time>i-400&&0==_o(jo.pos,n)?(r="double",Uo={time:i,pos:n}):(r="single",jo={time:i,pos:n});var o,a=e.doc.sel,l=Eo?t.metaKey:t.ctrlKey;e.options.dragDrop&&el&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(_o((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(_o(o.to(),n)>0||n.xRel<0)?Kt(e,t,n,l):Xt(e,t,n,r,l)}function Kt(e,t,n,r){var i=e.display,o=+new Date,a=Et(e,function(l){wo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ia(document,"mouseup",a),Ia(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Ma(l),!r&&+new Date-200<o&&be(e.doc,n),wo||xo&&9==bo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});wo&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),Ea(document,"mouseup",a),Ea(i.scroller,"drop",a)}function Xt(e,t,n,r,i){function o(t){if(0!=_o(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Fa(Zr(c,n.line).text,n.ch,o),l=Fa(Zr(c,t.line).text,t.ch,o),s=Math.min(a,l),d=Math.max(a,l),p=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=p;p++){var v=Zr(c,p).text,y=za(v,s,o);s==d?i.push(new fe(Bo(p,y),Bo(p,y))):v.length>y&&i.push(new fe(Bo(p,y),Bo(p,za(v,d,o))))}i.length||i.push(new fe(n,n)),Te(c,he(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=u,b=x.anchor,w=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new fe(Bo(t.line,0),me(c,Bo(t.line+1,0)));_o(k.anchor,b)>0?(w=k.head,b=K(x.from(),k.anchor)):(w=k.anchor,b=V(x.to(),k.head))}var i=h.ranges.slice(0);i[f]=new fe(me(c,b),w),Te(c,he(i,f),Ba)}}function a(t){var n=++y,i=Yt(e,t,!0,"rect"==r);if(i)if(0!=_o(i,g)){e.curOp.focus=Gi(),o(i);var l=b(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(Et(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Et(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(t){e.state.selectingText=!1,y=1/0,Ma(t),s.input.focus(),Ia(document,"mousemove",x),Ia(document,"mouseup",w),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;Ma(t);var u,f,h=c.sel,d=h.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?d[f]:new fe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),Oo?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new fe(n,n)),n=Yt(e,t,!0,!0),f=-1;else if("double"==r){var p=e.findWordAt(n);u=e.display.shift||c.extend?xe(c,u,p.anchor,p.head):p}else if("triple"==r){var m=new fe(Bo(n.line,0),me(c,Bo(n.line+1,0)));u=e.display.shift||c.extend?xe(c,u,m.anchor,m.head):m}else u=xe(c,u,n);i?-1==f?(f=d.length,Te(c,he(d.concat([u]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(d.slice(0,f).concat(d.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),h=c.sel):ke(c,f,u,Ba):(f=0,Te(c,new ue([u],0),Ba),h=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,x=Et(e,function(e){ki(e)?a(e):l(e)}),w=Et(e,l);e.state.selectingText=w,Ea(document,"mousemove",x),Ea(document,"mouseup",w)}function Zt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ma(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ni(e,n))return bi(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=ni(e.doc,o),f=e.options.gutters[s];return Pa(e,n,e,u,f,t),bi(t)}}}function Jt(e,t){return Zt(e,t,"gutterClick",!0)}function Qt(e){var t=this;if(nn(t),!Ti(t,e)&&!Gt(t.display,e)){Ma(e),xo&&($o=+new Date);var n=Yt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=Pi(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Et(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=me(t.doc,n);var s={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,s),Le(t.doc,de(n,Qo(s)))}}),l.readAsText(e)}},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Eo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Me(t.doc,de(n,n)),c)for(var s=0;s<c.length;++s)In(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function en(e,t){if(xo&&(!e.state.draggingText||+new Date-$o<100))return void Aa(t);if(!Ti(e,t)&&!Gt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Lo)){var n=ji("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Co&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),Co&&n.parentNode.removeChild(n)}}function tn(e,t){var n=Yt(e,t);if(n){var r=document.createDocumentFragment();He(e,n,r),e.display.dragCursor||(e.display.dragCursor=ji("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),qi(e.display.dragCursor,r)}}function nn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function rn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,go||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),go&&A(e),_e(e,100))}function on(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,w(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function an(e,t){var n=Xo(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&l||i&&s){if(i&&Eo&&wo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f<u.length;f++)if(u[f].node==c){e.display.currentWheelTarget=c;break e}if(r&&!go&&!Co&&null!=Ko)return i&&s&&rn(e,Math.max(0,Math.min(a.scrollTop+i*Ko,a.scrollHeight-a.clientHeight))),on(e,Math.max(0,Math.min(a.scrollLeft+r*Ko,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&Ma(t),void(o.wheelStartX=null);if(i&&null!=Ko){var h=i*Ko,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;0>h?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),A(e,{top:d,bottom:p})}20>Vo&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ko=(Ko*Vo+n)/(Vo+1),++Vo)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function ln(e,t,n){if("string"==typeof t&&(t=ua[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ha}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function sn(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=ha(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&ha(t,e.options.extraKeys,n,e)||ha(t,e.options.keyMap,n,e)}function cn(e,t,n,r){var i=e.state.keySeq;if(i){if(da(t))return"handled";Zo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=sn(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ci(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(Ma(n),Be(e)),i&&!o&&/\'$/.test(t)?(Ma(n),!0):!!o}function un(e,t){var n=pa(t,!0);return n?t.shiftKey&&!e.state.keySeq?cn(e,"Shift-"+n,t,function(t){return ln(e,t,!0)})||cn(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?ln(e,t):void 0}):cn(e,n,t,function(t){return ln(e,t)}):!1}function fn(e,t,n){return cn(e,"'"+n+"'",t,function(t){return ln(e,t,!0)})}function hn(e){var t=this;if(t.curOp.focus=Gi(),!Ti(t,e)){xo&&11>bo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=un(t,e);Co&&(Jo=r?n:null,!r&&88==n&&!rl&&(Eo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||dn(t)}}function dn(e){function t(e){18!=e.keyCode&&e.altKey||(Za(n,"CodeMirror-crosshair"),Ia(document,"keyup",t),Ia(document,"mouseover",t))}var n=e.display.lineDiv;Ja(n,"CodeMirror-crosshair"),Ea(document,"keyup",t),Ea(document,"mouseover",t)}function pn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ti(this,e)}function mn(e){var t=this;if(!(Gt(t.display,e)||Ti(t,e)||e.ctrlKey&&!e.altKey||Eo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Co&&n==Jo)return Jo=null,void Ma(e);if(!Co||e.which&&!(e.which<10)||!un(t,e)){var i=String.fromCharCode(null==r?n:r);fn(t,e,i)||t.display.input.onKeyPress(e)}}}function gn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function vn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Pa(e,"focus",e),e.state.focused=!0,Ja(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Be(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(Pa(e,"blur",e),e.state.focused=!1,Za(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xn(e,t){Gt(e.display,t)||bn(e,t)||Ti(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function bn(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wn(e,t){if(_o(e,t.from)<0)return e;if(_o(e,t.to)<=0)return Qo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Qo(t).ch-t.to.ch),Bo(n,r)}function kn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new fe(wn(i.anchor,t),wn(i.head,t)))}return he(n,e.sel.primIndex)}function Sn(e,t,n){return e.line==t.line?Bo(n.line,e.ch-t.ch+n.ch):Bo(n.line+(e.line-t.line),e.ch)}function Cn(e,t,n){for(var r=[],i=Bo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Sn(l.from,i,o),c=Sn(Qo(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=_o(u.head,u.anchor)<0;r[a]=new fe(f?c:s,f?s:c)}else r[a]=new fe(s,s)}return new ue(r,e.sel.primIndex)}function Ln(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=me(e,t)),n&&(this.to=me(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),Pa(e,"beforeChange",e,r),e.cm&&Pa(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Tn(e,t,n){if(e.cm){if(!e.cm.curOp)return Et(e.cm,Tn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"))||(t=Ln(e,t,!0))){var r=Ho&&!n&&sr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Mn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Mn(e,t)}}function Mn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=_o(t.from,t.to)){var n=kn(e,t);ci(e,t,n,e.cm?e.cm.curOp.id:NaN),En(e,t,n,or(e,t));var r=[];Kr(e,function(e,n){n||-1!=Pi(r,e.history)||(xi(e.history,t),r.push(e.history)),En(e,t,null,or(e,t))})}}function Nn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(hi(r,l),n&&!r.equals(e.sel))return void Te(e,r,{clearRedo:!1});o=r}var c=[];hi(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var f=r.changes[s];if(f.origin=t,u&&!Ln(e,f,!1))return void(a.length=0);c.push(ai(e,f));var h=s?kn(e,f):Ii(a);En(e,f,h,lr(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Qo(f)});var d=[];Kr(e,function(e,t){t||-1!=Pi(d,e.history)||(xi(e.history,f),d.push(e.history)),En(e,f,null,lr(e,f))})}}}}function An(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(Ri(e.sel.ranges,function(e){return new fe(Bo(e.anchor.line+t,e.anchor.ch),Bo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Ht(e.cm,r,"gutter")}}function En(e,t,n,r){if(e.cm&&!e.cm.curOp)return Et(e.cm,En)(e,t,n,r);if(t.to.line<e.first)return void An(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);An(e,i),t={from:Bo(e.first,0),to:Bo(t.to.line+i,t.to.ch),text:[Ii(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Bo(o,Zr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(e,t.from,t.to),n||(n=kn(e,t)),e.cm?On(e.cm,t,r):Yr(e,t,r),Me(e,n,Wa)}}function On(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=ti(yr(Zr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Mi(e),Yr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),_e(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?Dt(e):a.line!=l.line||1!=t.text.length||Gr(e.doc,t)?Dt(e,a.line,l.line+1,u):Ht(e,a.line,"text");var h=Ni(e,"changes"),d=Ni(e,"change");if(d||h){var p={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};d&&Ci(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function In(e,t,n,r,i){if(r||(r=n),_o(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function Pn(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=ji("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ue(e.display))+"px; height: "+(t.bottom-t.top+Ye(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Rn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=dt(e,t),l=n&&n!=t?dt(e,n):a,s=Hn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(rn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(on(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function Dn(e,t,n,r,i){var o=Hn(e,t,n,r,i);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function Hn(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ve(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+qe(o),f=a>n,h=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var d=Math.min(n,(h?u:i)-s);d!=l&&(c.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=$e(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:p>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+p-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Wn(e,t,n){null==t&&null==n||_n(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Bn(e){_n(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Bo(t.line,t.ch-1):t,r=Bo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function _n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pt(e,t.from),r=pt(e,t.to),i=Hn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=je(e,t):n="prev");var a=e.options.tabSize,l=Zr(o,t),s=Fa(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ha||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Fa(Zr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)h+=a,f+=" ";if(c>h&&(f+=Oi(c-h)),f!=u)return In(o,f,Bo(t,0),Bo(t,u.length),"+input"),l.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==t&&p.head.ch<u.length){var h=Bo(t,u.length);ke(o,d,new fe(h,h));break}}}function zn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Zr(e,pe(e,t)):i=ti(t),null==i?null:(r(o,i)&&e.cm&&Ht(e.cm,i,n),o)}function jn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&_o(o.from,Ii(r).to)<=0;){var a=r.pop();if(_o(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}At(e,function(){for(var t=r.length-1;t>=0;t--)In(e.doc,"",r[t].from,r[t].to,"+delete");Bn(e)})}function Un(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?!1:(l=t,u=Zr(e,t))}function a(e){var t=(i?fo:ho)(u,s,n,!0);if(null==t){if(e||!o())return!1;s=i?(0>n?io:ro)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Zr(e,l);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>n)||a(!p);p=!1){var m=u.text.charAt(s)||"\n",g=_i(m,d)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),f&&f!=g){0>n&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!p))break}var v=Ie(e,Bo(l,s),t,c,!0);return _o(t,v)||(v.hitSide=!0),v}function qn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Gn(t,n,r,i){e.defaults[t]=n,r&&(ta[t]=i?function(e,t,n){n!=na&&r(e,t,n)}:r)}function Yn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{ -if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $n(e){return"string"==typeof e?fa[e]:e}function Vn(e,t,n,r,i){if(r&&r.shared)return Kn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Et(e.cm,Vn)(e,t,n,r,i);var o=new va(e,i),a=_o(t,n);if(r&&Wi(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ji("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vr(e,t.line,t,n,o)||t.line!=n.line&&vr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wo=!0}o.addToHistory&&ci(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&yr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ei(e,0),nr(e,new Qn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){kr(e,t)&&ei(t,0)}),o.clearOnEnter&&Ea(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Ho=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Dt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Ht(c,u,"text");o.atomic&&Ae(c.doc),Ci(c,"markerAdded",c,o)}return o}function Kn(e,t,n,r,i){r=Wi(r),r.shared=!1;var o=[Vn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Kr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Vn(e,me(e,t),me(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Ii(o)}),new ya(o,a)}function Xn(e){return e.findMarks(Bo(e.first,0),e.clipPos(Bo(e.lastLine())),function(e){return e.parent})}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(_o(o,a)){var l=Vn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Jn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Kr(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Pi(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Qn(e,t,n){this.marker=e,this.from=t,this.to=n}function er(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function tr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function nr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function rr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Qn(a,o.from,s?null:o.to))}}return r}function ir(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Qn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function or(e,t){if(t.full)return null;var n=ve(e,t.from.line)&&Zr(e,t.from.line).markedSpans,r=ve(e,t.to.line)&&Zr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==_o(t.from,t.to),l=rr(n,i,a),s=ir(r,o,a),c=1==t.text.length,u=Ii(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var h=l[f];if(null==h.to){var d=er(s,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null!=h.to&&(h.to+=u),null==h.from){var d=er(l,h.marker);d||(h.from=u,c&&(l||(l=[])).push(h))}else h.from+=u,c&&(l||(l=[])).push(h)}l&&(l=ar(l)),s&&s!=l&&(s=ar(s));var p=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var f=0;f<l.length;++f)null==l[f].to&&(m||(m=[])).push(new Qn(l[f].marker,null,null));for(var f=0;g>f;++f)p.push(m);p.push(s)}return p}function ar(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function lr(e,t){var n=mi(e,t),r=or(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function sr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Pi(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(_o(c.to,l.from)<0||_o(c.from,l.to)>0)){var u=[s,1],f=_o(c.from,l.from),h=_o(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function cr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ur(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function fr(e){return e.inclusiveLeft?-1:0}function hr(e){return e.inclusiveRight?1:0}function dr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=_o(r.from,i.from)||fr(e)-fr(t);if(o)return-o;var a=_o(r.to,i.to)||hr(e)-hr(t);return a?a:t.id-e.id}function pr(e,t){var n,r=Wo&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||dr(n,i.marker)<0)&&(n=i.marker);return n}function mr(e){return pr(e,!0)}function gr(e){return pr(e,!1)}function vr(e,t,n,r,i){var o=Zr(e,t),a=Wo&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=_o(c.from,n)||fr(s.marker)-fr(i),f=_o(c.to,r)||hr(s.marker)-hr(i);if(!(u>=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.to,n)>=0:_o(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.from,r)<=0:_o(c.from,r)<0)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=gr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function br(e,t){var n=Zr(e,t),r=yr(n);return n==r?t:ti(r)}function wr(e,t){if(t>e.lastLine())return t;var n,r=Zr(e,t);if(!kr(e,r))return t;for(;n=gr(r);)r=n.find(1,!0).line;return ti(r)+1}function kr(e,t){var n=Wo&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Sr(e,t,r))return!0}}function Sr(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Sr(e,r.line,er(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Sr(e,t,i))return!0}function Cr(e,t,n){ri(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Wn(e,null,n)}function Lr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Va(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),qi(t.display.measure,ji("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Tr(e,t,n,r){var i=new xa(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),zn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!kr(e,t)){var r=ri(t)<e.scrollTop;ei(t,t.height+Lr(i)),r&&Wn(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Mr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),cr(e),ur(e,n);var i=r?r(e):1;i!=e.height&&ei(e,i)}function Nr(e){e.parent=null,cr(e)}function Ar(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Er(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Or(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Ir(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?sa(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=me(a,t);var s,c=Zr(a,t.line),u=je(e,t.line,n),f=new ma(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,o=Or(l,f,u),r&&s.push(i(!0));return r?s:i()}function Pr(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new ma(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&Ar(Er(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&Hr(e,t,r,f.pos),f.pos=t.length,s=null):s=Ar(Or(n,f,r,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e4),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e4);i(p,u),c=p}}function Rr(e,t,n,r){var i=[e.state.modeGen],o={};Pr(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Pr(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=je(e,ti(t)),i=Rr(e,t,t.text.length>e.options.maxHighlightLength?sa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Hr(e,t,n,r){var i=e.doc.mode,o=new ma(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Er(i,n);!o.eol();)Or(i,o,n),o.start=o.pos}function Wr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ka:wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Br(e,t){var n=ji("span",null,null,wo?"padding-right: .1px":null),r={pre:ji("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(xo||wo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,Ji(e.display.measure)&&(o=ii(a))&&(r.addToken=jr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&ti(a);qr(a,r,Dr(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=$i(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=$i(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(wo){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Pa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=$i(r.pre.className,r.textClass||"")),r}function _r(e){var t=ji("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,zr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var h=s.exec(t),d=h?h.index-f:t.length-f;if(d){var p=document.createTextNode(l.slice(f,f+d));xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!h)break;if(f+=d+1," "==h[0]){var m=e.cm.options.tabSize,g=m-e.col%m,p=u.appendChild(ji("span",Oi(g),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=g}else if("\r"==h[0]||"\n"==h[0]){var p=u.appendChild(ji("span","\r"==h[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",h[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(h[0]);p.setAttribute("cm-text",h[0]),xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),xo&&9>bo&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=ji("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function zr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function jr(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=0;f<t.length;f++){var h=t[f];if(h.to>c&&h.from<=c)break}if(h.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,h.to-c),i,o,null,l,s),o=null,r=r.slice(h.to-c),c=h.to}}}function Ur(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function qr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,h,d=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=f=l="",h=null,v=1/0;for(var y,x=[],b=0;b<r.length;++b){var w=r[b],k=w.marker;"bookmark"==k.type&&w.from==p&&k.widgetNode?x.push(k):w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!f&&(f=k.title),k.collapsed&&(!h||dr(h.marker,k)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(var b=0;b<y.length;b+=2)y[b+1]==v&&(c+=" "+y[b]);if(!h||h.from==p)for(var b=0;b<x.length;++b)Ur(t,0,x[b]);if(h&&(h.from||0)==p){if(Ur(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var S=Math.min(d,v);;){if(g){var C=p+g.length;if(!h){var L=C>S?g.slice(0,S-p):g;t.addToken(t,L,a?a+s:s,u,p+L.length==v?c:"",f,l)}if(C>=S){g=g.slice(S-p),p=S;break}p=C,u=""}g=i.slice(o,o=n[m++]),a=Wr(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),Wr(n[m+1],t.cm.options))}function Gr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Ii(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Yr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){Mr(e,n,i,r),Ci(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new ba(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Zr(e,l.line),f=Zr(e,s.line),h=Ii(c),d=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,t)){var m=a(0,c.length-1);o(f,f.text,d),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+h+u.text.slice(s.ch),d);else{var m=a(1,c.length-1);m.push(new ba(h+u.text.slice(s.ch),d,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,h+f.text.slice(s.ch),d);var m=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,m)}Ci(e,"change",e,t)}function $r(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Vr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Kr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Xr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,Dt(e)}function Zr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Jr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Qr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ei(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ti(e){if(null==e.parent)return null;for(var t=e.parent,n=Pi(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ni(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function ri(e){e=yr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function ii(e){var t=e.order;return null==t&&(t=e.order=ll(e.text)),t}function oi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ai(e,t){var n={from:$(t.from),to:Qo(t),text:Jr(e,t.from,t.to)};return di(e,n,t.from.line,t.to.line+1),Kr(e,function(e){di(e,n,t.from.line,t.to.line+1)},!0),n}function li(e){for(;e.length;){var t=Ii(e);if(!t.ranges)break;e.pop()}}function si(e,t){return t?(li(e.done),Ii(e.done)):e.done.length&&!Ii(e.done).ranges?Ii(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ii(e.done)):void 0}function ci(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=si(i,i.lastOp==r))){var l=Ii(o.changes);0==_o(t.from,t.to)&&0==_o(t.from,l.to)?l.to=Qo(t):o.changes.push(ai(e,t))}else{var s=Ii(i.done);for(s&&s.ranges||hi(e.sel,i.done),o={changes:[ai(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Pa(e,"historyAdded")}function ui(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ui(e,o,Ii(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&li(i.undone)}function hi(e,t){var n=Ii(t);n&&n.ranges&&n.equals(e)||t.push(e)}function di(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function mi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(pi(n[r]));return i}function gi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?ue.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&Pi(t,Number(c[1]))>-1&&(Ii(l)[f]=u[f],delete u[f])}}}return i}function vi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function yi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)vi(o.ranges[l].anchor,t,n,r),vi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=Bo(s.from.line+r,s.from.ch),s.to=Bo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;yi(e.done,n,r,i),yi(e.undone,n,r,i)}function bi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function wi(e){return e.target||e.srcElement}function ki(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Eo&&e.ctrlKey&&1==t&&(t=3),t}function Si(e,t,n){var r=e._handlers&&e._handlers[t];return n?r&&r.length>0?r.slice():Oa:r||Oa}function Ci(e,t){function n(e){return function(){e.apply(null,o)}}var r=Si(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Go?i=Go.delayedCallbacks:Ra?i=Ra:(i=Ra=[],setTimeout(Li,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function Li(){var e=Ra;Ra=null;for(var t=0;t<e.length;++t)e[t]()}function Ti(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pa(e,n||t.type,e,t),bi(t)||t.codemirrorIgnore}function Mi(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Pi(n,t[r])&&n.push(t[r])}function Ni(e,t){return Si(e,t).length>0}function Ai(e){e.prototype.on=function(e,t){Ea(this,e,t)},e.prototype.off=function(e,t){Ia(this,e,t)}}function Ei(){this.id=null}function Oi(e){for(;ja.length<=e;)ja.push(Ii(ja)+" ");return ja[e]}function Ii(e){return e[e.length-1]}function Pi(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Ri(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Di(){}function Hi(e,t){var n;return Object.create?n=Object.create(e):(Di.prototype=e,n=new Di),t&&Wi(t,n),n}function Wi(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Bi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function _i(e,t){return t?t.source.indexOf("\\w")>-1&&Ya(e)?!0:t.test(e):Ya(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function zi(e){return e.charCodeAt(0)>=768&&$a.test(e)}function ji(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Ui(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function qi(e,t){return Ui(e).appendChild(t)}function Gi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Yi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $i(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Yi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Vi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Ki(){Qa||(Xi(),Qa=!0)}function Xi(){var e;Ea(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Vi(qt)},100))}),Ea(window,"blur",function(){Vi(yn)})}function Zi(e){if(null==Ka){var t=ji("span","​");qi(e,ji("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ka=t.offsetWidth<=1&&t.offsetHeight>2&&!(xo&&8>bo))}var n=Ka?ji("span","​"):ji("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ji(e){if(null!=Xa)return Xa;var t=qi(e,document.createTextNode("AخA")),n=qa(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=qa(t,1,2).getBoundingClientRect();return Xa=r.right-n.right<3}function Qi(e){if(null!=il)return il;var t=qi(e,ji("span","x")),n=t.getBoundingClientRect(),r=qa(t,0,1).getBoundingClientRect();return il=Math.abs(n.left-r.left)>1}function eo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function ro(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?no(Ii(t)):e.text.length}function oo(e,t){var n=Zr(e.doc,t),r=yr(n);r!=n&&(t=ti(r));var i=ii(r),o=i?i[0].level%2?io(r):ro(r):0;return Bo(t,o)}function ao(e,t){for(var n,r=Zr(e.doc,t);n=gr(r);)r=n.find(1,!0).line,t=null;var i=ii(r),o=i?i[0].level%2?ro(r):io(r):r.text.length;return Bo(null==t?ti(r):t,o)}function lo(e,t){var n=oo(e,t.line),r=Zr(e.doc,n.line),i=ii(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Bo(n.line,a?0:o)}return n}function so(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function co(e,t){al=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return so(e,i.level,e[n].level)?(i.from!=i.to&&(al=n),r):(i.from!=i.to&&(al=r),n);n=r}}return n}function uo(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&zi(e.text.charAt(t)));return t}function fo(e,t,n,r){var i=ii(e);if(!i)return ho(e,t,n,r);for(var o=co(i,t),a=i[o],l=uo(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return co(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?uo(e,a.to,-1,r):uo(e,a.from,1,r)}}function ho(e,t,n,r){var i=t+n;if(r)for(;i>0&&zi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,mo=navigator.platform,go=/gecko\/\d/i.test(po),vo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),xo=vo||yo,bo=xo&&(vo?document.documentMode||6:yo[1]),wo=/WebKit\//.test(po),ko=wo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Co=/Opera\//.test(po),Lo=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Ao=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Eo=No||/Mac/.test(mo),Oo=/\bCrOS\b/.test(po),Io=/win/i.test(mo),Po=Co&&po.match(/Version\/(\d*\.\d*)/);Po&&(Po=Number(Po[1])),Po&&Po>=15&&(Co=!1,wo=!0);var Ro=Eo&&(ko||Co&&(null==Po||12.11>Po)),Do=go||xo&&bo>=9,Ho=!1,Wo=!1;m.prototype=Wi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Eo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ei,this.disableVert=new Ei},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Wi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},L.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},L.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pa.apply(null,this.events[e])};var Bo=e.Pos=function(e,t){return this instanceof Bo?(this.line=e,void(this.ch=t)):new Bo(e,t)},_o=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Fo=null;ne.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Fo.text.join("\n"),Ua(o));else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type?r.setSelections(t.ranges,null,Wa):(n.prevInput="",o.value=t.text.join("\n"),Ua(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}var n=this,r=this.cm,i=this.wrapper=re(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),No&&(o.style.width="0px"),Ea(o,"input",function(){xo&&bo>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Ea(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Ea(o,"cut",t),Ea(o,"copy",t),Ea(e.scroller,"paste",function(t){Gt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Ea(e.lineSpace,"selectstart",function(t){Gt(e,t)||Ma(t)}),Ea(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ea(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var i=dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;qi(n.cursorDiv,e.cursors),qi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rl&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&Ua(this.textarea),xo&&bo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",xo&&bo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Ao||Gi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0; -},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||nl(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&bo>=9&&this.hasSelection===r||Eo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return At(e,function(){Z(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&bo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,xo&&9>bo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!xo||xo&&9>bo)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Et(i,ua.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Yt(i,e),s=o.scroller.scrollTop;if(l&&!Co){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&Et(i,Te)(i.doc,de(l),Wa);var u=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",wo)var d=window.scrollY;if(o.input.focus(),wo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&bo>=9&&t(),Do){Aa(e);var p=function(){Ia(window,"mouseup",p),setTimeout(n,20)};Ea(window,"mouseup",p)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Di,needsContentAttribute:!1},ne.prototype),ie.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Wa),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Fo.text.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Fo.text.join("\n");var o=document.activeElement;Ua(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;te(i),Ea(i,"paste",function(e){Ti(r,e)||J(e,r)}),Ea(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=de(Bo(i.head.line,a),Bo(i.head.line,a+t.length)))}}),Ea(i,"compositionupdate",function(e){n.composing.data=e.data}),Ea(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Ea(i,"touchstart",function(){n.forceCompositionEnd()}),Ea(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||At(n.cm,function(){Dt(r)})}),Ea(i,"copy",t),Ea(i,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=_o(K(n,r),t.from())||0!=_o(V(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=qa(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(!go&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):go&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){qi(this.cm.display.cursorDiv,e.cursors),qi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Va(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,de(n,r),Wa),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Bt(e,r.line)))var a=ti(t.view[0].line),l=t.view[0].node;else var a=ti(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Bt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ti(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=e.doc.splitLines(ce(e,l,u,a,c)),h=Jr(e.doc,Bo(a,0),Bo(c,Zr(e.doc,c).text.length));f.length>1&&h.length>1;)if(Ii(f)==Ii(h))f.pop(),h.pop(),c--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),a++}for(var d=0,p=0,m=f[0],g=h[0],v=Math.min(m.length,g.length);v>d&&m.charCodeAt(d)==g.charCodeAt(d);)++d;for(var y=Ii(f),x=Ii(h),b=Math.min(y.length-(1==f.length?d:0),x.length-(1==h.length?d:0));b>p&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var w=Bo(a,d),k=Bo(c,h.length?Ii(h).length-p:0);return f.length>1||f[0]||_o(w,k)?(In(e.doc,f,w,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Et(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Et(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Et(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Di,resetPosition:Di,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=_o(n.anchor,r.anchor)||0!=_o(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fe($(this.ranges[t].anchor),$(this.ranges[t].head));return new ue(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(_o(t,r.from())>=0&&_o(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return V(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var zo,jo,Uo,qo={left:0,right:0,top:0,bottom:0},Go=null,Yo=0,$o=0,Vo=0,Ko=null;xo?Ko=-.53:go?Ko=15:So?Ko=-.7:Lo&&(Ko=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);return t.x*=Ko,t.y*=Ko,t};var Zo=new Ei,Jo=null,Qo=e.changeEnd=function(e){return e.text?Bo(e.from.line+e.text.length-1,Ii(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ta.hasOwnProperty(e)&&Et(this,ta[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($n(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ot(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,Dt(this)}),removeOverlay:Ot(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Dt(this)}}),indentLine:Ot(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ve(this.doc,e)&&Fn(this,e,t,n)}),indentSelection:Ot(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Bn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)Fn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&ke(this.doc,r,new fe(o,c[r].to()),Wa)}}}),getTokenAt:function(e,t){return Ir(this,e,t)},getLineTokens:function(e,t){return Ir(this,Bo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Zr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!la.hasOwnProperty(t))return n;var r=la[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Pi(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=pe(n,null==e?n.first+n.size-1:e),je(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?me(this.doc,e):e?r.from():r.to(),dt(this,n,t||"page")},charCoords:function(e,t){return ht(this,me(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ft(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ft(this,{top:e,left:0},t||"page").top,ni(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Zr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ri(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ot(function(e,t,n){return zn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Ht(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Zr(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=dt(this,me(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&Dn(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(hn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:pn,execCommand:function(e){return ua.hasOwnProperty(e)?ua[e].call(null,this):void 0},triggerElectric:Ot(function(e){Q(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=me(this.doc,e);t>o&&(a=Un(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Un(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},_a)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):jn(this,function(n){var i=Un(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=me(this.doc,e);t>a;++a){var s=dt(this,l,"div");if(null==o?o=s.left:s.left=o,l=qn(this,s,i,n),l.hitSide)break}return l},moveV:Ot(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=dt(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=qn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Wn(n,null,ht(n,s,"div").top-l.top),s},_a),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Zr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=_i(a,o)?function(e){return _i(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!_i(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new fe(Bo(e.line,r),Bo(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ja(this.display.cursorDiv,"CodeMirror-overwrite"):Za(this.display.cursorDiv,"CodeMirror-overwrite"),Pa(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Gi()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ot(function(e,t){null==e&&null==t||_n(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ye(this)-this.display.barHeight,width:e.scrollWidth-Ye(this)-this.display.barWidth,clientHeight:Ve(this),clientWidth:$e(this)}},scrollIntoView:Ot(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Bo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)_n(this),this.curOp.scrollToPos=e;else{var n=Hn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:Ot(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&at(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Ht(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,Pa(r,"refresh",this)}),operation:function(e){return At(this,e)},refresh:Ot(function(){var e=this.display.cachedTextHeight;Dt(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-yt(this.display))>.5)&&a(this),Pa(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Xr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ci(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ai(e);var ea=e.defaults={},ta=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Gn("value","",function(e,t){e.setValue(t)},!0),Gn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Gn("indentUnit",2,n,!0),Gn("indentWithTabs",!1),Gn("smartIndent",!0),Gn("tabSize",4,function(e){r(e),lt(e),Dt(e)},!0),Gn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Bo(r,o))}r++});for(var i=n.length-1;i>=0;i--)In(e.doc,t,n[i],Bo(n[i].line,n[i].ch+t.length))}}),Gn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Gn("specialCharPlaceholder",_r,function(e){e.refresh()},!0),Gn("electricChars",!0),Gn("inputStyle",Ao?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Gn("rtlMoveVisually",!Io),Gn("wholeLineUpdateBefore",!0),Gn("theme","default",function(e){l(e),s(e)},!0),Gn("keyMap","default",function(t,n,r){var i=$n(n),o=r!=e.Init&&$n(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Gn("extraKeys",null),Gn("lineWrapping",!1,i,!0),Gn("gutters",[],function(e){d(e.options),s(e)},!0),Gn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Gn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Gn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Gn("lineNumbers",!1,function(e){d(e.options),s(e)},!0),Gn("firstLineNumber",1,s,!0),Gn("lineNumberFormatter",function(e){return e},s,!0),Gn("showCursorWhenSelecting",!1,Re,!0),Gn("resetSelectionOnContextMenu",!0),Gn("lineWiseCopyCut",!0),Gn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Gn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Gn("dragDrop",!0,Ut),Gn("allowDropFileTypes",null),Gn("cursorBlinkRate",530),Gn("cursorScrollMargin",0),Gn("cursorHeight",1,Re,!0),Gn("singleCursorHeightPerLine",!0,Re,!0),Gn("workTime",100),Gn("workDelay",100),Gn("flattenSpans",!0,r,!0),Gn("addModeClass",!1,r,!0),Gn("pollInterval",100),Gn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Gn("historyEventDelay",1250),Gn("viewportMargin",10,function(e){e.refresh()},!0),Gn("maxHighlightLength",1e4,r,!0),Gn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Gn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Gn("autofocus",null);var ra=e.modes={},ia=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),ra[t]=n},e.defineMIME=function(e,t){ia[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ia.hasOwnProperty(t))t=ia[t];else if(t&&"string"==typeof t.name&&ia.hasOwnProperty(t.name)){var n=ia[t.name];"string"==typeof n&&(n={name:n}),t=Hi(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=ra[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(oa.hasOwnProperty(n.name)){var o=oa[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var oa=e.modeExtensions={};e.extendMode=function(e,t){var n=oa.hasOwnProperty(e)?oa[e]:oa[e]={};Wi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Ca.prototype[e]=t},e.defineOption=Gn;var aa=[];e.defineInitHook=function(e){aa.push(e)};var la=e.helpers={};e.registerHelper=function(t,n,r){la.hasOwnProperty(t)||(la[t]=e[t]={_global:[]}),la[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),la[t]._global.push({pred:r,val:i})};var sa=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ca=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ua=e.commands={selectAll:function(e){e.setSelection(Bo(e.firstLine(),0),Bo(e.lastLine()),Wa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Wa)},killLine:function(e){jn(e,function(t){if(t.empty()){var n=Zr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Bo(t.head.line+1,0)}:{from:t.head,to:Bo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){jn(e,function(t){return{from:Bo(t.from().line,0),to:me(e.doc,Bo(t.to().line+1,0))}})},delLineLeft:function(e){jn(e,function(e){return{from:Bo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Bo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Bo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return lo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return ao(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},_a)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},_a)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?lo(e,t.head):r},_a)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Fa(e.getLine(o.line),o.ch,r);t.push(Oi(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Zr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Bo(i.line,i.ch-1)),i.ch>0)i=new Bo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Bo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Zr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Bo(i.line-1,a.length-1),Bo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Bn(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},fa=e.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fa["default"]=Eo?fa.macDefault:fa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Ri(n.split(" "),Yn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var ha=e.lookupKey=function(e,t,n,r){t=$n(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return ha(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=ha(e,t.fallthrough[o],n,r); -if(a)return a}}},da=e.isModifierKey=function(e){var t="string"==typeof e?e:ol[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},pa=e.keyName=function(e,t){if(Co&&34==e.keyCode&&e["char"])return!1;var n=ol[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Ro?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(Ro?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n=n?Wi(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=Gi();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Ea(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ia(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ma=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ma.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Fa(this.string,null,this.tabSize)-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ga=0,va=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ga};Ai(va),va.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),Ni(this,"clear")){var n=this.find();n&&Ci(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=er(a.markedSpans,this);e&&!this.collapsed?Ht(e,ti(a),"text"):e&&(null!=l.to&&(i=ti(a)),null!=l.from&&(r=ti(a))),a.markedSpans=tr(a.markedSpans,l),null==l.from&&this.collapsed&&!kr(this.doc,a)&&e&&ei(a,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=yr(this.lines[o]),c=f(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&Ci(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},va.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=er(o.markedSpans,this);if(null!=a.from&&(n=Bo(t?o:ti(o),a.from),-1==e))return n;if(null!=a.to&&(r=Bo(t?o:ti(o),a.to),1==e))return r}return n&&{from:n,to:r}},va.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&At(n,function(){var r=e.line,i=ti(e.line),o=Qe(n,i);if(o&&(ot(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!kr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=Lr(t)-a;l&&ei(r,r.height+l)}})},va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Pi(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},va.prototype.detachLine=function(e){if(this.lines.splice(Pi(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var ga=0,ya=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Ai(ya),ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ci(this,"clear")}},ya.prototype.find=function(e,t){return this.primary.find(e,t)};var xa=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Ai(xa),xa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ti(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Lr(this);ei(n,Math.max(0,n.height-o)),e&&At(e,function(){Cr(e,n,-o),Ht(e,r,"widget")})}},xa.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Lr(this)-e;r&&(ei(n,n.height+r),t&&At(t,function(){t.curOp.forceUpdate=!0,Cr(t,n,r)}))};var ba=e.Line=function(e,t,n){this.text=e,ur(this,t),this.height=n?n(this):1};Ai(ba),ba.prototype.lineNo=function(){return ti(this)};var wa={},ka={};$r.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Nr(i),Ci(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof $r))){var l=[];this.collapse(l),this.children=[new $r(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new $r(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Vr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Pi(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Vr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var Sa=0,Ca=e.Doc=function(e,t,n,r){if(!(this instanceof Ca))return new Ca(e,t,n,r);null==n&&(n=0),Vr.call(this,[new $r([new ba("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=Bo(n,0);this.sel=de(i),this.history=new oi(null),this.id=++Sa,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Yr(this,{from:i,to:i,text:e}),Te(this,de(i),Wa)};Ca.prototype=Hi(Vr.prototype,{constructor:Ca,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:It(function(e){var t=Bo(this.first,0),n=this.first+this.size-1;Tn(this,{from:t,to:Bo(n,Zr(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Te(this,de(t))}),replaceRange:function(e,t,n,r){t=me(this,t),n=n?me(this,n):t,In(this,e,t,n,r)},getRange:function(e,t,n){var r=Jr(this,me(this,e),me(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ve(this,e)?Zr(this,e):void 0},getLineNumber:function(e){return ti(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Zr(this,e)),yr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return me(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:It(function(e,t,n){Se(this,me(this,"number"==typeof e?Bo(e,t||0):e),null,n)}),setSelection:It(function(e,t,n){Se(this,me(this,e),me(this,t||e),n)}),extendSelection:It(function(e,t,n){be(this,me(this,e),t&&me(this,t),n)}),extendSelections:It(function(e,t){we(this,ye(this,e),t)}),extendSelectionsBy:It(function(e,t){var n=Ri(this.sel.ranges,e);we(this,ye(this,n),t)}),setSelections:It(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new fe(me(this,e[r].anchor),me(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,he(i,t),n)}}),addSelection:It(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new fe(me(this,e),me(this,t||e))),Te(this,he(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:It(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&Cn(this,r,t),o=r.length-1;o>=0;o--)Tn(this,r[o]);l?Le(this,l):this.cm&&Bn(this.cm)}),undo:It(function(){Nn(this,"undo")}),redo:It(function(){Nn(this,"redo")}),undoSelection:It(function(){Nn(this,"undo",!0)}),redoSelection:It(function(){Nn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new oi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:gi(this.history.done),undone:gi(this.history.undone)}},setHistory:function(e){var t=this.history=new oi(this.history.maxGeneration);t.done=gi(e.done.slice(0),null,!0),t.undone=gi(e.undone.slice(0),null,!0)},addLineClass:It(function(e,t,n){return zn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Yi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:It(function(e,t,n){return zn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Yi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:It(function(e,t,n){return Tr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vn(this,me(this,e),me(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=me(this,e),Vn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=me(this,e);var t=[],n=Zr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;return o>e?(t=e,!0):(e-=o,void++n)}),me(this,Bo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ca(Qr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ca(Qr(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Zn(r,Xn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Jn(Xn(this));break}}if(t.history==this.history){var i=[t.id];Kr(t,function(e){i.push(e.id)},!0),t.history=new oi(null),t.history.done=gi(this.history.done,i),t.history.undone=gi(this.history.undone,i)}},iterLinkedDocs:function(e){Kr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):tl(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Ca.prototype.eachLine=Ca.prototype.iter;var La="iter insert remove copy getEditor constructor".split(" ");for(var Ta in Ca.prototype)Ca.prototype.hasOwnProperty(Ta)&&Pi(La,Ta)<0&&(e.prototype[Ta]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ca.prototype[Ta]));Ai(Ca);var Ma=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Na=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Aa=e.e_stop=function(e){Ma(e),Na(e)},Ea=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Oa=[],Ia=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var r=Si(e,t,!1),i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}},Pa=e.signal=function(e,t){var n=Si(e,t,!0);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Ra=null,Da=30,Ha=e.Pass={toString:function(){return"CodeMirror.Pass"}},Wa={scroll:!1},Ba={origin:"*mouse"},_a={origin:"+move"};Ei.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Fa=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},za=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},ja=[""],Ua=function(e){e.select()};No?Ua=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&(Ua=function(e){try{e.select()}catch(t){}});var qa,Ga=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ya=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ga.test(e))},$a=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;qa=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Va=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&11>bo&&(Gi=function(){try{return document.activeElement}catch(e){return document.body}});var Ka,Xa,Za=e.rmClass=function(e,t){var n=e.className,r=Yi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ja=e.addClass=function(e,t){var n=e.className;Yi(t).test(n)||(e.className+=(n?" ":"")+t)},Qa=!1,el=function(){if(xo&&9>bo)return!1;var e=ji("div");return"draggable"in e||"dragDrop"in e}(),tl=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},nl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rl=function(){var e=ji("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),il=null,ol=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)ol[e+48]=ol[e+96]=String(e);for(var e=65;90>=e;e++)ol[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ol[e+111]=ol[e+63235]="F"+e}();var al,ll=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],h=0;u>h;++h)f.push(r=e(n.charCodeAt(h)));for(var h=0,d=c;u>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=c;u>h;++h){var r=f[h];"1"==r&&"r"==p?f[h]="n":a.test(r)&&(p=r,"r"==r&&(f[h]="R"))}for(var h=1,d=f[0];u-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=r}for(var h=0;u>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var m=h+1;u>m&&"%"==f[m];++m);for(var g=h&&"!"==f[h-1]||u>m&&"1"==f[m]?"1":"N",v=h;m>v;++v)f[v]=g;h=m-1}}for(var h=0,p=c;u>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;u>h;++h)if(o.test(f[h])){for(var m=h+1;u>m&&o.test(f[m]);++m);for(var y="L"==(h?f[h-1]:c),x="L"==(u>m?f[m]:c),g=y||x?"L":"R",v=h;m>v;++v)f[v]=g;h=m-1}for(var b,w=[],h=0;u>h;)if(l.test(f[h])){var k=h;for(++h;u>h&&l.test(f[h]);++h);w.push(new t(0,k,h))}else{var S=h,C=w.length;for(++h;u>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(s.test(f[v])){v>S&&w.splice(C,0,new t(1,S,v));var L=v;for(++v;h>v&&s.test(f[v]);++v);w.splice(C,0,new t(2,L,v)),S=v}else++v;h>S&&w.splice(C,0,new t(1,S,h))}return 1==w[0].level&&(b=n.match(/^\s+/))&&(w[0].from=b[0].length,w.unshift(new t(0,0,b[0].length))),1==Ii(w).level&&(b=n.match(/\s+$/))&&(Ii(w).to-=b[0].length,w.push(new t(0,u-b[0].length,u))),2==w[0].level&&w.unshift(new t(1,w[0].to,w[0].to)),w[0].level!=Ii(w).level&&w.push(new t(w[0].level,u,u)),w}}();return e.version="5.15.2",e})},{}],11:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],i):i(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},l={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var s in r)l[s]=r[s];return l.name="markdown",e.overlayMode(e.getMode(n,l),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../xml/xml","../meta"],i):i(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,k&&e.f==c&&(e.f=p,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(t,o){var l=t.sol(),s=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,s&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var f=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,S.code):null;if(t.eatSpace())return null;if((f=t.match(A))&&f[1].length<=6)return o.header=f[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(!(a(o.prevLine)||o.quote||s||c)&&(f=t.match(E)))return o.header="="==f[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(t.eat(">"))return o.quote=l?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),h(o);if("["===t.peek())return i(t,o,y);if(t.match(L,!0))return o.hr=!0,S.hr;if((a(o.prevLine)||s)&&(t.match(T,!1)||t.match(M,!1))){var d=null;for(t.match(T,!0)?d="ul":(t.match(M,!0),d="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()<o.listStack[o.listStack.length-1];)o.listStack.pop();return o.listStack.push(o.indentation),n.taskLists&&t.match(N,!1)&&(o.taskList=!0),o.f=o.inline,n.highlightFormatting&&(o.formatting=["list","list-"+d]),h(o)}return n.fencedCodeBlocks&&(f=t.match(I,!0))?(o.fencedChars=f[1],o.localMode=r(f[2]),o.localMode&&(o.localState=e.startState(o.localMode)),o.f=o.block=u,n.highlightFormatting&&(o.formatting="code-block"),o.code=-1,h(o)):i(t,o,o.inline)}function c(t,n){var r=w.token(t,n.htmlState);if(!k){var i=e.innerMode(w,n.htmlState);("xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=p,n.block=s,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S.code)}function f(e,t){e.match(t.fencedChars),t.block=s,t.f=p,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=h(t);return t.code=0,r}function h(e){var t=[];if(e.formatting){t.push(S.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(S.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(S.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(S.linkHref,"url"):(e.strong&&t.push(S.strong),e.em&&t.push(S.em),e.strikethrough&&t.push(S.strikethrough),e.linkText&&t.push(S.linkText),e.code&&t.push(S.code)),e.header&&t.push(S.header,S.header+"-"+e.header),e.quote&&(t.push(S.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.quote+"-"+e.quote):t.push(S.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(S.list2):t.push(S.list3):t.push(S.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(O,!0)?h(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,h(r);if(r.taskList){var a="x"!==t.match(N,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,h(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"), -h(r);var l=t.sol(),s=t.next();if(r.linkTitle){r.linkTitle=!1;var u=s;"("===s&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),!0))return S.linkHref}if("`"===s){var d=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0==r.code)return r.code=p,h(r);if(p==r.code){var v=h(r);return r.code=0,v}return r.formatting=d,h(r)}if(r.code)return h(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var y=h(r),x=S.formatting+"-escape";return y?y+" "+x:x}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=g,S.image;if("["===s&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),h(r);if("]"===s&&r.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=h(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkEmail}if("<"===s&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var k=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(k)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(w),o(t,r,c)}if("<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var L=t.pos-2;if(L>=0){var T=t.string.charAt(L);"_"!==T&&T.match(/(\w)/,!1)&&(C=!0)}}if("*"===s||"_"===s&&!C)if(l&&" "===t.peek());else{if(r.strong===s&&t.eat(s)){n.highlightFormatting&&(r.formatting="strong");var v=h(r);return r.strong=!1,v}if(!r.strong&&t.eat(s))return r.strong=s,n.highlightFormatting&&(r.formatting="strong"),h(r);if(r.em===s){n.highlightFormatting&&(r.formatting="em");var v=h(r);return r.em=!1,v}if(!r.em)return r.em=s,n.highlightFormatting&&(r.formatting="em"),h(r)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return h(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=h(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),h(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return h(r);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),h(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=h(t);return i?i+=" ":i="",i+S.linkInline}return e.match(/^[^>]+/,!0),S.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,h(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=h(r);return r.linkHref=!1,o}return t.match(P[e]),r.linkHref=!0,h(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=x,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,h(t)):i(e,t,p)}function x(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=h(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,S.linkHref+" url")}var w=e.getMode(t,"text/html"),k="null"==w.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var S={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in S)S.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(S[C]=n.tokenTypeOverrides[C]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,M=/^[0-9]+([.)])\s+/,N=/^\[(x| )\](?=\s)/,A=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,O=/^[^#!\[\]*_\\<>` "'(~]+/,I=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},R={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(l(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:R}},blankLine:l,getType:h,fold:"markdown"};return R},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../lib/codemirror")):"function"==typeof e&&e.amd?e(["../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}})},{"../lib/codemirror":10}],14:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=d,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:d}function p(e,t,n){return"word"==e?(n.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||S.matchClosing===!1?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,n){return"endTag"!=e?(M="error",g):(f(n),d)}function v(e,t,n){return M="error",g(e,t,n)}function y(e,t,n){if("word"==e)return M="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),d}return M="error",y}function x(e,t,n){return"equals"==e?b:(S.allowMissing||(M="error"),y(e,t,n))}function b(e,t,n){return"string"==e?w:"word"==e&&S.allowUnquoted?(M="string",y):(M="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var k=r.indentUnit,S={},C=i.htmlMode?t:n;for(var L in C)S[L]=C[L];for(var L in i)S[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:d,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(M=null,t.state=t.state(T||n,e,t),M&&(n="error"==M?n+" error":M)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return S.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!S.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=S.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,c=s>>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=l;u>0;o=256*o+e[t+f],f+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,l,s,c=8*o-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),t+=a+f>=1?h/s:h*Math.pow(2,1-f),t*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*s-1)*Math.pow(2,i),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&l,d+=p,l/=256,i-=8);for(a=a<<i|l,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},{}],16:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],17:[function(t,n,r){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=d.normal,this.options.gfm&&(this.options.tables?this.rules=d.tables:this.rules=d.gfm)}function i(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function o(e){this.options=e||{}}function a(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}function l(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function s(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function f(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function h(e,n,r){if(r||"function"==typeof n){r||(r=n,n=null),n=f({},h.defaults,n||{});var i,o,s=n.highlight,c=0;try{i=t.lex(e,n)}catch(u){return r(u)}o=i.length;var d=function(e){if(e)return n.highlight=s,r(e);var t;try{t=a.parse(i,n)}catch(o){e=o}return n.highlight=s,e?r(e):r(null,t)};if(!s||s.length<3)return d();if(delete n.highlight,!o)return d();for(;c<i.length;c++)!function(e){return"code"!==e.type?--o||d():s(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--o||d():(e.text=n,e.escaped=!0,void(--o||d()))})}(i[c])}else try{return n&&(n=f({},h.defaults,n)),a.parse(t.lex(e,n),n)}catch(u){if(u.message+="\nPlease report this to https://github.com/chjj/marked.",(n||h.defaults).silent)return"<p>An error occured:</p><pre>"+l(u.message+"",!0)+"</pre>";throw u}}var d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=c(d.item,"gm")(/bull/g,d.bullet)(),d.list=c(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=c(d.blockquote)("def",d.def)(),d._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",d.html=c(d.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,d._tag)(),d.paragraph=c(d.paragraph)("hr",d.hr)("heading",d.heading)("lheading",d.lheading)("blockquote",d.blockquote)("tag","<"+d._tag)("def",d.def)(),d.normal=f({},d),d.gfm=f({},d.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),d.gfm.paragraph=c(d.paragraph)("(?!","(?!"+d.gfm.fences.source.replace("\\1","\\2")+"|"+d.list.source.replace("\\1","\\3")+"|")(),d.tables=f({},d.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=d,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,a,l,s,c,u,f,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].split(/ *\| */);this.tokens.push(s)}else if(o=this.rules.lheading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(this.rules.item),r=!1,f=o.length,u=0;f>u;u++)s=o[u],c=s.length,s=s.replace(/^ *([*+-]|\d+\.) +/,""),~s.indexOf("\n ")&&(c-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==f-1&&(l=d.bullet.exec(o[u+1])[0],a===l||a.length>1&&l.length>1||(e=o.slice(u+1).join("\n")+e,u=f-1)),i=r||/\n\n(?!\s*$)/.test(s),u!==f-1&&(r="\n"===s.charAt(s.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),s={type:"table", -header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(s)}else if(t&&(o=this.rules.paragraph.exec(e)))e=e.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var p={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};p._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,p._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=c(p.link)("inside",p._inside)("href",p._href)(),p.reflink=c(p.reflink)("inside",p._inside)(),p.normal=f({},p),p.pedantic=f({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=f({},p.normal,{escape:c(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=f({},p.gfm,{br:c(p.br)("{2,}","*")(),text:c(p.gfm.text)("{2,}","*")()}),i.rules=p,i.output=function(e,t,n){var r=new i(t,n);return r.output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=l(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):l(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(l(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(l(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=l(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=l(t.href),r=t.title?l(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,l(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+l(t,!0)+'">'+(n?e:l(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:l(e,!0))+"\n</code></pre>"},o.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},o.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},o.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},o.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},o.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},o.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},o.prototype.strong=function(e){return"<strong>"+e+"</strong>"},o.prototype.em=function(e){return"<em>"+e+"</em>"},o.prototype.codespan=function(e){return"<code>"+e+"</code>"},o.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},o.prototype.del=function(e){return"<del>"+e+"</del>"},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(s(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>"},o.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},o.prototype.text=function(e){return e},a.parse=function(e,t,n){var r=new a(t,n);return r.parse(e)},a.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",a="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(o+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",i=0;i<t.length;i++)n+=this.renderer.tablecell(this.inline.output(t[i]),{header:!1,align:this.token.align[i]});a+=this.renderer.tablerow(n)}return this.renderer.table(o,a);case"blockquote_start":for(var a="";"blockquote_end"!==this.next().type;)a+=this.tok();return this.renderer.blockquote(a);case"list_start":for(var a="",l=this.token.ordered;"list_end"!==this.next().type;)a+=this.tok();return this.renderer.list(a,l);case"list_item_start":for(var a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(a);case"loose_item_start":for(var a="";"list_item_end"!==this.next().type;)a+=this.tok();return this.renderer.listitem(a);case"html":var s=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(s);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},u.exec=u,h.options=h.setOptions=function(e){return f(h.defaults,e),h},h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new o,xhtml:!1},h.Parser=a,h.parser=a.parse,h.Renderer=o,h.Lexer=t,h.lexer=t.lex,h.InlineLexer=i,h.inlineLexer=i.output,h.parse=h,"undefined"!=typeof n&&"object"==typeof r?n.exports=h:"function"==typeof e&&e.amd?e(function(){return h}):this.marked=h}).call(function(){return this||("undefined"!=typeof window?window:t)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(e,t,n){(function(n,r){"use strict";var i=function(e,t,n,i){if(i=i||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=i.flags||{},e){if(this.dictionary=e,"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension)t||(t=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".aff"))),n||(n=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".dic")));else{if(i.dictionaryPath)var o=i.dictionaryPath;else if("undefined"!=typeof r)var o=r+"/dictionaries";else var o="./dictionaries";t||(t=this._readFile(o+"/"+e+"/"+e+".aff")),n||(n=this._readFile(o+"/"+e+"/"+e+".dic"))}this.rules=this._parseAFF(t),this.compoundRuleCodes={};for(var a=0,l=this.compoundRules.length;l>a;a++)for(var s=this.compoundRules[a],c=0,u=s.length;u>c;c++)this.compoundRuleCodes[s[c]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n);for(var a in this.compoundRuleCodes)0==this.compoundRuleCodes[a].length&&delete this.compoundRuleCodes[a];for(var a=0,l=this.compoundRules.length;l>a;a++){for(var f=this.compoundRules[a],h="",c=0,u=f.length;u>c;c++){var d=f[c];h+=d in this.compoundRuleCodes?"("+this.compoundRuleCodes[d].join("|")+")":d}this.compoundRules[a]=new RegExp(h,"i")}}return this};i.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(t,r){if(r||(r="utf8"),"undefined"!=typeof XMLHttpRequest){var i=new XMLHttpRequest;return i.open("GET",t,!1),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+r),i.send(null),i.responseText}if("undefined"!=typeof e){var o=e("fs");try{if(o.existsSync(t)){var a=o.statSync(t),l=o.openSync(t,"r"),s=new n(a.size);return o.readSync(l,s,0,s.length,null),s.toString(r,0,s.length)}console.log("Path "+t+" does not exist.")}catch(c){return console.log(c),""}}},_parseAFF:function(e){var t={};e=this._removeAffixComments(e);for(var n=e.split("\n"),r=0,i=n.length;i>r;r++){var o=n[r],a=o.split(/\s+/),l=a[0];if("PFX"==l||"SFX"==l){for(var s=a[1],c=a[2],u=parseInt(a[3],10),f=[],h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/),m=p[2],g=p[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),x=p[4],b={};b.add=v,y.length>0&&(b.continuationClasses=y),"."!==x&&("SFX"===l?b.match=new RegExp(x+"$"):b.match=new RegExp("^"+x)),"0"!=m&&("SFX"===l?b.remove=new RegExp(m+"$"):b.remove=m),f.push(b)}t[s]={type:l,combineable:"Y"==c,entries:f},r+=u}else if("COMPOUNDRULE"===l){for(var u=parseInt(a[1],10),h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/);this.compoundRules.push(p[1])}r+=u}else if("REP"===l){var p=o.split(/\s+/);3===p.length&&this.replacementTable.push([p[1],p[2]])}else this.flags[l]=a[1]}return t},_removeAffixComments:function(e){return e=e.replace(/#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in r&&"object"==typeof r[e]||(r[e]=[]),r[e].push(t)}e=this._removeDicComments(e);for(var n=e.split("\n"),r={},i=1,o=n.length;o>i;i++){var a=n[i],l=a.split("/",2),s=l[0];if(l.length>1){var c=this.parseRuleCodes(l[1]);"NEEDAFFIX"in this.flags&&-1!=c.indexOf(this.flags.NEEDAFFIX)||t(s,c);for(var u=0,f=c.length;f>u;u++){var h=c[u],d=this.rules[h];if(d)for(var p=this._applyRule(s,d),m=0,g=p.length;g>m;m++){var v=p[m];if(t(v,[]),d.combineable)for(var y=u+1;f>y;y++){var x=c[y],b=this.rules[x];if(b&&b.combineable&&d.type!=b.type)for(var w=this._applyRule(v,b),k=0,S=w.length;S>k;k++){var C=w[k];t(C,[])}}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(s)}}else t(s.trim(),[])}return r},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,r=e.length;r>n;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?textCode.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;o>i;i++){var a=n[i];if(!a.match||e.match(a.match)){var l=e;if(a.remove&&(l=l.replace(a.remove,"")),"SFX"===t.type?l+=a.add:l=a.add+l,r.push(l),"continuationClasses"in a)for(var s=0,c=a.continuationClasses.length;c>s;s++){var u=this.rules[a.continuationClasses[s]];u&&(r=r.concat(this._applyRule(l,u)))}}}return r},check:function(e){var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var r=t.toLowerCase();if(r!==t){if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if("undefined"==typeof t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;r>n;n++)if(e.match(this.compoundRules[n]))return!0;return!1}if("object"==typeof t){for(var n=0,r=t.length;r>n;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1}},hasFlag:function(e,t,n){if(t in this.flags){if("undefined"==typeof n)var n=Array.prototype.concat.apply([],this.dictionaryTable[e]);if(n&&-1!==n.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(e,t){function n(e){for(var t=[],n=0,r=e.length;r>n;n++){for(var i=e[n],o=[],a=0,l=i.length+1;l>a;a++)o.push([i.substring(0,a),i.substring(a,i.length)]);for(var s=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1]&&s.push(u[0]+u[1].substring(1))}for(var f=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1].length>1&&f.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2))}for(var h=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1].substring(1))}for(var m=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1])}t=t.concat(s),t=t.concat(f),t=t.concat(h),t=t.concat(m)}return t}function r(e){for(var t=[],n=0;n<e.length;n++)c.check(e[n])&&t.push(e[n]);return t}function i(e){function i(e,t){return e[1]<t[1]?-1:1}for(var o=n([e]),a=n(o),l=r(o).concat(r(a)),s={},u=0,f=l.length;f>u;u++)l[u]in s?s[l[u]]+=1:s[l[u]]=1;var h=[];for(var u in s)h.push([u,s[u]]);h.sort(i).reverse();for(var d=[],u=0,f=Math.min(t,h.length);f>u;u++)c.hasFlag(h[u][0],"NOSUGGEST")||d.push(h[u][0]);return d}if(t||(t=5),this.check(e))return[];for(var o=0,a=this.replacementTable.length;a>o;o++){var l=this.replacementTable[o];if(-1!==e.indexOf(l[0])){var s=e.replace(l[0],l[1]);if(this.check(s))return[s]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",i(e)}},"undefined"!=typeof t&&(t.exports=i)}).call(this,e("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(e,t,n){var r=e("codemirror");r.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentMore");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}},r.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentLess");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}}},{codemirror:10}],20:[function(e,t,n){"use strict";function r(e){return e=U?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function i(e,t,n){e=e||{};var r=document.createElement("a");return t=void 0==t?!0:t,e.title&&t&&(r.title=a(e.title,e.action,n),U&&(r.title=r.title.replace("Ctrl","⌘"),r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=e.className,r}function o(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function a(e,t,n){var i,o=e;return t&&(i=Y(t),n[i]&&(o+=" ("+r(n[i])+")")),o}function l(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),a={},l=0;l<o.length;l++)r=o[l],"strong"===r?a.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===r?a.quote=!0:"em"===r?a.italic=!0:"quote"===r?a.quote=!0:"strikethrough"===r?a.strikethrough=!0:"comment"===r?a.code=!0:"link"===r?a.link=!0:"tag"===r?a.image=!0:r.match(/^header(\-[1-6])?$/)&&(a[r.replace("header","heading")]=!0);return a}function s(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(V=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=V;var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen";var r=e.toolbarElements.fullscreen;/active/.test(r.className)?r.className=r.className.replace(/\s*active\s*/g,""):r.className+=" active";var i=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(i.className)&&N(e)}function c(e){P(e,"bold",e.options.blockStyles.bold)}function u(e){P(e,"italic",e.options.blockStyles.italic)}function f(e){P(e,"strikethrough","~~")}function h(e){function t(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function n(e){return e.state.base.base||e.state.base}function r(e,r,i,o,a){i=i||e.getLineHandle(r),o=o||e.getTokenAt({line:r,ch:1}),a=a||!!i.text&&e.getTokenAt({line:r,ch:i.text.length-1});var l=o.type?o.type.split(" "):[];return a&&n(a).indentedCode?"indented":-1===l.indexOf("comment")?!1:n(o).fencedChars||n(a).fencedChars||t(i)?"fenced":"single"}function i(e,t,n,r){var i=t.line+1,o=n.line+1,a=t.line!==n.line,l=r+"\n",s="\n"+r;a&&o++,a&&0===n.ch&&(s=r+"\n",o--),E(e,!1,[l,s]),e.setSelection({line:i,ch:0},{line:o,ch:0})}var o,a,l,s=e.options.blockStyles.code,c=e.codemirror,u=c.getCursor("start"),f=c.getCursor("end"),h=c.getTokenAt({line:u.line,ch:u.ch||1}),d=c.getLineHandle(u.line),p=r(c,u.line,d,h);if("single"===p){var m=d.text.slice(0,u.ch).replace("`",""),g=d.text.slice(u.ch).replace("`","");c.replaceRange(m+g,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),u.ch--,u!==f&&f.ch--,c.setSelection(u,f),c.focus()}else if("fenced"===p)if(u.line!==f.line||u.ch!==f.ch){for(o=u.line;o>=0&&(d=c.getLineHandle(o),!t(d));o--);var v,y,x,b,w=c.getTokenAt({line:o,ch:1}),k=n(w).fencedChars;t(c.getLineHandle(u.line))?(v="",y=u.line):t(c.getLineHandle(u.line-1))?(v="",y=u.line-1):(v=k+"\n",y=u.line),t(c.getLineHandle(f.line))?(x="",b=f.line,0===f.ch&&(b+=1)):0!==f.ch&&t(c.getLineHandle(f.line+1))?(x="",b=f.line+1):(x=k+"\n",b=f.line+1),0===f.ch&&(b-=1),c.operation(function(){c.replaceRange(x,{line:b,ch:0},{line:b+(x?0:1),ch:0}),c.replaceRange(v,{line:y,ch:0},{line:y+(v?0:1),ch:0})}),c.setSelection({line:y+(v?1:0),ch:0},{line:b+(v?1:-1),ch:0}),c.focus()}else{var S=u.line;if(t(c.getLineHandle(u.line))&&("fenced"===r(c,u.line+1)?(o=u.line,S=u.line+1):(a=u.line,S=u.line-1)),void 0===o)for(o=S;o>=0&&(d=c.getLineHandle(o),!t(d));o--);if(void 0===a)for(l=c.lineCount(),a=S;l>a&&(d=c.getLineHandle(a),!t(d));a++);c.operation(function(){c.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),c.replaceRange("",{line:a-1,ch:0},{line:a,ch:0})}),c.focus()}else if("indented"===p){if(u.line!==f.line||u.ch!==f.ch)o=u.line,a=f.line,0===f.ch&&a--;else{for(o=u.line;o>=0;o--)if(d=c.getLineHandle(o),!d.text.match(/^\s*$/)&&"indented"!==r(c,o,d)){o+=1;break}for(l=c.lineCount(),a=u.line;l>a;a++)if(d=c.getLineHandle(a),!d.text.match(/^\s*$/)&&"indented"!==r(c,a,d)){a-=1;break}}var C=c.getLineHandle(a+1),L=C&&c.getTokenAt({line:a+1,ch:C.text.length-1}),T=L&&n(L).indentedCode;T&&c.replaceRange("\n",{line:a+1,ch:0});for(var M=o;a>=M;M++)c.indentLine(M,"subtract");c.focus()}else{var N=u.line===f.line&&u.ch===f.ch&&0===u.ch,A=u.line!==f.line;N||A?i(c,u,f,s):E(c,!1,["`","`"])}}function d(e){var t=e.codemirror;I(t,"quote")}function p(e){var t=e.codemirror;O(t,"smaller")}function m(e){var t=e.codemirror;O(t,"bigger")}function g(e){var t=e.codemirror;O(t,void 0,1)}function v(e){var t=e.codemirror;O(t,void 0,2)}function y(e){var t=e.codemirror;O(t,void 0,3)}function x(e){var t=e.codemirror;I(t,"unordered-list")}function b(e){var t=e.codemirror;I(t,"ordered-list")}function w(e){var t=e.codemirror;R(t)}function k(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.link),!i)?!1:void E(t,n.link,r.insertTexts.link,i)}function S(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.image),!i)?!1:void E(t,n.image,r.insertTexts.image,i)}function C(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.table,r.insertTexts.table)}function L(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.image,r.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function M(e){var t=e.codemirror;t.redo(),t.focus()}function N(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||s(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,c=n.previousSibling;l.className=l.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}var u=function(){r.innerHTML=e.options.previewRender(e.value(),r)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=u),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function A(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=e.options.toolbar?e.toolbarElements.preview:!1,o=n.lastChild;o&&/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&N(e)}function E(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],a=n[1],l=e.getCursor("start"),s=e.getCursor("end");r&&(a=a.replace("#url#",r)),t?(i=e.getLine(l.line),o=i.slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function O(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/);i=void 0!==t?0>=o?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?0>=o?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?0>=o?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):0>=o?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o);e.focus()}}function I(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=l(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)!function(r){var i=e.getLine(r);i=n[t]?i.replace(o[t],"$1"):a[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(s);e.focus()}}function P(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r="undefined"==typeof r?n:r;var i,o=e.codemirror,a=l(o),s=n,c=r,u=o.getCursor("start"),f=o.getCursor("end");a[t]?(i=o.getLine(u.line),s=i.slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==f&&(f.ch-=2)):"italic"==t&&(u.ch-=1,u!==f&&(f.ch-=1))):(i=o.getSelection(),"bold"==t?(i=i.split("**").join(""),i=i.split("__").join("")):"italic"==t?(i=i.split("*").join(""),i=i.split("_").join("")):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,f.ch=u.ch+i.length),o.setSelection(u,f),o.focus()}}function R(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=e.getLine(i),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}function D(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=D(e[n]||{},t[n]):e[n]=t[n]);return e}function H(e){for(var t=1;t<arguments.length;t++)e=D(e,arguments[t]);return e}function W(e){var t=/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),r=0;if(null===n)return r;for(var i=0;i<n.length;i++)r+=n[i].charCodeAt(0)>=19968?n[i].length:1;return r}function B(e){e=e||{},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar){e.toolbar=[];for(var o in K)K.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(K[o]["default"]===!0||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=H({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=H({},X,e.insertTexts||{}),e.promptTexts=Z,e.blockStyles=H({},J,e.blockStyles||{}),e.shortcuts=H({},G,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}function _(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var F=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var z=e("codemirror-spell-checker"),j=e("marked"),U=/Mac/.test(navigator.platform),q={toggleBold:c,toggleItalic:u,drawLink:k,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:S,toggleBlockquote:d,toggleOrderedList:b,toggleUnorderedList:x,toggleCodeBlock:h,togglePreview:A,toggleStrikethrough:f,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:C,drawHorizontalRule:L,undo:T,redo:M,toggleSideBySide:N,toggleFullScreen:s},G={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Y=function(e){for(var t in q)if(q[t]===e)return t;return null},$=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0); -}(navigator.userAgent||navigator.vendor||window.opera),e},V="",K={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:f,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:d,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:x,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:b,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:k,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:S,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:C,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:L,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:A,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:N,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:s,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:M,className:"fa fa-repeat no-disable",title:"Redo"}},X={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Z={link:"URL for the link:",image:"URL of the image:"},J={bold:"**",code:"```",italic:"*"};B.prototype.markdown=function(e){if(j){var t={};return this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),j.setOptions(t),j(e)}},B.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,i={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==q[o]&&!function(e){i[r(t.shortcuts[e])]=function(){q[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(e){e.getOption("fullScreen")&&s(n)},document.addEventListener("keydown",function(e){e=e||window.event,27==e.keyCode&&n.codemirror.getOption("fullScreen")&&s(n)},!1);var a,l;if(t.spellChecker!==!1?(a="spell-checker",l=t.parsingConfig,l.name="gfm",l.gitHubSpice=!1,z({codeMirrorInstance:F})):(a=t.parsingConfig,a.name="gfm",a.gitHubSpice=!1),this.codemirror=F.fromTextArea(e,{mode:a,backdrop:l,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:i,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:void 0!=t.styleSelectedText?t.styleSelectedText:!0}),t.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var u=this.codemirror;setTimeout(function(){u.refresh()}.bind(u),0)}},B.prototype.autosave=function(){if(_()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",a=r;a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=10>i?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.clearAutosavedValue=function(){if(_()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var r=!1,i=!1;return e.on("scroll",function(e){if(r)return void(r=!1);i=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,a=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=a}),n.onscroll=function(){if(i)return void(i=!1);r=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,a=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,a)},n},B.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t;for(t=0;t<e.length;t++)void 0!=K[e[t]]&&(e[t]=K[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var r=this,a={};for(r.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||r.options.toolbarGuideIcon!==!1)&&!(r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&$())){if("|"===e[t]){for(var s=!1,c=t+1;c<e.length;c++)"|"===e[c]||r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[c].name)||(s=!0);if(!s)continue}!function(e){var t;t="|"===e?o():i(e,r.options.toolbarTips,r.options.shortcuts),e.action&&("function"==typeof e.action?t.onclick=function(t){t.preventDefault(),e.action(r)}:"string"==typeof e.action&&(t.href=e.action,t.target="_blank")),a[e.name||e]=t,n.appendChild(t)}(e[t])}r.toolbarElements=a;var u=this.codemirror;u.on("cursorActivity",function(){var e=l(u);for(var t in a)!function(t){var n=a[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)});var f=u.getWrapperElement();return f.parentNode.insertBefore(n,f),n}},B.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var r,i,o,a=[];for(r=0;r<e.length;r++)if(i=void 0,o=void 0,"object"==typeof e[r])a.push({className:e[r].className,defaultValue:e[r].defaultValue,onUpdate:e[r].onUpdate});else{var l=e[r];"words"===l?(o=function(e){e.innerHTML=W(n.getValue())},i=function(e){e.innerHTML=W(n.getValue())}):"lines"===l?(o=function(e){e.innerHTML=n.lineCount()},i=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(o=function(e){e.innerHTML="0:0"},i=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===l&&(o=function(e){void 0!=t.autosave&&t.autosave.enabled===!0&&e.setAttribute("id","autosaved")}),a.push({className:l,defaultValue:o,onUpdate:i})}var s=document.createElement("div");for(s.className="editor-statusbar",r=0;r<a.length;r++){var c=a[r],u=document.createElement("span");u.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(u),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(u,c)),s.appendChild(u)}var f=this.codemirror.getWrapperElement();return f.parentNode.insertBefore(s,f.nextSibling),s}},B.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},B.toggleBold=c,B.toggleItalic=u,B.toggleStrikethrough=f,B.toggleBlockquote=d,B.toggleHeadingSmaller=p,B.toggleHeadingBigger=m,B.toggleHeading1=g,B.toggleHeading2=v,B.toggleHeading3=y,B.toggleCodeBlock=h,B.toggleUnorderedList=x,B.toggleOrderedList=b,B.cleanBlock=w,B.drawLink=k,B.drawImage=S,B.drawTable=C,B.drawHorizontalRule=L,B.undo=T,B.redo=M,B.togglePreview=A,B.toggleSideBySide=N,B.toggleFullScreen=s,B.prototype.toggleBold=function(){c(this)},B.prototype.toggleItalic=function(){u(this)},B.prototype.toggleStrikethrough=function(){f(this)},B.prototype.toggleBlockquote=function(){d(this)},B.prototype.toggleHeadingSmaller=function(){p(this)},B.prototype.toggleHeadingBigger=function(){m(this)},B.prototype.toggleHeading1=function(){g(this)},B.prototype.toggleHeading2=function(){v(this)},B.prototype.toggleHeading3=function(){y(this)},B.prototype.toggleCodeBlock=function(){h(this)},B.prototype.toggleUnorderedList=function(){x(this)},B.prototype.toggleOrderedList=function(){b(this)},B.prototype.cleanBlock=function(){w(this)},B.prototype.drawLink=function(){k(this)},B.prototype.drawImage=function(){S(this)},B.prototype.drawTable=function(){C(this)},B.prototype.drawHorizontalRule=function(){L(this)},B.prototype.undo=function(){T(this)},B.prototype.redo=function(){M(this)},B.prototype.togglePreview=function(){A(this)},B.prototype.toggleSideBySide=function(){N(this)},B.prototype.toggleFullScreen=function(){s(this)},B.prototype.isPreviewActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.lastChild;return/editor-preview-active/.test(n.className)},B.prototype.isSideBySideActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;return/editor-preview-active-side/.test(n.className)},B.prototype.isFullscreenActive=function(){var e=this.codemirror;return e.getOption("fullScreen")},B.prototype.getState=function(){var e=this.codemirror;return l(e)},B.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement();t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=B},{"./codemirror/tablist":19,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,marked:17}]},{},[20])(20)}); -/* ./modules/editor/trumbowyg/trumbowyg.min.js *//** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ -jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",undo:"Undo",redo:"Redo",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Stroke",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",superscript:"Superscript",subscript:"Subscript",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",link:"Link",createLink:"Insert link",unlink:"Remove link",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",removeformat:"Remove format",fullscreen:"Fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",required:"Required",description:"Description",title:"Title",text:"Text",target:"Target",width:"Width"}},plugins:{},svgPath:null,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,"defaultOptions",{value:{lang:"en",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,prefix:"trumbowyg-",semantic:!0,resetCss:!1,removeformatPasted:!1,tagsToRemove:[],btns:[["viewHTML"],["undo","redo"],["formatting"],["strong","em","del"],["superscript","subscript"],["link"],["insertImage"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["unorderedList","orderedList"],["horizontalRule"],["removeformat"],["fullscreen"]],btnsDef:{},inlineElementsSelector:"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u",pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1},writable:!1,enumerable:!0,configurable:!1}),function(e,t,n,a){"use strict";var o="tbwconfirm",r="tbwcancel";a.fn.trumbowyg=function(e,t){var n="trumbowyg";if(e===Object(e)||!e)return this.each(function(){a(this).data(n)||a(this).data(n,new i(this,e))});if(1===this.length)try{var o=a(this).data(n);switch(e){case"execCmd":return o.execCmd(t.cmd,t.param,t.forceCss);case"openModal":return o.openModal(t.title,t.content);case"closeModal":return o.closeModal();case"openModalInsert":return o.openModalInsert(t.title,t.fields,t.callback);case"saveRange":return o.saveRange();case"getRange":return o.range;case"getRangeText":return o.getRangeText();case"restoreRange":return o.restoreRange();case"enable":return o.setDisabled(!1);case"disable":return o.setDisabled(!0);case"toggle":return o.toggle();case"destroy":return o.destroy();case"empty":return o.empty();case"html":return o.html(t)}}catch(r){}return!1};var i=function(o,r){var i=this,s="trumbowyg-icons",l=a.trumbowyg;i.doc=o.ownerDocument||n,i.$ta=a(o),i.$c=a(o),r=r||{},null!=r.lang||null!=l.langs[r.lang]?i.lang=a.extend(!0,{},l.langs.en,l.langs[r.lang]):i.lang=l.langs.en,i.hideButtonTexts=null!=l.hideButtonTexts?l.hideButtonTexts:r.hideButtonTexts;var d=null!=l.svgPath?l.svgPath:r.svgPath;if(i.hasSvg=d!==!1,i.svgPath=i.doc.querySelector("base")?t.location.href.split("#")[0]:"",0===a("#"+s,i.doc).length&&d!==!1){if(null==d){for(var c=n.getElementsByTagName("script"),u=0;u<c.length;u+=1){var g=c[u].src,f=g.match("trumbowyg(.min)?.js");null!=f&&(d=g.substring(0,g.indexOf(f[0]))+"ui/icons.svg")}null==d&&console.warn("You must define svgPath: https://goo.gl/CfTY9U")}var h=i.doc.createElement("div");h.id=s,i.doc.body.insertBefore(h,i.doc.body.childNodes[0]),a.ajax({async:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",dataType:"xml",crossDomain:!0,url:d,data:null,beforeSend:null,complete:null,success:function(e){h.innerHTML=(new XMLSerializer).serializeToString(e.documentElement)}})}var p=i.lang.header,m=function(){return(t.chrome||t.Intl&&Intl.v8BreakIterator)&&"CSS"in t};i.btnsDef={viewHTML:{fn:"toggle"},undo:{isSupported:m,key:"Z"},redo:{isSupported:m,key:"Y"},p:{fn:"formatBlock"},blockquote:{fn:"formatBlock"},h1:{fn:"formatBlock",title:p+" 1"},h2:{fn:"formatBlock",title:p+" 2"},h3:{fn:"formatBlock",title:p+" 3"},h4:{fn:"formatBlock",title:p+" 4"},subscript:{tag:"sub"},superscript:{tag:"sup"},bold:{key:"B",tag:"b"},italic:{key:"I",tag:"i"},underline:{tag:"u"},strikethrough:{tag:"strike"},strong:{fn:"bold",key:"B"},em:{fn:"italic",key:"I"},del:{fn:"strikethrough"},createLink:{key:"K",tag:"a"},unlink:{},insertImage:{},justifyLeft:{tag:"left",forceCss:!0},justifyCenter:{tag:"center",forceCss:!0},justifyRight:{tag:"right",forceCss:!0},justifyFull:{tag:"justify",forceCss:!0},unorderedList:{fn:"insertUnorderedList",tag:"ul"},orderedList:{fn:"insertOrderedList",tag:"ol"},horizontalRule:{fn:"insertHorizontalRule"},removeformat:{},fullscreen:{"class":"trumbowyg-not-disable"},close:{fn:"destroy","class":"trumbowyg-not-disable"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"],ico:"p"},link:{dropdown:["createLink","unlink"]}},i.o=a.extend(!0,{},l.defaultOptions,r),i.o.hasOwnProperty("imgDblClickHandler")||(i.o.imgDblClickHandler=i.getDefaultImgDblClickHandler()),i.urlPrefix=i.setupUrlPrefix(),i.disabled=i.o.disabled||"TEXTAREA"===o.nodeName&&o.disabled,r.btns?i.o.btns=r.btns:i.o.semantic||(i.o.btns[3]=["bold","italic","underline","strikethrough"]),a.each(i.o.btnsDef,function(e,t){i.addBtnDef(e,t)}),i.eventNamespace="trumbowyg-event",i.keys=[],i.tagToButton={},i.tagHandlers=[],i.pasteHandlers=[].concat(i.o.pasteHandlers),i.isIE=e.userAgent.indexOf("MSIE")!==-1||e.appVersion.indexOf("Trident/")!==-1,i.init()};i.prototype={DEFAULT_SEMANTIC_MAP:{b:"strong",i:"em",s:"del",strike:"del",div:"p"},init:function(){var e=this;e.height=e.$ta.height(),e.initPlugins();try{e.doc.execCommand("enableObjectResizing",!1,!1),e.doc.execCommand("defaultParagraphSeparator",!1,"p")}catch(t){}e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay(),setTimeout(function(){e.disabled&&e.setDisabled(!0),e.$c.trigger("tbwinit")})},addBtnDef:function(e,t){this.btnsDef[e]=t},setupUrlPrefix:function(){var e=this.o.urlProtocol;if(e)return"string"!=typeof e?"https://":/:\/\/$/.test(e)?e:e+"://"},buildEditor:function(){var e=this,n=e.o.prefix,o="";e.$box=a("<div/>",{"class":n+"box "+n+"editor-visible "+n+e.o.lang+" trumbowyg"}),e.isTextarea=e.$ta.is("textarea"),e.isTextarea?(o=e.$ta.val(),e.$ed=a("<div/>"),e.$box.insertAfter(e.$ta).append(e.$ed,e.$ta)):(e.$ed=e.$ta,o=e.$ed.html(),e.$ta=a("<textarea/>",{name:e.$ta.attr("id"),height:e.height}).val(o),e.$box.insertAfter(e.$ed).append(e.$ta,e.$ed),e.syncCode()),e.$ta.addClass(n+"textarea").attr("tabindex",-1),e.$ed.addClass(n+"editor").attr({contenteditable:!0,dir:e.lang._dir||"ltr"}).html(o),e.o.tabindex&&e.$ed.attr("tabindex",e.o.tabindex),e.$c.is("[placeholder]")&&e.$ed.attr("placeholder",e.$c.attr("placeholder")),e.$c.is("[spellcheck]")&&e.$ed.attr("spellcheck",e.$c.attr("spellcheck")),e.o.resetCss&&e.$ed.addClass(n+"reset-css"),e.o.autogrow||e.$ta.add(e.$ed).css({height:e.height}),e.semanticCode(),e.o.autogrowOnEnter&&e.$ed.addClass(n+"autogrow-on-enter");var r,i=!1,s=!1,l="keyup";e.$ed.on("dblclick","img",e.o.imgDblClickHandler).on("keydown",function(t){if((t.ctrlKey||t.metaKey)&&!t.altKey){i=!0;var n=e.keys[String.fromCharCode(t.which).toUpperCase()];try{return e.execCmd(n.fn,n.param),!1}catch(a){}}}).on("compositionstart compositionupdate",function(){s=!0}).on(l+" compositionend",function(t){if("compositionend"===t.type)s=!1;else if(s)return;var n=t.which;if(!(n>=37&&n<=40)){if(!t.ctrlKey&&!t.metaKey||89!==n&&90!==n)if(i||17===n)"undefined"==typeof t.which&&e.semanticCode(!1,!1,!0);else{var a=!e.isIE||"compositionend"===t.type;e.semanticCode(!1,a&&13===n),e.$c.trigger("tbwchange")}else e.$c.trigger("tbwchange");setTimeout(function(){i=!1},50)}}).on("mouseup keydown keyup",function(t){(!t.ctrlKey&&!t.metaKey||t.altKey)&&setTimeout(function(){i=!1},50),clearTimeout(r),r=setTimeout(function(){e.updateButtonPaneStatus()},50)}).on("focus blur",function(t){if(e.$c.trigger("tbw"+t.type),"blur"===t.type&&a("."+n+"active-button",e.$btnPane).removeClass(n+"active-button "+n+"active"),e.o.autogrowOnEnter){if(e.autogrowOnEnterDontClose)return;"focus"===t.type?(e.autogrowOnEnterWasFocused=!0,e.autogrowEditorOnEnter()):e.o.autogrow||(e.$ed.css({height:e.$ed.css("min-height")}),e.$c.trigger("tbwresize"))}}).on("cut",function(){setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger("tbwchange")},0)}).on("paste",function(n){if(e.o.removeformatPasted){n.preventDefault(),t.getSelection&&t.getSelection().deleteFromDocument&&t.getSelection().deleteFromDocument();try{var o=t.clipboardData.getData("Text");try{e.doc.selection.createRange().pasteHTML(o)}catch(r){e.doc.getSelection().getRangeAt(0).insertNode(e.doc.createTextNode(o))}e.$c.trigger("tbwchange",n)}catch(i){e.execCmd("insertText",(n.originalEvent||n).clipboardData.getData("text/plain"))}}a.each(e.pasteHandlers,function(e,t){t(n)}),setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger("tbwpaste",n)},0)}),e.$ta.on("keyup",function(){e.$c.trigger("tbwchange")}).on("paste",function(){setTimeout(function(){e.$c.trigger("tbwchange")},0)}),e.$box.on("keydown",function(t){if(27===t.which&&1===a("."+n+"modal-box",e.$box).length)return e.closeModal(),!1})},autogrowEditorOnEnter:function(){var e=this;e.$ed.removeClass("autogrow-on-enter");var t=e.$ed[0].clientHeight;e.$ed.height("auto");var n=e.$ed[0].scrollHeight;e.$ed.addClass("autogrow-on-enter"),t!==n&&(e.$ed.height(t),setTimeout(function(){e.$ed.css({height:n}),e.$c.trigger("tbwresize")},0))},buildBtnPane:function(){var e=this,t=e.o.prefix,n=e.$btnPane=a("<div/>",{"class":t+"button-pane"});a.each(e.o.btns,function(o,r){a.isArray(r)||(r=[r]);var i=a("<div/>",{"class":t+"button-group "+(r.indexOf("fullscreen")>=0?t+"right":"")});a.each(r,function(t,n){try{e.isSupportedBtn(n)&&i.append(e.buildBtn(n))}catch(a){}}),i.html().trim().length>0&&n.append(i)}),e.$box.prepend(n)},buildBtn:function(e){var t=this,n=t.o.prefix,o=t.btnsDef[e],r=o.dropdown,i=null==o.hasIcon||o.hasIcon,s=t.lang[e]||e,l=a("<button/>",{type:"button","class":n+e+"-button "+(o["class"]||"")+(i?"":" "+n+"textual-button"),html:t.hasSvg&&i?'<svg><use xlink:href="'+t.svgPath+"#"+n+(o.ico||e).replace(/([A-Z]+)/g,"-$1").toLowerCase()+'"/></svg>':t.hideButtonTexts?"":o.text||o.title||t.lang[e]||e,title:(o.title||o.text||s)+(o.key?" (Ctrl + "+o.key+")":""),tabindex:-1,mousedown:function(){return r&&!a("."+e+"-"+n+"dropdown",t.$box).is(":hidden")||a("body",t.doc).trigger("mousedown"),!((t.$btnPane.hasClass(n+"disable")||t.$box.hasClass(n+"disabled"))&&!a(this).hasClass(n+"active")&&!a(this).hasClass(n+"not-disable"))&&(t.execCmd(!!r&&"dropdown"||o.fn||e,o.param||e,o.forceCss),!1)}});if(r){l.addClass(n+"open-dropdown");var d=n+"dropdown",c={"class":d+"-"+e+" "+d+" "+n+"fixed-top"};c["data-"+d]=e;var u=a("<div/>",c);a.each(r,function(e,n){t.btnsDef[n]&&t.isSupportedBtn(n)&&u.append(t.buildSubBtn(n))}),t.$box.append(u.hide())}else o.key&&(t.keys[o.key]={fn:o.fn||e,param:o.param||e});return r||(t.tagToButton[(o.tag||e).toLowerCase()]=e),l},buildSubBtn:function(e){var t=this,n=t.o.prefix,o=t.btnsDef[e],r=null==o.hasIcon||o.hasIcon;return o.key&&(t.keys[o.key]={fn:o.fn||e,param:o.param||e}),t.tagToButton[(o.tag||e).toLowerCase()]=e,a("<button/>",{type:"button","class":n+e+"-dropdown-button"+(o.ico?" "+n+o.ico+"-button":""),html:t.hasSvg&&r?'<svg><use xlink:href="'+t.svgPath+"#"+n+(o.ico||e).replace(/([A-Z]+)/g,"-$1").toLowerCase()+'"/></svg>'+(o.text||o.title||t.lang[e]||e):o.text||o.title||t.lang[e]||e,title:o.key?" (Ctrl + "+o.key+")":null,style:o.style||null,mousedown:function(){return a("body",t.doc).trigger("mousedown"),t.execCmd(o.fn||e,o.param||e,o.forceCss),!1}})},isSupportedBtn:function(e){try{return this.btnsDef[e].isSupported()}catch(t){}return!0},buildOverlay:function(){var e=this;return e.$overlay=a("<div/>",{"class":e.o.prefix+"overlay"}).appendTo(e.$box),e.$overlay},showOverlay:function(){var e=this;a(t).trigger("scroll"),e.$overlay.fadeIn(200),e.$box.addClass(e.o.prefix+"box-blur")},hideOverlay:function(){var e=this;e.$overlay.fadeOut(50),e.$box.removeClass(e.o.prefix+"box-blur")},fixedBtnPaneEvents:function(){var e=this,n=e.o.fixedFullWidth,o=e.$box;e.o.fixedBtnPane&&(e.isFixed=!1,a(t).on("scroll."+e.eventNamespace+" resize."+e.eventNamespace,function(){if(o){e.syncCode();var r=a(t).scrollTop(),i=o.offset().top+1,s=e.$btnPane,l=s.outerHeight()-2;r-i>0&&r-i-e.height<0?(e.isFixed||(e.isFixed=!0,s.css({position:"fixed",top:0,left:n?"0":"auto",zIndex:7}),a([e.$ta,e.$ed]).css({marginTop:s.height()})),s.css({width:n?"100%":o.width()-1+"px"}),a("."+e.o.prefix+"fixed-top",o).css({position:n?"fixed":"absolute",top:n?l:l+(r-i)+"px",zIndex:15})):e.isFixed&&(e.isFixed=!1,s.removeAttr("style"),a([e.$ta,e.$ed]).css({marginTop:0}),a("."+e.o.prefix+"fixed-top",o).css({position:"absolute",top:l}))}}))},setDisabled:function(e){var t=this,n=t.o.prefix;t.disabled=e,e?t.$ta.attr("disabled",!0):t.$ta.removeAttr("disabled"),t.$box.toggleClass(n+"disabled",e),t.$ed.attr("contenteditable",!e)},destroy:function(){var e=this,n=e.o.prefix;e.isTextarea?e.$box.after(e.$ta.css({height:""}).val(e.html()).removeClass(n+"textarea").show()):e.$box.after(e.$ed.css({height:""}).removeClass(n+"editor").removeAttr("contenteditable").removeAttr("dir").html(e.html()).show()),e.$ed.off("dblclick","img"),e.destroyPlugins(),e.$box.remove(),e.$c.removeData("trumbowyg"),a("body").removeClass(n+"body-fullscreen"),e.$c.trigger("tbwclose"),a(t).off("scroll."+e.eventNamespace+" resize."+e.eventNamespace)},empty:function(){this.$ta.val(""),this.syncCode(!0)},toggle:function(){var e=this,t=e.o.prefix;e.o.autogrowOnEnter&&(e.autogrowOnEnterDontClose=!e.$box.hasClass(t+"editor-hidden")),e.semanticCode(!1,!0),setTimeout(function(){e.doc.activeElement.blur(),e.$box.toggleClass(t+"editor-hidden "+t+"editor-visible"),e.$btnPane.toggleClass(t+"disable"),a("."+t+"viewHTML-button",e.$btnPane).toggleClass(t+"active"),e.$box.hasClass(t+"editor-visible")?e.$ta.attr("tabindex",-1):e.$ta.removeAttr("tabindex"),e.o.autogrowOnEnter&&!e.autogrowOnEnterDontClose&&e.autogrowEditorOnEnter()},0)},dropdown:function(e){var n=this,o=n.doc,r=n.o.prefix,i=a("[data-"+r+"dropdown="+e+"]",n.$box),s=a("."+r+e+"-button",n.$btnPane),l=i.is(":hidden");if(a("body",o).trigger("mousedown"),l){var d=s.offset().left;s.addClass(r+"active"),i.css({position:"absolute",top:s.offset().top-n.$btnPane.offset().top+s.outerHeight(),left:n.o.fixedFullWidth&&n.isFixed?d+"px":d-n.$btnPane.offset().left+"px"}).show(),a(t).trigger("scroll"),a("body",o).on("mousedown."+n.eventNamespace,function(e){i.is(e.target)||(a("."+r+"dropdown",n.$box).hide(),a("."+r+"active",n.$btnPane).removeClass(r+"active"),a("body",o).off("mousedown."+n.eventNamespace))})}},html:function(e){var t=this;return null!=e?(t.$ta.val(e),t.syncCode(!0),t.$c.trigger("tbwchange"),t):t.$ta.val()},syncTextarea:function(){var e=this;e.$ta.val(e.$ed.text().trim().length>0||e.$ed.find("hr,img,embed,iframe,input").length>0?e.$ed.html():"")},syncCode:function(e){var t=this;if(!e&&t.$ed.is(":visible"))t.syncTextarea();else{var n=a("<div>").html(t.$ta.val()),o=a("<div>").append(n);a(t.o.tagsToRemove.join(","),o).remove(),t.$ed.html(o.contents().html())}if(t.o.autogrow&&(t.height=t.$ed.height(),t.height!==t.$ta.css("height")&&(t.$ta.css({height:t.height}),t.$c.trigger("tbwresize"))),t.o.autogrowOnEnter){t.$ed.height("auto");var r=t.autogrowOnEnterWasFocused?t.$ed[0].scrollHeight:t.$ed.css("min-height");r!==t.$ta.css("height")&&(t.$ed.css({height:r}),t.$c.trigger("tbwresize"))}},semanticCode:function(e,t,n){var o=this;if(o.saveRange(),o.syncCode(e),o.o.semantic){if(o.semanticTag("b"),o.semanticTag("i"),o.semanticTag("s"),o.semanticTag("strike"),t){var r=o.o.inlineElementsSelector,i=":not("+r+")";o.$ed.contents().filter(function(){return 3===this.nodeType&&this.nodeValue.trim().length>0}).wrap("<span data-tbw/>");var s=function(e){if(0!==e.length){var t=e.nextUntil(i).addBack().wrapAll("<p/>").parent(),n=t.nextAll(r).first();t.next("br").remove(),s(n)}};s(o.$ed.children(r).first()),o.semanticTag("div",!0),o.$ed.find("p").filter(function(){return(!o.range||this!==o.range.startContainer)&&(0===a(this).text().trim().length&&0===a(this).children().not("br,span").length)}).contents().unwrap(),a("[data-tbw]",o.$ed).contents().unwrap(),o.$ed.find("p:empty").remove()}n||o.restoreRange(),o.syncTextarea()}},semanticTag:function(e,t){var n;if(null!=this.o.semantic&&"object"==typeof this.o.semantic&&this.o.semantic.hasOwnProperty(e))n=this.o.semantic[e];else{if(this.o.semantic!==!0||!this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(e))return;n=this.DEFAULT_SEMANTIC_MAP[e]}a(e,this.$ed).each(function(){var e=a(this);e.wrap("<"+n+"/>"),t&&a.each(e.prop("attributes"),function(){e.parent().attr(this.name,this.value)}),e.contents().unwrap()})},createLink:function(){for(var e,t,n,o=this,r=o.doc.getSelection(),i=r.focusNode,s=(new XMLSerializer).serializeToString(r.getRangeAt(0).cloneContents());["A","DIV"].indexOf(i.nodeName)<0;)i=i.parentNode;if(i&&"A"===i.nodeName){var l=a(i);s=l.text(),e=l.attr("href"),o.o.minimalLinks||(t=l.attr("title"),n=l.attr("target"));var d=o.doc.createRange();d.selectNode(i),r.removeAllRanges(),r.addRange(d)}o.saveRange();var c={url:{label:"URL",required:!0,value:e},text:{label:o.lang.text,value:s}};o.o.minimalLinks||Object.assign(c,{title:{label:o.lang.title,value:t},target:{label:o.lang.target,value:n}}),o.openModalInsert(o.lang.createLink,c,function(e){var t=o.prependUrlPrefix(e.url);if(!t.length)return!1;var n=a(['<a href="',e.url,'">',e.text||e.url,"</a>"].join(""));return o.o.minimalLinks||(e.title.length>0&&n.attr("title",e.title),e.target.length>0&&n.attr("target",e.target)),o.range.deleteContents(),o.range.insertNode(n[0]),o.syncCode(),o.$c.trigger("tbwchange"),!0})},prependUrlPrefix:function(e){var t=this;if(!t.urlPrefix)return e;const n=/^([a-z][-+.a-z0-9]*:|\/|#)/i;if(n.test(e))return e;const a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return a.test(e)?"mailto:"+e:t.urlPrefix+e},unlink:function(){var e=this,t=e.doc.getSelection(),n=t.focusNode;if(t.isCollapsed){for(;["A","DIV"].indexOf(n.nodeName)<0;)n=n.parentNode;if(n&&"A"===n.nodeName){var a=e.doc.createRange();a.selectNode(n),t.removeAllRanges(),t.addRange(a)}}e.execCmd("unlink",void 0,void 0,!0)},insertImage:function(){var e=this;e.saveRange();var t={url:{label:"URL",required:!0},alt:{label:e.lang.description,value:e.getRangeText()}};e.o.imageWidthModalEdit&&(t.width={}),e.openModalInsert(e.lang.insertImage,t,function(t){e.execCmd("insertImage",t.url);var n=a('img[src="'+t.url+'"]:not([alt])',e.$box);return n.attr("alt",t.alt),e.o.imageWidthModalEdit&&n.attr({width:t.width}),e.syncCode(),e.$c.trigger("tbwchange"),!0})},fullscreen:function(){var e,n=this,o=n.o.prefix,r=o+"fullscreen";n.$box.toggleClass(r),e=n.$box.hasClass(r),a("body").toggleClass(o+"body-fullscreen",e),a(t).trigger("scroll"),n.$c.trigger("tbw"+(e?"open":"close")+"fullscreen")},execCmd:function(e,t,n,a){var o=this;a=!!a||"","dropdown"!==e&&o.$ed.focus();try{o.doc.execCommand("styleWithCSS",!1,n||!1)}catch(r){}try{o[e+a](t)}catch(r){try{e(t)}catch(i){"insertHorizontalRule"===e?t=void 0:"formatBlock"===e&&o.isIE&&(t="<"+t+">"),o.doc.execCommand(e,!1,t),o.syncCode(),o.semanticCode(!1,!0)}"dropdown"!==e&&(o.updateButtonPaneStatus(),o.$c.trigger("tbwchange"))}},openModal:function(e,n){var i=this,s=i.o.prefix;if(a("."+s+"modal-box",i.$box).length>0)return!1;i.o.autogrowOnEnter&&(i.autogrowOnEnterDontClose=!0),i.saveRange(),i.showOverlay(),i.$btnPane.addClass(s+"disable");var l=a("<div/>",{"class":s+"modal "+s+"fixed-top"}).css({top:i.$btnPane.height()}).appendTo(i.$box);i.$overlay.one("click",function(){return l.trigger(r),!1});var d=a("<form/>",{action:"",html:n}).on("submit",function(){return l.trigger(o),!1}).on("reset",function(){return l.trigger(r),!1}).on("submit reset",function(){i.o.autogrowOnEnter&&(i.autogrowOnEnterDontClose=!1)}),c=a("<div/>",{"class":s+"modal-box",html:d}).css({top:"-"+i.$btnPane.outerHeight()+"px",opacity:0}).appendTo(l).animate({top:0,opacity:1},100);return a("<span/>",{text:e,"class":s+"modal-title"}).prependTo(c),l.height(c.outerHeight()+10),a("input:first",c).focus(),i.buildModalBtn("submit",c),i.buildModalBtn("reset",c),a(t).trigger("scroll"),l},buildModalBtn:function(e,t){var n=this,o=n.o.prefix;return a("<button/>",{"class":o+"modal-button "+o+"modal-"+e,type:e,text:n.lang[e]||e}).appendTo(a("form",t))},closeModal:function(){var e=this,t=e.o.prefix;e.$btnPane.removeClass(t+"disable"),e.$overlay.off();var n=a("."+t+"modal-box",e.$box);n.animate({top:"-"+n.height()},100,function(){n.parent().remove(),e.hideOverlay()}),e.restoreRange()},openModalInsert:function(e,t,n){var i=this,s=i.o.prefix,l=i.lang,d="";return a.each(t,function(e,t){var n=t.label||e,a=t.name||e,o=t.attributes||{},r=Object.keys(o).map(function(e){return e+'="'+o[e]+'"'}).join(" ");d+='<label><input type="'+(t.type||"text")+'" name="'+a+'"'+("checkbox"===t.type&&t.value?' checked="checked"':' value="'+(t.value||"").replace(/"/g,"&quot;"))+'"'+r+'><span class="'+s+'input-infos"><span>'+(l[n]?l[n]:n)+"</span></span></label>"}),i.openModal(e,d).on(o,function(){var e=a("form",a(this)),r=!0,s={};a.each(t,function(t,n){var o=n.name||t,l=a('input[name="'+o+'"]',e),d=l.attr("type");switch(d.toLowerCase()){case"checkbox":s[o]=l.is(":checked");break;case"radio":s[o]=l.filter(":checked").val();break;default:s[o]=a.trim(l.val())}n.required&&""===s[o]?(r=!1,i.addErrorOnModalField(l,i.lang.required)):n.pattern&&!n.pattern.test(s[o])&&(r=!1,i.addErrorOnModalField(l,n.patternError))}),r&&(i.restoreRange(),n(s,t)&&(i.syncCode(),i.$c.trigger("tbwchange"),i.closeModal(),a(this).off(o)))}).one(r,function(){a(this).off(o),i.closeModal()})},addErrorOnModalField:function(e,t){var n=this.o.prefix,o=e.parent();e.on("change keyup",function(){o.removeClass(n+"input-error")}),o.addClass(n+"input-error").find("input+span").append(a("<span/>",{"class":n+"msg-error",text:t}))},getDefaultImgDblClickHandler:function(){var e=this;return function(){var t=a(this),n=t.attr("src"),o="(Base64)";0===n.indexOf("data:image")&&(n=o);var r={url:{label:"URL",value:n,required:!0},alt:{label:e.lang.description,value:t.attr("alt")}};return e.o.imageWidthModalEdit&&(r.width={value:t.attr("width")?t.attr("width"):""}),e.openModalInsert(e.lang.insertImage,r,function(n){return n.src!==o&&t.attr({src:n.url}),t.attr({alt:n.alt}),e.o.imageWidthModalEdit&&(parseInt(n.width)>0?t.attr({width:n.width}):t.removeAttr("width")),!0}),!1}},saveRange:function(){var e=this,t=e.doc.getSelection();if(e.range=null,t.rangeCount){var n,a=e.range=t.getRangeAt(0),o=e.doc.createRange();o.selectNodeContents(e.$ed[0]),o.setEnd(a.startContainer,a.startOffset),n=(o+"").length,e.metaRange={start:n,end:n+(a+"").length}}},restoreRange:function(){var e,t=this,n=t.metaRange,a=t.range,o=t.doc.getSelection();if(a){if(n&&n.start!==n.end){var r,i=0,s=[t.$ed[0]],l=!1,d=!1;for(e=t.doc.createRange();!d&&(r=s.pop());)if(3===r.nodeType){var c=i+r.length;!l&&n.start>=i&&n.start<=c&&(e.setStart(r,n.start-i),l=!0),l&&n.end>=i&&n.end<=c&&(e.setEnd(r,n.end-i),d=!0),i=c}else for(var u=r.childNodes,g=u.length;g>0;)g-=1,s.push(u[g])}o.removeAllRanges(),o.addRange(e||a)}},getRangeText:function(){return this.range+""},updateButtonPaneStatus:function(){var e=this,t=e.o.prefix,n=e.getTagsRecursive(e.doc.getSelection().focusNode),o=t+"active-button "+t+"active";a("."+t+"active-button",e.$btnPane).removeClass(o),a.each(n,function(n,r){var i=e.tagToButton[r.toLowerCase()],s=a("."+t+i+"-button",e.$btnPane);if(s.length>0)s.addClass(o);else try{s=a("."+t+"dropdown ."+t+i+"-dropdown-button",e.$box);var l=s.parent().data("dropdown");a("."+t+l+"-button",e.$box).addClass(o)}catch(d){}})},getTagsRecursive:function(e,t){var n=this;if(t=t||(e&&e.tagName?[e.tagName]:[]),!e||!e.parentNode)return t;e=e.parentNode;var o=e.tagName;return"DIV"===o?t:("P"===o&&""!==e.style.textAlign&&t.push(e.style.textAlign),a.each(n.tagHandlers,function(a,o){t=t.concat(o(e,n))}),t.push(o),n.getTagsRecursive(e,t).filter(function(e){return null!=e}))},initPlugins:function(){var e=this;e.loadedPlugins=[],a.each(a.trumbowyg.plugins,function(t,n){n.shouldInit&&!n.shouldInit(e)||(n.init(e),n.tagHandler&&e.tagHandlers.push(n.tagHandler),e.loadedPlugins.push(n))})},destroyPlugins:function(){a.each(this.loadedPlugins,function(e,t){t.destroy&&t.destroy()})}}}(navigator,window,document,jQuery); -/* ./modules/cms/ui/themes/default/script/openrat/init.min.js */;window.Openrat={}; -/* ./modules/cms/ui/themes/default/script/openrat/view.min.js */;Openrat.View=function(e,t,i,r){this.action=e;this.method=t;this.id=i;this.params=r;this.before=function(){};this.start=function(e){this.before();this.element=e;this.loadView()};this.afterLoad=function(){};this.close=function(){};function n(e){Openrat.Workbench.afterViewLoadedHandler.fire(e);let f=$(e).data('afterViewLoaded');if(f instanceof Function)f(e)};this.loadView=function(){let url=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!1);let element=this.element;let view=this;let loadViewHtmlPromise=$.ajax(url);$(this.element).addClass('loader');loadViewHtmlPromise.done(function(e,t){if(!e)e='';$(element).html(e).removeClass('loader');$(element).find('form').each(function(){let form=new Openrat.Form();form.close=function(){view.close()};form.initOnElement(this)});n(element)});loadViewHtmlPromise.fail(function(e,t,i){$(element).html('');Openrat.Workbench.notify('','','error','Server Error',['Server Error while requesting url '+url,t])});let apiUrl=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!0);loadViewHtmlPromise.done(function(){})};Openrat.View.createUrl=function(e,subaction,i,extraid={},api=!1){let url='./';if(api)url+='api/';url+='?';if(e)url+='&action='+e;if(subaction)url+='&subaction='+subaction;if(i)url+='&id='+i;if(typeof extraid==='string'){extraid=extraid.replace(/'/g,'"');let extraObject=jQuery.parseJSON(extraid);jQuery.each(extraObject,function(e,t){url=url+'&'+e+'='+t})} -else if(typeof extraid==='object'){jQuery.each(extraid,function(e,t){url=url+'&'+e+'='+t})} -else{};return url}}; -/* ./modules/cms/ui/themes/default/script/openrat/form.min.js */;Openrat.Form=function(){const modes={showBrowserNotice:1,keepOpen:2,closeAfterSubmit:4,closeAfterSuccess:8,};this.setLoadStatus=function(e){$(this.element).closest('div.content').toggleClass('loader',e)};this.initOnElement=function(e){this.element=e;let form=this;if($(this.element).data('autosave')){$(this.element).find('input[type="checkbox"]').click(function(){form.submit(modes.keepOpen)});$(this.element).find('select').change(function(){form.submit(modes.keepOpen)})};$(e).find('.or-form-btn--cancel').click(function(){form.cancel()});$(e).find('.or-form-btn--reset').click(function(){form.rollback()});$(e).find('.or-form-btn--apply').click(function(){form.submit(modes.keepOpen)});$(e).submit(function(e){if($(this).data('target')=='view'){form.submit();e.preventDefault()}})};this.cancel=function(){this.close()};this.rollback=function(){this.element.trigger('reset')};this.close=function(){};this.forwardTo=function(e,t,s,o){let view=new Openrat.View(e,t,s,o);view.start($(this.element).closest('.view'))};this.submit=function(e){if(e===undefined)if($(this.element).data('async'))e=modes.closeAfterSubmit;else e=modes.closeAfterSuccess;let status=$('<div class="notice info"><div class="text loader"></div></div>');$('#noticebar').prepend(status);$(status).show();$(this.element).find('.error').removeClass('error');let params=$(this.element).serializeArray();let data={};$(params).each(function(e,t){data[t.name]=t.value});if(!data.id)data.id=Openrat.Workbench.state.id;if(!data.action)data.action=Openrat.Workbench.state.action;let formMethod=$(this.element).attr('method').toUpperCase();if(formMethod=='GET'){this.forwardTo(data.action,data.subaction,data.id,data);$(status).remove()} -else{let url='./api/';this.setLoadStatus(!0);url+='';data.output='json';if(e==modes.closeAfterSubmit)this.close();let form=this;$.ajax({'type':'POST',url:url,data:data,success:function(t,s,o){form.setLoadStatus(!1);$(status).remove();form.doResponse(t,s,form.element,function(){if(e==modes.closeAfterSuccess){form.close();$(form.element).closest('div.panel').find('div.header ul.views li.action.active').removeClass('dirty')};let afterSuccess=$(form.element).data('afterSuccess');let async=$(form.element).data('async');if(afterSuccess){if(afterSuccess=='reloadAll'){Openrat.Workbench.reloadAll()}} -else{if(async);else Openrat.Workbench.reloadViews()}})},error:function(e,t,s){form.setLoadStatus(!1);$(status).remove();try{let error=jQuery.parseJSON(e.responseText);Openrat.Workbench.notify('','','error',error.error,[error.description])}catch(o){let msg=e.responseText;Openrat.Workbench.notify('','','error','Server Error',[msg])}}});$(form.element).fadeIn()}};this.doResponse=function(e,t,s,onSuccess=$.noop){if(t!='success'){alert('Server error: '+t);return};let form=this;$.each(e['notices'],function(t,e){let notifyBrowser=$(s).data('async');Openrat.Workbench.notify(e.type,e.name,e.status,e.text,e.log,notifyBrowser);if(e.status=='ok'){onSuccess();Openrat.Workbench.dataChangedHandler.fire()} -else{}});$.each(e['errors'],function(e,t){$('input[name='+t+']').addClass('error').parent().addClass('error').parents('fieldset').addClass('show').addClass('open')});if(e.control.redirect)window.location.href=e.control.redirect}}; -/* ./modules/cms/ui/themes/default/script/openrat/workbench.min.js */;Openrat.Workbench=new function(){'use strict';this.state={};this.initialize=function(){this.initializePingTimer();this.initializeState();this.openModalDialog()};this.openModalDialog=function(){if($('#dialog').data('action')){startDialog('',$('#dialog').data('action'),$('#dialog').data('action'),0,{})}};this.initializeState=function(){let parts=window.location.hash.split('/');let state={action:'index',id:0};if(parts.length>=2)state.action=parts[1].toLowerCase();if(parts.length>=3)state.id=parts[2].replace(/[^0-9_]/gim,'');Openrat.Workbench.state=state;$('#editor').attr('data-action',state.action);$('#editor').attr('data-id',state.id);$('#editor').attr('data-extra','{}');Openrat.Navigator.toActualHistory(state)};this.initializePingTimer=function(){let ping=function(){let pingPromise=$.getJSON(Openrat.View.createUrl('profile','ping',0,{},!0));pingPromise.fail(function(){console.warn('The server ping has failed.')})};let timeoutMinutes=5;window.setInterval(ping,timeoutMinutes*60*1000)};this.loadNewActionState=function(t){Openrat.Workbench.state=t;Openrat.Workbench.loadNewAction(t.action,t.id,t.data);this.afterNewActionHandler.fire()};this.afterNewActionHandler=$.Callbacks();this.loadNewAction=function(t,e,i){$('#editor').attr('data-action',t);$('#editor').attr('data-id',e);$('#editor').attr('data-extra',JSON.stringify(i));this.reloadViews()};this.reloadViews=function(){$('#workbench section.closed .view-loader').empty();Openrat.Workbench.loadViews($('#workbench section.open .view-loader'))};this.reloadAll=function(){$('#workbench .view').empty();Openrat.Workbench.loadViews($('#workbench .view.view-loader, #workbench .view.view-static'));this.loadUserStyle();this.loadLanguage();this.loadUISettings()};this.loadUserStyle=function(){let url=Openrat.View.createUrl('profile','userinfo',0,{},!0);$.getJSON(url,function(t){let style=t.output['style'];Openrat.Workbench.setUserStyle(style);let color=t.output['theme-color'];Openrat.Workbench.setThemeColor(color)})};this.settings={};this.language={};this.loadLanguage=function(){let url=Openrat.View.createUrl('profile','language',0,{},!0);$.getJSON(url,function(t){Openrat.Workbench.language=t.output.language})};this.loadUISettings=function(){let url=Openrat.View.createUrl('profile','uisettings',0,{},!0);$.getJSON(url,function(t){Openrat.Workbench.settings=t.output.settings.settings})};this.loadViews=function(t){t.each(function(t){let $targetDOMElement=$(this);Openrat.Workbench.loadNewActionIntoElement($targetDOMElement)})};this.loadNewActionIntoElement=function(t){let action;if(t.is('.view-static'))action=t.attr('data-action');else action=$('#editor').attr('data-action');let id=$('#editor').attr('data-id');let params=$('#editor').attr('data-extra');let method=t.data('method');let view=new Openrat.View(action,method,id,params);view.start(t)};this.setUserStyle=function(t){var e=$('html'),i=e.attr('class').split(/\s+/);$.each(i,function(t,i){if(i.startsWith('theme-')){e.removeClass(i)}});e.addClass('theme-'+t.toLowerCase())};this.setThemeColor=function(t){$('#theme-color').attr('content',t)};let notifyBrowser=function(t){if(!('Notification' in window)){return} -else if(Notification.permission==='granted'){let notification=new Notification(t)} -else if(Notification.permission!=='denied'){Notification.requestPermission(function(e){if(e==='granted'){let notification=new Notification(t)}})}};this.notify=function(t,i,e,o,log=[],notifyTheBrowser=!1){if(notifyTheBrowser)notifyBrowser(o);let notice=$('<div class="notice '+e+'"></div>');let toolbar=$('<div class="or-notice-toolbar"></div>');if(log.length)$(toolbar).append('<i class="or-action-full image-icon image-icon--menu-fullscreen"></i>');$(toolbar).append('<i class="or-action-close image-icon image-icon--menu-close"></i>');$(notice).append(toolbar);let id=0;if(i)$(notice).append('<div class="name clickable"><a href="" data-type="open" data-action="'+t+'" data-id="'+id+'"><i class="or-action-full image-icon image-icon--action-'+t+'"></i> '+i+'</a></div>');$(notice).append('<div class="text">'+htmlEntities(o)+'</div>');if(log.length){let logLi=log.reduce((result,item)=>{result+='<li><pre>'+htmlEntities(item)+'</pre></li>';return result},'');$(notice).append('<div class="log"><ul>'+logLi+'</ul></div>')};$('#noticebar').prepend(notice);$(notice).orLinkify();$(notice).find('.or-action-full').click(function(){$(notice).toggleClass('full')});$(notice).find('.or-action-close').click(function(){$(notice).fadeOut('fast',function(){$(notice).remove()})});let timeout=1;if(e=='ok')timeout=20;if(e=='info')timeout=60;if(e=='warning')timeout=120;if(e=='error')timeout=120;if(timeout>0)setTimeout(function(){$(notice).fadeOut('slow',function(){$(this).remove()})},timeout*1000)};this.dataChangedHandler=$.Callbacks();this.dataChangedHandler.add(function(){if(popupWindow!==undefined)popupWindow.location.reload()});this.afterViewLoadedHandler=$.Callbacks();let afterViewFunctions=[];this.registerAfterViewLoaded=function(t){afterViewFunctions.push(t)};this.afterViewLoaded=function(t){afterViewFunctions.forEach(function(e){e(t)})}}; -/* ./modules/cms/ui/themes/default/script/openrat/navigator.min.js */;Openrat.Navigator=new function(){'use strict';this.navigateTo=function(t){Openrat.Workbench.loadNewActionState(t)};this.navigateToNew=function(t){this.navigateTo(t);window.history.pushState(t,t.name,this.createShortUrl(t.action,t.id))};this.toActualHistory=function(t){window.history.replaceState(t,t.name,this.createShortUrl(t.action,t.id))};this.createShortUrl=function(t,i){return'./#/'+t+(i?'/'+i:'')}}; -/* ./modules/cms/ui/themes/default/script/openrat/common.min.js */;var OR_THEMES_EXT_DIR='modules/cms-ui/themes/';$(function(){$('html').removeClass('nojs');$('.initial-hidden').removeClass('initial-hidden');function e(){function e(e){$(e).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};$('div.header').dblclick(function(){e(this)})};e();window.onpopstate=function(e){Openrat.Navigator.navigateTo(e.state)};Openrat.Workbench.initialize();Openrat.Workbench.reloadAll();let registerWorkbenchGlobalEvents=function(){$('.keystroke').each(function(){let keystrokeElement=$(this);let keystroke=keystrokeElement.text();if(keystroke.length==0)return;let keyaction=function(){keystrokeElement.click()};$(document).bind('keydown',keystroke,keyaction)});$('section.toggle-open-close .on-click-open-close').click(function(){var t=$(this).closest('section');if(t.hasClass('disabled'))return;var e=t.find('div.view-loader');if(e.children().length==0)Openrat.Workbench.loadNewActionIntoElement(e)})};$('.or-initial-notice').each(function(){Openrat.Workbench.notify('','','info',$(this).text());$(this).remove()});registerWorkbenchGlobalEvents();let closeMenu=function(){$('body').click(function(){$('.toolbar-icon.menu').parents('.or-menu').removeClass('open')})};closeMenu();Openrat.Workbench.afterNewActionHandler.add(function(){let url='./api/?action=tree&subaction=path&id='+Openrat.Workbench.state.id+'&type='+Openrat.Workbench.state.action+'&output=json';$.getJSON(url,function(e){$('nav .or-navtree-node').removeClass('or-navtree-node--selected');let output=e['output'];$.each(output.path,function(e,t){$nav=$('nav .or-navtree-node[data-type='+t.type+'][data-id='+t.id+'].or-navtree-node--is-closed .or-navtree-node-control');$nav.click()});if(output.actual)$('nav .or-navtree-node[data-type='+output.actual.type+'][data-id='+output.actual.id+']').addClass('or-navtree-node--selected');let $breadcrumb=$('.or-breadcrumb').empty();let items=[];$.each(output.path.concat(output.actual),function(e,t){items.push('<li class="or-breadcrumb-item clickable" tabindex="0"><a href="'+Openrat.Navigator.createShortUrl(t.action,t.id)+'" data-type="open" data-action="'+t.action+'" data-id="'+t.id+'"><i class="image-icon image-icon--action-'+t.action+'" />'+t.name+'</a></li>')});$breadcrumb.append(items.join('<li><i class="tree-icon image-icon image-icon--node-closed"></i></li>'));$('.or-breadcrumb .clickable').orLinkify()}).fail(function(e){console.warn(e);console.warn('failed to load path from '+url)}).always(function(){})})});let filterMenus=function(){let action=Openrat.Workbench.state.action;let id=Openrat.Workbench.state.id;$('div.clickable').addClass('active');$('div.clickable.filtered').removeClass('active').addClass('inactive');$('div.clickable.filtered.on-action-'+action).addClass('active').removeClass('inactive');$('div.clickable.filtered a').attr('data-id',id)};$('#title.view').data('afterViewLoaded',function(){filterMenus()});Openrat.Workbench.afterNewActionHandler.add(function(){filterMenus()});Openrat.Workbench.afterViewLoadedHandler.add(function(e){if(typeof popupWindow!='undefined')$(e).find('a[data-type=\'popup\']').each(function(){popupWindow.location.href=$(this).attr('data-url')})});Openrat.Workbench.afterViewLoadedHandler.add(function(e){var t=$(e).closest('section');t.toggleClass('is-empty',$(e).is(':empty'));if(!$(e).is(':empty'))t.slideDown('fast');else t.slideUp('fast');$(e).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(e).find('.toggle-nav-open-close').click(function(){$('nav').toggleClass('open')});$(e).find('.toggle-nav-small').click(function(){$('nav').toggleClass('small')});$(e).find('div.headermenu > a').each(function(e,t){});$(e).find('div.header > a.back').each(function(t,n){$(n).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo($(e).closest('div.panel').find('div.header div.dropdown').first())});$(e).find('div.selector.tree').each(function(){var e=this;$(this).orTree({type:'project',selectable:$(e).attr('data-types').split(','),id:$(e).attr('data-init-folderid'),onSelect:function(t,n,a){var i=$(e).parent();$(i).find('input[type=text]').attr('value',t);$(i).find('input[type=hidden]').attr('value',a)}})});n(e);$(e).find('input').change(function(){$(this).parent('div.view').addClass('dirty')});$(e).find('.or-theme-chooser').change(function(){Openrat.Workbench.setUserStyle(this.value)});function a(e){$(e).find('.toolbar-icon.menu').click(function(e){e.stopPropagation();$(this).parents('.or-menu').toggleClass('open')});$(e).find('.toolbar-icon.menu').mouseover(function(){$(this).parents('.or-menu').find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')})};function i(e){$(e).find('.search input').orSearch({dropdown:'#title div.search div.dropdown',select:function(e){openNewAction(e.name,e.action,e.id)}})};function o(e){$(e).find('.selector input').orSearch({dropdown:'.dropdown',select:function(t){$(e).find('.or-selector-link-value').val(t.id);$(e).find('.or-selector-link-name').val(t.name).attr('placeholder',t.name)}})};function l(e){$(e).find('.or-navtree-node').orTree()};a(e);i(e);o(e);l(e);function n(e){registerDraggable(e);registerDroppable(e)};n(e)});function registerDraggable(e){$(e).find('.or-draggable').draggable({helper:'clone',opacity:0.7,zIndex:2,distance:10,cursor:'move',revert:'false'})};function registerTreeBranchEvents(e){registerDraggable(e)};function registerDroppable(e){$(e).find('.or-droppable').droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let id=dropped.data('id');let name=dropped.data('name');if(!name)name=id;$(this).find('.or-selector-link-value').val(id);$(this).find('.or-selector-link-name').val(name).attr('placeholder',name)}})};function startDialog(e,t,n,a,i){if(!t)t=$('#editor').attr('data-action');if(!a)a=$('#editor').attr('data-id');let view=new Openrat.View(t,n,a,i);view.before=function(){$('#dialog > .view').html('<div class="header"><img class="icon" title="" src="./themes/default/images/icon/'+n+'.png" />'+e+'</div>');$('#dialog > .view').data('id',a);$('#dialog').removeClass('is-closed').addClass('is-open');let view=this;this.escapeKeyClosingHandler=function(e){if(e.keyCode==27){view.close();$(document).off('keyup')}};$(document).keyup(this.escapeKeyClosingHandler);$('#dialog .filler').click(function(){view.close()})};view.close=function(){if($('div#dialog').hasClass('modal'))return;$('#dialog .view').html('');$('#dialog').removeClass('is-open').addClass('is-closed');$(document).unbind('keyup',this.escapeKeyClosingHandler)};view.start($('div#dialog > .view'))};function setTitle(e){if(e)$('head > title').text(e+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};function openNewAction(e,t,n){$('nav').removeClass('open');setTitle(e);Openrat.Navigator.navigateToNew({'action':t,'id':n})};function insert(e,t,a){var n=document.forms[0].elements[e];n.focus();if(typeof document.selection!='undefined'){var l=document.selection.createRange(),i=l.text;l.text=t+i+a;l=document.selection.createRange();if(i.length==0){l.move('character',-a.length)} -else{l.moveStart('character',t.length+i.length+a.length)};l.select()} -else if(typeof n.selectionStart!='undefined'){var r=n.selectionStart,c=n.selectionEnd,i=n.value.substring(r,c);n.value=n.value.substr(0,r)+t+i+a+n.value.substr(c);var o;if(i.length==0){o=r+t.length} -else{o=r+t.length+i.length+a.length};n.selectionStart=o;n.selectionEnd=o} -else{o=n.value.length;var i=prompt('Text');n.value=n.value.substr(0,o)+t+i+a+n.value.substr(o)}};function help(e,t,n){var a=$(e).closest('div.panel').find('li.action.active').attr('data-action'),i=$(e).closest('div.panel').find('li.action.active').attr('data-method');window.open(t+a+'/'+i+n,'OpenRat_Help','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes')};function htmlEntities(e){return String(e).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;')};function registerOpenClose(e){$(e).children('.on-click-open-close').click(function(){$(this).closest('.toggle-open-close').toggleClass('open closed')})}; -/* ./modules//template_engine/components/html/editor/editor.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('textarea').orAutoheight();$(e).find('textarea.editor.code-editor').each(function(){let mode=$(this).data('mode');let mimetype=$(this).data('mimetype');if(mimetype.length>0)mode=mimetype;let textareaEl=this;let editor=CodeMirror.fromTextArea(textareaEl,{lineNumbers:!0,viewportMargin:Infinity,mode:mode});editor.on('change',function(){let newValue=editor.getValue();$(textareaEl).val(newValue)});$(editor.getWrapperElement()).droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let pos=editor.getCursor();editor.setSelection(pos,pos);let insertText=dropped.data('id');let toInsert=''+insertText;editor.replaceSelection(toInsert)}})});$(e).find('textarea.editor.markdown-editor').each(function(){let textarea=this;let toolbar=[{name:'bold',action:SimpleMDE.toggleBold,className:'image-icon image-icon--editor-bold',title:'Bold',},{name:'italic',action:SimpleMDE.toggleItalic,className:'image-icon image-icon--editor-italic',title:'Italic',},{name:'heading',action:SimpleMDE.toggleHeadingBigger,className:'image-icon image-icon--editor-headline',title:'Headline',},'|',{name:'quote',action:SimpleMDE.toggleBlockquote,className:'image-icon image-icon--editor-quote',title:'Quote',},{name:'code',action:SimpleMDE.toggleCodeBlock,className:'image-icon image-icon--editor-code',title:'Code',},'|',{name:'generic list',action:SimpleMDE.toggleUnorderedList,className:'image-icon image-icon--editor-unnumberedlist',title:'Unnumbered list',},{name:'numbered list',action:SimpleMDE.toggleOrderedList,className:'image-icon image-icon--editor-numberedlist',title:'Numbered list',},'|',{name:'table',action:SimpleMDE.drawTable,className:'image-icon image-icon--editor-table',title:'Table',},{name:'horizontalrule',action:SimpleMDE.drawHorizontalRule,className:'image-icon image-icon--editor-horizontalrule',title:'Horizontal rule',},'|',{name:'undo',action:SimpleMDE.undo,className:'image-icon image-icon--editor-undo',title:'Undo',},{name:'redo',action:SimpleMDE.redo,className:'image-icon image-icon--editor-redo',title:'Redo',},'|',{name:'link',action:SimpleMDE.drawLink,className:'image-icon image-icon--editor-link',title:'Link',},{name:'image',action:SimpleMDE.drawImage,className:'image-icon image-icon--editor-image',title:'Image',},'|',{name:'guide',action:'https://simplemde.com/markdown-guide',className:'image-icon image-icon--editor-help',title:'Howto markdown',},];let mde=new SimpleMDE({element:$(this)[0],toolbar:toolbar,autoDownloadFontAwesome:!1});let codemirror=mde.codemirror;$(codemirror.getWrapperElement()).droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let insertText='';let id=dropped.data('id');let url='__OID__'+id+'__';if(dropped.data('type')=='image')insertText='![]('+url+')';else insertText='['+id+']('+url+')';let pos=codemirror.getCursor();codemirror.setSelection(pos,pos);codemirror.replaceSelection(insertText)}});codemirror.on('change',function(){let newValue=codemirror.getValue();$(textarea).val(newValue)})});$(e).find('textarea.editor.html-editor').each(function(){let textarea=this;$.trumbowyg.svgPath='./modules/editor/trumbowyg/ui/icons.svg';$(textarea).trumbowyg();$(textarea).closest('form').find('.trumbowyg-editor').droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let id=dropped.data('id');let url='./?_='+dropped.data('type')+'-'+id+'&subaction=show&embed=1&__OID__'+id+'__='+id;let insertText='';if(dropped.data('type')=='image')insertText='<img src="'+url+'" alt="" />';else insertText='<a href="'+url+'" />'+id+'</a>';$(textarea).trumbowyg('execCmd',{cmd:'insertHTML',param:insertText,forceCss:!1,})}})})}); -/* ./modules//template_engine/components/html/link/link.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('.clickable').orLinkify()}); -/* ./modules//template_engine/components/html/qrcode/qrcode.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(r){$(r).find('.or-qrcode').mouseover(function(){let r=this;if($(r).children().length>0)return;let wrapper=$('<div class="or-info-popup"></div>');$(r).append(wrapper);var e=$(r).attr('data-qrcode');$(wrapper).qrcode({render:'div',text:e,fill:'currentColor'});wrapper.attr('title','')})}); -/* ./modules//template_engine/components/html/table/table.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(t){$(t).find('table.or-table--sortable > tbody').sortable();$(t).find('table.or-table--sortable > tbody').closest('form').submit(function(){var t=[];$(this).find('table.or-table--sortable').find('tbody > tr.data').each(function(){let objectid=$(this).data('id');t.push(objectid)});$(this).find('input[name=order]').val(t.join(','))});$(t).find('tr.headline > td > input.checkbox').click(function(){$(this).closest('table').find('tr.data > td > input.checkbox').attr('checked',Boolean($(this).attr('checked')))});$(t).find('.or-table-filter > input').keyup(function(){let filterExpression=$(this).val().toLowerCase();let table=$(this).parents('.or-table-wrapper').find('table');table.addClass('loader');setTimeout(()=>{table.find('tr:not(.headline)').filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(filterExpression)>-1)});table.removeClass('loader')},50)});$(t).find('table > tbody > tr.headline > td, table > tbody > tr > th').click(function(){let column=$(this);let table=column.parents('table');table.addClass('loader');let isAscending=!column.hasClass('sort-asc');table.find('tr.headline > td, tr > th').removeClass('sort-asc sort-desc');if(isAscending)column.addClass('sort-asc');else column.addClass('sort-desc');setTimeout(function(){let rows=table.find('tr:gt(0)').toArray().sort(a(column.index()));if(!isAscending){rows=rows.reverse()};for(var t=0;t<rows.length;t++){table.append(rows[t])};table.removeClass('loader')},50)});function a(t){return function(a,l){let valA=e(a,t),valB=e(l,t);return $.isNumeric(valA)&&$.isNumeric(valB)?valA-valB:valA.toString().localeCompare(valB)}};function e(t,e){return $(t).children('td').eq(e).text()}}); -/* ./modules//template_engine/components/html/column/column.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(e){}); -/* ./modules//template_engine/components/html/image/image.min.js */; -/* ./modules//template_engine/components/html/group/group.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(e){registerOpenClose($(e).find('.or-group.toggle-open-close'))}); -/* ./modules//template_engine/components/html/upload/upload.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(e){var o=$(e).find('form'),n=$(e).find('div.or-dropzone-upload > div.input');n.on('dragenter',function(e){e.stopPropagation();e.preventDefault();$(this).css('border','1px dotted gray')});n.on('dragover',function(e){e.stopPropagation();e.preventDefault()});n.on('drop',function(e){$(this).css('border','1px dotted red');e.preventDefault();var n=e.originalEvent.dataTransfer.files;handleFileUpload(o,n)});$(e).find('input[type=file]').change(function(){var e=$(this).prop('files');handleFileUpload(o,e)})});function handleFileUpload(e,a){for(var r=0,t;t=a[r];r++){var n=new FormData();n.append('file',t);n.append('action','folder');n.append('subaction',$(e).data('method'));n.append('output','json');n.append('token',$(e).find('input[name=token]').val());n.append('id',$(e).find('input[name=id]').val());var o=$('<div class="notice info"><div class="text loader"></div></div>');$('#noticebar').prepend(o);$(o).show();$.ajax({'type':'POST',url:'./api/',cache:!1,contentType:!1,processData:!1,data:n,success:function(n,a,r){$(o).remove();let oform=new Openrat.Form();oform.doResponse(n,a,e)},error:function(n,t,d){$(e).closest('div.content').removeClass('loader');$(o).remove();var r;try{var a=jQuery.parseJSON(n.responseText);r=a.error+'/'+a.description+': '+a.reason}catch(i){r=n.responseText};Openrat.Workbench.notify('Upload error',r)}})}}; -/* ./modules//template_engine/components/html/tree/tree.min.js */;Openrat.Workbench.afterViewLoadedHandler.add(function(e){});- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/jquery-ui.js b/modules/cms/ui/themes/default/script/jquery-ui.js @@ -1,4350 +0,0 @@ -/*! jQuery UI - v1.12.1 - 2018-09-03 -* http://jqueryui.com -* Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js, widgets/droppable.js, widgets/sortable.js, widgets/mouse.js -* Copyright jQuery Foundation and other contributors; Licensed MIT */ - -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - - // AMD. Register as an anonymous module. - define([ "jquery" ], factory ); - } else { - - // Browser globals - factory( jQuery ); - } -}(function( $ ) { - -$.ui = $.ui || {}; - -var version = $.ui.version = "1.12.1"; - - -/*! - * jQuery UI Widget 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Widget -//>>group: Core -//>>description: Provides a factory for creating stateful widgets with a common API. -//>>docs: http://api.jqueryui.com/jQuery.widget/ -//>>demos: http://jqueryui.com/widget/ - - - -var widgetUuid = 0; -var widgetSlice = Array.prototype.slice; - -$.cleanData = ( function( orig ) { - return function( elems ) { - var events, elem, i; - for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { - try { - - // Only trigger remove when necessary to save time - events = $._data( elem, "events" ); - if ( events && events.remove ) { - $( elem ).triggerHandler( "remove" ); - } - - // Http://bugs.jquery.com/ticket/8235 - } catch ( e ) {} - } - orig( elems ); - }; -} )( $.cleanData ); - -$.widget = function( name, base, prototype ) { - var existingConstructor, constructor, basePrototype; - - // ProxiedPrototype allows the provided prototype to remain unmodified - // so that it can be used as a mixin for multiple widgets (#8876) - var proxiedPrototype = {}; - - var namespace = name.split( "." )[ 0 ]; - name = name.split( "." )[ 1 ]; - var fullName = namespace + "-" + name; - - if ( !prototype ) { - prototype = base; - base = $.Widget; - } - - if ( $.isArray( prototype ) ) { - prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); - } - - // Create selector for plugin - $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { - return !!$.data( elem, fullName ); - }; - - $[ namespace ] = $[ namespace ] || {}; - existingConstructor = $[ namespace ][ name ]; - constructor = $[ namespace ][ name ] = function( options, element ) { - - // Allow instantiation without "new" keyword - if ( !this._createWidget ) { - return new constructor( options, element ); - } - - // Allow instantiation without initializing for simple inheritance - // must use "new" keyword (the code above always passes args) - if ( arguments.length ) { - this._createWidget( options, element ); - } - }; - - // Extend with the existing constructor to carry over any static properties - $.extend( constructor, existingConstructor, { - version: prototype.version, - - // Copy the object used to create the prototype in case we need to - // redefine the widget later - _proto: $.extend( {}, prototype ), - - // Track widgets that inherit from this widget in case this widget is - // redefined after a widget inherits from it - _childConstructors: [] - } ); - - basePrototype = new base(); - - // We need to make the options hash a property directly on the new instance - // otherwise we'll modify the options hash on the prototype that we're - // inheriting from - basePrototype.options = $.widget.extend( {}, basePrototype.options ); - $.each( prototype, function( prop, value ) { - if ( !$.isFunction( value ) ) { - proxiedPrototype[ prop ] = value; - return; - } - proxiedPrototype[ prop ] = ( function() { - function _super() { - return base.prototype[ prop ].apply( this, arguments ); - } - - function _superApply( args ) { - return base.prototype[ prop ].apply( this, args ); - } - - return function() { - var __super = this._super; - var __superApply = this._superApply; - var returnValue; - - this._super = _super; - this._superApply = _superApply; - - returnValue = value.apply( this, arguments ); - - this._super = __super; - this._superApply = __superApply; - - return returnValue; - }; - } )(); - } ); - constructor.prototype = $.widget.extend( basePrototype, { - - // TODO: remove support for widgetEventPrefix - // always use the name + a colon as the prefix, e.g., draggable:start - // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name - }, proxiedPrototype, { - constructor: constructor, - namespace: namespace, - widgetName: name, - widgetFullName: fullName - } ); - - // If this widget is being redefined then we need to find all widgets that - // are inheriting from it and redefine all of them so that they inherit from - // the new version of this widget. We're essentially trying to replace one - // level in the prototype chain. - if ( existingConstructor ) { - $.each( existingConstructor._childConstructors, function( i, child ) { - var childPrototype = child.prototype; - - // Redefine the child widget using the same prototype that was - // originally used, but inherit from the new version of the base - $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, - child._proto ); - } ); - - // Remove the list of existing child constructors from the old constructor - // so the old child constructors can be garbage collected - delete existingConstructor._childConstructors; - } else { - base._childConstructors.push( constructor ); - } - - $.widget.bridge( name, constructor ); - - return constructor; -}; - -$.widget.extend = function( target ) { - var input = widgetSlice.call( arguments, 1 ); - var inputIndex = 0; - var inputLength = input.length; - var key; - var value; - - for ( ; inputIndex < inputLength; inputIndex++ ) { - for ( key in input[ inputIndex ] ) { - value = input[ inputIndex ][ key ]; - if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { - - // Clone objects - if ( $.isPlainObject( value ) ) { - target[ key ] = $.isPlainObject( target[ key ] ) ? - $.widget.extend( {}, target[ key ], value ) : - - // Don't extend strings, arrays, etc. with objects - $.widget.extend( {}, value ); - - // Copy everything else by reference - } else { - target[ key ] = value; - } - } - } - } - return target; -}; - -$.widget.bridge = function( name, object ) { - var fullName = object.prototype.widgetFullName || name; - $.fn[ name ] = function( options ) { - var isMethodCall = typeof options === "string"; - var args = widgetSlice.call( arguments, 1 ); - var returnValue = this; - - if ( isMethodCall ) { - - // If this is an empty collection, we need to have the instance method - // return undefined instead of the jQuery instance - if ( !this.length && options === "instance" ) { - returnValue = undefined; - } else { - this.each( function() { - var methodValue; - var instance = $.data( this, fullName ); - - if ( options === "instance" ) { - returnValue = instance; - return false; - } - - if ( !instance ) { - return $.error( "cannot call methods on " + name + - " prior to initialization; " + - "attempted to call method '" + options + "'" ); - } - - if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) { - return $.error( "no such method '" + options + "' for " + name + - " widget instance" ); - } - - methodValue = instance[ options ].apply( instance, args ); - - if ( methodValue !== instance && methodValue !== undefined ) { - returnValue = methodValue && methodValue.jquery ? - returnValue.pushStack( methodValue.get() ) : - methodValue; - return false; - } - } ); - } - } else { - - // Allow multiple hashes to be passed on init - if ( args.length ) { - options = $.widget.extend.apply( null, [ options ].concat( args ) ); - } - - this.each( function() { - var instance = $.data( this, fullName ); - if ( instance ) { - instance.option( options || {} ); - if ( instance._init ) { - instance._init(); - } - } else { - $.data( this, fullName, new object( options, this ) ); - } - } ); - } - - return returnValue; - }; -}; - -$.Widget = function( /* options, element */ ) {}; -$.Widget._childConstructors = []; - -$.Widget.prototype = { - widgetName: "widget", - widgetEventPrefix: "", - defaultElement: "<div>", - - options: { - classes: {}, - disabled: false, - - // Callbacks - create: null - }, - - _createWidget: function( options, element ) { - element = $( element || this.defaultElement || this )[ 0 ]; - this.element = $( element ); - this.uuid = widgetUuid++; - this.eventNamespace = "." + this.widgetName + this.uuid; - - this.bindings = $(); - this.hoverable = $(); - this.focusable = $(); - this.classesElementLookup = {}; - - if ( element !== this ) { - $.data( element, this.widgetFullName, this ); - this._on( true, this.element, { - remove: function( event ) { - if ( event.target === element ) { - this.destroy(); - } - } - } ); - this.document = $( element.style ? - - // Element within the document - element.ownerDocument : - - // Element is window or document - element.document || element ); - this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); - } - - this.options = $.widget.extend( {}, - this.options, - this._getCreateOptions(), - options ); - - this._create(); - - if ( this.options.disabled ) { - this._setOptionDisabled( this.options.disabled ); - } - - this._trigger( "create", null, this._getCreateEventData() ); - this._init(); - }, - - _getCreateOptions: function() { - return {}; - }, - - _getCreateEventData: $.noop, - - _create: $.noop, - - _init: $.noop, - - destroy: function() { - var that = this; - - this._destroy(); - $.each( this.classesElementLookup, function( key, value ) { - that._removeClass( value, key ); - } ); - - // We can probably remove the unbind calls in 2.0 - // all event bindings should go through this._on() - this.element - .off( this.eventNamespace ) - .removeData( this.widgetFullName ); - this.widget() - .off( this.eventNamespace ) - .removeAttr( "aria-disabled" ); - - // Clean up events and states - this.bindings.off( this.eventNamespace ); - }, - - _destroy: $.noop, - - widget: function() { - return this.element; - }, - - option: function( key, value ) { - var options = key; - var parts; - var curOption; - var i; - - if ( arguments.length === 0 ) { - - // Don't return a reference to the internal hash - return $.widget.extend( {}, this.options ); - } - - if ( typeof key === "string" ) { - - // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } - options = {}; - parts = key.split( "." ); - key = parts.shift(); - if ( parts.length ) { - curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); - for ( i = 0; i < parts.length - 1; i++ ) { - curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; - curOption = curOption[ parts[ i ] ]; - } - key = parts.pop(); - if ( arguments.length === 1 ) { - return curOption[ key ] === undefined ? null : curOption[ key ]; - } - curOption[ key ] = value; - } else { - if ( arguments.length === 1 ) { - return this.options[ key ] === undefined ? null : this.options[ key ]; - } - options[ key ] = value; - } - } - - this._setOptions( options ); - - return this; - }, - - _setOptions: function( options ) { - var key; - - for ( key in options ) { - this._setOption( key, options[ key ] ); - } - - return this; - }, - - _setOption: function( key, value ) { - if ( key === "classes" ) { - this._setOptionClasses( value ); - } - - this.options[ key ] = value; - - if ( key === "disabled" ) { - this._setOptionDisabled( value ); - } - - return this; - }, - - _setOptionClasses: function( value ) { - var classKey, elements, currentElements; - - for ( classKey in value ) { - currentElements = this.classesElementLookup[ classKey ]; - if ( value[ classKey ] === this.options.classes[ classKey ] || - !currentElements || - !currentElements.length ) { - continue; - } - - // We are doing this to create a new jQuery object because the _removeClass() call - // on the next line is going to destroy the reference to the current elements being - // tracked. We need to save a copy of this collection so that we can add the new classes - // below. - elements = $( currentElements.get() ); - this._removeClass( currentElements, classKey ); - - // We don't use _addClass() here, because that uses this.options.classes - // for generating the string of classes. We want to use the value passed in from - // _setOption(), this is the new value of the classes option which was passed to - // _setOption(). We pass this value directly to _classes(). - elements.addClass( this._classes( { - element: elements, - keys: classKey, - classes: value, - add: true - } ) ); - } - }, - - _setOptionDisabled: function( value ) { - this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); - - // If the widget is becoming disabled, then nothing is interactive - if ( value ) { - this._removeClass( this.hoverable, null, "ui-state-hover" ); - this._removeClass( this.focusable, null, "ui-state-focus" ); - } - }, - - enable: function() { - return this._setOptions( { disabled: false } ); - }, - - disable: function() { - return this._setOptions( { disabled: true } ); - }, - - _classes: function( options ) { - var full = []; - var that = this; - - options = $.extend( { - element: this.element, - classes: this.options.classes || {} - }, options ); - - function processClassString( classes, checkOption ) { - var current, i; - for ( i = 0; i < classes.length; i++ ) { - current = that.classesElementLookup[ classes[ i ] ] || $(); - if ( options.add ) { - current = $( $.unique( current.get().concat( options.element.get() ) ) ); - } else { - current = $( current.not( options.element ).get() ); - } - that.classesElementLookup[ classes[ i ] ] = current; - full.push( classes[ i ] ); - if ( checkOption && options.classes[ classes[ i ] ] ) { - full.push( options.classes[ classes[ i ] ] ); - } - } - } - - this._on( options.element, { - "remove": "_untrackClassesElement" - } ); - - if ( options.keys ) { - processClassString( options.keys.match( /\S+/g ) || [], true ); - } - if ( options.extra ) { - processClassString( options.extra.match( /\S+/g ) || [] ); - } - - return full.join( " " ); - }, - - _untrackClassesElement: function( event ) { - var that = this; - $.each( that.classesElementLookup, function( key, value ) { - if ( $.inArray( event.target, value ) !== -1 ) { - that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); - } - } ); - }, - - _removeClass: function( element, keys, extra ) { - return this._toggleClass( element, keys, extra, false ); - }, - - _addClass: function( element, keys, extra ) { - return this._toggleClass( element, keys, extra, true ); - }, - - _toggleClass: function( element, keys, extra, add ) { - add = ( typeof add === "boolean" ) ? add : extra; - var shift = ( typeof element === "string" || element === null ), - options = { - extra: shift ? keys : extra, - keys: shift ? element : keys, - element: shift ? this.element : element, - add: add - }; - options.element.toggleClass( this._classes( options ), add ); - return this; - }, - - _on: function( suppressDisabledCheck, element, handlers ) { - var delegateElement; - var instance = this; - - // No suppressDisabledCheck flag, shuffle arguments - if ( typeof suppressDisabledCheck !== "boolean" ) { - handlers = element; - element = suppressDisabledCheck; - suppressDisabledCheck = false; - } - - // No element argument, shuffle and use this.element - if ( !handlers ) { - handlers = element; - element = this.element; - delegateElement = this.widget(); - } else { - element = delegateElement = $( element ); - this.bindings = this.bindings.add( element ); - } - - $.each( handlers, function( event, handler ) { - function handlerProxy() { - - // Allow widgets to customize the disabled handling - // - disabled as an array instead of boolean - // - disabled class as method for disabling individual parts - if ( !suppressDisabledCheck && - ( instance.options.disabled === true || - $( this ).hasClass( "ui-state-disabled" ) ) ) { - return; - } - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - - // Copy the guid so direct unbinding works - if ( typeof handler !== "string" ) { - handlerProxy.guid = handler.guid = - handler.guid || handlerProxy.guid || $.guid++; - } - - var match = event.match( /^([\w:-]*)\s*(.*)$/ ); - var eventName = match[ 1 ] + instance.eventNamespace; - var selector = match[ 2 ]; - - if ( selector ) { - delegateElement.on( eventName, selector, handlerProxy ); - } else { - element.on( eventName, handlerProxy ); - } - } ); - }, - - _off: function( element, eventName ) { - eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + - this.eventNamespace; - element.off( eventName ).off( eventName ); - - // Clear the stack to avoid memory leaks (#10056) - this.bindings = $( this.bindings.not( element ).get() ); - this.focusable = $( this.focusable.not( element ).get() ); - this.hoverable = $( this.hoverable.not( element ).get() ); - }, - - _delay: function( handler, delay ) { - function handlerProxy() { - return ( typeof handler === "string" ? instance[ handler ] : handler ) - .apply( instance, arguments ); - } - var instance = this; - return setTimeout( handlerProxy, delay || 0 ); - }, - - _hoverable: function( element ) { - this.hoverable = this.hoverable.add( element ); - this._on( element, { - mouseenter: function( event ) { - this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); - }, - mouseleave: function( event ) { - this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); - } - } ); - }, - - _focusable: function( element ) { - this.focusable = this.focusable.add( element ); - this._on( element, { - focusin: function( event ) { - this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); - }, - focusout: function( event ) { - this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); - } - } ); - }, - - _trigger: function( type, event, data ) { - var prop, orig; - var callback = this.options[ type ]; - - data = data || {}; - event = $.Event( event ); - event.type = ( type === this.widgetEventPrefix ? - type : - this.widgetEventPrefix + type ).toLowerCase(); - - // The original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[ 0 ]; - - // Copy original event properties over to the new event - orig = event.originalEvent; - if ( orig ) { - for ( prop in orig ) { - if ( !( prop in event ) ) { - event[ prop ] = orig[ prop ]; - } - } - } - - this.element.trigger( event, data ); - return !( $.isFunction( callback ) && - callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || - event.isDefaultPrevented() ); - } -}; - -$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { - $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { - if ( typeof options === "string" ) { - options = { effect: options }; - } - - var hasOptions; - var effectName = !options ? - method : - options === true || typeof options === "number" ? - defaultEffect : - options.effect || defaultEffect; - - options = options || {}; - if ( typeof options === "number" ) { - options = { duration: options }; - } - - hasOptions = !$.isEmptyObject( options ); - options.complete = callback; - - if ( options.delay ) { - element.delay( options.delay ); - } - - if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { - element[ method ]( options ); - } else if ( effectName !== method && element[ effectName ] ) { - element[ effectName ]( options.duration, options.easing, callback ); - } else { - element.queue( function( next ) { - $( this )[ method ](); - if ( callback ) { - callback.call( element[ 0 ] ); - } - next(); - } ); - } - }; -} ); - -var widget = $.widget; - - -/*! - * jQuery UI :data 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: :data Selector -//>>group: Core -//>>description: Selects elements which have data stored under the specified key. -//>>docs: http://api.jqueryui.com/data-selector/ - - -var data = $.extend( $.expr[ ":" ], { - data: $.expr.createPseudo ? - $.expr.createPseudo( function( dataName ) { - return function( elem ) { - return !!$.data( elem, dataName ); - }; - } ) : - - // Support: jQuery <1.8 - function( elem, i, match ) { - return !!$.data( elem, match[ 3 ] ); - } -} ); - -/*! - * jQuery UI Scroll Parent 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: scrollParent -//>>group: Core -//>>description: Get the closest ancestor element that is scrollable. -//>>docs: http://api.jqueryui.com/scrollParent/ - - - -var scrollParent = $.fn.scrollParent = function( includeHidden ) { - var position = this.css( "position" ), - excludeStaticParent = position === "absolute", - overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, - scrollParent = this.parents().filter( function() { - var parent = $( this ); - if ( excludeStaticParent && parent.css( "position" ) === "static" ) { - return false; - } - return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + - parent.css( "overflow-x" ) ); - } ).eq( 0 ); - - return position === "fixed" || !scrollParent.length ? - $( this[ 0 ].ownerDocument || document ) : - scrollParent; -}; - - - - -// This file is deprecated -var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); - -/*! - * jQuery UI Mouse 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Mouse -//>>group: Widgets -//>>description: Abstracts mouse-based interactions to assist in creating certain widgets. -//>>docs: http://api.jqueryui.com/mouse/ - - - -var mouseHandled = false; -$( document ).on( "mouseup", function() { - mouseHandled = false; -} ); - -var widgetsMouse = $.widget( "ui.mouse", { - version: "1.12.1", - options: { - cancel: "input, textarea, button, select, option", - distance: 1, - delay: 0 - }, - _mouseInit: function() { - var that = this; - - this.element - .on( "mousedown." + this.widgetName, function( event ) { - return that._mouseDown( event ); - } ) - .on( "click." + this.widgetName, function( event ) { - if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { - $.removeData( event.target, that.widgetName + ".preventClickEvent" ); - event.stopImmediatePropagation(); - return false; - } - } ); - - this.started = false; - }, - - // TODO: make sure destroying one instance of mouse doesn't mess with - // other instances of mouse - _mouseDestroy: function() { - this.element.off( "." + this.widgetName ); - if ( this._mouseMoveDelegate ) { - this.document - .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); - } - }, - - _mouseDown: function( event ) { - - // don't let more than one widget handle mouseStart - if ( mouseHandled ) { - return; - } - - this._mouseMoved = false; - - // We may have missed mouseup (out of window) - ( this._mouseStarted && this._mouseUp( event ) ); - - this._mouseDownEvent = event; - - var that = this, - btnIsLeft = ( event.which === 1 ), - - // event.target.nodeName works around a bug in IE 8 with - // disabled inputs (#7620) - elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? - $( event.target ).closest( this.options.cancel ).length : false ); - if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { - return true; - } - - this.mouseDelayMet = !this.options.delay; - if ( !this.mouseDelayMet ) { - this._mouseDelayTimer = setTimeout( function() { - that.mouseDelayMet = true; - }, this.options.delay ); - } - - if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { - this._mouseStarted = ( this._mouseStart( event ) !== false ); - if ( !this._mouseStarted ) { - event.preventDefault(); - return true; - } - } - - // Click event may never have fired (Gecko & Opera) - if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { - $.removeData( event.target, this.widgetName + ".preventClickEvent" ); - } - - // These delegates are required to keep context - this._mouseMoveDelegate = function( event ) { - return that._mouseMove( event ); - }; - this._mouseUpDelegate = function( event ) { - return that._mouseUp( event ); - }; - - this.document - .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); - - event.preventDefault(); - - mouseHandled = true; - return true; - }, - - _mouseMove: function( event ) { - - // Only check for mouseups outside the document if you've moved inside the document - // at least once. This prevents the firing of mouseup in the case of IE<9, which will - // fire a mousemove event if content is placed under the cursor. See #7778 - // Support: IE <9 - if ( this._mouseMoved ) { - - // IE mouseup check - mouseup happened when mouse was out of window - if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && - !event.button ) { - return this._mouseUp( event ); - - // Iframe mouseup check - mouseup occurred in another document - } else if ( !event.which ) { - - // Support: Safari <=8 - 9 - // Safari sets which to 0 if you press any of the following keys - // during a drag (#14461) - if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || - event.originalEvent.metaKey || event.originalEvent.shiftKey ) { - this.ignoreMissingWhich = true; - } else if ( !this.ignoreMissingWhich ) { - return this._mouseUp( event ); - } - } - } - - if ( event.which || event.button ) { - this._mouseMoved = true; - } - - if ( this._mouseStarted ) { - this._mouseDrag( event ); - return event.preventDefault(); - } - - if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { - this._mouseStarted = - ( this._mouseStart( this._mouseDownEvent, event ) !== false ); - ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) ); - } - - return !this._mouseStarted; - }, - - _mouseUp: function( event ) { - this.document - .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); - - if ( this._mouseStarted ) { - this._mouseStarted = false; - - if ( event.target === this._mouseDownEvent.target ) { - $.data( event.target, this.widgetName + ".preventClickEvent", true ); - } - - this._mouseStop( event ); - } - - if ( this._mouseDelayTimer ) { - clearTimeout( this._mouseDelayTimer ); - delete this._mouseDelayTimer; - } - - this.ignoreMissingWhich = false; - mouseHandled = false; - event.preventDefault(); - }, - - _mouseDistanceMet: function( event ) { - return ( Math.max( - Math.abs( this._mouseDownEvent.pageX - event.pageX ), - Math.abs( this._mouseDownEvent.pageY - event.pageY ) - ) >= this.options.distance - ); - }, - - _mouseDelayMet: function( /* event */ ) { - return this.mouseDelayMet; - }, - - // These are placeholder methods, to be overriden by extending plugin - _mouseStart: function( /* event */ ) {}, - _mouseDrag: function( /* event */ ) {}, - _mouseStop: function( /* event */ ) {}, - _mouseCapture: function( /* event */ ) { return true; } -} ); - - - - -// $.ui.plugin is deprecated. Use $.widget() extensions instead. -var plugin = $.ui.plugin = { - add: function( module, option, set ) { - var i, - proto = $.ui[ module ].prototype; - for ( i in set ) { - proto.plugins[ i ] = proto.plugins[ i ] || []; - proto.plugins[ i ].push( [ option, set[ i ] ] ); - } - }, - call: function( instance, name, args, allowDisconnected ) { - var i, - set = instance.plugins[ name ]; - - if ( !set ) { - return; - } - - if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || - instance.element[ 0 ].parentNode.nodeType === 11 ) ) { - return; - } - - for ( i = 0; i < set.length; i++ ) { - if ( instance.options[ set[ i ][ 0 ] ] ) { - set[ i ][ 1 ].apply( instance.element, args ); - } - } - } -}; - - - -var safeActiveElement = $.ui.safeActiveElement = function( document ) { - var activeElement; - - // Support: IE 9 only - // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> - try { - activeElement = document.activeElement; - } catch ( error ) { - activeElement = document.body; - } - - // Support: IE 9 - 11 only - // IE may return null instead of an element - // Interestingly, this only seems to occur when NOT in an iframe - if ( !activeElement ) { - activeElement = document.body; - } - - // Support: IE 11 only - // IE11 returns a seemingly empty object in some cases when accessing - // document.activeElement from an <iframe> - if ( !activeElement.nodeName ) { - activeElement = document.body; - } - - return activeElement; -}; - - - -var safeBlur = $.ui.safeBlur = function( element ) { - - // Support: IE9 - 10 only - // If the <body> is blurred, IE will switch windows, see #9420 - if ( element && element.nodeName.toLowerCase() !== "body" ) { - $( element ).trigger( "blur" ); - } -}; - - -/*! - * jQuery UI Draggable 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Draggable -//>>group: Interactions -//>>description: Enables dragging functionality for any element. -//>>docs: http://api.jqueryui.com/draggable/ -//>>demos: http://jqueryui.com/draggable/ -//>>css.structure: ../../themes/base/draggable.css - - - -$.widget( "ui.draggable", $.ui.mouse, { - version: "1.12.1", - widgetEventPrefix: "drag", - options: { - addClasses: true, - appendTo: "parent", - axis: false, - connectToSortable: false, - containment: false, - cursor: "auto", - cursorAt: false, - grid: false, - handle: false, - helper: "original", - iframeFix: false, - opacity: false, - refreshPositions: false, - revert: false, - revertDuration: 500, - scope: "default", - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - snap: false, - snapMode: "both", - snapTolerance: 20, - stack: false, - zIndex: false, - - // Callbacks - drag: null, - start: null, - stop: null - }, - _create: function() { - - if ( this.options.helper === "original" ) { - this._setPositionRelative(); - } - if ( this.options.addClasses ) { - this._addClass( "ui-draggable" ); - } - this._setHandleClassName(); - - this._mouseInit(); - }, - - _setOption: function( key, value ) { - this._super( key, value ); - if ( key === "handle" ) { - this._removeHandleClassName(); - this._setHandleClassName(); - } - }, - - _destroy: function() { - if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { - this.destroyOnClear = true; - return; - } - this._removeHandleClassName(); - this._mouseDestroy(); - }, - - _mouseCapture: function( event ) { - var o = this.options; - - // Among others, prevent a drag on a resizable-handle - if ( this.helper || o.disabled || - $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) { - return false; - } - - //Quit if we're not on a valid handle - this.handle = this._getHandle( event ); - if ( !this.handle ) { - return false; - } - - this._blurActiveElement( event ); - - this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); - - return true; - - }, - - _blockFrames: function( selector ) { - this.iframeBlocks = this.document.find( selector ).map( function() { - var iframe = $( this ); - - return $( "<div>" ) - .css( "position", "absolute" ) - .appendTo( iframe.parent() ) - .outerWidth( iframe.outerWidth() ) - .outerHeight( iframe.outerHeight() ) - .offset( iframe.offset() )[ 0 ]; - } ); - }, - - _unblockFrames: function() { - if ( this.iframeBlocks ) { - this.iframeBlocks.remove(); - delete this.iframeBlocks; - } - }, - - _blurActiveElement: function( event ) { - var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), - target = $( event.target ); - - // Don't blur if the event occurred on an element that is within - // the currently focused element - // See #10527, #12472 - if ( target.closest( activeElement ).length ) { - return; - } - - // Blur any element that currently has focus, see #4261 - $.ui.safeBlur( activeElement ); - }, - - _mouseStart: function( event ) { - - var o = this.options; - - //Create and append the visible helper - this.helper = this._createHelper( event ); - - this._addClass( this.helper, "ui-draggable-dragging" ); - - //Cache the helper size - this._cacheHelperProportions(); - - //If ddmanager is used for droppables, set the global draggable - if ( $.ui.ddmanager ) { - $.ui.ddmanager.current = this; - } - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Store the helper's css position - this.cssPosition = this.helper.css( "position" ); - this.scrollParent = this.helper.scrollParent( true ); - this.offsetParent = this.helper.offsetParent(); - this.hasFixedAncestor = this.helper.parents().filter( function() { - return $( this ).css( "position" ) === "fixed"; - } ).length > 0; - - //The element's absolute position on the page minus margins - this.positionAbs = this.element.offset(); - this._refreshOffsets( event ); - - //Generate the original position - this.originalPosition = this.position = this._generatePosition( event, false ); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if "cursorAt" is supplied - ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); - - //Set a containment if given in the options - this._setContainment(); - - //Trigger event + callbacks - if ( this._trigger( "start", event ) === false ) { - this._clear(); - return false; - } - - //Recache the helper size - this._cacheHelperProportions(); - - //Prepare the droppable offsets - if ( $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); - } - - // Execute the drag once - this causes the helper not to be visible before getting its - // correct position - this._mouseDrag( event, true ); - - // If the ddmanager is used for droppables, inform the manager that dragging has started - // (see #5003) - if ( $.ui.ddmanager ) { - $.ui.ddmanager.dragStart( this, event ); - } - - return true; - }, - - _refreshOffsets: function( event ) { - this.offset = { - top: this.positionAbs.top - this.margins.top, - left: this.positionAbs.left - this.margins.left, - scroll: false, - parent: this._getParentOffset(), - relative: this._getRelativeOffset() - }; - - this.offset.click = { - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }; - }, - - _mouseDrag: function( event, noPropagation ) { - - // reset any necessary cached properties (see #5009) - if ( this.hasFixedAncestor ) { - this.offset.parent = this._getParentOffset(); - } - - //Compute the helpers position - this.position = this._generatePosition( event, true ); - this.positionAbs = this._convertPositionTo( "absolute" ); - - //Call plugins and callbacks and use the resulting position if something is returned - if ( !noPropagation ) { - var ui = this._uiHash(); - if ( this._trigger( "drag", event, ui ) === false ) { - this._mouseUp( new $.Event( "mouseup", event ) ); - return false; - } - this.position = ui.position; - } - - this.helper[ 0 ].style.left = this.position.left + "px"; - this.helper[ 0 ].style.top = this.position.top + "px"; - - if ( $.ui.ddmanager ) { - $.ui.ddmanager.drag( this, event ); - } - - return false; - }, - - _mouseStop: function( event ) { - - //If we are using droppables, inform the manager about the drop - var that = this, - dropped = false; - if ( $.ui.ddmanager && !this.options.dropBehaviour ) { - dropped = $.ui.ddmanager.drop( this, event ); - } - - //if a drop comes from outside (a sortable) - if ( this.dropped ) { - dropped = this.dropped; - this.dropped = false; - } - - if ( ( this.options.revert === "invalid" && !dropped ) || - ( this.options.revert === "valid" && dropped ) || - this.options.revert === true || ( $.isFunction( this.options.revert ) && - this.options.revert.call( this.element, dropped ) ) - ) { - $( this.helper ).animate( - this.originalPosition, - parseInt( this.options.revertDuration, 10 ), - function() { - if ( that._trigger( "stop", event ) !== false ) { - that._clear(); - } - } - ); - } else { - if ( this._trigger( "stop", event ) !== false ) { - this._clear(); - } - } - - return false; - }, - - _mouseUp: function( event ) { - this._unblockFrames(); - - // If the ddmanager is used for droppables, inform the manager that dragging has stopped - // (see #5003) - if ( $.ui.ddmanager ) { - $.ui.ddmanager.dragStop( this, event ); - } - - // Only need to focus if the event occurred on the draggable itself, see #10527 - if ( this.handleElement.is( event.target ) ) { - - // The interaction is over; whether or not the click resulted in a drag, - // focus the element - this.element.trigger( "focus" ); - } - - return $.ui.mouse.prototype._mouseUp.call( this, event ); - }, - - cancel: function() { - - if ( this.helper.is( ".ui-draggable-dragging" ) ) { - this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) ); - } else { - this._clear(); - } - - return this; - - }, - - _getHandle: function( event ) { - return this.options.handle ? - !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : - true; - }, - - _setHandleClassName: function() { - this.handleElement = this.options.handle ? - this.element.find( this.options.handle ) : this.element; - this._addClass( this.handleElement, "ui-draggable-handle" ); - }, - - _removeHandleClassName: function() { - this._removeClass( this.handleElement, "ui-draggable-handle" ); - }, - - _createHelper: function( event ) { - - var o = this.options, - helperIsFunction = $.isFunction( o.helper ), - helper = helperIsFunction ? - $( o.helper.apply( this.element[ 0 ], [ event ] ) ) : - ( o.helper === "clone" ? - this.element.clone().removeAttr( "id" ) : - this.element ); - - if ( !helper.parents( "body" ).length ) { - helper.appendTo( ( o.appendTo === "parent" ? - this.element[ 0 ].parentNode : - o.appendTo ) ); - } - - // Http://bugs.jqueryui.com/ticket/9446 - // a helper function can return the original element - // which wouldn't have been set to relative in _create - if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) { - this._setPositionRelative(); - } - - if ( helper[ 0 ] !== this.element[ 0 ] && - !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) { - helper.css( "position", "absolute" ); - } - - return helper; - - }, - - _setPositionRelative: function() { - if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) { - this.element[ 0 ].style.position = "relative"; - } - }, - - _adjustOffsetFromHelper: function( obj ) { - if ( typeof obj === "string" ) { - obj = obj.split( " " ); - } - if ( $.isArray( obj ) ) { - obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; - } - if ( "left" in obj ) { - this.offset.click.left = obj.left + this.margins.left; - } - if ( "right" in obj ) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ( "top" in obj ) { - this.offset.click.top = obj.top + this.margins.top; - } - if ( "bottom" in obj ) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _isRootNode: function( element ) { - return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ]; - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - var po = this.offsetParent.offset(), - document = this.document[ 0 ]; - - // This is a special case where we need to modify a offset calculated on start, since the - // following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the - // next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't - // the document, which means that the scroll is included in the initial calculation of the - // offset of the parent, and never recalculated upon drag - if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - if ( this._isRootNode( this.offsetParent[ 0 ] ) ) { - po = { top: 0, left: 0 }; - } - - return { - top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), - left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) - }; - - }, - - _getRelativeOffset: function() { - if ( this.cssPosition !== "relative" ) { - return { top: 0, left: 0 }; - } - - var p = this.element.position(), - scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); - - return { - top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + - ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), - left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + - ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) - }; - - }, - - _cacheMargins: function() { - this.margins = { - left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ), - top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ), - right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ), - bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 ) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var isUserScrollable, c, ce, - o = this.options, - document = this.document[ 0 ]; - - this.relativeContainer = null; - - if ( !o.containment ) { - this.containment = null; - return; - } - - if ( o.containment === "window" ) { - this.containment = [ - $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, - $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, - $( window ).scrollLeft() + $( window ).width() - - this.helperProportions.width - this.margins.left, - $( window ).scrollTop() + - ( $( window ).height() || document.body.parentNode.scrollHeight ) - - this.helperProportions.height - this.margins.top - ]; - return; - } - - if ( o.containment === "document" ) { - this.containment = [ - 0, - 0, - $( document ).width() - this.helperProportions.width - this.margins.left, - ( $( document ).height() || document.body.parentNode.scrollHeight ) - - this.helperProportions.height - this.margins.top - ]; - return; - } - - if ( o.containment.constructor === Array ) { - this.containment = o.containment; - return; - } - - if ( o.containment === "parent" ) { - o.containment = this.helper[ 0 ].parentNode; - } - - c = $( o.containment ); - ce = c[ 0 ]; - - if ( !ce ) { - return; - } - - isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) ); - - this.containment = [ - ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + - ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), - ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + - ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), - ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - - this.helperProportions.width - - this.margins.left - - this.margins.right, - ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - - this.helperProportions.height - - this.margins.top - - this.margins.bottom - ]; - this.relativeContainer = c; - }, - - _convertPositionTo: function( d, pos ) { - - if ( !pos ) { - pos = this.position; - } - - var mod = d === "absolute" ? 1 : -1, - scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); - - return { - top: ( - - // The absolute mouse position - pos.top + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top * mod - - ( ( this.cssPosition === "fixed" ? - -this.offset.scroll.top : - ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod ) - ), - left: ( - - // The absolute mouse position - pos.left + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left * mod - - ( ( this.cssPosition === "fixed" ? - -this.offset.scroll.left : - ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod ) - ) - }; - - }, - - _generatePosition: function( event, constrainPosition ) { - - var containment, co, top, left, - o = this.options, - scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ), - pageX = event.pageX, - pageY = event.pageY; - - // Cache the scroll - if ( !scrollIsRootNode || !this.offset.scroll ) { - this.offset.scroll = { - top: this.scrollParent.scrollTop(), - left: this.scrollParent.scrollLeft() - }; - } - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - // If we are not dragging yet, we won't check for options - if ( constrainPosition ) { - if ( this.containment ) { - if ( this.relativeContainer ) { - co = this.relativeContainer.offset(); - containment = [ - this.containment[ 0 ] + co.left, - this.containment[ 1 ] + co.top, - this.containment[ 2 ] + co.left, - this.containment[ 3 ] + co.top - ]; - } else { - containment = this.containment; - } - - if ( event.pageX - this.offset.click.left < containment[ 0 ] ) { - pageX = containment[ 0 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top < containment[ 1 ] ) { - pageY = containment[ 1 ] + this.offset.click.top; - } - if ( event.pageX - this.offset.click.left > containment[ 2 ] ) { - pageX = containment[ 2 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top > containment[ 3 ] ) { - pageY = containment[ 3 ] + this.offset.click.top; - } - } - - if ( o.grid ) { - - //Check for grid elements set to 0 to prevent divide by 0 error causing invalid - // argument errors in IE (see ticket #6950) - top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY - - this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY; - pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] || - top - this.offset.click.top > containment[ 3 ] ) ? - top : - ( ( top - this.offset.click.top >= containment[ 1 ] ) ? - top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; - - left = o.grid[ 0 ] ? this.originalPageX + - Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] : - this.originalPageX; - pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] || - left - this.offset.click.left > containment[ 2 ] ) ? - left : - ( ( left - this.offset.click.left >= containment[ 0 ] ) ? - left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; - } - - if ( o.axis === "y" ) { - pageX = this.originalPageX; - } - - if ( o.axis === "x" ) { - pageY = this.originalPageY; - } - } - - return { - top: ( - - // The absolute mouse position - pageY - - - // Click offset (relative to the element) - this.offset.click.top - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top + - ( this.cssPosition === "fixed" ? - -this.offset.scroll.top : - ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) - ), - left: ( - - // The absolute mouse position - pageX - - - // Click offset (relative to the element) - this.offset.click.left - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left + - ( this.cssPosition === "fixed" ? - -this.offset.scroll.left : - ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) - ) - }; - - }, - - _clear: function() { - this._removeClass( this.helper, "ui-draggable-dragging" ); - if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) { - this.helper.remove(); - } - this.helper = null; - this.cancelHelperRemoval = false; - if ( this.destroyOnClear ) { - this.destroy(); - } - }, - - // From now on bulk stuff - mainly helpers - - _trigger: function( type, event, ui ) { - ui = ui || this._uiHash(); - $.ui.plugin.call( this, type, [ event, ui, this ], true ); - - // Absolute position and offset (see #6884 ) have to be recalculated after plugins - if ( /^(drag|start|stop)/.test( type ) ) { - this.positionAbs = this._convertPositionTo( "absolute" ); - ui.offset = this.positionAbs; - } - return $.Widget.prototype._trigger.call( this, type, event, ui ); - }, - - plugins: {}, - - _uiHash: function() { - return { - helper: this.helper, - position: this.position, - originalPosition: this.originalPosition, - offset: this.positionAbs - }; - } - -} ); - -$.ui.plugin.add( "draggable", "connectToSortable", { - start: function( event, ui, draggable ) { - var uiSortable = $.extend( {}, ui, { - item: draggable.element - } ); - - draggable.sortables = []; - $( draggable.options.connectToSortable ).each( function() { - var sortable = $( this ).sortable( "instance" ); - - if ( sortable && !sortable.options.disabled ) { - draggable.sortables.push( sortable ); - - // RefreshPositions is called at drag start to refresh the containerCache - // which is used in drag. This ensures it's initialized and synchronized - // with any changes that might have happened on the page since initialization. - sortable.refreshPositions(); - sortable._trigger( "activate", event, uiSortable ); - } - } ); - }, - stop: function( event, ui, draggable ) { - var uiSortable = $.extend( {}, ui, { - item: draggable.element - } ); - - draggable.cancelHelperRemoval = false; - - $.each( draggable.sortables, function() { - var sortable = this; - - if ( sortable.isOver ) { - sortable.isOver = 0; - - // Allow this sortable to handle removing the helper - draggable.cancelHelperRemoval = true; - sortable.cancelHelperRemoval = false; - - // Use _storedCSS To restore properties in the sortable, - // as this also handles revert (#9675) since the draggable - // may have modified them in unexpected ways (#8809) - sortable._storedCSS = { - position: sortable.placeholder.css( "position" ), - top: sortable.placeholder.css( "top" ), - left: sortable.placeholder.css( "left" ) - }; - - sortable._mouseStop( event ); - - // Once drag has ended, the sortable should return to using - // its original helper, not the shared helper from draggable - sortable.options.helper = sortable.options._helper; - } else { - - // Prevent this Sortable from removing the helper. - // However, don't set the draggable to remove the helper - // either as another connected Sortable may yet handle the removal. - sortable.cancelHelperRemoval = true; - - sortable._trigger( "deactivate", event, uiSortable ); - } - } ); - }, - drag: function( event, ui, draggable ) { - $.each( draggable.sortables, function() { - var innermostIntersecting = false, - sortable = this; - - // Copy over variables that sortable's _intersectsWith uses - sortable.positionAbs = draggable.positionAbs; - sortable.helperProportions = draggable.helperProportions; - sortable.offset.click = draggable.offset.click; - - if ( sortable._intersectsWith( sortable.containerCache ) ) { - innermostIntersecting = true; - - $.each( draggable.sortables, function() { - - // Copy over variables that sortable's _intersectsWith uses - this.positionAbs = draggable.positionAbs; - this.helperProportions = draggable.helperProportions; - this.offset.click = draggable.offset.click; - - if ( this !== sortable && - this._intersectsWith( this.containerCache ) && - $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) { - innermostIntersecting = false; - } - - return innermostIntersecting; - } ); - } - - if ( innermostIntersecting ) { - - // If it intersects, we use a little isOver variable and set it once, - // so that the move-in stuff gets fired only once. - if ( !sortable.isOver ) { - sortable.isOver = 1; - - // Store draggable's parent in case we need to reappend to it later. - draggable._parent = ui.helper.parent(); - - sortable.currentItem = ui.helper - .appendTo( sortable.element ) - .data( "ui-sortable-item", true ); - - // Store helper option to later restore it - sortable.options._helper = sortable.options.helper; - - sortable.options.helper = function() { - return ui.helper[ 0 ]; - }; - - // Fire the start events of the sortable with our passed browser event, - // and our own helper (so it doesn't create a new one) - event.target = sortable.currentItem[ 0 ]; - sortable._mouseCapture( event, true ); - sortable._mouseStart( event, true, true ); - - // Because the browser event is way off the new appended portlet, - // modify necessary variables to reflect the changes - sortable.offset.click.top = draggable.offset.click.top; - sortable.offset.click.left = draggable.offset.click.left; - sortable.offset.parent.left -= draggable.offset.parent.left - - sortable.offset.parent.left; - sortable.offset.parent.top -= draggable.offset.parent.top - - sortable.offset.parent.top; - - draggable._trigger( "toSortable", event ); - - // Inform draggable that the helper is in a valid drop zone, - // used solely in the revert option to handle "valid/invalid". - draggable.dropped = sortable.element; - - // Need to refreshPositions of all sortables in the case that - // adding to one sortable changes the location of the other sortables (#9675) - $.each( draggable.sortables, function() { - this.refreshPositions(); - } ); - - // Hack so receive/update callbacks work (mostly) - draggable.currentItem = draggable.element; - sortable.fromOutside = draggable; - } - - if ( sortable.currentItem ) { - sortable._mouseDrag( event ); - - // Copy the sortable's position because the draggable's can potentially reflect - // a relative position, while sortable is always absolute, which the dragged - // element has now become. (#8809) - ui.position = sortable.position; - } - } else { - - // If it doesn't intersect with the sortable, and it intersected before, - // we fake the drag stop of the sortable, but make sure it doesn't remove - // the helper by using cancelHelperRemoval. - if ( sortable.isOver ) { - - sortable.isOver = 0; - sortable.cancelHelperRemoval = true; - - // Calling sortable's mouseStop would trigger a revert, - // so revert must be temporarily false until after mouseStop is called. - sortable.options._revert = sortable.options.revert; - sortable.options.revert = false; - - sortable._trigger( "out", event, sortable._uiHash( sortable ) ); - sortable._mouseStop( event, true ); - - // Restore sortable behaviors that were modfied - // when the draggable entered the sortable area (#9481) - sortable.options.revert = sortable.options._revert; - sortable.options.helper = sortable.options._helper; - - if ( sortable.placeholder ) { - sortable.placeholder.remove(); - } - - // Restore and recalculate the draggable's offset considering the sortable - // may have modified them in unexpected ways. (#8809, #10669) - ui.helper.appendTo( draggable._parent ); - draggable._refreshOffsets( event ); - ui.position = draggable._generatePosition( event, true ); - - draggable._trigger( "fromSortable", event ); - - // Inform draggable that the helper is no longer in a valid drop zone - draggable.dropped = false; - - // Need to refreshPositions of all sortables just in case removing - // from one sortable changes the location of other sortables (#9675) - $.each( draggable.sortables, function() { - this.refreshPositions(); - } ); - } - } - } ); - } -} ); - -$.ui.plugin.add( "draggable", "cursor", { - start: function( event, ui, instance ) { - var t = $( "body" ), - o = instance.options; - - if ( t.css( "cursor" ) ) { - o._cursor = t.css( "cursor" ); - } - t.css( "cursor", o.cursor ); - }, - stop: function( event, ui, instance ) { - var o = instance.options; - if ( o._cursor ) { - $( "body" ).css( "cursor", o._cursor ); - } - } -} ); - -$.ui.plugin.add( "draggable", "opacity", { - start: function( event, ui, instance ) { - var t = $( ui.helper ), - o = instance.options; - if ( t.css( "opacity" ) ) { - o._opacity = t.css( "opacity" ); - } - t.css( "opacity", o.opacity ); - }, - stop: function( event, ui, instance ) { - var o = instance.options; - if ( o._opacity ) { - $( ui.helper ).css( "opacity", o._opacity ); - } - } -} ); - -$.ui.plugin.add( "draggable", "scroll", { - start: function( event, ui, i ) { - if ( !i.scrollParentNotHidden ) { - i.scrollParentNotHidden = i.helper.scrollParent( false ); - } - - if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && - i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { - i.overflowOffset = i.scrollParentNotHidden.offset(); - } - }, - drag: function( event, ui, i ) { - - var o = i.options, - scrolled = false, - scrollParent = i.scrollParentNotHidden[ 0 ], - document = i.document[ 0 ]; - - if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) { - if ( !o.axis || o.axis !== "x" ) { - if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < - o.scrollSensitivity ) { - scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed; - } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) { - scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed; - } - } - - if ( !o.axis || o.axis !== "y" ) { - if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < - o.scrollSensitivity ) { - scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed; - } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) { - scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed; - } - } - - } else { - - if ( !o.axis || o.axis !== "x" ) { - if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) { - scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed ); - } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) < - o.scrollSensitivity ) { - scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed ); - } - } - - if ( !o.axis || o.axis !== "y" ) { - if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) { - scrolled = $( document ).scrollLeft( - $( document ).scrollLeft() - o.scrollSpeed - ); - } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) < - o.scrollSensitivity ) { - scrolled = $( document ).scrollLeft( - $( document ).scrollLeft() + o.scrollSpeed - ); - } - } - - } - - if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( i, event ); - } - - } -} ); - -$.ui.plugin.add( "draggable", "snap", { - start: function( event, ui, i ) { - - var o = i.options; - - i.snapElements = []; - - $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap ) - .each( function() { - var $t = $( this ), - $o = $t.offset(); - if ( this !== i.element[ 0 ] ) { - i.snapElements.push( { - item: this, - width: $t.outerWidth(), height: $t.outerHeight(), - top: $o.top, left: $o.left - } ); - } - } ); - - }, - drag: function( event, ui, inst ) { - - var ts, bs, ls, rs, l, r, t, b, i, first, - o = inst.options, - d = o.snapTolerance, - x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, - y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; - - for ( i = inst.snapElements.length - 1; i >= 0; i-- ) { - - l = inst.snapElements[ i ].left - inst.margins.left; - r = l + inst.snapElements[ i ].width; - t = inst.snapElements[ i ].top - inst.margins.top; - b = t + inst.snapElements[ i ].height; - - if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || - !$.contains( inst.snapElements[ i ].item.ownerDocument, - inst.snapElements[ i ].item ) ) { - if ( inst.snapElements[ i ].snapping ) { - ( inst.options.snap.release && - inst.options.snap.release.call( - inst.element, - event, - $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) - ) ); - } - inst.snapElements[ i ].snapping = false; - continue; - } - - if ( o.snapMode !== "inner" ) { - ts = Math.abs( t - y2 ) <= d; - bs = Math.abs( b - y1 ) <= d; - ls = Math.abs( l - x2 ) <= d; - rs = Math.abs( r - x1 ) <= d; - if ( ts ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: t - inst.helperProportions.height, - left: 0 - } ).top; - } - if ( bs ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: b, - left: 0 - } ).top; - } - if ( ls ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: l - inst.helperProportions.width - } ).left; - } - if ( rs ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: r - } ).left; - } - } - - first = ( ts || bs || ls || rs ); - - if ( o.snapMode !== "outer" ) { - ts = Math.abs( t - y1 ) <= d; - bs = Math.abs( b - y2 ) <= d; - ls = Math.abs( l - x1 ) <= d; - rs = Math.abs( r - x2 ) <= d; - if ( ts ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: t, - left: 0 - } ).top; - } - if ( bs ) { - ui.position.top = inst._convertPositionTo( "relative", { - top: b - inst.helperProportions.height, - left: 0 - } ).top; - } - if ( ls ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: l - } ).left; - } - if ( rs ) { - ui.position.left = inst._convertPositionTo( "relative", { - top: 0, - left: r - inst.helperProportions.width - } ).left; - } - } - - if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { - ( inst.options.snap.snap && - inst.options.snap.snap.call( - inst.element, - event, - $.extend( inst._uiHash(), { - snapItem: inst.snapElements[ i ].item - } ) ) ); - } - inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); - - } - - } -} ); - -$.ui.plugin.add( "draggable", "stack", { - start: function( event, ui, instance ) { - var min, - o = instance.options, - group = $.makeArray( $( o.stack ) ).sort( function( a, b ) { - return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) - - ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); - } ); - - if ( !group.length ) { return; } - - min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; - $( group ).each( function( i ) { - $( this ).css( "zIndex", min + i ); - } ); - this.css( "zIndex", ( min + group.length ) ); - } -} ); - -$.ui.plugin.add( "draggable", "zIndex", { - start: function( event, ui, instance ) { - var t = $( ui.helper ), - o = instance.options; - - if ( t.css( "zIndex" ) ) { - o._zIndex = t.css( "zIndex" ); - } - t.css( "zIndex", o.zIndex ); - }, - stop: function( event, ui, instance ) { - var o = instance.options; - - if ( o._zIndex ) { - $( ui.helper ).css( "zIndex", o._zIndex ); - } - } -} ); - -var widgetsDraggable = $.ui.draggable; - - -/*! - * jQuery UI Droppable 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Droppable -//>>group: Interactions -//>>description: Enables drop targets for draggable elements. -//>>docs: http://api.jqueryui.com/droppable/ -//>>demos: http://jqueryui.com/droppable/ - - - -$.widget( "ui.droppable", { - version: "1.12.1", - widgetEventPrefix: "drop", - options: { - accept: "*", - addClasses: true, - greedy: false, - scope: "default", - tolerance: "intersect", - - // Callbacks - activate: null, - deactivate: null, - drop: null, - out: null, - over: null - }, - _create: function() { - - var proportions, - o = this.options, - accept = o.accept; - - this.isover = false; - this.isout = true; - - this.accept = $.isFunction( accept ) ? accept : function( d ) { - return d.is( accept ); - }; - - this.proportions = function( /* valueToWrite */ ) { - if ( arguments.length ) { - - // Store the droppable's proportions - proportions = arguments[ 0 ]; - } else { - - // Retrieve or derive the droppable's proportions - return proportions ? - proportions : - proportions = { - width: this.element[ 0 ].offsetWidth, - height: this.element[ 0 ].offsetHeight - }; - } - }; - - this._addToManager( o.scope ); - - o.addClasses && this._addClass( "ui-droppable" ); - - }, - - _addToManager: function( scope ) { - - // Add the reference and positions to the manager - $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || []; - $.ui.ddmanager.droppables[ scope ].push( this ); - }, - - _splice: function( drop ) { - var i = 0; - for ( ; i < drop.length; i++ ) { - if ( drop[ i ] === this ) { - drop.splice( i, 1 ); - } - } - }, - - _destroy: function() { - var drop = $.ui.ddmanager.droppables[ this.options.scope ]; - - this._splice( drop ); - }, - - _setOption: function( key, value ) { - - if ( key === "accept" ) { - this.accept = $.isFunction( value ) ? value : function( d ) { - return d.is( value ); - }; - } else if ( key === "scope" ) { - var drop = $.ui.ddmanager.droppables[ this.options.scope ]; - - this._splice( drop ); - this._addToManager( value ); - } - - this._super( key, value ); - }, - - _activate: function( event ) { - var draggable = $.ui.ddmanager.current; - - this._addActiveClass(); - if ( draggable ) { - this._trigger( "activate", event, this.ui( draggable ) ); - } - }, - - _deactivate: function( event ) { - var draggable = $.ui.ddmanager.current; - - this._removeActiveClass(); - if ( draggable ) { - this._trigger( "deactivate", event, this.ui( draggable ) ); - } - }, - - _over: function( event ) { - - var draggable = $.ui.ddmanager.current; - - // Bail if draggable and droppable are same element - if ( !draggable || ( draggable.currentItem || - draggable.element )[ 0 ] === this.element[ 0 ] ) { - return; - } - - if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || - draggable.element ) ) ) { - this._addHoverClass(); - this._trigger( "over", event, this.ui( draggable ) ); - } - - }, - - _out: function( event ) { - - var draggable = $.ui.ddmanager.current; - - // Bail if draggable and droppable are same element - if ( !draggable || ( draggable.currentItem || - draggable.element )[ 0 ] === this.element[ 0 ] ) { - return; - } - - if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || - draggable.element ) ) ) { - this._removeHoverClass(); - this._trigger( "out", event, this.ui( draggable ) ); - } - - }, - - _drop: function( event, custom ) { - - var draggable = custom || $.ui.ddmanager.current, - childrenIntersection = false; - - // Bail if draggable and droppable are same element - if ( !draggable || ( draggable.currentItem || - draggable.element )[ 0 ] === this.element[ 0 ] ) { - return false; - } - - this.element - .find( ":data(ui-droppable)" ) - .not( ".ui-draggable-dragging" ) - .each( function() { - var inst = $( this ).droppable( "instance" ); - if ( - inst.options.greedy && - !inst.options.disabled && - inst.options.scope === draggable.options.scope && - inst.accept.call( - inst.element[ 0 ], ( draggable.currentItem || draggable.element ) - ) && - intersect( - draggable, - $.extend( inst, { offset: inst.element.offset() } ), - inst.options.tolerance, event - ) - ) { - childrenIntersection = true; - return false; } - } ); - if ( childrenIntersection ) { - return false; - } - - if ( this.accept.call( this.element[ 0 ], - ( draggable.currentItem || draggable.element ) ) ) { - this._removeActiveClass(); - this._removeHoverClass(); - - this._trigger( "drop", event, this.ui( draggable ) ); - return this.element; - } - - return false; - - }, - - ui: function( c ) { - return { - draggable: ( c.currentItem || c.element ), - helper: c.helper, - position: c.position, - offset: c.positionAbs - }; - }, - - // Extension points just to make backcompat sane and avoid duplicating logic - // TODO: Remove in 1.13 along with call to it below - _addHoverClass: function() { - this._addClass( "ui-droppable-hover" ); - }, - - _removeHoverClass: function() { - this._removeClass( "ui-droppable-hover" ); - }, - - _addActiveClass: function() { - this._addClass( "ui-droppable-active" ); - }, - - _removeActiveClass: function() { - this._removeClass( "ui-droppable-active" ); - } -} ); - -var intersect = $.ui.intersect = ( function() { - function isOverAxis( x, reference, size ) { - return ( x >= reference ) && ( x < ( reference + size ) ); - } - - return function( draggable, droppable, toleranceMode, event ) { - - if ( !droppable.offset ) { - return false; - } - - var x1 = ( draggable.positionAbs || - draggable.position.absolute ).left + draggable.margins.left, - y1 = ( draggable.positionAbs || - draggable.position.absolute ).top + draggable.margins.top, - x2 = x1 + draggable.helperProportions.width, - y2 = y1 + draggable.helperProportions.height, - l = droppable.offset.left, - t = droppable.offset.top, - r = l + droppable.proportions().width, - b = t + droppable.proportions().height; - - switch ( toleranceMode ) { - case "fit": - return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b ); - case "intersect": - return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half - x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half - t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half - y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half - case "pointer": - return isOverAxis( event.pageY, t, droppable.proportions().height ) && - isOverAxis( event.pageX, l, droppable.proportions().width ); - case "touch": - return ( - ( y1 >= t && y1 <= b ) || // Top edge touching - ( y2 >= t && y2 <= b ) || // Bottom edge touching - ( y1 < t && y2 > b ) // Surrounded vertically - ) && ( - ( x1 >= l && x1 <= r ) || // Left edge touching - ( x2 >= l && x2 <= r ) || // Right edge touching - ( x1 < l && x2 > r ) // Surrounded horizontally - ); - default: - return false; - } - }; -} )(); - -/* - This manager tracks offsets of draggables and droppables -*/ -$.ui.ddmanager = { - current: null, - droppables: { "default": [] }, - prepareOffsets: function( t, event ) { - - var i, j, - m = $.ui.ddmanager.droppables[ t.options.scope ] || [], - type = event ? event.type : null, // workaround for #2317 - list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack(); - - droppablesLoop: for ( i = 0; i < m.length; i++ ) { - - // No disabled and non-accepted - if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], - ( t.currentItem || t.element ) ) ) ) { - continue; - } - - // Filter out elements in the current dragged item - for ( j = 0; j < list.length; j++ ) { - if ( list[ j ] === m[ i ].element[ 0 ] ) { - m[ i ].proportions().height = 0; - continue droppablesLoop; - } - } - - m[ i ].visible = m[ i ].element.css( "display" ) !== "none"; - if ( !m[ i ].visible ) { - continue; - } - - // Activate the droppable if used directly from draggables - if ( type === "mousedown" ) { - m[ i ]._activate.call( m[ i ], event ); - } - - m[ i ].offset = m[ i ].element.offset(); - m[ i ].proportions( { - width: m[ i ].element[ 0 ].offsetWidth, - height: m[ i ].element[ 0 ].offsetHeight - } ); - - } - - }, - drop: function( draggable, event ) { - - var dropped = false; - - // Create a copy of the droppables in case the list changes during the drop (#9116) - $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() { - - if ( !this.options ) { - return; - } - if ( !this.options.disabled && this.visible && - intersect( draggable, this, this.options.tolerance, event ) ) { - dropped = this._drop.call( this, event ) || dropped; - } - - if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], - ( draggable.currentItem || draggable.element ) ) ) { - this.isout = true; - this.isover = false; - this._deactivate.call( this, event ); - } - - } ); - return dropped; - - }, - dragStart: function( draggable, event ) { - - // Listen for scrolling so that if the dragging causes scrolling the position of the - // droppables can be recalculated (see #5003) - draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() { - if ( !draggable.options.refreshPositions ) { - $.ui.ddmanager.prepareOffsets( draggable, event ); - } - } ); - }, - drag: function( draggable, event ) { - - // If you have a highly dynamic page, you might try this option. It renders positions - // every time you move the mouse. - if ( draggable.options.refreshPositions ) { - $.ui.ddmanager.prepareOffsets( draggable, event ); - } - - // Run through all droppables and check their positions based on specific tolerance options - $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() { - - if ( this.options.disabled || this.greedyChild || !this.visible ) { - return; - } - - var parentInstance, scope, parent, - intersects = intersect( draggable, this, this.options.tolerance, event ), - c = !intersects && this.isover ? - "isout" : - ( intersects && !this.isover ? "isover" : null ); - if ( !c ) { - return; - } - - if ( this.options.greedy ) { - - // find droppable parents with same scope - scope = this.options.scope; - parent = this.element.parents( ":data(ui-droppable)" ).filter( function() { - return $( this ).droppable( "instance" ).options.scope === scope; - } ); - - if ( parent.length ) { - parentInstance = $( parent[ 0 ] ).droppable( "instance" ); - parentInstance.greedyChild = ( c === "isover" ); - } - } - - // We just moved into a greedy child - if ( parentInstance && c === "isover" ) { - parentInstance.isover = false; - parentInstance.isout = true; - parentInstance._out.call( parentInstance, event ); - } - - this[ c ] = true; - this[ c === "isout" ? "isover" : "isout" ] = false; - this[ c === "isover" ? "_over" : "_out" ].call( this, event ); - - // We just moved out of a greedy child - if ( parentInstance && c === "isout" ) { - parentInstance.isout = false; - parentInstance.isover = true; - parentInstance._over.call( parentInstance, event ); - } - } ); - - }, - dragStop: function( draggable, event ) { - draggable.element.parentsUntil( "body" ).off( "scroll.droppable" ); - - // Call prepareOffsets one final time since IE does not fire return scroll events when - // overflow was caused by drag (see #5003) - if ( !draggable.options.refreshPositions ) { - $.ui.ddmanager.prepareOffsets( draggable, event ); - } - } -}; - -// DEPRECATED -// TODO: switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat !== false ) { - - // Backcompat for activeClass and hoverClass options - $.widget( "ui.droppable", $.ui.droppable, { - options: { - hoverClass: false, - activeClass: false - }, - _addActiveClass: function() { - this._super(); - if ( this.options.activeClass ) { - this.element.addClass( this.options.activeClass ); - } - }, - _removeActiveClass: function() { - this._super(); - if ( this.options.activeClass ) { - this.element.removeClass( this.options.activeClass ); - } - }, - _addHoverClass: function() { - this._super(); - if ( this.options.hoverClass ) { - this.element.addClass( this.options.hoverClass ); - } - }, - _removeHoverClass: function() { - this._super(); - if ( this.options.hoverClass ) { - this.element.removeClass( this.options.hoverClass ); - } - } - } ); -} - -var widgetsDroppable = $.ui.droppable; - - -/*! - * jQuery UI Sortable 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Sortable -//>>group: Interactions -//>>description: Enables items in a list to be sorted using the mouse. -//>>docs: http://api.jqueryui.com/sortable/ -//>>demos: http://jqueryui.com/sortable/ -//>>css.structure: ../../themes/base/sortable.css - - - -var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, { - version: "1.12.1", - widgetEventPrefix: "sort", - ready: false, - options: { - appendTo: "parent", - axis: false, - connectWith: false, - containment: false, - cursor: "auto", - cursorAt: false, - dropOnEmpty: true, - forcePlaceholderSize: false, - forceHelperSize: false, - grid: false, - handle: false, - helper: "original", - items: "> *", - opacity: false, - placeholder: false, - revert: false, - scroll: true, - scrollSensitivity: 20, - scrollSpeed: 20, - scope: "default", - tolerance: "intersect", - zIndex: 1000, - - // Callbacks - activate: null, - beforeStop: null, - change: null, - deactivate: null, - out: null, - over: null, - receive: null, - remove: null, - sort: null, - start: null, - stop: null, - update: null - }, - - _isOverAxis: function( x, reference, size ) { - return ( x >= reference ) && ( x < ( reference + size ) ); - }, - - _isFloating: function( item ) { - return ( /left|right/ ).test( item.css( "float" ) ) || - ( /inline|table-cell/ ).test( item.css( "display" ) ); - }, - - _create: function() { - this.containerCache = {}; - this._addClass( "ui-sortable" ); - - //Get the items - this.refresh(); - - //Let's determine the parent's offset - this.offset = this.element.offset(); - - //Initialize mouse events for interaction - this._mouseInit(); - - this._setHandleClassName(); - - //We're ready to go - this.ready = true; - - }, - - _setOption: function( key, value ) { - this._super( key, value ); - - if ( key === "handle" ) { - this._setHandleClassName(); - } - }, - - _setHandleClassName: function() { - var that = this; - this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" ); - $.each( this.items, function() { - that._addClass( - this.instance.options.handle ? - this.item.find( this.instance.options.handle ) : - this.item, - "ui-sortable-handle" - ); - } ); - }, - - _destroy: function() { - this._mouseDestroy(); - - for ( var i = this.items.length - 1; i >= 0; i-- ) { - this.items[ i ].item.removeData( this.widgetName + "-item" ); - } - - return this; - }, - - _mouseCapture: function( event, overrideHandle ) { - var currentItem = null, - validHandle = false, - that = this; - - if ( this.reverting ) { - return false; - } - - if ( this.options.disabled || this.options.type === "static" ) { - return false; - } - - //We have to refresh the items data once first - this._refreshItems( event ); - - //Find out if the clicked node (or one of its parents) is a actual item in this.items - $( event.target ).parents().each( function() { - if ( $.data( this, that.widgetName + "-item" ) === that ) { - currentItem = $( this ); - return false; - } - } ); - if ( $.data( event.target, that.widgetName + "-item" ) === that ) { - currentItem = $( event.target ); - } - - if ( !currentItem ) { - return false; - } - if ( this.options.handle && !overrideHandle ) { - $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() { - if ( this === event.target ) { - validHandle = true; - } - } ); - if ( !validHandle ) { - return false; - } - } - - this.currentItem = currentItem; - this._removeCurrentsFromItems(); - return true; - - }, - - _mouseStart: function( event, overrideHandle, noActivation ) { - - var i, body, - o = this.options; - - this.currentContainer = this; - - //We only need to call refreshPositions, because the refreshItems call has been moved to - // mouseCapture - this.refreshPositions(); - - //Create and append the visible helper - this.helper = this._createHelper( event ); - - //Cache the helper size - this._cacheHelperProportions(); - - /* - * - Position generation - - * This block generates everything position related - it's the core of draggables. - */ - - //Cache the margins of the original element - this._cacheMargins(); - - //Get the next scrolling parent - this.scrollParent = this.helper.scrollParent(); - - //The element's absolute position on the page minus margins - this.offset = this.currentItem.offset(); - this.offset = { - top: this.offset.top - this.margins.top, - left: this.offset.left - this.margins.left - }; - - $.extend( this.offset, { - click: { //Where the click happened, relative to the element - left: event.pageX - this.offset.left, - top: event.pageY - this.offset.top - }, - parent: this._getParentOffset(), - - // This is a relative to absolute position minus the actual position calculation - - // only used for relative positioned helper - relative: this._getRelativeOffset() - } ); - - // Only after we got the offset, we can change the helper's position to absolute - // TODO: Still need to figure out a way to make relative sorting possible - this.helper.css( "position", "absolute" ); - this.cssPosition = this.helper.css( "position" ); - - //Generate the original position - this.originalPosition = this._generatePosition( event ); - this.originalPageX = event.pageX; - this.originalPageY = event.pageY; - - //Adjust the mouse offset relative to the helper if "cursorAt" is supplied - ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); - - //Cache the former DOM position - this.domPosition = { - prev: this.currentItem.prev()[ 0 ], - parent: this.currentItem.parent()[ 0 ] - }; - - // If the helper is not the original, hide the original so it's not playing any role during - // the drag, won't cause anything bad this way - if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { - this.currentItem.hide(); - } - - //Create the placeholder - this._createPlaceholder(); - - //Set a containment if given in the options - if ( o.containment ) { - this._setContainment(); - } - - if ( o.cursor && o.cursor !== "auto" ) { // cursor option - body = this.document.find( "body" ); - - // Support: IE - this.storedCursor = body.css( "cursor" ); - body.css( "cursor", o.cursor ); - - this.storedStylesheet = - $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body ); - } - - if ( o.opacity ) { // opacity option - if ( this.helper.css( "opacity" ) ) { - this._storedOpacity = this.helper.css( "opacity" ); - } - this.helper.css( "opacity", o.opacity ); - } - - if ( o.zIndex ) { // zIndex option - if ( this.helper.css( "zIndex" ) ) { - this._storedZIndex = this.helper.css( "zIndex" ); - } - this.helper.css( "zIndex", o.zIndex ); - } - - //Prepare scrolling - if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ].tagName !== "HTML" ) { - this.overflowOffset = this.scrollParent.offset(); - } - - //Call callbacks - this._trigger( "start", event, this._uiHash() ); - - //Recache the helper size - if ( !this._preserveHelperProportions ) { - this._cacheHelperProportions(); - } - - //Post "activate" events to possible containers - if ( !noActivation ) { - for ( i = this.containers.length - 1; i >= 0; i-- ) { - this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); - } - } - - //Prepare possible droppables - if ( $.ui.ddmanager ) { - $.ui.ddmanager.current = this; - } - - if ( $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); - } - - this.dragging = true; - - this._addClass( this.helper, "ui-sortable-helper" ); - - // Execute the drag once - this causes the helper not to be visiblebefore getting its - // correct position - this._mouseDrag( event ); - return true; - - }, - - _mouseDrag: function( event ) { - var i, item, itemElement, intersection, - o = this.options, - scrolled = false; - - //Compute the helpers position - this.position = this._generatePosition( event ); - this.positionAbs = this._convertPositionTo( "absolute" ); - - if ( !this.lastPositionAbs ) { - this.lastPositionAbs = this.positionAbs; - } - - //Do scrolling - if ( this.options.scroll ) { - if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ].tagName !== "HTML" ) { - - if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - - event.pageY < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollTop = - scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; - } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollTop = - scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; - } - - if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - - event.pageX < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollLeft = scrolled = - this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; - } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollLeft = scrolled = - this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; - } - - } else { - - if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { - scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); - } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < - o.scrollSensitivity ) { - scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); - } - - if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { - scrolled = this.document.scrollLeft( - this.document.scrollLeft() - o.scrollSpeed - ); - } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < - o.scrollSensitivity ) { - scrolled = this.document.scrollLeft( - this.document.scrollLeft() + o.scrollSpeed - ); - } - - } - - if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); - } - } - - //Regenerate the absolute position used for position checks - this.positionAbs = this._convertPositionTo( "absolute" ); - - //Set the helper position - if ( !this.options.axis || this.options.axis !== "y" ) { - this.helper[ 0 ].style.left = this.position.left + "px"; - } - if ( !this.options.axis || this.options.axis !== "x" ) { - this.helper[ 0 ].style.top = this.position.top + "px"; - } - - //Rearrange - for ( i = this.items.length - 1; i >= 0; i-- ) { - - //Cache variables and intersection, continue if no intersection - item = this.items[ i ]; - itemElement = item.item[ 0 ]; - intersection = this._intersectsWithPointer( item ); - if ( !intersection ) { - continue; - } - - // Only put the placeholder inside the current Container, skip all - // items from other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this, moving items in "sub-sortables" can cause - // the placeholder to jitter between the outer and inner container. - if ( item.instance !== this.currentContainer ) { - continue; - } - - // Cannot intersect with itself - // no useless actions that have been done before - // no action if the item moved is the parent of the item checked - if ( itemElement !== this.currentItem[ 0 ] && - this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement && - !$.contains( this.placeholder[ 0 ], itemElement ) && - ( this.options.type === "semi-dynamic" ? - !$.contains( this.element[ 0 ], itemElement ) : - true - ) - ) { - - this.direction = intersection === 1 ? "down" : "up"; - - if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) { - this._rearrange( event, item ); - } else { - break; - } - - this._trigger( "change", event, this._uiHash() ); - break; - } - } - - //Post events to containers - this._contactContainers( event ); - - //Interconnect with droppables - if ( $.ui.ddmanager ) { - $.ui.ddmanager.drag( this, event ); - } - - //Call callbacks - this._trigger( "sort", event, this._uiHash() ); - - this.lastPositionAbs = this.positionAbs; - return false; - - }, - - _mouseStop: function( event, noPropagation ) { - - if ( !event ) { - return; - } - - //If we are using droppables, inform the manager about the drop - if ( $.ui.ddmanager && !this.options.dropBehaviour ) { - $.ui.ddmanager.drop( this, event ); - } - - if ( this.options.revert ) { - var that = this, - cur = this.placeholder.offset(), - axis = this.options.axis, - animation = {}; - - if ( !axis || axis === "x" ) { - animation.left = cur.left - this.offset.parent.left - this.margins.left + - ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? - 0 : - this.offsetParent[ 0 ].scrollLeft - ); - } - if ( !axis || axis === "y" ) { - animation.top = cur.top - this.offset.parent.top - this.margins.top + - ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? - 0 : - this.offsetParent[ 0 ].scrollTop - ); - } - this.reverting = true; - $( this.helper ).animate( - animation, - parseInt( this.options.revert, 10 ) || 500, - function() { - that._clear( event ); - } - ); - } else { - this._clear( event, noPropagation ); - } - - return false; - - }, - - cancel: function() { - - if ( this.dragging ) { - - this._mouseUp( new $.Event( "mouseup", { target: null } ) ); - - if ( this.options.helper === "original" ) { - this.currentItem.css( this._storedCSS ); - this._removeClass( this.currentItem, "ui-sortable-helper" ); - } else { - this.currentItem.show(); - } - - //Post deactivating events to containers - for ( var i = this.containers.length - 1; i >= 0; i-- ) { - this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); - if ( this.containers[ i ].containerCache.over ) { - this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); - this.containers[ i ].containerCache.over = 0; - } - } - - } - - if ( this.placeholder ) { - - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, - // it unbinds ALL events from the original node! - if ( this.placeholder[ 0 ].parentNode ) { - this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); - } - if ( this.options.helper !== "original" && this.helper && - this.helper[ 0 ].parentNode ) { - this.helper.remove(); - } - - $.extend( this, { - helper: null, - dragging: false, - reverting: false, - _noFinalSort: null - } ); - - if ( this.domPosition.prev ) { - $( this.domPosition.prev ).after( this.currentItem ); - } else { - $( this.domPosition.parent ).prepend( this.currentItem ); - } - } - - return this; - - }, - - serialize: function( o ) { - - var items = this._getItemsAsjQuery( o && o.connected ), - str = []; - o = o || {}; - - $( items ).each( function() { - var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) - .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); - if ( res ) { - str.push( - ( o.key || res[ 1 ] + "[]" ) + - "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); - } - } ); - - if ( !str.length && o.key ) { - str.push( o.key + "=" ); - } - - return str.join( "&" ); - - }, - - toArray: function( o ) { - - var items = this._getItemsAsjQuery( o && o.connected ), - ret = []; - - o = o || {}; - - items.each( function() { - ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); - } ); - return ret; - - }, - - /* Be careful with the following core functions */ - _intersectsWith: function( item ) { - - var x1 = this.positionAbs.left, - x2 = x1 + this.helperProportions.width, - y1 = this.positionAbs.top, - y2 = y1 + this.helperProportions.height, - l = item.left, - r = l + item.width, - t = item.top, - b = t + item.height, - dyClick = this.offset.click.top, - dxClick = this.offset.click.left, - isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && - ( y1 + dyClick ) < b ), - isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && - ( x1 + dxClick ) < r ), - isOverElement = isOverElementHeight && isOverElementWidth; - - if ( this.options.tolerance === "pointer" || - this.options.forcePointerForContainers || - ( this.options.tolerance !== "pointer" && - this.helperProportions[ this.floating ? "width" : "height" ] > - item[ this.floating ? "width" : "height" ] ) - ) { - return isOverElement; - } else { - - return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half - x2 - ( this.helperProportions.width / 2 ) < r && // Left Half - t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half - y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half - - } - }, - - _intersectsWithPointer: function( item ) { - var verticalDirection, horizontalDirection, - isOverElementHeight = ( this.options.axis === "x" ) || - this._isOverAxis( - this.positionAbs.top + this.offset.click.top, item.top, item.height ), - isOverElementWidth = ( this.options.axis === "y" ) || - this._isOverAxis( - this.positionAbs.left + this.offset.click.left, item.left, item.width ), - isOverElement = isOverElementHeight && isOverElementWidth; - - if ( !isOverElement ) { - return false; - } - - verticalDirection = this._getDragVerticalDirection(); - horizontalDirection = this._getDragHorizontalDirection(); - - return this.floating ? - ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) - : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); - - }, - - _intersectsWithSides: function( item ) { - - var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + - this.offset.click.top, item.top + ( item.height / 2 ), item.height ), - isOverRightHalf = this._isOverAxis( this.positionAbs.left + - this.offset.click.left, item.left + ( item.width / 2 ), item.width ), - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - - if ( this.floating && horizontalDirection ) { - return ( ( horizontalDirection === "right" && isOverRightHalf ) || - ( horizontalDirection === "left" && !isOverRightHalf ) ); - } else { - return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || - ( verticalDirection === "up" && !isOverBottomHalf ) ); - } - - }, - - _getDragVerticalDirection: function() { - var delta = this.positionAbs.top - this.lastPositionAbs.top; - return delta !== 0 && ( delta > 0 ? "down" : "up" ); - }, - - _getDragHorizontalDirection: function() { - var delta = this.positionAbs.left - this.lastPositionAbs.left; - return delta !== 0 && ( delta > 0 ? "right" : "left" ); - }, - - refresh: function( event ) { - this._refreshItems( event ); - this._setHandleClassName(); - this.refreshPositions(); - return this; - }, - - _connectWith: function() { - var options = this.options; - return options.connectWith.constructor === String ? - [ options.connectWith ] : - options.connectWith; - }, - - _getItemsAsjQuery: function( connected ) { - - var i, j, cur, inst, - items = [], - queries = [], - connectWith = this._connectWith(); - - if ( connectWith && connected ) { - for ( i = connectWith.length - 1; i >= 0; i-- ) { - cur = $( connectWith[ i ], this.document[ 0 ] ); - for ( j = cur.length - 1; j >= 0; j-- ) { - inst = $.data( cur[ j ], this.widgetFullName ); - if ( inst && inst !== this && !inst.options.disabled ) { - queries.push( [ $.isFunction( inst.options.items ) ? - inst.options.items.call( inst.element ) : - $( inst.options.items, inst.element ) - .not( ".ui-sortable-helper" ) - .not( ".ui-sortable-placeholder" ), inst ] ); - } - } - } - } - - queries.push( [ $.isFunction( this.options.items ) ? - this.options.items - .call( this.element, null, { options: this.options, item: this.currentItem } ) : - $( this.options.items, this.element ) - .not( ".ui-sortable-helper" ) - .not( ".ui-sortable-placeholder" ), this ] ); - - function addItems() { - items.push( this ); - } - for ( i = queries.length - 1; i >= 0; i-- ) { - queries[ i ][ 0 ].each( addItems ); - } - - return $( items ); - - }, - - _removeCurrentsFromItems: function() { - - var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); - - this.items = $.grep( this.items, function( item ) { - for ( var j = 0; j < list.length; j++ ) { - if ( list[ j ] === item.item[ 0 ] ) { - return false; - } - } - return true; - } ); - - }, - - _refreshItems: function( event ) { - - this.items = []; - this.containers = [ this ]; - - var i, j, cur, inst, targetData, _queries, item, queriesLength, - items = this.items, - queries = [ [ $.isFunction( this.options.items ) ? - this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : - $( this.options.items, this.element ), this ] ], - connectWith = this._connectWith(); - - //Shouldn't be run the first time through due to massive slow-down - if ( connectWith && this.ready ) { - for ( i = connectWith.length - 1; i >= 0; i-- ) { - cur = $( connectWith[ i ], this.document[ 0 ] ); - for ( j = cur.length - 1; j >= 0; j-- ) { - inst = $.data( cur[ j ], this.widgetFullName ); - if ( inst && inst !== this && !inst.options.disabled ) { - queries.push( [ $.isFunction( inst.options.items ) ? - inst.options.items - .call( inst.element[ 0 ], event, { item: this.currentItem } ) : - $( inst.options.items, inst.element ), inst ] ); - this.containers.push( inst ); - } - } - } - } - - for ( i = queries.length - 1; i >= 0; i-- ) { - targetData = queries[ i ][ 1 ]; - _queries = queries[ i ][ 0 ]; - - for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { - item = $( _queries[ j ] ); - - // Data for target checking (mouse manager) - item.data( this.widgetName + "-item", targetData ); - - items.push( { - item: item, - instance: targetData, - width: 0, height: 0, - left: 0, top: 0 - } ); - } - } - - }, - - refreshPositions: function( fast ) { - - // Determine whether items are being displayed horizontally - this.floating = this.items.length ? - this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : - false; - - //This has to be redone because due to the item being moved out/into the offsetParent, - // the offsetParent's position will change - if ( this.offsetParent && this.helper ) { - this.offset.parent = this._getParentOffset(); - } - - var i, item, t, p; - - for ( i = this.items.length - 1; i >= 0; i-- ) { - item = this.items[ i ]; - - //We ignore calculating positions of all connected containers when we're not over them - if ( item.instance !== this.currentContainer && this.currentContainer && - item.item[ 0 ] !== this.currentItem[ 0 ] ) { - continue; - } - - t = this.options.toleranceElement ? - $( this.options.toleranceElement, item.item ) : - item.item; - - if ( !fast ) { - item.width = t.outerWidth(); - item.height = t.outerHeight(); - } - - p = t.offset(); - item.left = p.left; - item.top = p.top; - } - - if ( this.options.custom && this.options.custom.refreshContainers ) { - this.options.custom.refreshContainers.call( this ); - } else { - for ( i = this.containers.length - 1; i >= 0; i-- ) { - p = this.containers[ i ].element.offset(); - this.containers[ i ].containerCache.left = p.left; - this.containers[ i ].containerCache.top = p.top; - this.containers[ i ].containerCache.width = - this.containers[ i ].element.outerWidth(); - this.containers[ i ].containerCache.height = - this.containers[ i ].element.outerHeight(); - } - } - - return this; - }, - - _createPlaceholder: function( that ) { - that = that || this; - var className, - o = that.options; - - if ( !o.placeholder || o.placeholder.constructor === String ) { - className = o.placeholder; - o.placeholder = { - element: function() { - - var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(), - element = $( "<" + nodeName + ">", that.document[ 0 ] ); - - that._addClass( element, "ui-sortable-placeholder", - className || that.currentItem[ 0 ].className ) - ._removeClass( element, "ui-sortable-helper" ); - - if ( nodeName === "tbody" ) { - that._createTrPlaceholder( - that.currentItem.find( "tr" ).eq( 0 ), - $( "<tr>", that.document[ 0 ] ).appendTo( element ) - ); - } else if ( nodeName === "tr" ) { - that._createTrPlaceholder( that.currentItem, element ); - } else if ( nodeName === "img" ) { - element.attr( "src", that.currentItem.attr( "src" ) ); - } - - if ( !className ) { - element.css( "visibility", "hidden" ); - } - - return element; - }, - update: function( container, p ) { - - // 1. If a className is set as 'placeholder option, we don't force sizes - - // the class is responsible for that - // 2. The option 'forcePlaceholderSize can be enabled to force it even if a - // class name is specified - if ( className && !o.forcePlaceholderSize ) { - return; - } - - //If the element doesn't have a actual height by itself (without styles coming - // from a stylesheet), it receives the inline height from the dragged item - if ( !p.height() ) { - p.height( - that.currentItem.innerHeight() - - parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - - parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); - } - if ( !p.width() ) { - p.width( - that.currentItem.innerWidth() - - parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - - parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); - } - } - }; - } - - //Create the placeholder - that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); - - //Append it after the actual current item - that.currentItem.after( that.placeholder ); - - //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) - o.placeholder.update( that, that.placeholder ); - - }, - - _createTrPlaceholder: function( sourceTr, targetTr ) { - var that = this; - - sourceTr.children().each( function() { - $( "<td>&#160;</td>", that.document[ 0 ] ) - .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) - .appendTo( targetTr ); - } ); - }, - - _contactContainers: function( event ) { - var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, - floating, axis, - innermostContainer = null, - innermostIndex = null; - - // Get innermost container that intersects with item - for ( i = this.containers.length - 1; i >= 0; i-- ) { - - // Never consider a container that's located within the item itself - if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { - continue; - } - - if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { - - // If we've already found a container and it's more "inner" than this, then continue - if ( innermostContainer && - $.contains( - this.containers[ i ].element[ 0 ], - innermostContainer.element[ 0 ] ) ) { - continue; - } - - innermostContainer = this.containers[ i ]; - innermostIndex = i; - - } else { - - // container doesn't intersect. trigger "out" event if necessary - if ( this.containers[ i ].containerCache.over ) { - this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); - this.containers[ i ].containerCache.over = 0; - } - } - - } - - // If no intersecting containers found, return - if ( !innermostContainer ) { - return; - } - - // Move the item into the container if it's not there already - if ( this.containers.length === 1 ) { - if ( !this.containers[ innermostIndex ].containerCache.over ) { - this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); - this.containers[ innermostIndex ].containerCache.over = 1; - } - } else { - - // When entering a new container, we will find the item with the least distance and - // append our item near it - dist = 10000; - itemWithLeastDistance = null; - floating = innermostContainer.floating || this._isFloating( this.currentItem ); - posProperty = floating ? "left" : "top"; - sizeProperty = floating ? "width" : "height"; - axis = floating ? "pageX" : "pageY"; - - for ( j = this.items.length - 1; j >= 0; j-- ) { - if ( !$.contains( - this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) - ) { - continue; - } - if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { - continue; - } - - cur = this.items[ j ].item.offset()[ posProperty ]; - nearBottom = false; - if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { - nearBottom = true; - } - - if ( Math.abs( event[ axis ] - cur ) < dist ) { - dist = Math.abs( event[ axis ] - cur ); - itemWithLeastDistance = this.items[ j ]; - this.direction = nearBottom ? "up" : "down"; - } - } - - //Check if dropOnEmpty is enabled - if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { - return; - } - - if ( this.currentContainer === this.containers[ innermostIndex ] ) { - if ( !this.currentContainer.containerCache.over ) { - this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); - this.currentContainer.containerCache.over = 1; - } - return; - } - - itemWithLeastDistance ? - this._rearrange( event, itemWithLeastDistance, null, true ) : - this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); - this._trigger( "change", event, this._uiHash() ); - this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); - this.currentContainer = this.containers[ innermostIndex ]; - - //Update the placeholder - this.options.placeholder.update( this.currentContainer, this.placeholder ); - - this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); - this.containers[ innermostIndex ].containerCache.over = 1; - } - - }, - - _createHelper: function( event ) { - - var o = this.options, - helper = $.isFunction( o.helper ) ? - $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : - ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); - - //Add the helper to the DOM if that didn't happen already - if ( !helper.parents( "body" ).length ) { - $( o.appendTo !== "parent" ? - o.appendTo : - this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] ); - } - - if ( helper[ 0 ] === this.currentItem[ 0 ] ) { - this._storedCSS = { - width: this.currentItem[ 0 ].style.width, - height: this.currentItem[ 0 ].style.height, - position: this.currentItem.css( "position" ), - top: this.currentItem.css( "top" ), - left: this.currentItem.css( "left" ) - }; - } - - if ( !helper[ 0 ].style.width || o.forceHelperSize ) { - helper.width( this.currentItem.width() ); - } - if ( !helper[ 0 ].style.height || o.forceHelperSize ) { - helper.height( this.currentItem.height() ); - } - - return helper; - - }, - - _adjustOffsetFromHelper: function( obj ) { - if ( typeof obj === "string" ) { - obj = obj.split( " " ); - } - if ( $.isArray( obj ) ) { - obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; - } - if ( "left" in obj ) { - this.offset.click.left = obj.left + this.margins.left; - } - if ( "right" in obj ) { - this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; - } - if ( "top" in obj ) { - this.offset.click.top = obj.top + this.margins.top; - } - if ( "bottom" in obj ) { - this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; - } - }, - - _getParentOffset: function() { - - //Get the offsetParent and cache its position - this.offsetParent = this.helper.offsetParent(); - var po = this.offsetParent.offset(); - - // This is a special case where we need to modify a offset calculated on start, since the - // following happened: - // 1. The position of the helper is absolute, so it's position is calculated based on the - // next positioned parent - // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't - // the document, which means that the scroll is included in the initial calculation of the - // offset of the parent, and never recalculated upon drag - if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { - po.left += this.scrollParent.scrollLeft(); - po.top += this.scrollParent.scrollTop(); - } - - // This needs to be actually done for all browsers, since pageX/pageY includes this - // information with an ugly IE fix - if ( this.offsetParent[ 0 ] === this.document[ 0 ].body || - ( this.offsetParent[ 0 ].tagName && - this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) { - po = { top: 0, left: 0 }; - } - - return { - top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), - left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) - }; - - }, - - _getRelativeOffset: function() { - - if ( this.cssPosition === "relative" ) { - var p = this.currentItem.position(); - return { - top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + - this.scrollParent.scrollTop(), - left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + - this.scrollParent.scrollLeft() - }; - } else { - return { top: 0, left: 0 }; - } - - }, - - _cacheMargins: function() { - this.margins = { - left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), - top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) - }; - }, - - _cacheHelperProportions: function() { - this.helperProportions = { - width: this.helper.outerWidth(), - height: this.helper.outerHeight() - }; - }, - - _setContainment: function() { - - var ce, co, over, - o = this.options; - if ( o.containment === "parent" ) { - o.containment = this.helper[ 0 ].parentNode; - } - if ( o.containment === "document" || o.containment === "window" ) { - this.containment = [ - 0 - this.offset.relative.left - this.offset.parent.left, - 0 - this.offset.relative.top - this.offset.parent.top, - o.containment === "document" ? - this.document.width() : - this.window.width() - this.helperProportions.width - this.margins.left, - ( o.containment === "document" ? - ( this.document.height() || document.body.parentNode.scrollHeight ) : - this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight - ) - this.helperProportions.height - this.margins.top - ]; - } - - if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { - ce = $( o.containment )[ 0 ]; - co = $( o.containment ).offset(); - over = ( $( ce ).css( "overflow" ) !== "hidden" ); - - this.containment = [ - co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + - ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, - co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + - ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, - co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - - ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - - ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - - this.helperProportions.width - this.margins.left, - co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - - ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - - ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - - this.helperProportions.height - this.margins.top - ]; - } - - }, - - _convertPositionTo: function( d, pos ) { - - if ( !pos ) { - pos = this.position; - } - var mod = d === "absolute" ? 1 : -1, - scroll = this.cssPosition === "absolute" && - !( this.scrollParent[ 0 ] !== this.document[ 0 ] && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? - this.offsetParent : - this.scrollParent, - scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); - - return { - top: ( - - // The absolute mouse position - pos.top + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top * mod - - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollTop() : - ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) - ), - left: ( - - // The absolute mouse position - pos.left + - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left * mod + - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left * mod - - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : - scroll.scrollLeft() ) * mod ) - ) - }; - - }, - - _generatePosition: function( event ) { - - var top, left, - o = this.options, - pageX = event.pageX, - pageY = event.pageY, - scroll = this.cssPosition === "absolute" && - !( this.scrollParent[ 0 ] !== this.document[ 0 ] && - $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? - this.offsetParent : - this.scrollParent, - scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); - - // This is another very weird special case that only happens for relative elements: - // 1. If the css position is relative - // 2. and the scroll parent is the document or similar to the offset parent - // we have to refresh the relative offset during the scroll so there are no jumps - if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { - this.offset.relative = this._getRelativeOffset(); - } - - /* - * - Position constraining - - * Constrain the position to a mix of grid, containment. - */ - - if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options - - if ( this.containment ) { - if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { - pageX = this.containment[ 0 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { - pageY = this.containment[ 1 ] + this.offset.click.top; - } - if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { - pageX = this.containment[ 2 ] + this.offset.click.left; - } - if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { - pageY = this.containment[ 3 ] + this.offset.click.top; - } - } - - if ( o.grid ) { - top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / - o.grid[ 1 ] ) * o.grid[ 1 ]; - pageY = this.containment ? - ( ( top - this.offset.click.top >= this.containment[ 1 ] && - top - this.offset.click.top <= this.containment[ 3 ] ) ? - top : - ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? - top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : - top; - - left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / - o.grid[ 0 ] ) * o.grid[ 0 ]; - pageX = this.containment ? - ( ( left - this.offset.click.left >= this.containment[ 0 ] && - left - this.offset.click.left <= this.containment[ 2 ] ) ? - left : - ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? - left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : - left; - } - - } - - return { - top: ( - - // The absolute mouse position - pageY - - - // Click offset (relative to the element) - this.offset.click.top - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.top - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.top + - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollTop() : - ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) - ), - left: ( - - // The absolute mouse position - pageX - - - // Click offset (relative to the element) - this.offset.click.left - - - // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.relative.left - - - // The offsetParent's offset without borders (offset + border) - this.offset.parent.left + - ( ( this.cssPosition === "fixed" ? - -this.scrollParent.scrollLeft() : - scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) - ) - }; - - }, - - _rearrange: function( event, i, a, hardRefresh ) { - - a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) : - i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], - ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); - - //Various things done here to improve the performance: - // 1. we create a setTimeout, that calls refreshPositions - // 2. on the instance, we have a counter variable, that get's higher after every append - // 3. on the local scope, we copy the counter variable, and check in the timeout, - // if it's still the same - // 4. this lets only the last addition to the timeout stack through - this.counter = this.counter ? ++this.counter : 1; - var counter = this.counter; - - this._delay( function() { - if ( counter === this.counter ) { - - //Precompute after each DOM insertion, NOT on mousemove - this.refreshPositions( !hardRefresh ); - } - } ); - - }, - - _clear: function( event, noPropagation ) { - - this.reverting = false; - - // We delay all events that have to be triggered to after the point where the placeholder - // has been removed and everything else normalized again - var i, - delayedTriggers = []; - - // We first have to update the dom position of the actual currentItem - // Note: don't do it if the current item is already removed (by a user), or it gets - // reappended (see #4088) - if ( !this._noFinalSort && this.currentItem.parent().length ) { - this.placeholder.before( this.currentItem ); - } - this._noFinalSort = null; - - if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { - for ( i in this._storedCSS ) { - if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { - this._storedCSS[ i ] = ""; - } - } - this.currentItem.css( this._storedCSS ); - this._removeClass( this.currentItem, "ui-sortable-helper" ); - } else { - this.currentItem.show(); - } - - if ( this.fromOutside && !noPropagation ) { - delayedTriggers.push( function( event ) { - this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); - } ); - } - if ( ( this.fromOutside || - this.domPosition.prev !== - this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || - this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { - - // Trigger update callback if the DOM position has changed - delayedTriggers.push( function( event ) { - this._trigger( "update", event, this._uiHash() ); - } ); - } - - // Check if the items Container has Changed and trigger appropriate - // events. - if ( this !== this.currentContainer ) { - if ( !noPropagation ) { - delayedTriggers.push( function( event ) { - this._trigger( "remove", event, this._uiHash() ); - } ); - delayedTriggers.push( ( function( c ) { - return function( event ) { - c._trigger( "receive", event, this._uiHash( this ) ); - }; - } ).call( this, this.currentContainer ) ); - delayedTriggers.push( ( function( c ) { - return function( event ) { - c._trigger( "update", event, this._uiHash( this ) ); - }; - } ).call( this, this.currentContainer ) ); - } - } - - //Post events to containers - function delayEvent( type, instance, container ) { - return function( event ) { - container._trigger( type, event, instance._uiHash( instance ) ); - }; - } - for ( i = this.containers.length - 1; i >= 0; i-- ) { - if ( !noPropagation ) { - delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); - } - if ( this.containers[ i ].containerCache.over ) { - delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); - this.containers[ i ].containerCache.over = 0; - } - } - - //Do what was originally in plugins - if ( this.storedCursor ) { - this.document.find( "body" ).css( "cursor", this.storedCursor ); - this.storedStylesheet.remove(); - } - if ( this._storedOpacity ) { - this.helper.css( "opacity", this._storedOpacity ); - } - if ( this._storedZIndex ) { - this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); - } - - this.dragging = false; - - if ( !noPropagation ) { - this._trigger( "beforeStop", event, this._uiHash() ); - } - - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, - // it unbinds ALL events from the original node! - this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); - - if ( !this.cancelHelperRemoval ) { - if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { - this.helper.remove(); - } - this.helper = null; - } - - if ( !noPropagation ) { - for ( i = 0; i < delayedTriggers.length; i++ ) { - - // Trigger all delayed events - delayedTriggers[ i ].call( this, event ); - } - this._trigger( "stop", event, this._uiHash() ); - } - - this.fromOutside = false; - return !this.cancelHelperRemoval; - - }, - - _trigger: function() { - if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { - this.cancel(); - } - }, - - _uiHash: function( _inst ) { - var inst = _inst || this; - return { - helper: inst.helper, - placeholder: inst.placeholder || $( [] ), - position: inst.position, - originalPosition: inst.originalPosition, - offset: inst.positionAbs, - item: inst.currentItem, - sender: _inst ? _inst.element : null - }; - } - -} ); - - - - -}));- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/jquery.hotkeys.js b/modules/cms/ui/themes/default/script/jquery.hotkeys.js @@ -1,204 +0,0 @@ -/*jslint browser: true*/ -/*jslint jquery: true*/ - -/* - * jQuery Hotkeys Plugin - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * - * Based upon the plugin by Tzury Bar Yochay: - * https://github.com/tzuryby/jquery.hotkeys - * - * Original idea by: - * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ - */ - -/* - * One small change is: now keys are passed by object { keys: '...' } - * Might be useful, when you want to pass some other data to your handler - */ - -(function(jQuery) { - - jQuery.hotkeys = { - version: "0.2.0", - - specialKeys: { - 8: "backspace", - 9: "tab", - 10: "return", - 13: "return", - 16: "shift", - 17: "ctrl", - 18: "alt", - 19: "pause", - 20: "capslock", - 27: "esc", - 32: "space", - 33: "pageup", - 34: "pagedown", - 35: "end", - 36: "home", - 37: "left", - 38: "up", - 39: "right", - 40: "down", - 45: "insert", - 46: "del", - 59: ";", - 61: "=", - 96: "0", - 97: "1", - 98: "2", - 99: "3", - 100: "4", - 101: "5", - 102: "6", - 103: "7", - 104: "8", - 105: "9", - 106: "*", - 107: "+", - 109: "-", - 110: ".", - 111: "/", - 112: "f1", - 113: "f2", - 114: "f3", - 115: "f4", - 116: "f5", - 117: "f6", - 118: "f7", - 119: "f8", - 120: "f9", - 121: "f10", - 122: "f11", - 123: "f12", - 144: "numlock", - 145: "scroll", - 173: "-", - 186: ";", - 187: "=", - 188: ",", - 189: "-", - 190: ".", - 191: "/", - 192: "`", - 219: "[", - 220: "\\", - 221: "]", - 222: "'" - }, - - shiftNums: { - "`": "~", - "1": "!", - "2": "@", - "3": "#", - "4": "$", - "5": "%", - "6": "^", - "7": "&", - "8": "*", - "9": "(", - "0": ")", - "-": "_", - "=": "+", - ";": ": ", - "'": "\"", - ",": "<", - ".": ">", - "/": "?", - "\\": "|" - }, - - // excludes: button, checkbox, file, hidden, image, password, radio, reset, search, submit, url - textAcceptingInputTypes: [ - "text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime", - "datetime-local", "search", "color", "tel"], - - // default input types not to bind to unless bound directly - textInputTypes: /textarea|input|select/i, - - options: { - filterInputAcceptingElements: true, - filterTextInputs: true, - filterContentEditable: true - } - }; - - function keyHandler(handleObj) { - if (typeof handleObj.data === "string") { - handleObj.data = { - keys: handleObj.data - }; - } - - // Only care when a possible input has been specified - if (!handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string") { - return; - } - - var origHandler = handleObj.handler, - keys = handleObj.data.keys.toLowerCase().split(" "); - - handleObj.handler = function(event) { - // Don't fire in text-accepting inputs that we didn't directly bind to - if (this !== event.target && - (jQuery.hotkeys.options.filterInputAcceptingElements && - jQuery.hotkeys.textInputTypes.test(event.target.nodeName) || - (jQuery.hotkeys.options.filterContentEditable && jQuery(event.target).attr('contenteditable')) || - (jQuery.hotkeys.options.filterTextInputs && - jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) { - return; - } - - var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[event.which], - character = String.fromCharCode(event.which).toLowerCase(), - modif = "", - possible = {}; - - jQuery.each(["alt", "ctrl", "shift"], function(index, specialKey) { - - if (event[specialKey + 'Key'] && special !== specialKey) { - modif += specialKey + '+'; - } - }); - - // metaKey is triggered off ctrlKey erronously - if (event.metaKey && !event.ctrlKey && special !== "meta") { - modif += "meta+"; - } - - if (event.metaKey && special !== "meta" && modif.indexOf("alt+ctrl+shift+") > -1) { - modif = modif.replace("alt+ctrl+shift+", "hyper+"); - } - - if (special) { - possible[modif + special] = true; - } - else { - possible[modif + character] = true; - possible[modif + jQuery.hotkeys.shiftNums[character]] = true; - - // "$" can be triggered as "Shift+4" or "Shift+$" or just "$" - if (modif === "shift+") { - possible[jQuery.hotkeys.shiftNums[character]] = true; - } - } - - for (var i = 0, l = keys.length; i < l; i++) { - if (possible[keys[i]]) { - return origHandler.apply(this, arguments); - } - } - }; - } - - jQuery.each(["keydown", "keyup", "keypress"], function() { - jQuery.event.special[this] = { - add: keyHandler - }; - }); - -})(jQuery || this.jQuery || window.jQuery); diff --git a/modules/cms/ui/themes/default/script/jquery.js b/modules/cms/ui/themes/default/script/jquery.js @@ -1,10598 +0,0 @@ -/*! - * jQuery JavaScript Library v3.4.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2019-05-01T21:04Z - */ -( function( global, factory ) { - - "use strict"; - - 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 ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. - "use strict"; - - var arr = []; - - var document = window.document; - - var getProto = Object.getPrototypeOf; - - var slice = arr.slice; - - var concat = arr.concat; - - var push = arr.push; - - var indexOf = arr.indexOf; - - var class2type = {}; - - var toString = class2type.toString; - - var hasOwn = class2type.hasOwnProperty; - - var fnToString = hasOwn.toString; - - var ObjectFunctionString = fnToString.call( Object ); - - var support = {}; - - var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML <object> elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - return typeof obj === "function" && typeof obj.nodeType !== "number"; - }; - - - var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - - function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - } - /* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - - var - version = "3.4.1", - - // 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.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - - jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // 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 all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // 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; - - // 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: arr.sort, - splice: arr.splice - }; - - jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // 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" && !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 ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // 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() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a global context - globalEval: function( code, options ) { - DOMEval( code, { nonce: options && options.nonce } ); - }, - - 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.0 only - 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 ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - 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, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support - } ); - - if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; - } - -// 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: real iOS 8.2 only (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 = toType( obj ); - - if ( isFunction( obj ) || 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.3.4 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2019-04-08 - */ - (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(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // 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 - // https://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-]|[^\0-\\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 + "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - 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" ) - }, - - rhtml = /HTML$/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 = /[+~]/, - - // 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 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// 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, 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 && - !nonnativeSelectorCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) && - - // Support: IE 8 only - // Exclude object elements - (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && rdescend.test( selector ) ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } 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 element and returns a boolean result - */ - function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = 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 && - a.sourceIndex - b.sourceIndex; - - // 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 :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ - function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; - } - - /** - * 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 ) { - var namespace = elem.namespaceURI, - docElem = (elem.ownerDocument || elem).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); - }; - - /** - * 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, subWindow, - 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 ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( el ) { - el.className = "i"; - return !el.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.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 programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID filter and find - if ( support.getById ) { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - 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; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( (elem = elems[i++]) ) { - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // 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 https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( el ) { - // 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 - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + - "<select id='" + expando + "-\r\\' msallowcapture=''>" + - "<option selected=''></option></select>"; - - // 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 - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.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 ( !el.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 ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( el ) { - el.innerHTML = "<a href='' disabled='disabled'></a>" + - "<select disabled='disabled'><option/></select>"; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.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 ( el.querySelectorAll(":enabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( el ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[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 ); - } - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ 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) { - nonnativeSelectorCache( expr, true ); - } - } - - 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.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); - }; - - 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 || 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": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( 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 > length ? - 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, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "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 ); - } - } - return false; - } : - - // 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 ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( (oldCache = uniqueCache[ key ]) && - 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[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - return false; - }; - } - - 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: <number>) 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" && - 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( el ) { - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; - }); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx - if ( !assert(function( el ) { - el.innerHTML = "<a href='#'></a>"; - return el.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( el ) { - el.innerHTML = "<input/>"; - el.firstChild.setAttribute( "value", "" ); - return el.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( el ) { - return el.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; - -// Deprecated - jQuery.expr[ ":" ] = jQuery.expr.pseudos; - jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; - jQuery.text = Sizzle.getText; - jQuery.isXMLDoc = Sizzle.isXML; - jQuery.contains = Sizzle.contains; - jQuery.escapeSelector = Sizzle.escape; - - - - - 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; - - - - function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - - }; - var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not - function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); - } - - jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); - }; - - jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - 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; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : 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 <tag> to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method 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[ 0 ] === "<" && - selector[ 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; - - // Option to run 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 ( 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 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - 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[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - 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 targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.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 set - 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 indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - 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 ) { - while ( ( cur = cur[ dir ] ) && 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 ) { - if ( typeof elem.contentDocument !== "undefined" ) { - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } - }, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; - } ); - var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones - function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], 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 = 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 ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( 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 = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - 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; - }; - - - function Identity( v ) { - return v; - } - function Thrower( ex ) { - throw ex; - } - - function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } - } - - jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).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 = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - 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( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the master Deferred - master = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return master.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); - } - - return master.promise(); - } - } ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. - var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - - jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } - }; - - - - - jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); - }; - - - - -// The deferred used on DOM ready - var readyList = jQuery.Deferred(); - - jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - 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, - - // 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 ] ); - } - } ); - - jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method - function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); - } - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// 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 ); - - } else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); - } - - - - -// 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, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( 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 ( !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 < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; - }; - - -// Matches dashed string for camelizing - var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() - function fcamelCase( all, letter ) { - return letter.toUpperCase(); - } - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) - function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - } - var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); - }; - - - - - function Data() { - this.expando = jQuery.expando + Data.uid++; - } - - Data.uid = 1; - - Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } - }; - var dataPriv = new Data(); - - var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - - var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - - function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; - } - - function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; - } - - jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } - } ); - - jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } - } ); - - - jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( 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 public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", 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 = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } - } ); - var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - - var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - - var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - - var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } - var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - var swap = function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - }; - - - - - function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - 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 = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - 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; - } - - - var defaultDisplayMap = {}; - - function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; - } - - function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; - } - - jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } - } ); - var rcheckableType = ( /^(?:checkbox|radio)$/i ); - - var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - - var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -// We have to close these tags to support XHTML (#13200) - var wrapMap = { - - // Support: IE <=9 only - option: [ 1, "<select multiple='multiple'>", "</select>" ], - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting <tbody> or other required elements. - thead: [ 1, "<table>", "</table>" ], - col: [ 2, "<table><colgroup>", "</colgroup></table>" ], - tr: [ 2, "<table><tbody>", "</tbody></table>" ], - td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], - - _default: [ 0, "", "" ] - }; - -// Support: IE <=9 only - wrapMap.optgroup = wrapMap.option; - - wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; - wrapMap.th = wrapMap.td; - - - function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; - } - - -// Mark scripts as having already been evaluated - function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } - } - - - var rhtml = /<|&#?\w+;/; - - function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - 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; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; - } - - - ( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = "<textarea>x</textarea>"; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - } )(); - - - var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - - function returnTrue() { - return true; - } - - function returnFalse() { - return false; - } - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). - function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); - } - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 - 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 handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( 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; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, 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" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - 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 if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( 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; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - 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 data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - // Make a writable jQuery.Event from the native event object - var event = jQuery.event.fix( nativeEvent ); - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - handlers = ( dataPriv.get( 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; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - 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() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - 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, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG <use> instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( 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; - } - } - } - } - }; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. - function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - return result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); - } - - jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, 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: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // 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 || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; - }; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://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, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } - }; - -// Includes all common event props including KeyEvent and MouseEvent specific props - jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } - }, jQuery.event.addProp ); - - jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - delegateType: delegateType - }; - } ); - -// 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://bugs.chromium.org/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; - } - }; - } ); - - 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 ); - } ); - } - } ); - - - var - - /* eslint-disable max-len */ - - // See https://github.com/eslint/eslint/issues/3229 - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - - /* eslint-enable */ - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /<script|<style|<link/i, - - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; - -// Prefer a tbody over its parent table for containing new rows - function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; - } - -// Replace/restore the type attribute of script elements for safe DOM manipulation - function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; - } - function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; - } - - function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.access( src ); - pdataCur = dataPriv.set( dest, pdataOld ); - events = pdataOld.events; - - if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } - } - -// Fix IE bugs, see support tests - function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } 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 fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - 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.0 only, PhantomJS 1 only - // 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 || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - } ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; - } - - function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; - } - - jQuery.extend( { - htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1></$2>" ); - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], 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, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - 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 ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } - } ); - - jQuery.fn.extend( { - 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().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = 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++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - 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 && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - 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, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; - } ); - var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - - var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - - var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - - ( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - } - } ); - } )(); - - - function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; - } - - - function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; - } - - - var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined - function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } - } - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property - function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; - } - - - var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - - function setPositiveNumber( elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; - } - - function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; - } - - function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - // Support: IE 9-11 only - // Also use offsetWidth/offsetHeight for when box sizing is unreliable - // We use getClientRects() to check for hidden/disconnected. - // In those cases, the computed value can be trusted to be border-box - if ( ( !support.boxSizingReliable() && isBorderBox || - val === "auto" || - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; - } - - jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } - } ); - - jQuery.each( [ "height", "width" ], function( i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; - } ); - - jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } - ); - -// These hooks are used by animate to expand properties - jQuery.each( { - margin: "", - padding: "", - border: "Width" - }, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } - } ); - - jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } - } ); - - - function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); - } - jQuery.Tween = Tween; - - Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } - }; - - Tween.prototype.init.prototype = Tween.prototype; - - Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } - }; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes - Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } - }; - - jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" - }; - - jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point - jQuery.fx.step = {}; - - - - - var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - - function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } - } - -// Animations created synchronously will run synchronously - function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); - } - -// Generate parameters to create a standard animation - function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; - } - - function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } - } - - function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } - } - - function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } - } - - function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; - } - - jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } - } ); - - jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; - }; - - jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue && type !== false ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } - } ); - - jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; - } ); - -// Generate shortcuts for custom animations - jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } - }, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; - } ); - - jQuery.timers = []; - jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; - }; - - jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); - }; - - jQuery.fx.interval = 13; - jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); - }; - - jQuery.fx.stop = function() { - inProgress = null; - }; - - jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 - }; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ - jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); - }; - - - ( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; - } )(); - - - var boolHook, - attrHandle = jQuery.expr.attrHandle; - - jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } - } ); - - jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } - } ); - -// Hooks for boolean attributes - boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } - }; - - jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; - } ); - - - - - var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - - jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } - } ); - - jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } - } ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop - if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; - } - - jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" - ], function() { - jQuery.propFix[ this.toLowerCase() ] = this; - } ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - - function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; - } - - function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; - } - - jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } - } ); - - - - - var rreturn = /\r/g; - - jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } - } ); - - jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } - } ); - -// Radios and checkboxes getter/setter - jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } - } ); - - - - -// Return jQuery for attributes-only inclusion - - - support.focusin = "onfocusin" in window; - - - var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - - jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = 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 && !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() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && - dataPriv.get( 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 as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !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; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - - } ); - - jQuery.fn.extend( { - - 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 ); - } - } - } ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// 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://bugs.chromium.org/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 = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); - } - var location = window.location; - - var nonce = Date.now(); - - var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing - jQuery.parseXML = function( data ) { - var xml; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } - - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }; - - - var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - - function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } - } - -// Serialize an array of form elements or a set of -// key/values into a query string - jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); - }; - - jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } - } ); - - - var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport - function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; - } - -// Base inspection function for prefilters and transports - function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); - } - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 - function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; - } - - /* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ - function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } - } - - /* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ - function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; - } - - jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } - } ); - - jQuery.each( [ "get", "post" ], function( i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; - } ); - - - jQuery._evalUrl = function( url, options ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options ); - } - } ); - }; - - - jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } - } ); - - - jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); - }; - jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); - }; - - - - - jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} - }; - - var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - - support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); - support.ajax = xhrSupported = !!xhrSupported; - - jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } - } ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) - jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } - } ); - -// Install script dataType - jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } - } ); - -// Handle cache's special case and crossDomain - jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } - } ); - -// Bind script tag hack transport - jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( "<script>" ) - .attr( s.scriptAttrs || {} ) - .prop( { charset: s.scriptCharset, src: s.url } ) - .on( "load error", callback = function( evt ) { - script.remove(); - callback = null; - if ( evt ) { - complete( evt.type === "error" ? 404 : 200, evt.type ); - } - } ); - - // Use native DOM manipulation to avoid our domManip AJAX trickery - document.head.appendChild( script[ 0 ] ); - }, - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } - } ); - - - - - var oldCallbacks = [], - rjsonp = /(=)\?(?=&|$)|\?\?/; - -// Default jsonp settings - jQuery.ajaxSetup( { - jsonp: "callback", - jsonpCallback: function() { - var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); - this[ callback ] = true; - return callback; - } - } ); - -// Detect, normalize options and install callbacks for jsonp requests - jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { - - var callbackName, overwritten, responseContainer, - jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? - "url" : - typeof s.data === "string" && - ( s.contentType || "" ) - .indexOf( "application/x-www-form-urlencoded" ) === 0 && - rjsonp.test( s.data ) && "data" - ); - - // Handle iff the expected data type is "jsonp" or we have a parameter to set - if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { - - // Get callback name, remembering preexisting value associated with it - callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? - s.jsonpCallback() : - s.jsonpCallback; - - // Insert callback into url or form data - if ( jsonProp ) { - s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); - } else if ( s.jsonp !== false ) { - s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; - } - - // Use data converter to retrieve json after script execution - s.converters[ "script json" ] = function() { - if ( !responseContainer ) { - jQuery.error( callbackName + " was not called" ); - } - return responseContainer[ 0 ]; - }; - - // Force json dataType - s.dataTypes[ 0 ] = "json"; - - // Install callback - overwritten = window[ callbackName ]; - window[ callbackName ] = function() { - responseContainer = arguments; - }; - - // Clean-up function (fires after converters) - jqXHR.always( function() { - - // If previous value didn't exist - remove it - if ( overwritten === undefined ) { - jQuery( window ).removeProp( callbackName ); - - // Otherwise restore preexisting value - } else { - window[ callbackName ] = overwritten; - } - - // Save back as free - if ( s[ callbackName ] ) { - - // Make sure that re-using the options doesn't screw things around - s.jsonpCallback = originalSettings.jsonpCallback; - - // Save the callback name for future use - oldCallbacks.push( callbackName ); - } - - // Call if it was a function and we have a response - if ( responseContainer && isFunction( overwritten ) ) { - overwritten( responseContainer[ 0 ] ); - } - - responseContainer = overwritten = undefined; - } ); - - // Delegate to script - return "script"; - } - } ); - - - - -// Support: Safari 8 only -// In Safari 8 documents created via document.implementation.createHTMLDocument -// collapse sibling forms: the second one becomes a child of the first one. -// Because of that, this security measure has to be disabled in Safari 8. -// https://bugs.webkit.org/show_bug.cgi?id=137337 - support.createHTMLDocument = ( function() { - var body = document.implementation.createHTMLDocument( "" ).body; - body.innerHTML = "<form></form><form></form>"; - return body.childNodes.length === 2; - } )(); - - -// Argument "data" should be string of html -// context (optional): If specified, the fragment will be created in this context, -// defaults to document -// keepScripts (optional): If true, will include scripts passed in the html string - jQuery.parseHTML = function( data, context, keepScripts ) { - if ( typeof data !== "string" ) { - return []; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - - var base, parsed, scripts; - - if ( !context ) { - - // Stop scripts or inline event handlers from being executed immediately - // by using document.implementation - if ( support.createHTMLDocument ) { - context = document.implementation.createHTMLDocument( "" ); - - // Set the base href for the created document - // so any parsed elements with URLs - // are based on the document's URL (gh-2965) - base = context.createElement( "base" ); - base.href = document.location.href; - context.head.appendChild( base ); - } else { - context = document; - } - } - - parsed = rsingleTag.exec( data ); - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[ 1 ] ) ]; - } - - parsed = buildFragment( [ data ], context, scripts ); - - if ( scripts && scripts.length ) { - jQuery( scripts ).remove(); - } - - return jQuery.merge( [], parsed.childNodes ); - }; - - - /** - * Load a url into a page - */ - jQuery.fn.load = function( url, params, callback ) { - var selector, type, response, - self = this, - off = url.indexOf( " " ); - - if ( off > -1 ) { - selector = stripAndCollapse( url.slice( off ) ); - url = url.slice( 0, off ); - } - - // If it's a function - if ( isFunction( params ) ) { - - // We assume that it's the callback - callback = params; - params = undefined; - - // Otherwise, build a param string - } else if ( params && typeof params === "object" ) { - type = "POST"; - } - - // If we have elements to modify, make the request - if ( self.length > 0 ) { - jQuery.ajax( { - url: url, - - // If "type" variable is undefined, then "GET" method will be used. - // Make value of this field explicit since - // user can override it through ajaxSetup method - type: type || "GET", - dataType: "html", - data: params - } ).done( function( responseText ) { - - // Save response for use in complete callback - response = arguments; - - self.html( selector ? - - // If a selector was specified, locate the right elements in a dummy div - // Exclude scripts to avoid IE 'Permission Denied' errors - jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : - - // Otherwise use the full result - responseText ); - - // If the request succeeds, this function gets "data", "status", "jqXHR" - // but they are ignored because response was set above. - // If it fails, this function gets "jqXHR", "status", "error" - } ).always( callback && function( jqXHR, status ) { - self.each( function() { - callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); - } ); - } ); - } - - return this; - }; - - - - -// Attach a bunch of functions for handling common AJAX events - jQuery.each( [ - "ajaxStart", - "ajaxStop", - "ajaxComplete", - "ajaxError", - "ajaxSuccess", - "ajaxSend" - ], function( i, type ) { - jQuery.fn[ type ] = function( fn ) { - return this.on( type, fn ); - }; - } ); - - - - - jQuery.expr.pseudos.animated = function( elem ) { - return jQuery.grep( jQuery.timers, function( fn ) { - return elem === fn.elem; - } ).length; - }; - - - - - jQuery.offset = { - setOffset: function( elem, options, i ) { - var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, - position = jQuery.css( elem, "position" ), - curElem = jQuery( elem ), - props = {}; - - // Set position first, in-case top/left are set even on static elem - if ( position === "static" ) { - elem.style.position = "relative"; - } - - curOffset = curElem.offset(); - curCSSTop = jQuery.css( elem, "top" ); - curCSSLeft = jQuery.css( elem, "left" ); - calculatePosition = ( position === "absolute" || position === "fixed" ) && - ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; - - // Need to be able to calculate position if either - // top or left is auto and position is either absolute or fixed - if ( calculatePosition ) { - curPosition = curElem.position(); - curTop = curPosition.top; - curLeft = curPosition.left; - - } else { - curTop = parseFloat( curCSSTop ) || 0; - curLeft = parseFloat( curCSSLeft ) || 0; - } - - if ( isFunction( options ) ) { - - // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) - options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); - } - - if ( options.top != null ) { - props.top = ( options.top - curOffset.top ) + curTop; - } - if ( options.left != null ) { - props.left = ( options.left - curOffset.left ) + curLeft; - } - - if ( "using" in options ) { - options.using.call( elem, props ); - - } else { - curElem.css( props ); - } - } - }; - - jQuery.fn.extend( { - - // offset() relates an element's border box to the document origin - offset: function( options ) { - - // Preserve chaining for setter - if ( arguments.length ) { - return options === undefined ? - this : - this.each( function( i ) { - jQuery.offset.setOffset( this, options, i ); - } ); - } - - var rect, win, - elem = this[ 0 ]; - - if ( !elem ) { - return; - } - - // Return zeros for disconnected and hidden (display: none) elements (gh-2310) - // Support: IE <=11 only - // Running getBoundingClientRect on a - // disconnected node in IE throws an error - if ( !elem.getClientRects().length ) { - return { top: 0, left: 0 }; - } - - // Get document-relative position by adding viewport scroll to viewport-relative gBCR - rect = elem.getBoundingClientRect(); - win = elem.ownerDocument.defaultView; - return { - top: rect.top + win.pageYOffset, - left: rect.left + win.pageXOffset - }; - }, - - // position() relates an element's margin box to its offset parent's padding box - // This corresponds to the behavior of CSS absolute positioning - position: function() { - if ( !this[ 0 ] ) { - return; - } - - var offsetParent, offset, doc, - elem = this[ 0 ], - parentOffset = { top: 0, left: 0 }; - - // position:fixed elements are offset from the viewport, which itself always has zero offset - if ( jQuery.css( elem, "position" ) === "fixed" ) { - - // Assume position:fixed implies availability of getBoundingClientRect - offset = elem.getBoundingClientRect(); - - } else { - offset = this.offset(); - - // Account for the *real* offset parent, which can be the document or its root element - // when a statically positioned element is identified - doc = elem.ownerDocument; - offsetParent = elem.offsetParent || doc.documentElement; - while ( offsetParent && - ( offsetParent === doc.body || offsetParent === doc.documentElement ) && - jQuery.css( offsetParent, "position" ) === "static" ) { - - offsetParent = offsetParent.parentNode; - } - if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { - - // Incorporate borders into its offset, since they are outside its content origin - parentOffset = jQuery( offsetParent ).offset(); - parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); - parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); - } - } - - // Subtract parent offsets and element margins - return { - top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), - left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) - }; - }, - - // This method will return documentElement in the following cases: - // 1) For the element inside the iframe without offsetParent, this method will return - // documentElement of the parent window - // 2) For the hidden or detached element - // 3) For body or html element, i.e. in case of the html node - it will return itself - // - // but those exceptions were never presented as a real life use-cases - // and might be considered as more preferable results. - // - // This logic, however, is not guaranteed and can change at any point in the future - offsetParent: function() { - return this.map( function() { - var offsetParent = this.offsetParent; - - while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { - offsetParent = offsetParent.offsetParent; - } - - return offsetParent || documentElement; - } ); - } - } ); - -// Create scrollLeft and scrollTop methods - jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { - var top = "pageYOffset" === prop; - - jQuery.fn[ method ] = function( val ) { - return access( this, function( elem, method, val ) { - - // Coalesce documents and windows - var win; - if ( isWindow( elem ) ) { - win = elem; - } else if ( elem.nodeType === 9 ) { - win = elem.defaultView; - } - - if ( val === undefined ) { - return win ? win[ prop ] : elem[ method ]; - } - - if ( win ) { - win.scrollTo( - !top ? val : win.pageXOffset, - top ? val : win.pageYOffset - ); - - } else { - elem[ method ] = val; - } - }, method, val, arguments.length ); - }; - } ); - -// Support: Safari <=7 - 9.1, Chrome <=37 - 49 -// Add the top/left cssHooks using jQuery.fn.position -// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 -// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 -// getComputedStyle returns percent when specified for top/left/bottom/right; -// rather than make the css module depend on the offset module, just check for it here - jQuery.each( [ "top", "left" ], function( i, prop ) { - jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, - function( elem, computed ) { - if ( computed ) { - computed = curCSS( elem, prop ); - - // If curCSS returns percentage, fallback to offset - return rnumnonpx.test( computed ) ? - jQuery( elem ).position()[ prop ] + "px" : - computed; - } - } - ); - } ); - - -// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods - jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { - jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, - function( defaultExtra, funcName ) { - - // Margin is only for outerHeight, outerWidth - jQuery.fn[ funcName ] = function( margin, value ) { - var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), - extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); - - return access( this, function( elem, type, value ) { - var doc; - - if ( isWindow( elem ) ) { - - // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) - return funcName.indexOf( "outer" ) === 0 ? - elem[ "inner" + name ] : - elem.document.documentElement[ "client" + name ]; - } - - // Get document width or height - if ( elem.nodeType === 9 ) { - doc = elem.documentElement; - - // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], - // whichever is greatest - return Math.max( - elem.body[ "scroll" + name ], doc[ "scroll" + name ], - elem.body[ "offset" + name ], doc[ "offset" + name ], - doc[ "client" + name ] - ); - } - - return value === undefined ? - - // Get width or height on the element, requesting but not forcing parseFloat - jQuery.css( elem, type, extra ) : - - // Set width or height on the element - jQuery.style( elem, type, value, extra ); - }, type, chainable ? margin : undefined, chainable ); - }; - } ); - } ); - - - jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup contextmenu" ).split( " " ), - function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - return arguments.length > 0 ? - this.on( name, null, data, fn ) : - this.trigger( name ); - }; - } ); - - jQuery.fn.extend( { - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } - } ); - - - - - jQuery.fn.extend( { - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length === 1 ? - this.off( selector, "**" ) : - this.off( types, selector || "**", fn ); - } - } ); - -// Bind a function to a context, optionally partially applying any -// arguments. -// jQuery.proxy is deprecated to promote standards (specifically Function#bind) -// However, it is not slated for removal any time soon - jQuery.proxy = function( fn, context ) { - var tmp, args, proxy; - - 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 ( !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; - }; - - jQuery.holdReady = function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }; - jQuery.isArray = Array.isArray; - jQuery.parseJSON = JSON.parse; - jQuery.nodeName = nodeName; - jQuery.isFunction = isFunction; - jQuery.isWindow = isWindow; - jQuery.camelCase = camelCase; - jQuery.type = toType; - - jQuery.now = Date.now; - - jQuery.isNumeric = function( obj ) { - - // As of jQuery 3.0, isNumeric is limited to - // strings and numbers (primitives or objects) - // that can be coerced to finite numbers (gh-2662) - var type = jQuery.type( obj ); - return ( type === "number" || type === "string" ) && - - // parseFloat NaNs numeric-cast false positives ("") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - !isNaN( obj - parseFloat( obj ) ); - }; - - - - -// Register as a named AMD module, since jQuery can be concatenated with other -// files that may use define, but not via a proper concatenation script that -// understands anonymous AMD modules. A named AMD is safest and most robust -// way to register. Lowercase jquery is used because AMD module names are -// derived from file names, and jQuery is normally delivered in a lowercase -// file name. Do this after creating the global so that if an AMD module wants -// to call noConflict to hide this version of jQuery, it will work. - -// Note that for maximum portability, libraries that are not jQuery should -// declare themselves as anonymous modules, and avoid setting a global if an -// AMD loader is present. jQuery is a special case. For more information, see -// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon - - if ( typeof define === "function" && define.amd ) { - define( "jquery", [], function() { - return jQuery; - } ); - } - - - - - var - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$; - - jQuery.noConflict = function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }; - -// Expose jQuery and $ identifiers, even in AMD -// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) -// and CommonJS for browser emulators (#13566) - if ( !noGlobal ) { - window.jQuery = window.$ = jQuery; - } - - - - - return jQuery; -} ); diff --git a/modules/cms/ui/themes/default/script/jquery.scrollTo.js b/modules/cms/ui/themes/default/script/jquery.scrollTo.js @@ -1,216 +0,0 @@ -/*! - * jQuery.ScrollTo - * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com - * Dual licensed under MIT and GPL. - * Date: 06/05/2009 - * - * @projectDescription Easy element scrolling using jQuery. - * http://flesler.blogspot.com/2007/10/jqueryscrollto.html - * Works with jQuery +1.2.6. Tested on FF 2/3, IE 6/7/8, Opera 9.5/6, Safari 3, Chrome 1 on WinXP. - * - * @author Ariel Flesler - * @version 1.4.2 - * - * @id jQuery.scrollTo - * @id jQuery.fn.scrollTo - * @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements. - * The different options for target are: - * - A number position (will be applied to all axes). - * - A string position ('44', '100px', '+=90', etc ) will be applied to all axes - * - A jQuery/DOM element ( logically, child of the element to scroll ) - * - A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc ) - * - A hash { top:x, left:y }, x and y can be any kind of number/string like above. - * - A percentage of the container's dimension/s, for example: 50% to go to the middle. - * - The string 'max' for go-to-end. - * @param {Number, Function} duration The OVERALL length of the animation, this argument can be the settings object instead. - * @param {Object,Function} settings Optional set of settings or the onAfter callback. - * @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'. - * @option {Number, Function} duration The OVERALL length of the animation. - * @option {String} easing The easing method for the animation. - * @option {Boolean} margin If true, the margin of the target element will be deducted from the final position. - * @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }. - * @option {Object, Number} over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes. - * @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends. - * @option {Function} onAfter Function to be called after the scrolling ends. - * @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends. - * @return {jQuery} Returns the same jQuery object, for chaining. - * - * @desc Scroll to a fixed position - * @example $('div').scrollTo( 340 ); - * - * @desc Scroll relatively to the actual position - * @example $('div').scrollTo( '+=340px', { axis:'y' } ); - * - * @desc Scroll using a selector (relative to the scrolled element) - * @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } ); - * - * @desc Scroll to a DOM element (same for jQuery object) - * @example var second_child = document.getElementById('container').firstChild.nextSibling; - * $('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){ - * alert('scrolled!!'); - * }}); - * - * @desc Scroll on both axes, to different values - * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } ); - */ - -;(function( $ ){ - - var $scrollTo = $.scrollTo = function( target, duration, settings ){ - $(window).scrollTo( target, duration, settings ); - }; - - $scrollTo.defaults = { - axis:'xy', - duration: parseFloat($.fn.jquery) >= 1.3 ? 0 : 1, - limit:true - }; - - // Returns the element that needs to be animated to scroll the window. - // Kept for backwards compatibility (specially for localScroll & serialScroll) - $scrollTo.window = function( scope ){ - return $(window)._scrollable(); - }; - - // Hack, hack, hack :) - // Returns the real elements to scroll (supports window/iframes, documents and regular nodes) - $.fn._scrollable = function(){ - return this.map(function(){ - var elem = this, - isWin = !elem.nodeName || $.inArray( elem.nodeName.toLowerCase(), ['iframe','#document','html','body'] ) != -1; - - if( !isWin ) - return elem; - - var doc = (elem.contentWindow || elem).document || elem.ownerDocument || elem; - - return $.browser.safari || doc.compatMode == 'BackCompat' ? - doc.body : - doc.documentElement; - }); - }; - - $.fn.scrollTo = function( target, duration, settings ){ - if( typeof duration == 'object' ){ - settings = duration; - duration = 0; - } - if( typeof settings == 'function' ) - settings = { onAfter:settings }; - - if( target == 'max' ) - target = 9e9; - - settings = $.extend( {}, $scrollTo.defaults, settings ); - // Speed is still recognized for backwards compatibility - duration = duration || settings.duration; - // Make sure the settings are given right - settings.queue = settings.queue && settings.axis.length > 1; - - if( settings.queue ) - // Let's keep the overall duration - duration /= 2; - settings.offset = both( settings.offset ); - settings.over = both( settings.over ); - - return this._scrollable().each(function(){ - var elem = this, - $elem = $(elem), - targ = target, toff, attr = {}, - win = $elem.is('html,body'); - - switch( typeof targ ){ - // A number will pass the regex - case 'number': - case 'string': - if( /^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ) ){ - targ = both( targ ); - // We are done - break; - } - // Relative selector, no break! - targ = $(targ,this); - case 'object': - // DOMElement / jQuery - if( targ.is || targ.style ) - // Get the real position of the target - toff = (targ = $(targ)).offset(); - } - $.each( settings.axis.split(''), function( i, axis ){ - var Pos = axis == 'x' ? 'Left' : 'Top', - pos = Pos.toLowerCase(), - key = 'scroll' + Pos, - old = elem[key], - max = $scrollTo.max(elem, axis); - - if( toff ){// jQuery / DOMElement - attr[key] = toff[pos] + ( win ? 0 : old - $elem.offset()[pos] ); - - // If it's a dom element, reduce the margin - if( settings.margin ){ - attr[key] -= parseInt(targ.css('margin'+Pos)) || 0; - attr[key] -= parseInt(targ.css('border'+Pos+'Width')) || 0; - } - - attr[key] += settings.offset[pos] || 0; - - if( settings.over[pos] ) - // Scroll to a fraction of its width/height - attr[key] += targ[axis=='x'?'width':'height']() * settings.over[pos]; - }else{ - var val = targ[pos]; - // Handle percentage values - attr[key] = val.slice && val.slice(-1) == '%' ? - parseFloat(val) / 100 * max - : val; - } - - // Number or 'number' - if( settings.limit && /^\d+$/.test(attr[key]) ) - // Check the limits - attr[key] = attr[key] <= 0 ? 0 : Math.min( attr[key], max ); - - // Queueing axes - if( !i && settings.queue ){ - // Don't waste time animating, if there's no need. - if( old != attr[key] ) - // Intermediate animation - animate( settings.onAfterFirst ); - // Don't animate this axis again in the next iteration. - delete attr[key]; - } - }); - - animate( settings.onAfter ); - - function animate( callback ){ - $elem.animate( attr, duration, settings.easing, callback && function(){ - callback.call(this, target, settings); - }); - }; - - }).end(); - }; - - // Max scrolling position, works on quirks mode - // It only fails (not too badly) on IE, quirks mode. - $scrollTo.max = function( elem, axis ){ - var Dim = axis == 'x' ? 'Width' : 'Height', - scroll = 'scroll'+Dim; - - if( !$(elem).is('html,body') ) - return elem[scroll] - $(elem)[Dim.toLowerCase()](); - - var size = 'client' + Dim, - html = elem.ownerDocument.documentElement, - body = elem.ownerDocument.body; - - return Math.max( html[scroll], body[scroll] ) - - Math.min( html[size] , body[size] ); - }; - - function both( val ){ - return typeof val == 'object' ? val : { top:val, left:val }; - }; - -})( jQuery );- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/mark.min.js b/modules/cms/ui/themes/default/script/mark.min.js @@ -1,27 +0,0 @@ - -function mark() -{ - for( i=0; i<document.forms[0].elements.length; i++ ) - { - if (document.forms[0].elements[i].type=='checkbox') - document.forms[0].elements[i].checked=true; - } -} - -function unmark() -{ - for( i=0; i<document.forms[0].elements.length; i++ ) - { - if (document.forms[0].elements[i].type=='checkbox') - document.forms[0].elements[i].checked=false; - } -} - -function flip() -{ - for( i=0; i<document.forms[0].elements.length; i++ ) - { - if (document.forms[0].elements[i].type=='checkbox') - document.forms[0].elements[i].checked=!document.forms[0].elements[i].checked; - } -} diff --git a/modules/cms/ui/themes/default/script/openrat.js b/modules/cms/ui/themes/default/script/openrat.js @@ -0,0 +1,53395 @@ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/jquery.min.js */ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!==C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[k]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[k]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[k]&&(v=Ce(v)),y&&!y[k]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[k]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=N[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?i.push(a):o.push(a);(a=N(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=S+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t===C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument===C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(S=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(S=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=k.split("").sort(D).join("")===k,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=k.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&N.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){k.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return k.Deferred(function(r){k.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=k.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var _=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)_(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<k.inArray(o,r))i&&i.push(o);else if(l=oe(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<k(i,this).index(l):k.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Q.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ke:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ne),!1},trigger:function(){return De(this,e),!0},delegateType:t}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Me(o[r],a[r]);else Me(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return _(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Nt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||Nt.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Pt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+$t+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=_t(Wt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/jquery-ui.min.js */ +/*! jQuery UI - v1.12.1 - 2018-09-03 +* http://jqueryui.com +* Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js, widgets/droppable.js, widgets/sortable.js, widgets/mouse.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ +(function(t){if(typeof define==="function"&&define.amd){define(["jquery"],t)} +else{t(jQuery)}}(function(t){t.ui=t.ui||{};var g=t.ui.version="1.12.1"; +/*! + * jQuery UI Widget 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var o=0,s=Array.prototype.slice;t.cleanData=(function(e){return function(i){var s,o,n;for(n=0;(o=i[n])!=null;n++){try{s=t._data(o,"events");if(s&&s.remove){t(o).triggerHandler("remove")}}catch(r){}};e(i)}})(t.cleanData);t.widget=function(e,i,s){var r,o,a,l={};var n=e.split(".")[0];e=e.split(".")[1];var h=n+"-"+e;if(!s){s=i;i=t.Widget};if(t.isArray(s)){s=t.extend.apply(null,[{}].concat(s))};t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)};t[n]=t[n]||{};r=t[n][e];o=t[n][e]=function(t,e){if(!this._createWidget){return new o(t,e)};if(arguments.length){this._createWidget(t,e)}};t.extend(o,r,{version:s.version,_proto:t.extend({},s),_childConstructors:[]});a=new i();a.options=t.widget.extend({},a.options);t.each(s,function(e,s){if(!t.isFunction(s)){l[e]=s;return};l[e]=(function(){function t(){return i.prototype[e].apply(this,arguments)};function o(t){return i.prototype[e].apply(this,t)};return function(){var i=this._super,n=this._superApply,e;this._super=t;this._superApply=o;e=s.apply(this,arguments);this._super=i;this._superApply=n;return e}})()});o.prototype=t.widget.extend(a,{widgetEventPrefix:r?(a.widgetEventPrefix||e):e},l,{constructor:o,namespace:n,widgetName:e,widgetFullName:h});if(r){t.each(r._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)});delete r._childConstructors} +else{i._childConstructors.push(o)};t.widget.bridge(e,o);return o};t.widget.extend=function(e){var r=s.call(arguments,1),n=0,a=r.length,i,o;for(;n<a;n++){for(i in r[n]){o=r[n][i];if(r[n].hasOwnProperty(i)&&o!==undefined){if(t.isPlainObject(o)){e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],o):t.widget.extend({},o)} +else{e[i]=o}}}};return e};t.widget.bridge=function(e,i){var o=i.prototype.widgetFullName||e;t.fn[e]=function(n){var h=typeof n==="string",a=s.call(arguments,1),r=this;if(h){if(!this.length&&n==="instance"){r=undefined} +else{this.each(function(){var i,s=t.data(this,o);if(n==="instance"){r=s;return!1};if(!s){return t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+n+"'")};if(!t.isFunction(s[n])||n.charAt(0)==="_"){return t.error("no such method '"+n+"' for "+e+" widget instance")};i=s[n].apply(s,a);if(i!==s&&i!==undefined){r=i&&i.jquery?r.pushStack(i.get()):i;return!1}})}} +else{if(a.length){n=t.widget.extend.apply(null,[n].concat(a))};this.each(function(){var e=t.data(this,o);if(e){e.option(n||{});if(e._init){e._init()}} +else{t.data(this,o,new i(n,this))}})};return r}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0];this.element=t(i);this.uuid=o++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=t();this.hoverable=t();this.focusable=t();this.classesElementLookup={};if(i!==this){t.data(i,this.widgetFullName,this);this._on(!0,this.element,{remove:function(t){if(t.target===i){this.destroy()}}});this.document=t(i.style?i.ownerDocument:i.document||i);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)};this.options=t.widget.extend({},this.options,this._getCreateOptions(),e);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)};this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy();t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var r=e,s,o,n;if(arguments.length===0){return t.widget.extend({},this.options)};if(typeof e==="string"){r={};s=e.split(".");e=s.shift();if(s.length){o=r[e]=t.widget.extend({},this.options[e]);for(n=0;n<s.length-1;n++){o[s[n]]=o[s[n]]||{};o=o[s[n]]};e=s.pop();if(arguments.length===1){return o[e]===undefined?null:o[e]};o[e]=i} +else{if(arguments.length===1){return this.options[e]===undefined?null:this.options[e]};r[e]=i}};this._setOptions(r);return this},_setOptions:function(t){var e;for(e in t){this._setOption(e,t[e])};return this},_setOption:function(t,e){if(t==="classes"){this._setOptionClasses(e)};this.options[t]=e;if(t==="disabled"){this._setOptionDisabled(e)};return this},_setOptionClasses:function(e){var i,o,s;for(i in e){s=this.classesElementLookup[i];if(e[i]===this.options.classes[i]||!s||!s.length){continue};o=t(s.get());this._removeClass(s,i);o.addClass(this._classes({element:o,keys:i,classes:e,add:!0}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],s=this;e=t.extend({element:this.element,classes:this.options.classes||{}},e);function o(o,n){var a,r;for(r=0;r<o.length;r++){a=s.classesElementLookup[o[r]]||t();if(e.add){a=t(t.unique(a.get().concat(e.element.get())))} +else{a=t(a.not(e.element).get())};s.classesElementLookup[o[r]]=a;i.push(o[r]);if(n&&e.classes[o[r]]){i.push(e.classes[o[r]])}}};this._on(e.element,{"remove":"_untrackClassesElement"});if(e.keys){o(e.keys.match(/\S+/g)||[],!0)};if(e.extra){o(e.extra.match(/\S+/g)||[])};return i.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,o){if(t.inArray(e.target,o)!==-1){i.classesElementLookup[s]=t(o.not(e.target).get())}})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s=(typeof s==="boolean")?s:i;var o=(typeof t==="string"||t===null),n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};n.element.toggleClass(this._classes(n),s);return this},_on:function(e,i,s){var n,o=this;if(typeof e!=="boolean"){s=i;i=e;e=!1};if(!s){s=i;i=this.element;n=this.widget()} +else{i=n=t(i);this.bindings=this.bindings.add(i)};t.each(s,function(s,r){function a(){if(!e&&(o.options.disabled===!0||t(this).hasClass("ui-state-disabled"))){return};return(typeof r==="string"?o[r]:r).apply(o,arguments)};if(typeof r!=="string"){a.guid=r.guid=r.guid||a.guid||t.guid++};var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];if(c){n.on(l,c,a)} +else{i.on(l,a)}})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.off(i).off(i);this.bindings=t(this.bindings.not(e).get());this.focusable=t(this.focusable.not(e).get());this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function s(){return(typeof t==="string"?i[t]:t).apply(i,arguments)};var i=this;return setTimeout(s,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var o,n,r=this.options[e];s=s||{};i=t.Event(i);i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();i.target=this.element[0];n=i.originalEvent;if(n){for(o in n){if(!(o in i)){i[o]=n[o]}}};this.element.trigger(i,s);return!(t.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,o,n){if(typeof o==="string"){o={effect:o}};var a,r=!o?e:o===!0||typeof o==="number"?i:o.effect||i;o=o||{};if(typeof o==="number"){o={duration:o}};a=!t.isEmptyObject(o);o.complete=n;if(o.delay){s.delay(o.delay)};if(a&&t.effects&&t.effects.effect[r]){s[e](o)} +else if(r!==e&&s[r]){s[r](o.duration,o.easing,n)} +else{s.queue(function(i){t(this)[e]();if(n){n.call(s[0])};i()})}}});var m=t.widget; +/*! + * jQuery UI :data 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var d=t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}); +/*! + * jQuery UI Scroll Parent 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var p=t.fn.scrollParent=function(e){var i=this.css("position"),o=i==="absolute",n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var e=t(this);if(o&&e.css("position")==="static"){return!1};return n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return i==="fixed"||!s.length?t(this[0].ownerDocument||document):s},u=t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); +/*! + * jQuery UI Mouse 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var e=!1;t(document).on("mouseup",function(){e=!1});var f=t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent")){t.removeData(i.target,e.widgetName+".preventClickEvent");i.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(i){if(e){return};this._mouseMoved=!1;(this._mouseStarted&&this._mouseUp(i));this._mouseDownEvent=i;var s=this,o=(i.which===1),n=(typeof this.options.cancel==="string"&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1);if(!o||n||!this._mouseCapture(i)){return!0};this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)};if(this._mouseDistanceMet(i)&&this._mouseDelayMet(i)){this._mouseStarted=(this._mouseStart(i)!==!1);if(!this._mouseStarted){i.preventDefault();return!0}};if(!0===t.data(i.target,this.widgetName+".preventClickEvent")){t.removeData(i.target,this.widgetName+".preventClickEvent")};this._mouseMoveDelegate=function(t){return s._mouseMove(t)};this._mouseUpDelegate=function(t){return s._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);i.preventDefault();e=!0;return!0},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button){return this._mouseUp(e)} +else if(!e.which){if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey){this.ignoreMissingWhich=!0} +else if(!this.ignoreMissingWhich){return this._mouseUp(e)}}};if(e.which||e.button){this._mouseMoved=!0};if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()};if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==!1);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e))};return!this._mouseStarted},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;if(i.target===this._mouseDownEvent.target){t.data(i.target,this.widgetName+".preventClickEvent",!0)};this._mouseStop(i)};if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer};this.ignoreMissingWhich=!1;e=!1;i.preventDefault()},_mouseDistanceMet:function(t){return(Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});var c=t.ui.plugin={add:function(e,i,s){var o,n=t.ui[e].prototype;for(o in s){n.plugins[o]=n.plugins[o]||[];n.plugins[o].push([i,s[o]])}},call:function(t,e,i,o){var s,n=t.plugins[e];if(!n){return};if(!o&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return};for(s=0;s<n.length;s++){if(t.options[n[s][0]]){n[s][1].apply(t.element,i)}}}};var h=t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body};if(!e){e=t.body};if(!e.nodeName){e=t.body};return e},l=t.ui.safeBlur=function(e){if(e&&e.nodeName.toLowerCase()!=="body"){t(e).trigger("blur")}}; +/*! + * jQuery UI Draggable 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()};if(this.options.addClasses){this._addClass("ui-draggable")};this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return};this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;if(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0){return!1};this.handle=this._getHandle(e);if(!this.handle){return!1};this._blurActiveElement(e);this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix);return!0},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);if(s.closest(i).length){return};t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;this.helper=this._createHelper(e);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(t.ui.ddmanager){t.ui.ddmanager.current=this};this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(!0);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return t(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(e);this.originalPosition=this.position=this._generatePosition(e,!1);this.originalPageX=e.pageX;this.originalPageY=e.pageY;(i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt));this._setContainment();if(this._trigger("start",e)===!1){this._clear();return!1};this._cacheHelperProportions();if(t.ui.ddmanager&&!i.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)};this._mouseDrag(e,!0);if(t.ui.ddmanager){t.ui.ddmanager.dragStart(this,e)};return!0},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()};this.position=this._generatePosition(e,!0);this.positionAbs=this._convertPositionTo("absolute");if(!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1){this._mouseUp(new t.Event("mouseup",e));return!1};this.position=s.position};this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)};return!1},_mouseStop:function(e){var s=this,i=!1;if(t.ui.ddmanager&&!this.options.dropBehaviour){i=t.ui.ddmanager.drop(this,e)};if(this.dropped){i=this.dropped;this.dropped=!1};if((this.options.revert==="invalid"&&!i)||(this.options.revert==="valid"&&i)||this.options.revert===!0||(t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i))){t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(s._trigger("stop",e)!==!1){s._clear()}})} +else{if(this._trigger("stop",e)!==!1){this._clear()}};return!1},_mouseUp:function(e){this._unblockFrames();if(t.ui.ddmanager){t.ui.ddmanager.dragStop(this,e)};if(this.handleElement.is(e.target)){this.element.trigger("focus")};return t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new t.Event("mouseup",{target:this.element[0]}))} +else{this._clear()};return this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var s=this.options,o=t.isFunction(s.helper),i=o?t(s.helper.apply(this.element[0],[e])):(s.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!i.parents("body").length){i.appendTo((s.appendTo==="parent"?this.element[0].parentNode:s.appendTo))};if(o&&i[0]===this.element[0]){this._setPositionRelative()};if(i[0]!==this.element[0]&&!(/(fixed|absolute)/).test(i.css("position"))){i.css("position","absolute")};return i},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")};if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}};if("left" in e){this.offset.click.left=e.left+this.margins.left};if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left};if("top" in e){this.offset.click.top=e.top+this.margins.top};if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_isRootNode:function(t){return(/(html|body)/i).test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()};if(this._isRootNode(this.offsetParent[0])){e={top:0,left:0}};return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var n,e,i,s=this.options,o=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return};if(s.containment==="window"){this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return};if(s.containment==="document"){this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return};if(s.containment.constructor===Array){this.containment=s.containment;return};if(s.containment==="parent"){s.containment=this.helper[0].parentNode};e=t(s.containment);i=e[0];if(!i){return};n=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(n?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(n?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e){e=this.position};var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:(e.top+this.offset.relative.top*i+this.offset.parent.top*i-((this.cssPosition==="fixed"?-this.offset.scroll.top:(s?0:this.offset.scroll.top))*i)),left:(e.left+this.offset.relative.left*i+this.offset.parent.left*i-((this.cssPosition==="fixed"?-this.offset.scroll.left:(s?0:this.offset.scroll.left))*i))}},_generatePosition:function(t,e){var i,h,o,n,s=this.options,l=this._isRootNode(this.scrollParent[0]),r=t.pageX,a=t.pageY;if(!l||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}};if(e){if(this.containment){if(this.relativeContainer){h=this.relativeContainer.offset();i=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]} +else{i=this.containment};if(t.pageX-this.offset.click.left<i[0]){r=i[0]+this.offset.click.left};if(t.pageY-this.offset.click.top<i[1]){a=i[1]+this.offset.click.top};if(t.pageX-this.offset.click.left>i[2]){r=i[2]+this.offset.click.left};if(t.pageY-this.offset.click.top>i[3]){a=i[3]+this.offset.click.top}};if(s.grid){o=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY;a=i?((o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3])?o:((o-this.offset.click.top>=i[1])?o-s.grid[1]:o+s.grid[1])):o;n=s.grid[0]?this.originalPageX+Math.round((r-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX;r=i?((n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2])?n:((n-this.offset.click.left>=i[0])?n-s.grid[0]:n+s.grid[0])):n};if(s.axis==="y"){r=this.originalPageX};if(s.axis==="x"){a=this.originalPageY}};return{top:(a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(l?0:this.offset.scroll.top))),left:(r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(l?0:this.offset.scroll.left)))}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()};this.helper=null;this.cancelHelperRemoval=!1;if(this.destroyOnClear){this.destroy()}},_trigger:function(e,i,s){s=s||this._uiHash();t.ui.plugin.call(this,e,[i,s,this],!0);if(/^(drag|start|stop)/.test(e)){this.positionAbs=this._convertPositionTo("absolute");s.offset=this.positionAbs};return t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var o=t.extend({},i,{item:s.element});s.sortables=[];t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");if(i&&!i.options.disabled){s.sortables.push(i);i.refreshPositions();i._trigger("activate",e,o)}})},stop:function(e,i,s){var o=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1;t.each(s.sortables,function(){var t=this;if(t.isOver){t.isOver=0;s.cancelHelperRemoval=!0;t.cancelHelperRemoval=!1;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper} +else{t.cancelHelperRemoval=!0;t._trigger("deactivate",e,o)}})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs;o.helperProportions=s.helperProportions;o.offset.click=s.offset.click;if(o._intersectsWith(o.containerCache)){n=!0;t.each(s.sortables,function(){this.positionAbs=s.positionAbs;this.helperProportions=s.helperProportions;this.offset.click=s.offset.click;if(this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])){n=!1};return n})};if(n){if(!o.isOver){o.isOver=1;s._parent=i.helper.parent();o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0);o.options._helper=o.options.helper;o.options.helper=function(){return i.helper[0]};e.target=o.currentItem[0];o._mouseCapture(e,!0);o._mouseStart(e,!0,!0);o.offset.click.top=s.offset.click.top;o.offset.click.left=s.offset.click.left;o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left;o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top;s._trigger("toSortable",e);s.dropped=o.element;t.each(s.sortables,function(){this.refreshPositions()});s.currentItem=s.element;o.fromOutside=s};if(o.currentItem){o._mouseDrag(e);i.position=o.position}} +else{if(o.isOver){o.isOver=0;o.cancelHelperRemoval=!0;o.options._revert=o.options.revert;o.options.revert=!1;o._trigger("out",e,o._uiHash(o));o._mouseStop(e,!0);o.options.revert=o.options._revert;o.options.helper=o.options._helper;if(o.placeholder){o.placeholder.remove()};i.helper.appendTo(s._parent);s._refreshOffsets(e);i.position=s._generatePosition(e,!0);s._trigger("fromSortable",e);s.dropped=!1;t.each(s.sortables,function(){this.refreshPositions()})}}})}});t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var o=t("body"),n=s.options;if(o.css("cursor")){n._cursor=o.css("cursor")};o.css("cursor",n.cursor)},stop:function(e,i,s){var o=s.options;if(o._cursor){t("body").css("cursor",o._cursor)}}});t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var o=t(i.helper),n=s.options;if(o.css("opacity")){n._opacity=o.css("opacity")};o.css("opacity",n.opacity)},stop:function(e,i,s){var o=s.options;if(o._opacity){t(i.helper).css("opacity",o._opacity)}}});t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(!1)};if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(e,i,s){var o=s.options,a=!1,r=s.scrollParentNotHidden[0],n=s.document[0];if(r!==n&&r.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((s.overflowOffset.top+r.offsetHeight)-e.pageY<o.scrollSensitivity){r.scrollTop=a=r.scrollTop+o.scrollSpeed} +else if(e.pageY-s.overflowOffset.top<o.scrollSensitivity){r.scrollTop=a=r.scrollTop-o.scrollSpeed}};if(!o.axis||o.axis!=="y"){if((s.overflowOffset.left+r.offsetWidth)-e.pageX<o.scrollSensitivity){r.scrollLeft=a=r.scrollLeft+o.scrollSpeed} +else if(e.pageX-s.overflowOffset.left<o.scrollSensitivity){r.scrollLeft=a=r.scrollLeft-o.scrollSpeed}}} +else{if(!o.axis||o.axis!=="x"){if(e.pageY-t(n).scrollTop()<o.scrollSensitivity){a=t(n).scrollTop(t(n).scrollTop()-o.scrollSpeed)} +else if(t(window).height()-(e.pageY-t(n).scrollTop())<o.scrollSensitivity){a=t(n).scrollTop(t(n).scrollTop()+o.scrollSpeed)}};if(!o.axis||o.axis!=="y"){if(e.pageX-t(n).scrollLeft()<o.scrollSensitivity){a=t(n).scrollLeft(t(n).scrollLeft()-o.scrollSpeed)} +else if(t(window).width()-(e.pageX-t(n).scrollLeft())<o.scrollSensitivity){a=t(n).scrollLeft(t(n).scrollLeft()+o.scrollSpeed)}}};if(a!==!1&&t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(s,e)}}});t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var o=s.options;s.snapElements=[];t(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var e=t(this),i=e.offset();if(this!==s.element[0]){s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})}})},drag:function(e,i,s){var r,a,h,l,c,p,f,u,o,g,v=s.options,n=v.snapTolerance,d=i.offset.left,b=d+s.helperProportions.width,m=i.offset.top,P=m+s.helperProportions.height;for(o=s.snapElements.length-1;o>=0;o--){c=s.snapElements[o].left-s.margins.left;p=c+s.snapElements[o].width;f=s.snapElements[o].top-s.margins.top;u=f+s.snapElements[o].height;if(b<c-n||d>p+n||P<f-n||m>u+n||!t.contains(s.snapElements[o].item.ownerDocument,s.snapElements[o].item)){if(s.snapElements[o].snapping){(s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[o].item})))};s.snapElements[o].snapping=!1;continue};if(v.snapMode!=="inner"){r=Math.abs(f-P)<=n;a=Math.abs(u-m)<=n;h=Math.abs(c-b)<=n;l=Math.abs(p-d)<=n;if(r){i.position.top=s._convertPositionTo("relative",{top:f-s.helperProportions.height,left:0}).top};if(a){i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top};if(h){i.position.left=s._convertPositionTo("relative",{top:0,left:c-s.helperProportions.width}).left};if(l){i.position.left=s._convertPositionTo("relative",{top:0,left:p}).left}};g=(r||a||h||l);if(v.snapMode!=="outer"){r=Math.abs(f-m)<=n;a=Math.abs(u-P)<=n;h=Math.abs(c-d)<=n;l=Math.abs(p-b)<=n;if(r){i.position.top=s._convertPositionTo("relative",{top:f,left:0}).top};if(a){i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top};if(h){i.position.left=s._convertPositionTo("relative",{top:0,left:c}).left};if(l){i.position.left=s._convertPositionTo("relative",{top:0,left:p-s.helperProportions.width}).left}};if(!s.snapElements[o].snapping&&(r||a||h||l||g)){(s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[o].item})))};s.snapElements[o].snapping=(r||a||h||l||g)}}});t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,r=s.options,o=t.makeArray(t(r.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(!o.length){return};n=parseInt(t(o[0]).css("zIndex"),10)||0;t(o).each(function(e){t(this).css("zIndex",n+e)});this.css("zIndex",(n+o.length))}});t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var o=t(i.helper),n=s.options;if(o.css("zIndex")){n._zIndex=o.css("zIndex")};o.css("zIndex",n.zIndex)},stop:function(e,i,s){var o=s.options;if(o._zIndex){t(i.helper).css("zIndex",o._zIndex)}}});var a=t.ui.draggable; +/*! + * jQuery UI Droppable 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1;this.isout=!0;this.accept=t.isFunction(s)?s:function(t){return t.is(s)};this.proportions=function(){if(arguments.length){e=arguments[0]} +else{return e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(i.scope);i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[];t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++){if(t[e]===this){t.splice(e,1)}}},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if(e==="accept"){this.accept=t.isFunction(i)?i:function(t){return t.is(i)}} +else if(e==="scope"){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s);this._addToManager(i)};this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass();if(i){this._trigger("activate",e,this.ui(i))}},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass();if(i){this._trigger("deactivate",e,this.ui(i))}},_over:function(e){var i=t.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){this._addHoverClass();this._trigger("over",e,this.ui(i))}},_out:function(e){var i=t.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){this._removeHoverClass();this._trigger("out",e,this.ui(i))}},_drop:function(e,s){var o=s||t.ui.ddmanager.current,n=!1;if(!o||(o.currentItem||o.element)[0]===this.element[0]){return!1};this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var s=t(this).droppable("instance");if(s.options.greedy&&!s.options.disabled&&s.options.scope===o.options.scope&&s.accept.call(s.element[0],(o.currentItem||o.element))&&i(o,t.extend(s,{offset:s.element.offset()}),s.options.tolerance,e)){n=!0;return!1}});if(n){return!1};if(this.accept.call(this.element[0],(o.currentItem||o.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",e,this.ui(o));return this.element};return!1},ui:function(t){return{draggable:(t.currentItem||t.element),helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var i=t.ui.intersect=(function(){function t(t,e,i){return(t>=e)&&(t<(e+i))};return function(e,i,s,h){if(!i.offset){return!1};var r=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,l=r+e.helperProportions.width,c=a+e.helperProportions.height,o=i.offset.left,n=i.offset.top,f=o+i.proportions().width,p=n+i.proportions().height;switch(s){case"fit":return(o<=r&&l<=f&&n<=a&&c<=p);case"intersect":return(o<r+(e.helperProportions.width/2)&&l-(e.helperProportions.width/2)<f&&n<a+(e.helperProportions.height/2)&&c-(e.helperProportions.height/2)<p);case"pointer":return t(h.pageY,n,i.proportions().height)&&t(h.pageX,o,i.proportions().width);case"touch":return((a>=n&&a<=p)||(c>=n&&c<=p)||(a<n&&c>p))&&((r>=o&&r<=f)||(l>=o&&l<=f)||(r<o&&l>f));default:return!1}}})();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(s=0;s<o.length;s++){if(o[s].options.disabled||(e&&!o[s].accept.call(o[s].element[0],(e.currentItem||e.element)))){continue};for(n=0;n<r.length;n++){if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue;droppablesLoop}};o[s].visible=o[s].element.css("display")!=="none";if(!o[s].visible){continue};if(a==="mousedown"){o[s]._activate.call(o[s],i)};o[s].offset=o[s].element.offset();o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight})}},drop:function(e,s){var o=!1;t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){if(!this.options){return};if(!this.options.disabled&&this.visible&&i(e,this,this.options.tolerance,s)){o=this._drop.call(this,s)||o};if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(e.currentItem||e.element))){this.isout=!0;this.isover=!1;this._deactivate.call(this,s)}});return o},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){if(!e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,i)}})},drag:function(e,s){if(e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,s)};t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return};var o,a,r,h=i(e,this,this.options.tolerance,s),n=!h&&this.isover?"isout":(h&&!this.isover?"isover":null);if(!n){return};if(this.options.greedy){a=this.options.scope;r=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===a});if(r.length){o=t(r[0]).droppable("instance");o.greedyChild=(n==="isover")}};if(o&&n==="isover"){o.isover=!1;o.isout=!0;o._out.call(o,s)};this[n]=!0;this[n==="isout"?"isover":"isout"]=!1;this[n==="isover"?"_over":"_out"].call(this,s);if(o&&n==="isout"){o.isout=!1;o.isover=!0;o._over.call(o,s)}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable");if(!e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,i)}}};if(t.uiBackCompat!==!1){t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})};var r=t.ui.droppable; +/*! + * jQuery UI Sortable 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var n=t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return(t>=e)&&(t<(e+i))},_isFloating:function(t){return(/left|right/).test(t.css("float"))||(/inline|table-cell/).test(t.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=!0},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--){this.items[t].item.removeData(this.widgetName+"-item")};return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;if(this.reverting){return!1};if(this.options.disabled||this.options.type==="static"){return!1};this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o){s=t(this);return!1}});if(t.data(e.target,o.widgetName+"-item")===o){s=t(e.target)};if(!s){return!1};if(this.options.handle&&!i){t(this.options.handle,s).find("*").addBack().each(function(){if(this===e.target){n=!0}});if(!n){return!1}};this.currentItem=s;this._removeCurrentsFromItems();return!0},_mouseStart:function(e,i,s){var n,r,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()};this._createPlaceholder();if(o.containment){this._setContainment()};if(o.cursor&&o.cursor!=="auto"){r=this.document.find("body");this.storedCursor=r.css("cursor");r.css("cursor",o.cursor);this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(r)};if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")};this.helper.css("opacity",o.opacity)};if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")};this.helper.css("zIndex",o.zIndex)};if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()};this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()};if(!s){for(n=this.containers.length-1;n>=0;n--){this.containers[n]._trigger("activate",e,this._uiHash(this))}};if(t.ui.ddmanager){t.ui.ddmanager.current=this};if(t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)};this.dragging=!0;this._addClass(this.helper,"ui-sortable-helper");this._mouseDrag(e);return!0},_mouseDrag:function(e){var r,o,n,a,i=this.options,s=!1;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs};if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-e.pageY<i.scrollSensitivity){this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+i.scrollSpeed} +else if(e.pageY-this.overflowOffset.top<i.scrollSensitivity){this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-i.scrollSpeed};if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-e.pageX<i.scrollSensitivity){this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+i.scrollSpeed} +else if(e.pageX-this.overflowOffset.left<i.scrollSensitivity){this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-i.scrollSpeed}} +else{if(e.pageY-this.document.scrollTop()<i.scrollSensitivity){s=this.document.scrollTop(this.document.scrollTop()-i.scrollSpeed)} +else if(this.window.height()-(e.pageY-this.document.scrollTop())<i.scrollSensitivity){s=this.document.scrollTop(this.document.scrollTop()+i.scrollSpeed)};if(e.pageX-this.document.scrollLeft()<i.scrollSensitivity){s=this.document.scrollLeft(this.document.scrollLeft()-i.scrollSpeed)} +else if(this.window.width()-(e.pageX-this.document.scrollLeft())<i.scrollSensitivity){s=this.document.scrollLeft(this.document.scrollLeft()+i.scrollSpeed)}};if(s!==!1&&t.ui.ddmanager&&!i.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)}};this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"};if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"};for(r=this.items.length-1;r>=0;r--){o=this.items[r];n=o.item[0];a=this._intersectsWithPointer(o);if(!a){continue};if(o.instance!==this.currentContainer){continue};if(n!==this.currentItem[0]&&this.placeholder[a===1?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&(this.options.type==="semi-dynamic"?!t.contains(this.element[0],n):!0)){this.direction=a===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(o)){this._rearrange(e,o)} +else{break};this._trigger("change",e,this._uiHash());break}};this._contactContainers(e);if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)};this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(e,i){if(!e){return};if(t.ui.ddmanager&&!this.options.dropBehaviour){t.ui.ddmanager.drop(this,e)};if(this.options.revert){var r=this,n=this.placeholder.offset(),s=this.options.axis,o={};if(!s||s==="x"){o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)};if(!s||s==="y"){o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)};this.reverting=!0;t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(e)})} +else{this._clear(e,i)};return!1},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")} +else{this.currentItem.show()};for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}};if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])};if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()};t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});if(this.domPosition.prev){t(this.domPosition.prev).after(this.currentItem)} +else{t(this.domPosition.parent).prepend(this.currentItem)}};return this},serialize:function(e){var s=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};t(s).each(function(){var s=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[\-=_](.+)/));if(s){i.push((e.key||s[1]+"[]")+"="+(e.key&&e.expression?s[1]:s[2]))}});if(!i.length&&e.key){i.push(e.key+"=")};return i.join("&")},toArray:function(e){var s=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};s.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")});return i},_intersectsWith:function(t){var e=this.positionAbs.left,l=e+this.helperProportions.width,i=this.positionAbs.top,c=i+this.helperProportions.height,s=t.left,n=s+t.width,o=t.top,r=o+t.height,a=this.offset.click.top,h=this.offset.click.left,f=(this.options.axis==="x")||((i+a)>o&&(i+a)<r),p=(this.options.axis==="y")||((e+h)>s&&(e+h)<n),u=f&&p;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"])){return u} +else{return(s<e+(this.helperProportions.width/2)&&l-(this.helperProportions.width/2)<n&&o<i+(this.helperProportions.height/2)&&c-(this.helperProportions.height/2)<r)}},_intersectsWithPointer:function(t){var e,i,s=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),o=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=s&&o;if(!n){return!1};e=this._getDragVerticalDirection();i=this._getDragHorizontalDirection();return this.floating?((i==="right"||e==="down")?2:1):(e&&(e==="down"?2:1))},_intersectsWithSides:function(t){var s=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+(t.height/2),t.height),o=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+(t.width/2),t.width),e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();if(this.floating&&i){return((i==="right"&&o)||(i==="left"&&!o))} +else{return e&&((e==="down"&&s)||(e==="up"&&!s))}},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return t!==0&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return t!==0&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var s,o,r,i,h=[],n=[],a=this._connectWith();if(a&&e){for(s=a.length-1;s>=0;s--){r=t(a[s],this.document[0]);for(o=r.length-1;o>=0;o--){i=t.data(r[o],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){n.push([t.isFunction(i.options.items)?i.options.items.call(i.element):t(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i])}}}};n.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function l(){h.push(this)};for(s=n.length-1;s>=0;s--){n[s][0].each(l)};return t(h)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++){if(e[i]===t.item[0]){return!1}};return!0})},_refreshItems:function(e){this.items=[];this.containers=[this];var s,o,r,i,a,h,l,f,p=this.items,n=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready){for(s=c.length-1;s>=0;s--){r=t(c[s],this.document[0]);for(o=r.length-1;o>=0;o--){i=t.data(r[o],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){n.push([t.isFunction(i.options.items)?i.options.items.call(i.element[0],e,{item:this.currentItem}):t(i.options.items,i.element),i]);this.containers.push(i)}}}};for(s=n.length-1;s>=0;s--){a=n[s][1];h=n[s][0];for(o=0,f=h.length;o<f;o++){l=t(h[o]);l.data(this.widgetName+"-item",a);p.push({item:l,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):!1;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()};var i,s,n,o;for(i=this.items.length-1;i>=0;i--){s=this.items[i];if(s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]){continue};n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item;if(!e){s.width=n.outerWidth();s.height=n.outerHeight()};o=n.offset();s.left=o.left;s.top=o.top};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)} +else{for(i=this.containers.length-1;i>=0;i--){o=this.containers[i].element.offset();this.containers[i].containerCache.left=o.left;this.containers[i].containerCache.top=o.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}};return this},_createPlaceholder:function(e){e=e||this;var s,i=e.options;if(!i.placeholder||i.placeholder.constructor===String){s=i.placeholder;i.placeholder={element:function(){var o=e.currentItem[0].nodeName.toLowerCase(),i=t("<"+o+">",e.document[0]);e._addClass(i,"ui-sortable-placeholder",s||e.currentItem[0].className)._removeClass(i,"ui-sortable-helper");if(o==="tbody"){e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(i))} +else if(o==="tr"){e._createTrPlaceholder(e.currentItem,i)} +else if(o==="img"){i.attr("src",e.currentItem.attr("src"))};if(!s){i.css("visibility","hidden")};return i},update:function(t,o){if(s&&!i.forcePlaceholderSize){return};if(!o.height()){o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10))};if(!o.width()){o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}};e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);i.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var s,o,c,n,p,u,a,f,h,l,r=null,i=null;for(s=this.containers.length-1;s>=0;s--){if(t.contains(this.currentItem[0],this.containers[s].element[0])){continue};if(this._intersectsWith(this.containers[s].containerCache)){if(r&&t.contains(this.containers[s].element[0],r.element[0])){continue};r=this.containers[s];i=s} +else{if(this.containers[s].containerCache.over){this.containers[s]._trigger("out",e,this._uiHash(this));this.containers[s].containerCache.over=0}}};if(!r){return};if(this.containers.length===1){if(!this.containers[i].containerCache.over){this.containers[i]._trigger("over",e,this._uiHash(this));this.containers[i].containerCache.over=1}} +else{c=10000;n=null;h=r.floating||this._isFloating(this.currentItem);p=h?"left":"top";u=h?"width":"height";l=h?"pageX":"pageY";for(o=this.items.length-1;o>=0;o--){if(!t.contains(this.containers[i].element[0],this.items[o].item[0])){continue};if(this.items[o].item[0]===this.currentItem[0]){continue};a=this.items[o].item.offset()[p];f=!1;if(e[l]-a>this.items[o][u]/2){f=!0};if(Math.abs(e[l]-a)<c){c=Math.abs(e[l]-a);n=this.items[o];this.direction=f?"up":"down"}};if(!n&&!this.options.dropOnEmpty){return};if(this.currentContainer===this.containers[i]){if(!this.currentContainer.containerCache.over){this.containers[i]._trigger("over",e,this._uiHash());this.currentContainer.containerCache.over=1};return};n?this._rearrange(e,n,null,!0):this._rearrange(e,null,this.containers[i].element,!0);this._trigger("change",e,this._uiHash());this.containers[i]._trigger("change",e,this._uiHash(this));this.currentContainer=this.containers[i];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[i]._trigger("over",e,this._uiHash(this));this.containers[i].containerCache.over=1}},_createHelper:function(e){var s=this.options,i=t.isFunction(s.helper)?t(s.helper.apply(this.element[0],[e,this.currentItem])):(s.helper==="clone"?this.currentItem.clone():this.currentItem);if(!i.parents("body").length){t(s.appendTo!=="parent"?s.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0])};if(i[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}};if(!i[0].style.width||s.forceHelperSize){i.width(this.currentItem.width())};if(!i[0].style.height||s.forceHelperSize){i.height(this.currentItem.height())};return i},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")};if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}};if("left" in e){this.offset.click.left=e.left+this.margins.left};if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left};if("top" in e){this.offset.click.top=e.top+this.margins.top};if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()};if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&t.ui.ie)){e={top:0,left:0}};return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}} +else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,s,o,i=this.options;if(i.containment==="parent"){i.containment=this.helper[0].parentNode};if(i.containment==="document"||i.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,i.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(i.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]};if(!(/^(document|window|parent)$/).test(i.containment)){e=t(i.containment)[0];s=t(i.containment).offset();o=(t(e).css("overflow")!=="hidden");this.containment=[s.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,s.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,s.left+(o?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,s.top+(o?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){if(!i){i=this.position};var s=e==="absolute"?1:-1,o=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,n=(/(html|body)/i).test(o[0].tagName);return{top:(i.top+this.offset.relative.top*s+this.offset.parent.top*s-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(n?0:o.scrollTop()))*s)),left:(i.left+this.offset.relative.left*s+this.offset.parent.left*s-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():n?0:o.scrollLeft())*s))}},_generatePosition:function(e){var s,o,i=this.options,n=e.pageX,r=e.pageY,a=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(a[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()};if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){n=this.containment[0]+this.offset.click.left};if(e.pageY-this.offset.click.top<this.containment[1]){r=this.containment[1]+this.offset.click.top};if(e.pageX-this.offset.click.left>this.containment[2]){n=this.containment[2]+this.offset.click.left};if(e.pageY-this.offset.click.top>this.containment[3]){r=this.containment[3]+this.offset.click.top}};if(i.grid){s=this.originalPageY+Math.round((r-this.originalPageY)/i.grid[1])*i.grid[1];r=this.containment?((s-this.offset.click.top>=this.containment[1]&&s-this.offset.click.top<=this.containment[3])?s:((s-this.offset.click.top>=this.containment[1])?s-i.grid[1]:s+i.grid[1])):s;o=this.originalPageX+Math.round((n-this.originalPageX)/i.grid[0])*i.grid[0];n=this.containment?((o-this.offset.click.left>=this.containment[0]&&o-this.offset.click.left<=this.containment[2])?o:((o-this.offset.click.left>=this.containment[0])?o-i.grid[0]:o+i.grid[0])):o}};return{top:(r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(h?0:a.scrollTop())))),left:(n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():h?0:a.scrollLeft())))}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?e.item[0]:e.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){if(o===this.counter){this.refreshPositions(!s)}})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)};this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}};this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")} +else{this.currentItem.show()};if(this.fromOutside&&!e){s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})};if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!e){s.push(function(t){this._trigger("update",t,this._uiHash())})};if(this!==this.currentContainer){if(!e){s.push(function(t){this._trigger("remove",t,this._uiHash())});s.push((function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}).call(this,this.currentContainer));s.push((function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}).call(this,this.currentContainer))}};function o(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}};for(i=this.containers.length-1;i>=0;i--){if(!e){s.push(o("deactivate",this,this.containers[i]))};if(this.containers[i].containerCache.over){s.push(o("out",this,this.containers[i]));this.containers[i].containerCache.over=0}};if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()};if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)};if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)};this.dragging=!1;if(!e){this._trigger("beforeStop",t,this._uiHash())};this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()};this.helper=null};if(!e){for(i=0;i<s.length;i++){s[i].call(this,t)};this._trigger("stop",t,this._uiHash())};this.fromOutside=!1;return!this.cancelHelperRemoval},_trigger:function(){if(t.Widget.prototype._trigger.apply(this,arguments)===!1){this.cancel()}},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}));/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orSearch.min.js */ +/** + * Suche mit Dropdown + */ +jQuery.fn.orSearch = function( options ) +{ + // Create some defaults, extending them with any options that were provided + var settings = $.extend( { + 'dropdown': $(), // empty element + 'select' : function( obj ) {} + }, options); + + + return $(this).on('input', function() + { + let searchArgument = $(this).val(); + let dropdownEl = $( settings.dropdown ); + + if ( searchArgument.length > 3 ) + { + $(dropdownEl).empty(); // Leeren. + + $.ajax( { 'type':'GET',url:'./api/?action=search&subaction=quicksearch&output=json&search='+searchArgument, data:null, success:function(data, textStatus, jqXHR) + { + for( id in data.output.result ) + { + let result = data.output.result[id]; + + // Suchergebnis-Zeile in das Ergebnis schreiben. + + let div = $('<div class="entry or-search-result" title="'+result.desc+'"></div>'); + div.data('object',{ + 'name':result.name, + 'action':result.type, + 'id':result.id + } ); + let link = $('<a />').attr('href',Openrat.Navigator.createShortUrl(result.type, result.id)); + link.click( function(e) { + e.preventDefault(); + }); + $(link).append('<i class="image-icon image-icon--action-'+result.type+'" />'); + $(link).append('<span>'+result.name+'</span>'); + + $(div).append(link); + $(dropdownEl).append(div); + } + + // Open the menu + $(dropdownEl).closest('.or-menu').addClass('open'); + + // Register clickhandler for search results. + $(dropdownEl).find('.or-search-result').click( function(e) { + settings.select( $(this).data('object') ); + } ); + + } } ); + + + } + else + { + // No search argument. + $(dropdownEl).empty(); // Leeren. + } + }); +};/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js */ +/** + * Enable clicking on '.clickable'-Areas. + */ + +var popupWindow; + +jQuery.fn.orLinkify = function() +{ + + // Das 'echte' Ausführen der Links deaktivieren, da dies schon per Javascript erfolgt. + // Das Öffnen in einem neuen Tab funktioniert aber weiterhin über die URL. + $(this).find('a').click( function(event) { + event.preventDefault(); + } ); + + return $(this).click(function() + { + + $(this).find('a').first().each( function() { + + let type = $(this).attr('data-type'); + + // Inaktive Menüpunkte sind natürlich nicht anklickbar. + if ( $(this).parent().hasClass('inactive') ) + return; + + switch( type ) + { + case 'post': + + // Create a temporary form element. + $form = $('<form />').attr('method','POST').addClass('invisible'); + $form.data('afterSuccess', $(this).data('afterSuccess')); + let params = jQuery.parseJSON( $(this).attr('data-data') ); + params.output = 'json'; + + // Add input elements... + $.each( params, function(key,value) { + let $input = $('<input />').attr('type','hidden').attr('name',key).attr('value',value); + $form.append( $input ); + } ); + + // Submit the form. + let form = new Openrat.Form(); + form.initOnElement( $form ); + form.submit(); + + break; + + case 'edit': + case 'dialog': + startDialog($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-method'),$(this).attr('data-id'),$(this).attr('data-extra') ); + break; + + case 'external': + window.open( $(this).attr('data-url'),' _blank' ); + break; + + case 'popup': + popupWindow = window.open( $(this).attr('data-url'), 'Popup', 'location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes'); + break; + + case 'help': + help(this,$(this).attr('data-url'),$(this).attr('data-suffix') ); + break; + + case 'fullscreen': + fullscreen(this); + break; + + case 'open': + openNewAction( $(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-id') ); + break; + + default: + throw "UI error: Unknown link type: "+type+" in link "+$(this).html(); + } + } ); + }); +}; + + + +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orTree.min.js */ +/** + * Baum darstellen. + * + * Die Controls zum Öffnen/Schließen der Teilbäume werden mit Event-Listener bestückt. + * Beim Öffnen von Teilbäumen wird der Inhalt vom Server geladen. + */ +jQuery.fn.orTree = function () +{ + $(this).each(function (idxx, treeEl) + { + // Klick-Funktion zum Öffnen des Zweiges. + $(treeEl).children('.or-navtree-node-control').click( function () + { + var node = $(this).parent('.or-navtree-node'); + + if ($(node).is('.or-navtree-node--is-open')) { + // Pfad ist offen -> schließen + $(node).children('ul').slideUp('fast').remove(); + + // Am Knoten die Klasse wechseln. + $(node).removeClass('or-navtree-node--is-open').addClass('or-navtree-node--is-closed').find('.tree-icon').removeClass('image-icon--node-open').addClass('image-icon--node-closed'); + } + else { + // Pfad ist geschlossen -> öffnen. + $(treeEl).closest('div.view').addClass('loader'); + + var type = $(node).data('type'); + var id = $(node).data('id'); + var extraId = $(node).data('extra'); + + var loadBranchUrl = './api/?action=tree&subaction=loadBranch&id=' + id + '&type=' + type + '&output=json'; + + // Extra-Id ergänzen. + if (typeof extraId === 'string') { + jQuery.each(jQuery.parseJSON(extraId.replace(/'/g,'"')), function (name, value) { + loadBranchUrl = loadBranchUrl + '&' + name + '=' + value; + }); + } + else if (typeof extraId === 'object') { + jQuery.each(extraId, function (name, field) { + loadBranchUrl = loadBranchUrl + '&' + name + '=' + field; + }); + } + else { + ; + } + + // Die Inhalte des Zweiges laden. + $.getJSON(loadBranchUrl, function (json) { + + // Den neuen Unter-Zweig erzeugen. + let ul = $('<ul class="or-navtree-list" />'); + $(treeEl).append(ul); + let output = json['output']; + $.each(output['branch'], function (idx, line) { + //if (!line.action || line.action == 'folder' || settings.selectable.length == 0 || settings.selectable[0] == '' || jQuery.inArray(line.action, settings.selectable) != -1) { + //var img = (line.url!==undefined?'tree_plus':'tree_none'); + let new_li = $('<li class="or-navtree-node or-navtree-node--is-closed or-draggable or-draggable--type-'+line.type+'" data-name="' + line.text + '" data-id="' + line.internalId + '" data-type="' + line.type + '" data-extra="' + JSON.stringify(line.extraId).replace(/"/g, "\'") + '"><div class="tree or-navtree-node-control"><i class="tree-icon image-icon image-icon--node-closed"></i></div><div class="clickable"><a href="' + Openrat.Navigator.createShortUrl(line.action,line.internalId) + '" class="entry" data-extra="' + JSON.stringify(line.extraId).replace(/"/g, "'") + '" data-id="' + line.internalId + '" data-action="' + line.action + '" data-type="open" title="' + line.description + '"><i class="image-icon image-icon--action-' + line['icon'] + '"></i> ' + line.text + '</a></div></li>'); + $(ul).append(new_li); + + $(new_li).orTree(); // Alle Unter-Knoten erhalten auch Event-Listener zum Öffnen/Schließen. + + // Die Navigationspunkte sind anklickbar, hier wird der Standardmechanismus benutzt. + $(new_li).find('.clickable').orLinkify(); + $(new_li).find('.clickable a').click( function(event) { + event.preventDefault(); // Links werden per Javascript geöffnet. Beim Öffnen im neuen Tab hat das aber keine Bedeutung. + } ); + registerTreeBranchEvents(ul); + //} + }); + $(ul).slideDown('fast'); // Einblenden + + }).fail(function () { + // Ups... aber was können wir hier schon tun, außer hässliche Meldungen anzeigen. + Openrat.Workbench.notify('','','ERROR','failed to load subtree',[],false); + }).always(function () { + + // Die Loader-Animation entfernen. + $(treeEl).closest('div.view').removeClass('loader'); + }); + + // Am Knoten die Klasse wechseln. + $(node).addClass('or-navtree-node--is-open').removeClass('or-navtree-node--is-closed').find('.tree-icon').addClass('image-icon--node-open').removeClass('image-icon--node-closed'); + } + }); + + }); +};/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orAutoheight.min.js */ +/** + * Input-Hints + */ +jQuery.fn.orAutoheight = function() +{ + + var resize = function( element ) + { + var lines = $(element).val().split("\n").length; + $(element).attr('rows',lines+3); + }; + + $(this).each(function(i) + { + resize(this); + }); + + return $(this).keypress(function() + { + resize(this); + }); +};/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/jquery-qrcode.min.js */ +/*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */ +!function(r){"use strict";function t(t,e,n,o){function a(r,t){return r-=o,t-=o,0>r||r>=c||0>t||t>=c?!1:f.isDark(r,t)}function i(r,t,e,n){var o=u.isDark,a=1/l;u.isDark=function(i,u){var f=u*a,c=i*a,l=f+a,g=c+a;return o(i,u)&&(r>l||f>e||t>g||c>n)}}var u={},f=r(n,e);f.addData(t),f.make(),o=o||0;var c=f.getModuleCount(),l=f.getModuleCount()+2*o;return u.text=t,u.level=e,u.version=n,u.moduleCount=l,u.isDark=a,u.addBlank=i,u}function e(r,e,n,o,a){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var i=n;o>=i;i+=1)try{return t(r,e,i,a)}catch(u){}}function n(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,a=w("<canvas/>")[0].getContext("2d");a.font=o;var i=a.measureText(e.label).width,u=e.mSize,f=i/n,c=(1-f)*e.mPosX,l=(1-u)*e.mPosY,g=c+f,s=l+u,v=.01;1===e.mode?r.addBlank(0,l-v,n,s+v):r.addBlank(c-v,l-v,g+v,s+v),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,l*n+.75*e.mSize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalWidth||1,a=e.image.naturalHeight||1,i=e.mSize,u=i*o/a,f=(1-u)*e.mPosX,c=(1-i)*e.mPosY,l=f+u,g=c+i,s=.01;3===e.mode?r.addBlank(0,c-s,n,g+s):r.addBlank(f-s,c-s,l+s,g+s),t.drawImage(e.image,f*n,c*n,u*n,i*n)}function a(r,t,e){w(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var a=e.mode;1===a||2===a?n(r,t,e):(3===a||4===a)&&o(r,t,e)}function i(r,t,e,n,o,a,i,u){r.isDark(i,u)&&t.rect(n,o,a,a)}function u(r,t,e,n,o,a,i,u,f,c){i?r.moveTo(t+a,e):r.moveTo(t,e),u?(r.lineTo(n-a,e),r.arcTo(n,e,n,o,a)):r.lineTo(n,e),f?(r.lineTo(n,o-a),r.arcTo(n,o,t,o,a)):r.lineTo(n,o),c?(r.lineTo(t+a,o),r.arcTo(t,o,t,e,a)):r.lineTo(t,o),i?(r.lineTo(t,e+a),r.arcTo(t,e,n,e,a)):r.lineTo(t,e)}function f(r,t,e,n,o,a,i,u,f,c){i&&(r.moveTo(t+a,e),r.lineTo(t,e),r.lineTo(t,e+a),r.arcTo(t,e,t+a,e,a)),u&&(r.moveTo(n-a,e),r.lineTo(n,e),r.lineTo(n,e+a),r.arcTo(n,e,n-a,e,a)),f&&(r.moveTo(n-a,o),r.lineTo(n,o),r.lineTo(n,o-a),r.arcTo(n,o,n-a,o,a)),c&&(r.moveTo(t+a,o),r.lineTo(t,o),r.lineTo(t,o-a),r.arcTo(t,o,t+a,o,a))}function c(r,t,e,n,o,a,i,c){var l=r.isDark,g=n+a,s=o+a,v=e.radius*a,h=i-1,d=i+1,w=c-1,m=c+1,y=l(i,c),T=l(h,w),p=l(h,c),B=l(h,m),A=l(i,m),E=l(d,m),k=l(d,c),M=l(d,w),C=l(i,w);y?u(t,n,o,g,s,v,!p&&!C,!p&&!A,!k&&!A,!k&&!C):f(t,n,o,g,s,v,p&&C&&T,p&&A&&B,k&&A&&E,k&&C&&M)}function l(r,t,e){var n,o,a=r.moduleCount,u=e.size/a,f=i;for(e.radius>0&&e.radius<=.5&&(f=c),t.beginPath(),n=0;a>n;n+=1)for(o=0;a>o;o+=1){var l=e.left+o*u,g=e.top+n*u,s=u;f(r,t,e,l,g,s,n,o)}if(w(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var v=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=v,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function g(r,t){var n=e(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!n)return null;var o=w(r).data("qrcode",n),i=o[0].getContext("2d");return a(n,i,t),l(n,i,t),o}function s(r){var t=w("<canvas/>").attr("width",r.size).attr("height",r.size);return g(t,r)}function v(r){return w("<img/>").attr("src",s(r)[0].toDataURL("image/png"))}function h(r){var t=e(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var n,o,a=r.size,i=r.background,u=Math.floor,f=t.moduleCount,c=u(a/f),l=u(.5*(a-c*f)),g={position:"relative",left:0,top:0,padding:0,margin:0,width:a,height:a},s={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},v=w("<div/>").data("qrcode",t).css(g);for(i&&v.css("background-color",i),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isDark(n,o)&&w("<div/>").css(s).css({left:l+o*c,top:l+n*c}).appendTo(v);return v}function d(r){return m&&"canvas"===r.render?s(r):m&&"image"===r.render?v(r):h(r)}var w=window.jQuery,m=function(){var r=document.createElement("canvas");return!(!r.getContext||!r.getContext("2d"))}(),y={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};w.fn.qrcode=function(r){var t=w.extend({},y,r);return this.each(function(r,e){"canvas"===e.nodeName.toLowerCase()?g(e,t):w(e).append(d(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),o={};return o.getAt=function(r){return n[r]},o.getLength=function(){return n.length},o.multiply=function(t){for(var e=new Array(o.getLength()+t.getLength()-1),n=0;n<o.getLength();n+=1)for(var a=0;a<t.getLength();a+=1)e[n+a]^=i.gexp(i.glog(o.getAt(n))+i.glog(t.getAt(a)));return r(e,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=i.glog(o.getAt(0))-i.glog(t.getAt(0)),n=new Array(o.getLength()),a=0;a<o.getLength();a+=1)n[a]=o.getAt(a);for(var a=0;a<t.getLength();a+=1)n[a]^=i.gexp(i.glog(t.getAt(a))+e);return r(n,0).mod(t)},o}var t=function(t,e){var o=236,i=17,l=t,g=n[e],s=null,v=0,d=null,w=new Array,m={},y=function(r,t){v=4*l+17,s=function(r){for(var t=new Array(r),e=0;r>e;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(v),T(0,0),T(v-7,0),T(0,v-7),A(),B(),k(r,t),l>=7&&E(r),null==d&&(d=D(l,g,w)),M(d,t)},T=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=v))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=v||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?s[r+e][t+n]=!0:s[r+e][t+n]=!1)},p=function(){for(var r=0,t=0,e=0;8>e;e+=1){y(!0,e);var n=a.getLostPoint(m);(0==e||r>n)&&(r=n,t=e)}return t},B=function(){for(var r=8;v-8>r;r+=1)null==s[r][6]&&(s[r][6]=r%2==0);for(var t=8;v-8>t;t+=1)null==s[6][t]&&(s[6][t]=t%2==0)},A=function(){for(var r=a.getPatternPosition(l),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==s[n][o])for(var i=-2;2>=i;i+=1)for(var u=-2;2>=u;u+=1)-2==i||2==i||-2==u||2==u||0==i&&0==u?s[n+i][o+u]=!0:s[n+i][o+u]=!1}},E=function(r){for(var t=a.getBCHTypeNumber(l),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[Math.floor(e/3)][e%3+v-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[e%3+v-8-3][Math.floor(e/3)]=n}},k=function(r,t){for(var e=g<<3|t,n=a.getBCHTypeInfo(e),o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);6>o?s[o][8]=i:8>o?s[o+1][8]=i:s[v-15+o][8]=i}for(var o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);8>o?s[8][v-o-1]=i:9>o?s[8][15-o-1+1]=i:s[8][15-o-1]=i}s[v-8][8]=!r},M=function(r,t){for(var e=-1,n=v-1,o=7,i=0,u=a.getMaskFunction(t),f=v-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==s[n][f-c]){var l=!1;i<r.length&&(l=1==(r[i]>>>o&1));var g=u(n,f-c);g&&(l=!l),s[n][f-c]=l,o-=1,-1==o&&(i+=1,o=7)}if(n+=e,0>n||n>=v){n-=e,e=-e;break}}},C=function(t,e){for(var n=0,o=0,i=0,u=new Array(e.length),f=new Array(e.length),c=0;c<e.length;c+=1){var l=e[c].dataCount,g=e[c].totalCount-l;o=Math.max(o,l),i=Math.max(i,g),u[c]=new Array(l);for(var s=0;s<u[c].length;s+=1)u[c][s]=255&t.getBuffer()[s+n];n+=l;var v=a.getErrorCorrectPolynomial(g),h=r(u[c],v.getLength()-1),d=h.mod(v);f[c]=new Array(v.getLength()-1);for(var s=0;s<f[c].length;s+=1){var w=s+d.getLength()-f[c].length;f[c][s]=w>=0?d.getAt(w):0}}for(var m=0,s=0;s<e.length;s+=1)m+=e[s].totalCount;for(var y=new Array(m),T=0,s=0;o>s;s+=1)for(var c=0;c<e.length;c+=1)s<u[c].length&&(y[T]=u[c][s],T+=1);for(var s=0;i>s;s+=1)for(var c=0;c<e.length;c+=1)s<f[c].length&&(y[T]=f[c][s],T+=1);return y},D=function(r,t,e){for(var n=u.getRSBlocks(r,t),c=f(),l=0;l<e.length;l+=1){var g=e[l];c.put(g.getMode(),4),c.put(g.getLength(),a.getLengthInBits(g.getMode(),r)),g.write(c)}for(var s=0,l=0;l<n.length;l+=1)s+=n[l].dataCount;if(c.getLengthInBits()>8*s)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*s+")");for(c.getLengthInBits()+4<=8*s&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;;){if(c.getLengthInBits()>=8*s)break;if(c.put(o,8),c.getLengthInBits()>=8*s)break;c.put(i,8)}return C(c,n)};return m.addData=function(r){var t=c(r);w.push(t),d=null},m.isDark=function(r,t){if(0>r||r>=v||0>t||t>=v)throw new Error(r+","+t);return s[r][t]},m.getModuleCount=function(){return v},m.make=function(){y(!1,p())},m.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+t+"px;",e+='">',e+="<tbody>";for(var n=0;n<m.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<m.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=m.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},m.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=m.getModuleCount()*r+2*t,n=t,o=e-t;return h(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var a=Math.floor((t-n)/r),i=Math.floor((e-n)/r);return m.isDark(i,a)?0:1}return 1})},m};t.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},t.createStringToBytes=function(r,t){var e=function(){for(var e=s(r),n=function(){var r=e.read();if(-1==r)throw new Error;return r},o=0,a={};;){var i=e.read();if(-1==i)break;var u=n(),f=n(),c=n(),l=String.fromCharCode(i<<8|u),g=f<<8|c;a[l]=g,o+=1}if(o!=t)throw new Error(o+" != "+t);return a}(),n="?".charCodeAt(0);return function(r){for(var t=new Array,o=0;o<r.length;o+=1){var a=r.charCodeAt(o);if(128>a)t.push(a);else{var i=e[r.charAt(o)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,a=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<<c(t)-c(n);return(r<<10|t)^u},f.getBCHTypeNumber=function(r){for(var t=r<<12;c(t)-c(a)>=0;)t^=a<<c(t)-c(a);return r<<12|t},f.getPatternPosition=function(r){return t[r-1]},f.getMaskFunction=function(r){switch(r){case o.PATTERN000:return function(r,t){return(r+t)%2==0};case o.PATTERN001:return function(r,t){return r%2==0};case o.PATTERN010:return function(r,t){return t%3==0};case o.PATTERN011:return function(r,t){return(r+t)%3==0};case o.PATTERN100:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(r,t){return r*t%2+r*t%3==0};case o.PATTERN110:return function(r,t){return(r*t%2+r*t%3)%2==0};case o.PATTERN111:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},f.getErrorCorrectPolynomial=function(t){for(var e=r([1],0),n=0;t>n;n+=1)e=e.multiply(r([1,i.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var a=0,i=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&i==r.isDark(n+u,o+f)&&(a+=1);a>5&&(e+=3+a-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var l=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(l+=1);var g=Math.abs(100*l/t/t-50)/5;return e+=10*g},f}(),i=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<<e;for(var e=8;256>e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var a=n.length/3,i=new Array,u=0;a>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],l=n[3*u+2],g=0;f>g;g+=1)i.push(t(c,l));return i},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),a={};return a.getMode=function(){return n},a.getLength=function(r){return o.length},a.write=function(r){for(var t=0;t<o.length;t+=1)r.put(o[t],8)},a},l=function(){var r=new Array,t={};return t.writeByte=function(t){r.push(255&t)},t.writeShort=function(r){t.writeByte(r),t.writeByte(r>>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e<r.length;e+=1)t.writeByte(r.charCodeAt(e))},t.toByteArray=function(){return r},t.toString=function(){var t="";t+="[";for(var e=0;e<r.length;e+=1)e>0&&(t+=","),t+=r[e];return t+="]"},t},g=function(){var r=0,t=0,e=0,n="",o={},a=function(r){n+=String.fromCharCode(i(63&r))},i=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)a(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(a(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,i=0;o>i;i+=1)n+="="},o.toString=function(){return n},o},s=function(r){var t=r,e=0,n=0,o=0,a={};a.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|i(r.charCodeAt(0)),o+=6)}var a=n>>>o-8&255;return o-=8,a};var i=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return a},v=function(r,t){var e=r,n=t,o=new Array(r*t),a={};a.setPixel=function(r,t,n){o[t*e+r]=n},a.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var a=0;o.length-a>255;)r.writeByte(255),r.writeBytes(o,a,255),a+=255;r.writeByte(o.length-a),r.writeBytes(o,a,o.length-a),r.writeByte(0),r.writeString(";")};var i=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<<e|n)),o-=8-e,r>>>=8-e,n=0,e=0;n=r<<e|n,e+=o},o.flush=function(){e>0&&t.writeByte(n)},o},u=function(r){for(var t=1<<r,e=(1<<r)+1,n=r+1,a=f(),u=0;t>u;u+=1)a.add(String.fromCharCode(u));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(e));var c=l(),g=i(c);g.write(t,n);var s=0,v=String.fromCharCode(o[s]);for(s+=1;s<o.length;){var h=String.fromCharCode(o[s]);s+=1,a.contains(v+h)?v+=h:(g.write(a.indexOf(v),n),a.size()<4095&&(a.size()==1<<n&&(n+=1),a.add(v+h)),v=h)}return g.write(a.indexOf(v),n),g.write(e,n),g.flush(),c.toByteArray()},f=function(){var r={},t=0,e={};return e.add=function(n){if(e.contains(n))throw new Error("dup key:"+n);r[n]=t,t+=1},e.size=function(){return t},e.indexOf=function(t){return r[t]},e.contains=function(t){return"undefined"!=typeof r[t]},e};return a},h=function(r,t,e,n){for(var o=v(r,t),a=0;t>a;a+=1)for(var i=0;r>i;i+=1)o.setPixel(i,a,e(i,a));var u=l();o.write(u);for(var f=g(),c=u.toByteArray(),s=0;s<c.length;s+=1)f.writeByte(c[s]);f.flush();var h="";return h+="<img",h+=' src="',h+="data:image/gif;base64,",h+=f,h+='"',h+=' width="',h+=r,h+='"',h+=' height="',h+=t,h+='"',n&&(h+=' alt="',h+=n,h+='"'),h+="/>"};return t}();return function(r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r())}(function(){return r}),!function(r){r.stringToBytes=function(r){function t(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);128>n?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}());/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/jquery.hotkeys.min.js */ +(function(t){t.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}};function e(e){if(typeof e.data==="string"){e.data={keys:e.data}};if(!e.data||!e.data.keys||typeof e.data.keys!=="string"){return};var a=e.handler,s=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this!==e.target&&(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||(t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable"))||(t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1))){return};var n=e.type!=="keypress"&&t.hotkeys.specialKeys[e.which],f=String.fromCharCode(e.which).toLowerCase(),i="",r={};t.each(["alt","ctrl","shift"],function(t,s){if(e[s+"Key"]&&n!==s){i+=s+"+"}});if(e.metaKey&&!e.ctrlKey&&n!=="meta"){i+="meta+"};if(e.metaKey&&n!=="meta"&&i.indexOf("alt+ctrl+shift+")>-1){i=i.replace("alt+ctrl+shift+","hyper+")};if(n){r[i+n]=!0} +else{r[i+f]=!0;r[i+t.hotkeys.shiftNums[f]]=!0;if(i==="shift+"){r[t.hotkeys.shiftNums[f]]=!0}};for(var o=0,p=s.length;o<p;o++){if(r[s[o]]){return a.apply(this,arguments)}}}};t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})})(jQuery||this.jQuery||window.jQuery);/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/lib/codemirror.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// This is CodeMirror (http://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.CodeMirror = factory()); +}(this, (function () { 'use strict'; + +// Kludges for bugs and behavior differences that can't be feature +// detected are enabled based on userAgent etc sniffing. +var userAgent = navigator.userAgent +var platform = navigator.platform + +var gecko = /gecko\/\d/i.test(userAgent) +var ie_upto10 = /MSIE \d/.test(userAgent) +var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent) +var edge = /Edge\/(\d+)/.exec(userAgent) +var ie = ie_upto10 || ie_11up || edge +var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]) +var webkit = !edge && /WebKit\//.test(userAgent) +var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent) +var chrome = !edge && /Chrome\//.test(userAgent) +var presto = /Opera\//.test(userAgent) +var safari = /Apple Computer/.test(navigator.vendor) +var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent) +var phantom = /PhantomJS/.test(userAgent) + +var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent) +var android = /Android/.test(userAgent) +// This is woefully incomplete. Suggestions for alternative methods welcome. +var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent) +var mac = ios || /Mac/.test(platform) +var chromeOS = /\bCrOS\b/.test(userAgent) +var windows = /win/i.test(platform) + +var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/) +if (presto_version) { presto_version = Number(presto_version[1]) } +if (presto_version && presto_version >= 15) { presto = false; webkit = true } +// Some browsers use the wrong event properties to signal cmd/ctrl on OS X +var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)) +var captureRightClick = gecko || (ie && ie_version >= 9) + +function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } + +var rmClass = function(node, cls) { + var current = node.className + var match = classTest(cls).exec(current) + if (match) { + var after = current.slice(match.index + match[0].length) + node.className = current.slice(0, match.index) + (after ? match[1] + after : "") + } +} + +function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + { e.removeChild(e.firstChild) } + return e +} + +function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e) +} + +function elt(tag, content, className, style) { + var e = document.createElement(tag) + if (className) { e.className = className } + if (style) { e.style.cssText = style } + if (typeof content == "string") { e.appendChild(document.createTextNode(content)) } + else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } } + return e +} +// wrapper for elt, which removes the elt from the accessibility tree +function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style) + e.setAttribute("role", "presentation") + return e +} + +var range +if (document.createRange) { range = function(node, start, end, endNode) { + var r = document.createRange() + r.setEnd(endNode || node, end) + r.setStart(node, start) + return r +} } +else { range = function(node, start, end) { + var r = document.body.createTextRange() + try { r.moveToElementText(node.parentNode) } + catch(e) { return r } + r.collapse(true) + r.moveEnd("character", end) + r.moveStart("character", start) + return r +} } + +function contains(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + { child = child.parentNode } + if (parent.contains) + { return parent.contains(child) } + do { + if (child.nodeType == 11) { child = child.host } + if (child == parent) { return true } + } while (child = child.parentNode) +} + +function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement + try { + activeElement = document.activeElement + } catch(e) { + activeElement = document.body || null + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) + { activeElement = activeElement.shadowRoot.activeElement } + return activeElement +} + +function addClass(node, cls) { + var current = node.className + if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls } +} +function joinClasses(a, b) { + var as = a.split(" ") + for (var i = 0; i < as.length; i++) + { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } } + return b +} + +var selectInput = function(node) { node.select() } +if (ios) // Mobile Safari apparently has a bug where select() is broken. + { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } } +else if (ie) // Suppress mysterious IE10 errors + { selectInput = function(node) { try { node.select() } catch(_e) {} } } + +function bind(f) { + var args = Array.prototype.slice.call(arguments, 1) + return function(){return f.apply(null, args)} +} + +function copyObj(obj, target, overwrite) { + if (!target) { target = {} } + for (var prop in obj) + { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + { target[prop] = obj[prop] } } + return target +} + +// Counts the column offset in a string, taking tabs into account. +// Used mostly to find indentation. +function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/) + if (end == -1) { end = string.length } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i) + if (nextTab < 0 || nextTab >= end) + { return n + (end - i) } + n += nextTab - i + n += tabSize - (n % tabSize) + i = nextTab + 1 + } +} + +var Delayed = function() {this.id = null}; +Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id) + this.id = setTimeout(f, ms) +}; + +function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + { if (array[i] == elt) { return i } } + return -1 +} + +// Number of pixels added to scroller and sizer to hide scrollbar +var scrollerGap = 30 + +// Returned or thrown by various protocols to signal 'I'm not +// handling this'. +var Pass = {toString: function(){return "CodeMirror.Pass"}} + +// Reused option objects for setSelection & friends +var sel_dontScroll = {scroll: false}; +var sel_mouse = {origin: "*mouse"}; +var sel_move = {origin: "+move"}; +// The inverse of countColumn -- find the offset that corresponds to +// a particular column. +function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos) + if (nextTab == -1) { nextTab = string.length } + var skipped = nextTab - pos + if (nextTab == string.length || col + skipped >= goal) + { return pos + Math.min(skipped, goal - col) } + col += nextTab - pos + col += tabSize - (col % tabSize) + pos = nextTab + 1 + if (col >= goal) { return pos } + } +} + +var spaceStrs = [""] +function spaceStr(n) { + while (spaceStrs.length <= n) + { spaceStrs.push(lst(spaceStrs) + " ") } + return spaceStrs[n] +} + +function lst(arr) { return arr[arr.length-1] } + +function map(array, f) { + var out = [] + for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) } + return out +} + +function insertSorted(array, value, score) { + var pos = 0, priority = score(value) + while (pos < array.length && score(array[pos]) <= priority) { pos++ } + array.splice(pos, 0, value) +} + +function nothing() {} + +function createObj(base, props) { + var inst + if (Object.create) { + inst = Object.create(base) + } else { + nothing.prototype = base + inst = new nothing() + } + if (props) { copyObj(props, inst) } + return inst +} + +var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/ +function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) +} +function isWordChar(ch, helper) { + if (!helper) { return isWordCharBasic(ch) } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } + return helper.test(ch) +} + +function isEmpty(obj) { + for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } + return true +} + +// Extending unicode characters. A series of a non-extending char + +// any number of extending chars is treated as a single unit as far +// as editing and measuring is concerned. This is not fully correct, +// since some scripts/fonts/browsers also treat other configurations +// of code points as a group. +var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/ +function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } + +// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. +function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir } + return pos +} + +// Returns the value from the range [`from`; `to`] that satisfies +// `pred` and is closest to `from`. Assumes that at least `to` +// satisfies `pred`. Supports `from` being greater than `to`. +function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1 + for (;;) { + if (from == to) { return from } + var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF) + if (mid == from) { return pred(mid) ? from : to } + if (pred(mid)) { to = mid } + else { from = mid + dir } + } +} + +// The display handles the DOM integration, both for input reading +// and content drawing. It holds references to DOM nodes and +// display-related state. + +function Display(place, doc, input) { + var d = this + this.input = input + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler") + d.scrollbarFiller.setAttribute("cm-not-content", "true") + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler") + d.gutterFiller.setAttribute("cm-not-content", "true") + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code") + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1") + d.cursorDiv = elt("div", null, "CodeMirror-cursors") + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure") + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure") + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none") + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines") + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative") + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer") + d.sizerWidth = null + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;") + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters") + d.lineGutter = null + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll") + d.scroller.setAttribute("tabIndex", "-1") + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror") + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 } + if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true } + + if (place) { + if (place.appendChild) { place.appendChild(d.wrapper) } + else { place(d.wrapper) } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first + d.reportedViewFrom = d.reportedViewTo = doc.first + // Information about the rendered lines. + d.view = [] + d.renderedView = null + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null + // Empty space (in pixels) above the view + d.viewOffset = 0 + d.lastWrapHeight = d.lastWrapWidth = 0 + d.updateLineNumbers = null + + d.nativeBarWidth = d.barHeight = d.barWidth = 0 + d.scrollbarsClipped = false + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null + d.maxLineLength = 0 + d.maxLineChanged = false + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null + + // True when shift is held down. + d.shift = false + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null + + d.activeTouch = null + + input.init(d) +} + +// Find the line object corresponding to the given line number. +function getLine(doc, n) { + n -= doc.first + if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } + var chunk = doc + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize() + if (n < sz) { chunk = child; break } + n -= sz + } + } + return chunk.lines[n] +} + +// Get the part of a document between two positions, as an array of +// strings. +function getBetween(doc, start, end) { + var out = [], n = start.line + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text + if (n == end.line) { text = text.slice(0, end.ch) } + if (n == start.line) { text = text.slice(start.ch) } + out.push(text) + ++n + }) + return out +} +// Get the lines between from and to, as array of strings. +function getLines(doc, from, to) { + var out = [] + doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value + return out +} + +// Update the height of a line, propagating the height change +// upwards to parent nodes. +function updateLineHeight(line, height) { + var diff = height - line.height + if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } } +} + +// Given a line object, find its line number by walking up through +// its parent links. +function lineNo(line) { + if (line.parent == null) { return null } + var cur = line.parent, no = indexOf(cur.lines, line) + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { break } + no += chunk.children[i].chunkSize() + } + } + return no + cur.first +} + +// Find the line at the given vertical position, using the height +// information in the document tree. +function lineAtHeight(chunk, h) { + var n = chunk.first + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], ch = child.height + if (h < ch) { chunk = child; continue outer } + h -= ch + n += child.chunkSize() + } + return n + } while (!chunk.lines) + var i = 0 + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height + if (h < lh) { break } + h -= lh + } + return n + i +} + +function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} + +function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)) +} + +// A Pos instance represents a position within the text. +function Pos(line, ch, sticky) { + if ( sticky === void 0 ) sticky = null; + + if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } + this.line = line + this.ch = ch + this.sticky = sticky +} + +// Compare two positions, return 0 if they are the same, a negative +// number when a is less, and a positive number otherwise. +function cmp(a, b) { return a.line - b.line || a.ch - b.ch } + +function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } + +function copyPos(x) {return Pos(x.line, x.ch)} +function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } +function minPos(a, b) { return cmp(a, b) < 0 ? a : b } + +// Most of the external API clips given positions to make sure they +// actually exist within the document. +function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} +function clipPos(doc, pos) { + if (pos.line < doc.first) { return Pos(doc.first, 0) } + var last = doc.first + doc.size - 1 + if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } + return clipToLen(pos, getLine(doc, pos.line).text.length) +} +function clipToLen(pos, linelen) { + var ch = pos.ch + if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } + else if (ch < 0) { return Pos(pos.line, 0) } + else { return pos } +} +function clipPosArray(doc, array) { + var out = [] + for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) } + return out +} + +// Optimize some code when these features are not used. +var sawReadOnlySpans = false; +var sawCollapsedSpans = false; +function seeReadOnlySpans() { + sawReadOnlySpans = true +} + +function seeCollapsedSpans() { + sawCollapsedSpans = true +} + +// TEXTMARKER SPANS + +function MarkedSpan(marker, from, to) { + this.marker = marker + this.from = from; this.to = to +} + +// Search an array of spans for a span matching the given marker. +function getMarkedSpanFor(spans, marker) { + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i] + if (span.marker == marker) { return span } + } } +} +// Remove a span from an array, returning undefined if no spans are +// left (we don't store arrays for lines without spans). +function removeMarkedSpan(spans, span) { + var r + for (var i = 0; i < spans.length; ++i) + { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } } + return r +} +// Add a span to a line. +function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span] + span.marker.attachLine(line) +} + +// Used for the algorithm that adjusts markers for a change in the +// document. These functions cut an array of spans at a given +// character position, returning an array of remaining chunks (or +// undefined if nothing remains). +function markedSpansBefore(old, startCh, isInsert) { + var nw + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh) + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)) + } + } } + return nw +} +function markedSpansAfter(old, endCh, isInsert) { + var nw + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh) + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)) + } + } } + return nw +} + +// Given a change object, compute the new set of marker spans that +// cover the line in which the change took place. Removes spans +// entirely within the change, reconnects spans belonging to the +// same marker that appear on both sides of the change, and cuts off +// spans partially within the change. Returns an array of span +// arrays with one element for each line in (after) the change. +function stretchSpansOverChange(doc, change) { + if (change.full) { return null } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans + if (!oldFirst && !oldLast) { return null } + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0 + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert) + var last = markedSpansAfter(oldLast, endCh, isInsert) + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0) + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i] + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker) + if (!found) { span.to = startCh } + else if (sameLine) { span.to = found.to == null ? null : found.to + offset } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1] + if (span$1.to != null) { span$1.to += offset } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker) + if (!found$1) { + span$1.from = offset + if (sameLine) { (first || (first = [])).push(span$1) } + } + } else { + span$1.from += offset + if (sameLine) { (first || (first = [])).push(span$1) } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { first = clearEmptySpans(first) } + if (last && last != first) { last = clearEmptySpans(last) } + + var newMarkers = [first] + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers + if (gap > 0 && first) + { for (var i$2 = 0; i$2 < first.length; ++i$2) + { if (first[i$2].to == null) + { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } } + for (var i$3 = 0; i$3 < gap; ++i$3) + { newMarkers.push(gapMarkers) } + newMarkers.push(last) + } + return newMarkers +} + +// Remove spans that are empty and don't have a clearWhenEmpty +// option of false. +function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i] + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + { spans.splice(i--, 1) } + } + if (!spans.length) { return null } + return spans +} + +// Used to 'clip' out readOnly ranges when making a change. +function removeReadOnlyRanges(doc, from, to) { + var markers = null + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + { (markers || (markers = [])).push(mark) } + } } + }) + if (!markers) { return null } + var parts = [{from: from, to: to}] + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0) + for (var j = 0; j < parts.length; ++j) { + var p = parts[j] + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to) + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + { newParts.push({from: p.from, to: m.from}) } + if (dto > 0 || !mk.inclusiveRight && !dto) + { newParts.push({from: m.to, to: p.to}) } + parts.splice.apply(parts, newParts) + j += newParts.length - 3 + } + } + return parts +} + +// Connect or disconnect spans from a line. +function detachMarkedSpans(line) { + var spans = line.markedSpans + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.detachLine(line) } + line.markedSpans = null +} +function attachMarkedSpans(line, spans) { + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.attachLine(line) } + line.markedSpans = spans +} + +// Helpers used when computing which overlapping collapsed span +// counts as the larger one. +function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } +function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } + +// Returns a number indicating which of two overlapping collapsed +// spans is larger (and thus includes the other). Falls back to +// comparing ids when the spans cover exactly the same range. +function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length + if (lenDiff != 0) { return lenDiff } + var aPos = a.find(), bPos = b.find() + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b) + if (fromCmp) { return -fromCmp } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b) + if (toCmp) { return toCmp } + return b.id - a.id +} + +// Find out whether a line ends or starts in a collapsed span. If +// so, return the marker for that span. +function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i] + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + { found = sp.marker } + } } + return found +} +function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } +function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } + +// Test whether there exists a collapsed span that partially +// overlaps (covers the start or end, but not both) of a new span. +// Such overlap is not allowed. +function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo) + var sps = sawCollapsedSpans && line.markedSpans + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i] + if (!sp.marker.collapsed) { continue } + var found = sp.marker.find(0) + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker) + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker) + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) + { return true } + } } +} + +// A visual line is a line as drawn on the screen. Folding, for +// example, can cause multiple logical lines to appear on the same +// visual line. This finds the start of the visual line that the +// given line is part of (usually that is the line itself). +function visualLine(line) { + var merged + while (merged = collapsedSpanAtStart(line)) + { line = merged.find(-1, true).line } + return line +} + +function visualLineEnd(line) { + var merged + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line } + return line +} + +// Returns an array of logical lines that continue the visual line +// started by the argument, or undefined if there are no such lines. +function visualLineContinued(line) { + var merged, lines + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line + ;(lines || (lines = [])).push(line) + } + return lines +} + +// Get the line number of the start of the visual line that the +// given line number is part of. +function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line) + if (line == vis) { return lineN } + return lineNo(vis) +} + +// Get the line number of the start of the next visual line after +// the given line. +function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { return lineN } + var line = getLine(doc, lineN), merged + if (!lineIsHidden(doc, line)) { return lineN } + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line } + return lineNo(line) + 1 +} + +// Compute whether a line is hidden. Lines count as hidden when they +// are part of a visual line that starts with another line, or when +// they are entirely covered by collapsed, non-widget span. +function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i] + if (!sp.marker.collapsed) { continue } + if (sp.from == null) { return true } + if (sp.marker.widgetNode) { continue } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + { return true } + } } +} +function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true) + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) + } + if (span.marker.inclusiveRight && span.to == line.text.length) + { return true } + for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i] + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) { return true } + } +} + +// Find the height above the given line. +function heightAtLine(lineObj) { + lineObj = visualLine(lineObj) + + var h = 0, chunk = lineObj.parent + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i] + if (line == lineObj) { break } + else { h += line.height } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1] + if (cur == chunk) { break } + else { h += cur.height } + } + } + return h +} + +// Compute the character length of a line, taking into account +// collapsed ranges (see markText) that might hide parts, and join +// other lines onto it. +function lineLength(line) { + if (line.height == 0) { return 0 } + var len = line.text.length, merged, cur = line + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true) + cur = found.from.line + len += found.from.ch - found.to.ch + } + cur = line + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true) + len -= cur.text.length - found$1.from.ch + cur = found$1.to.line + len += cur.text.length - found$1.to.ch + } + return len +} + +// Find the longest line in the document. +function findMaxLine(cm) { + var d = cm.display, doc = cm.doc + d.maxLine = getLine(doc, doc.first) + d.maxLineLength = lineLength(d.maxLine) + d.maxLineChanged = true + doc.iter(function (line) { + var len = lineLength(line) + if (len > d.maxLineLength) { + d.maxLineLength = len + d.maxLine = line + } + }) +} + +// BIDI HELPERS + +function iterateBidiSections(order, from, to, f) { + if (!order) { return f(from, to, "ltr", 0) } + var found = false + for (var i = 0; i < order.length; ++i) { + var part = order[i] + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i) + found = true + } + } + if (!found) { f(from, to, "ltr") } +} + +var bidiOther = null +function getBidiPartAt(order, ch, sticky) { + var found + bidiOther = null + for (var i = 0; i < order.length; ++i) { + var cur = order[i] + if (cur.from < ch && cur.to > ch) { return i } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { found = i } + else { bidiOther = i } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { found = i } + else { bidiOther = i } + } + } + return found != null ? found : bidiOther +} + +// Bidirectional ordering algorithm +// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm +// that this (partially) implements. + +// One-char codes used for character types: +// L (L): Left-to-Right +// R (R): Right-to-Left +// r (AL): Right-to-Left Arabic +// 1 (EN): European Number +// + (ES): European Number Separator +// % (ET): European Number Terminator +// n (AN): Arabic Number +// , (CS): Common Number Separator +// m (NSM): Non-Spacing Mark +// b (BN): Boundary Neutral +// s (B): Paragraph Separator +// t (S): Segment Separator +// w (WS): Whitespace +// N (ON): Other Neutrals + +// Returns null if characters are ordered as they appear +// (left-to-right), or an array of sections ({from, to, level} +// objects) in the order in which they occur visually. +var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN" + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111" + function charType(code) { + if (code <= 0xf7) { return lowTypes.charAt(code) } + else if (0x590 <= code && code <= 0x5f4) { return "R" } + else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } + else if (0x6ee <= code && code <= 0x8ac) { return "r" } + else if (0x2000 <= code && code <= 0x200b) { return "w" } + else if (code == 0x200c) { return "b" } + else { return "L" } + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/ + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/ + + function BidiSpan(level, from, to) { + this.level = level + this.from = from; this.to = to + } + + return function(str, direction) { + var outerType = direction == "ltr" ? "L" : "R" + + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } + var len = str.length, types = [] + for (var i = 0; i < len; ++i) + { types.push(charType(str.charCodeAt(i))) } + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1] + if (type == "m") { types[i$1] = prev } + else { prev = type } + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2] + if (type$1 == "1" && cur == "r") { types[i$2] = "n" } + else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3] + if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" } + else if (type$2 == "," && prev$1 == types[i$3+1] && + (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 } + prev$1 = type$2 + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4] + if (type$3 == ",") { types[i$4] = "N" } + else if (type$3 == "%") { + var end = (void 0) + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N" + for (var j = i$4; j < end; ++j) { types[j] = replace } + i$4 = end - 1 + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5] + if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" } + else if (isStrong.test(type$4)) { cur$1 = type$4 } + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = (void 0) + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6-1] : outerType) == "L" + var after = (end$1 < len ? types[end$1] : outerType) == "L" + var replace$1 = before == after ? (before ? "L" : "R") : outerType + for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 } + i$6 = end$1 - 1 + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7 + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)) + } else { + var pos = i$7, at = order.length + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) } + var nstart = j$2 + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)) + pos = j$2 + } else { ++j$2 } + } + if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) } + } + } + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length + order.unshift(new BidiSpan(0, 0, m[0].length)) + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length + order.push(new BidiSpan(0, len - m[0].length, len)) + } + } + + return direction == "rtl" ? order.reverse() : order + } +})() + +// Get the bidi ordering for the given line (and cache it). Returns +// false for lines that are fully left-to-right, and an array of +// BidiSpan objects otherwise. +function getOrder(line, direction) { + var order = line.order + if (order == null) { order = line.order = bidiOrdering(line.text, direction) } + return order +} + +// EVENT HANDLING + +// Lightweight event framework. on/off also work on DOM nodes, +// registering native DOM handlers. + +var noHandlers = [] + +var on = function(emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false) + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f) + } else { + var map = emitter._handlers || (emitter._handlers = {}) + map[type] = (map[type] || noHandlers).concat(f) + } +} + +function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers +} + +function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false) + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f) + } else { + var map = emitter._handlers, arr = map && map[type] + if (arr) { + var index = indexOf(arr, f) + if (index > -1) + { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) } + } + } +} + +function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type) + if (!handlers.length) { return } + var args = Array.prototype.slice.call(arguments, 2) + for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) } +} + +// The DOM events that CodeMirror handles can be overridden by +// registering a (non-DOM) handler on the editor for the event name, +// and preventDefault-ing the event in that handler. +function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} } + signal(cm, override || e.type, cm, e) + return e_defaultPrevented(e) || e.codemirrorIgnore +} + +function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity + if (!arr) { return } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []) + for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) + { set.push(arr[i]) } } +} + +function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0 +} + +// Add on and off methods to a constructor's prototype, to make +// registering events on such objects more convenient. +function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f)} + ctor.prototype.off = function(type, f) {off(this, type, f)} +} + +// Due to the fact that we still support jurassic IE versions, some +// compatibility wrappers are needed. + +function e_preventDefault(e) { + if (e.preventDefault) { e.preventDefault() } + else { e.returnValue = false } +} +function e_stopPropagation(e) { + if (e.stopPropagation) { e.stopPropagation() } + else { e.cancelBubble = true } +} +function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false +} +function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)} + +function e_target(e) {return e.target || e.srcElement} +function e_button(e) { + var b = e.which + if (b == null) { + if (e.button & 1) { b = 1 } + else if (e.button & 2) { b = 3 } + else if (e.button & 4) { b = 2 } + } + if (mac && e.ctrlKey && b == 1) { b = 3 } + return b +} + +// Detect drag-and-drop +var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { return false } + var div = elt('div') + return "draggable" in div || "dragDrop" in div +}() + +var zwspSupported +function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b") + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])) + if (measure.firstChild.offsetHeight != 0) + { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) } + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px") + node.setAttribute("cm-text", "") + return node +} + +// Feature-detect IE's crummy client rect reporting for bidi text +var badBidiRects +function hasBadBidiRects(measure) { + if (badBidiRects != null) { return badBidiRects } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")) + var r0 = range(txt, 0, 1).getBoundingClientRect() + var r1 = range(txt, 1, 2).getBoundingClientRect() + removeChildren(measure) + if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) + return badBidiRects = (r1.right - r0.right < 3) +} + +// See if "".split is the broken IE version, if so, provide an +// alternative way to split lines. +var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, result = [], l = string.length + while (pos <= l) { + var nl = string.indexOf("\n", pos) + if (nl == -1) { nl = string.length } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl) + var rt = line.indexOf("\r") + if (rt != -1) { + result.push(line.slice(0, rt)) + pos += rt + 1 + } else { + result.push(line) + pos = nl + 1 + } + } + return result +} : function (string) { return string.split(/\r\n?|\n/); } + +var hasSelection = window.getSelection ? function (te) { + try { return te.selectionStart != te.selectionEnd } + catch(e) { return false } +} : function (te) { + var range + try {range = te.ownerDocument.selection.createRange()} + catch(e) {} + if (!range || range.parentElement() != te) { return false } + return range.compareEndPoints("StartToEnd", range) != 0 +} + +var hasCopyEvent = (function () { + var e = elt("div") + if ("oncopy" in e) { return true } + e.setAttribute("oncopy", "return;") + return typeof e.oncopy == "function" +})() + +var badZoomedRects = null +function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { return badZoomedRects } + var node = removeChildrenAndAdd(measure, elt("span", "x")) + var normal = node.getBoundingClientRect() + var fromRange = range(node, 0, 1).getBoundingClientRect() + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 +} + +var modes = {}; +var mimeModes = {}; +// Extra arguments are stored as the mode's dependencies, which is +// used by (legacy) mechanisms like loadmode.js to automatically +// load a mode. (Preferred mechanism is the require/define calls.) +function defineMode(name, mode) { + if (arguments.length > 2) + { mode.dependencies = Array.prototype.slice.call(arguments, 2) } + modes[name] = mode +} + +function defineMIME(mime, spec) { + mimeModes[mime] = spec +} + +// Given a MIME type, a {name, ...options} config object, or a name +// string, return a mode config object. +function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec] + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name] + if (typeof found == "string") { found = {name: found} } + spec = createObj(found, spec) + spec.name = found.name + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml") + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json") + } + if (typeof spec == "string") { return {name: spec} } + else { return spec || {name: "null"} } +} + +// Given a mode spec (anything that resolveMode accepts), find and +// initialize an actual mode object. +function getMode(options, spec) { + spec = resolveMode(spec) + var mfactory = modes[spec.name] + if (!mfactory) { return getMode(options, "text/plain") } + var modeObj = mfactory(options, spec) + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name] + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { continue } + if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] } + modeObj[prop] = exts[prop] + } + } + modeObj.name = spec.name + if (spec.helperType) { modeObj.helperType = spec.helperType } + if (spec.modeProps) { for (var prop$1 in spec.modeProps) + { modeObj[prop$1] = spec.modeProps[prop$1] } } + + return modeObj +} + +// This can be used to attach properties to mode objects from +// outside the actual mode definition. +var modeExtensions = {} +function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}) + copyObj(properties, exts) +} + +function copyState(mode, state) { + if (state === true) { return state } + if (mode.copyState) { return mode.copyState(state) } + var nstate = {} + for (var n in state) { + var val = state[n] + if (val instanceof Array) { val = val.concat([]) } + nstate[n] = val + } + return nstate +} + +// Given a mode and a state (for that mode), find the inner mode and +// state at the position that the state refers to. +function innerMode(mode, state) { + var info + while (mode.innerMode) { + info = mode.innerMode(state) + if (!info || info.mode == mode) { break } + state = info.state + mode = info.mode + } + return info || {mode: mode, state: state} +} + +function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true +} + +// STRING STREAM + +// Fed to the mode parsers, provides helper functions to make +// parsers more succinct. + +var StringStream = function(string, tabSize, lineOracle) { + this.pos = this.start = 0 + this.string = string + this.tabSize = tabSize || 8 + this.lastColumnPos = this.lastColumnValue = 0 + this.lineStart = 0 + this.lineOracle = lineOracle +}; + +StringStream.prototype.eol = function () {return this.pos >= this.string.length}; +StringStream.prototype.sol = function () {return this.pos == this.lineStart}; +StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; +StringStream.prototype.next = function () { + if (this.pos < this.string.length) + { return this.string.charAt(this.pos++) } +}; +StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos) + var ok + if (typeof match == "string") { ok = ch == match } + else { ok = ch && (match.test ? match.test(ch) : match(ch)) } + if (ok) {++this.pos; return ch} +}; +StringStream.prototype.eatWhile = function (match) { + var start = this.pos + while (this.eat(match)){} + return this.pos > start +}; +StringStream.prototype.eatSpace = function () { + var this$1 = this; + + var start = this.pos + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos } + return this.pos > start +}; +StringStream.prototype.skipToEnd = function () {this.pos = this.string.length}; +StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos) + if (found > -1) {this.pos = found; return true} +}; +StringStream.prototype.backUp = function (n) {this.pos -= n}; +StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue) + this.lastColumnPos = this.start + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) +}; +StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) +}; +StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; } + var substr = this.string.substr(this.pos, pattern.length) + if (cased(substr) == cased(pattern)) { + if (consume !== false) { this.pos += pattern.length } + return true + } + } else { + var match = this.string.slice(this.pos).match(pattern) + if (match && match.index > 0) { return null } + if (match && consume !== false) { this.pos += match[0].length } + return match + } +}; +StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; +StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n + try { return inner() } + finally { this.lineStart -= n } +}; +StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle + return oracle && oracle.lookAhead(n) +}; +StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle + return oracle && oracle.baseToken(this.pos) +}; + +var SavedContext = function(state, lookAhead) { + this.state = state + this.lookAhead = lookAhead +}; + +var Context = function(doc, state, line, lookAhead) { + this.state = state + this.doc = doc + this.line = line + this.maxLookAhead = lookAhead || 0 + this.baseTokens = null + this.baseTokenPos = 1 +}; + +Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n) + if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n } + return line +}; + +Context.prototype.baseToken = function (n) { + var this$1 = this; + + if (!this.baseTokens) { return null } + while (this.baseTokens[this.baseTokenPos] <= n) + { this$1.baseTokenPos += 2 } + var type = this.baseTokens[this.baseTokenPos + 1] + return {type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n} +}; + +Context.prototype.nextLine = function () { + this.line++ + if (this.maxLookAhead > 0) { this.maxLookAhead-- } +}; + +Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) + { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } + else + { return new Context(doc, copyState(doc.mode, saved), line) } +}; + +Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state +}; + + +// Compute a style array (an array starting with a mode generation +// -- for invalidation -- followed by pairs of end positions and +// style strings), which is used to highlight the tokens on the +// line. +function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {} + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, + lineClasses, forceToEnd) + var state = context.state + + // Run overlays, adjust style array. + var loop = function ( o ) { + context.baseTokens = st + var overlay = cm.state.overlays[o], i = 1, at = 0 + context.state = true + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i] + if (i_end > end) + { st.splice(i, 1, end, st[i+1], i_end) } + i += 2 + at = Math.min(end, i_end) + } + if (!style) { return } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style) + i = start + 2 + } else { + for (; start < i; start += 2) { + var cur = st[start+1] + st[start+1] = (cur ? cur + " " : "") + "overlay " + style + } + } + }, lineClasses) + context.state = state + context.baseTokens = null + context.baseTokenPos = 1 + }; + + for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} +} + +function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)) + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state) + var result = highlightLine(cm, line, context) + if (resetState) { context.state = resetState } + line.stateAfter = context.save(!resetState) + line.styles = result.styles + if (result.classes) { line.styleClasses = result.classes } + else if (line.styleClasses) { line.styleClasses = null } + if (updateFrontier === cm.doc.highlightFrontier) + { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) } + } + return line.styles +} + +function getContextBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display + if (!doc.mode.startState) { return new Context(doc, true, n) } + var start = findStartLine(cm, n, precise) + var saved = start > doc.first && getLine(doc, start - 1).stateAfter + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start) + + doc.iter(start, n, function (line) { + processLine(cm, line.text, context) + var pos = context.line + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null + context.nextLine() + }) + if (precise) { doc.modeFrontier = context.line } + return context +} + +// Lightweight form of highlight -- proceed over this line and +// update state, but don't save a style array. Used for lines that +// aren't currently visible. +function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode + var stream = new StringStream(text, cm.options.tabSize, context) + stream.start = stream.pos = startAt || 0 + if (text == "") { callBlankLine(mode, context.state) } + while (!stream.eol()) { + readToken(mode, stream, context.state) + stream.start = stream.pos + } +} + +function callBlankLine(mode, state) { + if (mode.blankLine) { return mode.blankLine(state) } + if (!mode.innerMode) { return } + var inner = innerMode(mode, state) + if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } +} + +function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { inner[0] = innerMode(mode, state).mode } + var style = mode.token(stream, state) + if (stream.pos > stream.start) { return style } + } + throw new Error("Mode " + mode.name + " failed to advance stream.") +} + +var Token = function(stream, type, state) { + this.start = stream.start; this.end = stream.pos + this.string = stream.current() + this.type = type || null + this.state = state +}; + +// Utility for getTokenAt and getLineTokens +function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, mode = doc.mode, style + pos = clipPos(doc, pos) + var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise) + var stream = new StringStream(line.text, cm.options.tabSize, context), tokens + if (asArray) { tokens = [] } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos + style = readToken(mode, stream, context.state) + if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) } + } + return asArray ? tokens : new Token(stream, style, context.state) +} + +function extractLineClasses(type, output) { + if (type) { for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/) + if (!lineClass) { break } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length) + var prop = lineClass[1] ? "bgClass" : "textClass" + if (output[prop] == null) + { output[prop] = lineClass[2] } + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + { output[prop] += " " + lineClass[2] } + } } + return type +} + +// Run the given mode's parser over a line, calling f for each token. +function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans + if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans } + var curStart = 0, curStyle = null + var stream = new StringStream(text, cm.options.tabSize, context), style + var inner = cm.options.addModeClass && [null] + if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false + if (forceToEnd) { processLine(cm, text, context, stream.pos) } + stream.pos = text.length + style = null + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses) + } + if (inner) { + var mName = inner[0].name + if (mName) { style = "m-" + (style ? mName + " " + style : mName) } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000) + f(curStart, curStyle) + } + curStyle = style + } + stream.start = stream.pos + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000) + f(pos, curStyle) + curStart = pos + } +} + +// Finds the line to start with when starting a parse. Tries to +// find a line with a stateAfter, so that it can start with a +// valid state. If that fails, it returns the line with the +// smallest indentation, which tends to need the least context to +// parse correctly. +function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100) + for (var search = n; search > lim; --search) { + if (search <= doc.first) { return doc.first } + var line = getLine(doc, search - 1), after = line.stateAfter + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) + { return search } + var indented = countColumn(line.text, null, cm.options.tabSize) + if (minline == null || minindent > indented) { + minline = search - 1 + minindent = indented + } + } + return minline +} + +function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n) + if (doc.highlightFrontier < n - 10) { return } + var start = doc.first + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1 + break + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start) +} + +// LINE DATA STRUCTURE + +// Line objects. These hold state related to a line, including +// highlighting info (the styles array). +var Line = function(text, markedSpans, estimateHeight) { + this.text = text + attachMarkedSpans(this, markedSpans) + this.height = estimateHeight ? estimateHeight(this) : 1 +}; + +Line.prototype.lineNo = function () { return lineNo(this) }; +eventMixin(Line) + +// Change the content (text, markers) of a line. Automatically +// invalidates cached information and tries to re-estimate the +// line's height. +function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text + if (line.stateAfter) { line.stateAfter = null } + if (line.styles) { line.styles = null } + if (line.order != null) { line.order = null } + detachMarkedSpans(line) + attachMarkedSpans(line, markedSpans) + var estHeight = estimateHeight ? estimateHeight(line) : 1 + if (estHeight != line.height) { updateLineHeight(line, estHeight) } +} + +// Detach a line from the document tree and its markers. +function cleanUpLine(line) { + line.parent = null + detachMarkedSpans(line) +} + +// Convert a style as returned by a mode (either null, or a string +// containing one or more styles) to a CSS style. This is cached, +// and also looks for line-wide styles. +var styleToClassCache = {}; +var styleToClassCacheWithMode = {}; +function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { return null } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")) +} + +// Render the DOM representation of the text of a line. Also builds +// up a 'line map', which points at the DOM nodes that represent +// specific stretches of text, and is used by the measuring code. +// The returned object contains the DOM node, this map, and +// information about line-wide styles that were set by the mode. +function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null) + var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + trailingSpace: false, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")} + lineView.measure = {} + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0) + builder.pos = 0 + builder.addToken = buildToken + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) + { builder.addToken = buildTokenBadBidi(builder.addToken, order) } + builder.map = [] + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line) + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)) + if (line.styleClasses) { + if (line.styleClasses.bgClass) + { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") } + if (line.styleClasses.textClass) + { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map + lineView.measure.cache = {} + } else { + ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) + ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}) + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + { builder.content.className = "cm-tab-wrap-hack" } + } + + signal(cm, "renderLine", cm, lineView.line, builder.pre) + if (builder.pre.className) + { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") } + + return builder +} + +function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar") + token.title = "\\u" + ch.charCodeAt(0).toString(16) + token.setAttribute("aria-label", token.title) + return token +} + +// Build up the DOM representation for a single token, and add it to +// the line map. Takes care to render special characters separately. +function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) { return } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text + var special = builder.cm.state.specialChars, mustWrap = false + var content + if (!special.test(text)) { + builder.col += text.length + content = document.createTextNode(displayText) + builder.map.push(builder.pos, builder.pos + text.length, content) + if (ie && ie_version < 9) { mustWrap = true } + builder.pos += text.length + } else { + content = document.createDocumentFragment() + var pos = 0 + while (true) { + special.lastIndex = pos + var m = special.exec(text) + var skipped = m ? m.index - pos : text.length - pos + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)) + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) } + else { content.appendChild(txt) } + builder.map.push(builder.pos, builder.pos + skipped, txt) + builder.col += skipped + builder.pos += skipped + } + if (!m) { break } + pos += skipped + 1 + var txt$1 = (void 0) + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")) + txt$1.setAttribute("role", "presentation") + txt$1.setAttribute("cm-text", "\t") + builder.col += tabWidth + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")) + txt$1.setAttribute("cm-text", m[0]) + builder.col += 1 + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]) + txt$1.setAttribute("cm-text", m[0]) + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) } + else { content.appendChild(txt$1) } + builder.col += 1 + } + builder.map.push(builder.pos, builder.pos + 1, txt$1) + builder.pos++ + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32 + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || "" + if (startStyle) { fullStyle += startStyle } + if (endStyle) { fullStyle += endStyle } + var token = elt("span", [content], fullStyle, css) + if (title) { token.title = title } + return builder.content.appendChild(token) + } + builder.content.appendChild(content) +} + +function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { return text } + var spaceBefore = trailingBefore, result = "" + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i) + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) + { ch = "\u00a0" } + result += ch + spaceBefore = ch == " " + } + return result +} + +// Work around nonsense dimensions being reported for stretches of +// right-to-left text. +function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border" + var start = builder.pos, end = start + text.length + for (;;) { + // Find the part that overlaps with the start of this text + var part = (void 0) + for (var i = 0; i < order.length; i++) { + part = order[i] + if (part.to > start && part.from <= start) { break } + } + if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css) + startStyle = null + text = text.slice(part.to - start) + start = part.to + } + } +} + +function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode + if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + { widget = builder.content.appendChild(document.createElement("span")) } + widget.setAttribute("cm-marker", marker.id) + } + if (widget) { + builder.cm.display.input.setUneditable(widget) + builder.content.appendChild(widget) + } + builder.pos += size + builder.trailingSpace = false +} + +// Outputs a number of spans to make up a line, taking highlighting +// and marked text into account. +function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0 + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1+=2) + { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) } + return + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = "" + collapsed = null; nextChange = Infinity + var foundBookmarks = [], endStyles = (void 0) + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m) + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to + spanEndStyle = "" + } + if (m.className) { spanStyle += " " + m.className } + if (m.css) { css = (css ? css + ";" : "") + m.css } + if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle } + if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) } + if (m.title && !title) { title = m.title } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + { collapsed = sp } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from + } + } + if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) + { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } } + + if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) + { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null) + if (collapsed.to == null) { return } + if (collapsed.to == pos) { collapsed = false } + } + } + if (pos >= len) { break } + + var upto = Math.min(len, nextChange) + while (true) { + if (text) { + var end = pos + text.length + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css) + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} + pos = end + spanStartStyle = "" + } + text = allText.slice(at, at = styles[i++]) + style = interpretTokenStyle(styles[i++], builder.cm.options) + } + } +} + + +// These objects are used to represent the visible (currently drawn) +// part of the document. A LineView may correspond to multiple +// logical lines, if those are connected by collapsed ranges. +function LineView(doc, line, lineN) { + // The starting line + this.line = line + // Continuing lines, if any + this.rest = visualLineContinued(line) + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1 + this.node = this.text = null + this.hidden = lineIsHidden(doc, line) +} + +// Create a range of LineView objects for the given lines. +function buildViewArray(cm, from, to) { + var array = [], nextPos + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos) + nextPos = pos + view.size + array.push(view) + } + return array +} + +var operationGroup = null + +function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op) + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + } + } +} + +function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0 + do { + for (; i < callbacks.length; i++) + { callbacks[i].call(null) } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j] + if (op.cursorActivityHandlers) + { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } } + } + } while (i < callbacks.length) +} + +function finishOperation(op, endCb) { + var group = op.ownsGroup + if (!group) { return } + + try { fireCallbacksForOps(group) } + finally { + operationGroup = null + endCb(group) + } +} + +var orphanDelayedCallbacks = null + +// Often, we want to signal events at a point where we are in the +// middle of some work, but don't want the handler to start calling +// other methods on the editor, which might be in an inconsistent +// state or simply not expect any other events to happen. +// signalLater looks whether there are any handlers, and schedules +// them to be executed when the last operation ends, or, if no +// operation is active, when a timeout fires. +function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type) + if (!arr.length) { return } + var args = Array.prototype.slice.call(arguments, 2), list + if (operationGroup) { + list = operationGroup.delayedCallbacks + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks + } else { + list = orphanDelayedCallbacks = [] + setTimeout(fireOrphanDelayed, 0) + } + var loop = function ( i ) { + list.push(function () { return arr[i].apply(null, args); }) + }; + + for (var i = 0; i < arr.length; ++i) + loop( i ); +} + +function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks + orphanDelayedCallbacks = null + for (var i = 0; i < delayed.length; ++i) { delayed[i]() } +} + +// When an aspect of a line changes, a string is added to +// lineView.changes. This updates the relevant part of the line's +// DOM structure. +function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j] + if (type == "text") { updateLineText(cm, lineView) } + else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) } + else if (type == "class") { updateLineClasses(cm, lineView) } + else if (type == "widget") { updateLineWidgets(cm, lineView, dims) } + } + lineView.changes = null +} + +// Lines with gutter elements, widgets or a background class need to +// be wrapped, and have the extra elements added to the wrapper div +function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative") + if (lineView.text.parentNode) + { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) } + lineView.node.appendChild(lineView.text) + if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 } + } + return lineView.node +} + +function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass + if (cls) { cls += " CodeMirror-linebackground" } + if (lineView.background) { + if (cls) { lineView.background.className = cls } + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null } + } else if (cls) { + var wrap = ensureLineWrapped(lineView) + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild) + cm.display.input.setUneditable(lineView.background) + } +} + +// Wrapper around buildLineContent which will reuse the structure +// in display.externalMeasured when possible. +function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null + lineView.measure = ext.measure + return ext.built + } + return buildLineContent(cm, lineView) +} + +// Redraw the line's text. Interacts with the background and text +// classes because the mode may output tokens that influence these +// classes. +function updateLineText(cm, lineView) { + var cls = lineView.text.className + var built = getLineContent(cm, lineView) + if (lineView.text == lineView.node) { lineView.node = built.pre } + lineView.text.parentNode.replaceChild(built.pre, lineView.text) + lineView.text = built.pre + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass + lineView.textClass = built.textClass + updateLineClasses(cm, lineView) + } else if (cls) { + lineView.text.className = cls + } +} + +function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView) + if (lineView.line.wrapClass) + { ensureLineWrapped(lineView).className = lineView.line.wrapClass } + else if (lineView.node != lineView.text) + { lineView.node.className = "" } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass + lineView.text.className = textClass || "" +} + +function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter) + lineView.gutter = null + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground) + lineView.gutterBackground = null + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView) + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, + ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")) + cm.display.input.setUneditable(lineView.gutterBackground) + wrap.insertBefore(lineView.gutterBackground, lineView.text) + } + var markers = lineView.line.gutterMarkers + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView) + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")) + cm.display.input.setUneditable(gutterWrap) + wrap$1.insertBefore(gutterWrap, lineView.text) + if (lineView.line.gutterClass) + { gutterWrap.className += " " + lineView.line.gutterClass } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + { lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) } + if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id] + if (found) + { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) } + } } + } +} + +function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { lineView.alignable = null } + for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { + next = node.nextSibling + if (node.className == "CodeMirror-linewidget") + { lineView.node.removeChild(node) } + } + insertLineWidgets(cm, lineView, dims) +} + +// Build a line's DOM representation from scratch +function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView) + lineView.text = lineView.node = built.pre + if (built.bgClass) { lineView.bgClass = built.bgClass } + if (built.textClass) { lineView.textClass = built.textClass } + + updateLineClasses(cm, lineView) + updateLineGutter(cm, lineView, lineN, dims) + insertLineWidgets(cm, lineView, dims) + return lineView.node +} + +// A lineView may contain multiple logical lines (when merged by +// collapsed spans). The widgets for all of them need to be drawn. +function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true) + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } } +} + +function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { return } + var wrap = ensureLineWrapped(lineView) + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget") + if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") } + positionLineWidget(widget, node, lineView, dims) + cm.display.input.setUneditable(node) + if (allowAbove && widget.above) + { wrap.insertBefore(node, lineView.gutter || lineView.text) } + else + { wrap.appendChild(node) } + signalLater(widget, "redraw") + } +} + +function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + ;(lineView.alignable || (lineView.alignable = [])).push(node) + var width = dims.wrapperWidth + node.style.left = dims.fixedPos + "px" + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth + node.style.paddingLeft = dims.gutterTotalWidth + "px" + } + node.style.width = width + "px" + } + if (widget.coverGutter) { + node.style.zIndex = 5 + node.style.position = "relative" + if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" } + } +} + +function widgetHeight(widget) { + if (widget.height != null) { return widget.height } + var cm = widget.doc.cm + if (!cm) { return 0 } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;" + if (widget.coverGutter) + { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" } + if (widget.noHScroll) + { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)) + } + return widget.height = widget.node.parentNode.offsetHeight +} + +// Return true when the given mouse event happened in a widget +function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + { return true } + } +} + +// POSITION MEASUREMENT + +function paddingTop(display) {return display.lineSpace.offsetTop} +function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} +function paddingH(display) { + if (display.cachedPaddingH) { return display.cachedPaddingH } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")) + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)} + if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data } + return data +} + +function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } +function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth +} +function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight +} + +// Ensure the lineView.wrapping.heights array is populated. This is +// an array of bottom offsets for the lines that make up a drawn +// line. When lineWrapping is on, there might be more than one +// height. +function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping + var curWidth = wrapping && displayWidth(cm) + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = [] + if (wrapping) { + lineView.measure.width = curWidth + var rects = lineView.text.firstChild.getClientRects() + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1] + if (Math.abs(cur.bottom - next.bottom) > 2) + { heights.push((cur.bottom + next.top) / 2 - rect.top) } + } + } + heights.push(rect.bottom - rect.top) + } +} + +// Find a line map (mapping character offsets to text nodes) and a +// measurement cache for the given line number. (A line view might +// contain multiple lines when collapsed ranges are present.) +function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + { return {map: lineView.measure.map, cache: lineView.measure.cache} } + for (var i = 0; i < lineView.rest.length; i++) + { if (lineView.rest[i] == line) + { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) + { if (lineNo(lineView.rest[i$1]) > lineN) + { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } +} + +// Render a line into the hidden node display.externalMeasured. Used +// when measurement is needed for a line that's not in the viewport. +function updateExternalMeasurement(cm, line) { + line = visualLine(line) + var lineN = lineNo(line) + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN) + view.lineN = lineN + var built = view.built = buildLineContent(cm, view) + view.text = built.pre + removeChildrenAndAdd(cm.display.lineMeasure, built.pre) + return view +} + +// Get a {top, bottom, left, right} box (in line-local coordinates) +// for a given character. +function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) +} + +// Find a line view that corresponds to the given line number. +function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + { return cm.display.view[findViewIndex(cm, lineN)] } + var ext = cm.display.externalMeasured + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + { return ext } +} + +// Measurement can be split in two steps, the set-up work that +// applies to the whole line, and the measurement of the actual +// character. Functions like coordsChar, that need to do a lot of +// measurements in a row, can thus ensure that the set-up work is +// only done once. +function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line) + var view = findViewForLine(cm, lineN) + if (view && !view.text) { + view = null + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)) + cm.curOp.forceUpdate = true + } + if (!view) + { view = updateExternalMeasurement(cm, line) } + + var info = mapFromLineView(view, line, lineN) + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + } +} + +// Given a prepared measurement object, measures the position of an +// actual character (or fetches it from the cache). +function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { ch = -1 } + var key = ch + (bias || ""), found + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key] + } else { + if (!prepared.rect) + { prepared.rect = prepared.view.text.getBoundingClientRect() } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect) + prepared.hasHeights = true + } + found = measureCharInner(cm, prepared, ch, bias) + if (!found.bogus) { prepared.cache[key] = found } + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom} +} + +var nullRect = {left: 0, right: 0, top: 0, bottom: 0} + +function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse, mStart, mEnd + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + mStart = map[i] + mEnd = map[i + 1] + if (ch < mStart) { + start = 0; end = 1 + collapse = "left" + } else if (ch < mEnd) { + start = ch - mStart + end = start + 1 + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart + start = end - 1 + if (ch >= mEnd) { collapse = "right" } + } + if (start != null) { + node = map[i + 2] + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + { collapse = bias } + if (bias == "left" && start == 0) + { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2] + collapse = "left" + } } + if (bias == "right" && start == mEnd - mStart) + { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2] + collapse = "right" + } } + break + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} +} + +function getUsefulRect(rects, bias) { + var rect = nullRect + if (bias == "left") { for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { break } + } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { break } + } } + return rect +} + +function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias) + var node = place.node, start = place.start, end = place.end, collapse = place.collapse + + var rect + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) + { rect = node.parentNode.getBoundingClientRect() } + else + { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) } + if (rect.left || rect.right || start == 0) { break } + end = start + start = start - 1 + collapse = "right" + } + if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) } + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) { collapse = bias = "right" } + var rects + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + { rect = rects[bias == "right" ? rects.length - 1 : 0] } + else + { rect = node.getBoundingClientRect() } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0] + if (rSpan) + { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} } + else + { rect = nullRect } + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top + var mid = (rtop + rbot) / 2 + var heights = prepared.view.measure.heights + var i = 0 + for (; i < heights.length - 1; i++) + { if (mid < heights[i]) { break } } + var top = i ? heights[i - 1] : 0, bot = heights[i] + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot} + if (!rect.left && !rect.right) { result.bogus = true } + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot } + + return result +} + +// Work around problem with bounding client rects on ranges being +// returned incorrectly when zoomed on IE10 and below. +function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + { return rect } + var scaleX = screen.logicalXDPI / screen.deviceXDPI + var scaleY = screen.logicalYDPI / screen.deviceYDPI + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY} +} + +function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {} + lineView.measure.heights = null + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { lineView.measure.caches[i] = {} } } + } +} + +function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null + removeChildren(cm.display.lineMeasure) + for (var i = 0; i < cm.display.view.length; i++) + { clearLineMeasurementCacheFor(cm.display.view[i]) } +} + +function clearCaches(cm) { + clearLineMeasurementCache(cm) + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null + if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true } + cm.display.lineNumChars = null +} + +function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft +} +function pageScrollY() { + if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } + return window.pageYOffset || (document.documentElement || document.body).scrollTop +} + +function widgetTopHeight(lineObj) { + var height = 0 + if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) + { height += widgetHeight(lineObj.widgets[i]) } } } + return height +} + +// Converts a {top, bottom, left, right} box from line-local +// coordinates into another coordinate system. Context may be one of +// "line", "div" (display.lineDiv), "local"./null (editor), "window", +// or "page". +function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets) { + var height = widgetTopHeight(lineObj) + rect.top += height; rect.bottom += height + } + if (context == "line") { return rect } + if (!context) { context = "local" } + var yOff = heightAtLine(lineObj) + if (context == "local") { yOff += paddingTop(cm.display) } + else { yOff -= cm.display.viewOffset } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect() + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()) + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()) + rect.left += xOff; rect.right += xOff + } + rect.top += yOff; rect.bottom += yOff + return rect +} + +// Coverts a box from "div" coords to another coordinate system. +// Context may be "window", "page", "div", or "local"./null. +function fromCoordSystem(cm, coords, context) { + if (context == "div") { return coords } + var left = coords.left, top = coords.top + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX() + top -= pageScrollY() + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect() + left += localBox.left + top += localBox.top + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect() + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} +} + +function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { lineObj = getLine(cm.doc, pos.line) } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) +} + +// Returns a box for a given cursor position, which may have an +// 'other' property containing the position of the secondary cursor +// on a bidi boundary. +// A cursor Pos(line, char, "before") is on the same visual line as `char - 1` +// and after `char - 1` in writing order of `char - 1` +// A cursor Pos(line, char, "after") is on the same visual line as `char` +// and before `char` in writing order of `char` +// Examples (upper-case letters are RTL, lower-case are LTR): +// Pos(0, 1, ...) +// before after +// ab a|b a|b +// aB a|B aB| +// Ab |Ab A|b +// AB B|A B|A +// Every position after the last character on a line is considered to stick +// to the last character on the line. +function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line) + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight) + if (right) { m.left = m.right; } else { m.right = m.left } + return intoCoordSystem(cm, lineObj, m, context) + } + var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky + if (ch >= lineObj.text.length) { + ch = lineObj.text.length + sticky = "before" + } else if (ch <= 0) { + ch = 0 + sticky = "after" + } + if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } + + function getBidi(ch, partPos, invert) { + var part = order[partPos], right = part.level == 1 + return get(invert ? ch - 1 : ch, right != invert) + } + var partPos = getBidiPartAt(order, ch, sticky) + var other = bidiOther + var val = getBidi(ch, partPos, sticky == "before") + if (other != null) { val.other = getBidi(ch, other, sticky != "before") } + return val +} + +// Used to cheaply estimate the coordinates for a position. Used for +// intermediate scroll updates. +function estimateCoords(cm, pos) { + var left = 0 + pos = clipPos(cm.doc, pos) + if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch } + var lineObj = getLine(cm.doc, pos.line) + var top = heightAtLine(lineObj) + paddingTop(cm.display) + return {left: left, right: left, top: top, bottom: top + lineObj.height} +} + +// Positions returned by coordsChar contain some extra information. +// xRel is the relative x position of the input coordinates compared +// to the found position (so xRel > 0 means the coordinates are to +// the right of the character position, for example). When outside +// is true, that means the coordinates lie outside the line's +// vertical range. +function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky) + pos.xRel = xRel + if (outside) { pos.outside = true } + return pos +} + +// Compute the character position closest to the given coordinates. +// Input must be lineSpace-local ("div" coordinate system). +function coordsChar(cm, x, y) { + var doc = cm.doc + y += cm.display.viewOffset + if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) } + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1 + if (lineN > last) + { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) } + if (x < 0) { x = 0 } + + var lineObj = getLine(doc, lineN) + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y) + var merged = collapsedSpanAtEnd(lineObj) + var mergedPos = merged && merged.find(0, true) + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) + { lineN = lineNo(lineObj = mergedPos.to.line) } + else + { return found } + } +} + +function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj) + var end = lineObj.text.length + var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0) + end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end) + return {begin: begin, end: end} +} + +function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) +} + +// Returns true if the given side of a box is after the given +// coordinates, in top-to-bottom, left-to-right order. +function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x +} + +function coordsCharInner(cm, lineObj, lineNo, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj) + var preparedMeasure = prepareMeasureForLine(cm, lineObj) + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight = widgetTopHeight(lineObj) + var begin = 0, end = lineObj.text.length, ltr = true + + var order = getOrder(lineObj, cm.doc.direction) + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) + (cm, lineObj, lineNo, preparedMeasure, order, x, y) + ltr = part.level != 1 + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1 + end = ltr ? part.to : part.from - 1 + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, boxAround = null + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch) + box.top += widgetHeight; box.bottom += widgetHeight + if (!boxIsAfter(box, x, y, false)) { return false } + if (box.top <= y && box.left <= x) { + chAround = ch + boxAround = box + } + return true + }, begin, end) + + var baseX, sticky, outside = false + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr + ch = chAround + (atStart ? 0 : 1) + sticky = atStart ? "after" : "before" + baseX = atLeft ? boxAround.left : boxAround.right + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { ch++ } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : + (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ? + "after" : "before" + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure) + baseX = coords.left + outside = y < coords.top || y >= coords.bottom + } + + ch = skipExtendingChars(lineObj.text, ch, 1) + return PosWithInfo(lineNo, ch, sticky, outside, x - baseX) +} + +function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], ltr = part.level != 1 + return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), + "line", lineObj, preparedMeasure), x, y, true) + }, 0, order.length - 1) + var part = order[index] + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1 + var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), + "line", lineObj, preparedMeasure) + if (boxIsAfter(start, x, y, true) && start.top > y) + { part = order[index - 1] } + } + return part +} + +function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { end-- } + var part = null, closestDist = null + for (var i = 0; i < order.length; i++) { + var p = order[i] + if (p.from >= end || p.to <= begin) { continue } + var ltr = p.level != 1 + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x + if (!part || closestDist > dist) { + part = p + closestDist = dist + } + } + if (!part) { part = order[order.length - 1] } + // Clip the part to the wrapped line. + if (part.from < begin) { part = {from: begin, to: part.to, level: part.level} } + if (part.to > end) { part = {from: part.from, to: end, level: part.level} } + return part +} + +var measureText +// Compute the default text height. +function textHeight(display) { + if (display.cachedTextHeight != null) { return display.cachedTextHeight } + if (measureText == null) { + measureText = elt("pre") + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")) + measureText.appendChild(elt("br")) + } + measureText.appendChild(document.createTextNode("x")) + } + removeChildrenAndAdd(display.measure, measureText) + var height = measureText.offsetHeight / 50 + if (height > 3) { display.cachedTextHeight = height } + removeChildren(display.measure) + return height || 1 +} + +// Compute the default character width. +function charWidth(display) { + if (display.cachedCharWidth != null) { return display.cachedCharWidth } + var anchor = elt("span", "xxxxxxxxxx") + var pre = elt("pre", [anchor]) + removeChildrenAndAdd(display.measure, pre) + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10 + if (width > 2) { display.cachedCharWidth = width } + return width || 10 +} + +// Do a bulk-read of the DOM positions and sizes needed to draw the +// view, so that we don't interleave reading and writing to the DOM. +function getDimensions(cm) { + var d = cm.display, left = {}, width = {} + var gutterLeft = d.gutters.clientLeft + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft + width[cm.options.gutters[i]] = n.clientWidth + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth} +} + +// Computes display.scroller.scrollLeft + display.gutters.offsetWidth, +// but using getBoundingClientRect to get a sub-pixel-accurate +// result. +function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left +} + +// Returns a function that estimates the height of a line, to use as +// first approximation until the line becomes visible (and is thus +// properly measurable). +function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3) + return function (line) { + if (lineIsHidden(cm.doc, line)) { return 0 } + + var widgetsHeight = 0 + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height } + } } + + if (wrapping) + { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } + else + { return widgetsHeight + th } + } +} + +function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm) + doc.iter(function (line) { + var estHeight = est(line) + if (estHeight != line.height) { updateLineHeight(line, estHeight) } + }) +} + +// Given a mouse event, find the corresponding position. If liberal +// is false, it checks whether a gutter or scrollbar was clicked, +// and returns null if it was. forRect is used by rectangular +// selections, and tries to estimate a character position even for +// coordinates beyond the right of the text. +function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } + + var x, y, space = display.lineSpace.getBoundingClientRect() + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top } + catch (e) { return null } + var coords = coordsChar(cm, x, y), line + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)) + } + return coords +} + +// Find the view element corresponding to a given line. Return null +// when the line isn't visible. +function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { return null } + n -= cm.display.viewFrom + if (n < 0) { return null } + var view = cm.display.view + for (var i = 0; i < view.length; i++) { + n -= view[i].size + if (n < 0) { return i } + } +} + +function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()) +} + +function prepareSelection(cm, primary) { + if ( primary === void 0 ) primary = true; + + var doc = cm.doc, result = {} + var curFragment = result.cursors = document.createDocumentFragment() + var selFragment = result.selection = document.createDocumentFragment() + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (!primary && i == doc.sel.primIndex) { continue } + var range = doc.sel.ranges[i] + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } + var collapsed = range.empty() + if (collapsed || cm.options.showCursorWhenSelecting) + { drawSelectionCursor(cm, range.head, curFragment) } + if (!collapsed) + { drawSelectionRange(cm, range, selFragment) } + } + return result +} + +// Draws a cursor for the given range +function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine) + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")) + cursor.style.left = pos.left + "px" + cursor.style.top = pos.top + "px" + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px" + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")) + otherCursor.style.display = "" + otherCursor.style.left = pos.other.left + "px" + otherCursor.style.top = pos.other.top + "px" + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px" + } +} + +function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } + +// Draws the given range as a highlighted selection +function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc + var fragment = document.createDocumentFragment() + var padding = paddingH(cm.display), leftSide = padding.left + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right + var docLTR = doc.direction == "ltr" + + function add(left, top, width, bottom) { + if (top < 0) { top = 0 } + top = Math.round(top) + bottom = Math.round(bottom) + fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))) + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line) + var lineLen = lineObj.text.length + var start, end + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias) + } + + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos) + var prop = (dir == "ltr") == (side == "after") ? "left" : "right" + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1) + return coords(ch, prop)[prop] + } + + var order = getOrder(lineObj, doc.direction) + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr" + var fromPos = coords(from, ltr ? "left" : "right") + var toPos = coords(to - 1, ltr ? "right" : "left") + + var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen + var first = i == 0, last = !order || i == order.length - 1 + if (toPos.top - fromPos.top <= 3) { // Single line + var openLeft = (docLTR ? openStart : openEnd) && first + var openRight = (docLTR ? openEnd : openStart) && last + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right + add(left, fromPos.top, right - left, fromPos.bottom) + } else { // Multiple lines + var topLeft, topRight, botLeft, botRight + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left + topRight = docLTR ? rightSide : wrapX(from, dir, "before") + botLeft = docLTR ? leftSide : wrapX(to, dir, "after") + botRight = docLTR && openEnd && last ? rightSide : toPos.right + } else { + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before") + topRight = !docLTR && openStart && first ? rightSide : fromPos.right + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left + botRight = !docLTR ? rightSide : wrapX(to, dir, "after") + } + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom) + if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top) } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom) + } + + if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos } + if (cmpCoords(toPos, start) < 0) { start = toPos } + if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos } + if (cmpCoords(toPos, end) < 0) { end = toPos } + }) + return {start: start, end: end} + } + + var sFrom = range.from(), sTo = range.to() + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch) + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line) + var singleVLine = visualLine(fromLine) == visualLine(toLine) + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom) + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom) + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom) + } + } + if (leftEnd.bottom < rightStart.top) + { add(leftSide, leftEnd.bottom, null, rightStart.top) } + } + + output.appendChild(fragment) +} + +// Cursor-blinking +function restartBlink(cm) { + if (!cm.state.focused) { return } + var display = cm.display + clearInterval(display.blinker) + var on = true + display.cursorDiv.style.visibility = "" + if (cm.options.cursorBlinkRate > 0) + { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, + cm.options.cursorBlinkRate) } + else if (cm.options.cursorBlinkRate < 0) + { display.cursorDiv.style.visibility = "hidden" } +} + +function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) } +} + +function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true + setTimeout(function () { if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false + onBlur(cm) + } }, 100) +} + +function onFocus(cm, e) { + if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false } + + if (cm.options.readOnly == "nocursor") { return } + if (!cm.state.focused) { + signal(cm, "focus", cm, e) + cm.state.focused = true + addClass(cm.display.wrapper, "CodeMirror-focused") + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset() + if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730 + } + cm.display.input.receivedFocus() + } + restartBlink(cm) +} +function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { return } + + if (cm.state.focused) { + signal(cm, "blur", cm, e) + cm.state.focused = false + rmClass(cm.display.wrapper, "CodeMirror-focused") + } + clearInterval(cm.display.blinker) + setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150) +} + +// Read the actual heights of the rendered lines, and update their +// stored heights to match. +function updateHeightsInViewport(cm) { + var display = cm.display + var prevBottom = display.lineDiv.offsetTop + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height = (void 0) + if (cur.hidden) { continue } + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight + height = bot - prevBottom + prevBottom = bot + } else { + var box = cur.node.getBoundingClientRect() + height = box.bottom - box.top + } + var diff = cur.line.height - height + if (height < 2) { height = textHeight(display) } + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height) + updateWidgetHeight(cur.line) + if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) + { updateWidgetHeight(cur.rest[j]) } } + } + } +} + +// Read and store the height of line widgets associated with the +// given line. +function updateWidgetHeight(line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], parent = w.node.parentNode + if (parent) { w.height = parent.offsetHeight } + } } +} + +// Compute the lines that are visible in a given viewport (defaults +// the the current scroll position). viewport may contain top, +// height, and ensure (see op.scrollToPos) properties. +function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop + top = Math.floor(top - paddingTop(display)) + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom) + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line + if (ensureFrom < from) { + from = ensureFrom + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight) + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight) + to = ensureTo + } + } + return {from: from, to: Math.max(to, from + 1)} +} + +// Re-align line numbers and gutter marks to compensate for +// horizontal scrolling. +function alignHorizontally(cm) { + var display = cm.display, view = display.view + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft + var gutterW = display.gutters.offsetWidth, left = comp + "px" + for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) + { view[i].gutter.style.left = left } + if (view[i].gutterBackground) + { view[i].gutterBackground.style.left = left } + } + var align = view[i].alignable + if (align) { for (var j = 0; j < align.length; j++) + { align[j].style.left = left } } + } } + if (cm.options.fixedGutter) + { display.gutters.style.left = (comp + gutterW) + "px" } +} + +// Used to ensure that the line number gutter is still the right +// size for the current document size. Returns true when an update +// is needed. +function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { return false } + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")) + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW + display.lineGutter.style.width = "" + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1 + display.lineNumWidth = display.lineNumInnerWidth + padding + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1 + display.lineGutter.style.width = display.lineNumWidth + "px" + updateGutterSpace(cm) + return true + } + return false +} + +// SCROLLING THINGS INTO VIEW + +// If an editor sits on the top or bottom of the window, partially +// scrolled out of view, this ensures that the cursor is visible. +function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null + if (rect.top + box.top < 0) { doScroll = true } + else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")) + cm.display.lineSpace.appendChild(scrollNode) + scrollNode.scrollIntoView(doScroll) + cm.display.lineSpace.removeChild(scrollNode) + } +} + +// Scroll a given position into view (immediately), verifying that +// it actually became visible (as line heights are accurately +// measured, the position of something may 'drift' during drawing). +function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { margin = 0 } + var rect + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos + } + for (var limit = 0; limit < 5; limit++) { + var changed = false + var coords = cursorCoords(cm, pos) + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end) + rect = {left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin} + var scrollPos = calculateScrollPos(cm, rect) + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop) + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft) + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true } + } + if (!changed) { break } + } + return rect +} + +// Scroll a given set of coordinates into view (immediately). +function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect) + if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) } + if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) } +} + +// Calculate a new scroll position needed to scroll the given +// rectangle into view. Returns an object with scrollTop and +// scrollLeft properties. When these are undefined, the +// vertical/horizontal position does not need to be adjusted. +function calculateScrollPos(cm, rect) { + var display = cm.display, snapMargin = textHeight(cm.display) + if (rect.top < 0) { rect.top = 0 } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop + var screen = displayHeight(cm), result = {} + if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen } + var docBottom = cm.doc.height + paddingVert(display) + var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen) + if (newTop != screentop) { result.scrollTop = newTop } + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0) + var tooWide = rect.right - rect.left > screenw + if (tooWide) { rect.right = rect.left + screenw } + if (rect.left < 10) + { result.scrollLeft = 0 } + else if (rect.left < screenleft) + { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) } + else if (rect.right > screenw + screenleft - 3) + { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw } + return result +} + +// Store a relative adjustment to the scroll position in the current +// operation (to be applied when the operation finishes). +function addToScrollTop(cm, top) { + if (top == null) { return } + resolveScrollToPos(cm) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top +} + +// Make sure that at the end of the operation the current cursor is +// shown. +function ensureCursorVisible(cm) { + resolveScrollToPos(cm) + var cur = cm.getCursor() + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin} +} + +function scrollToCoords(cm, x, y) { + if (x != null || y != null) { resolveScrollToPos(cm) } + if (x != null) { cm.curOp.scrollLeft = x } + if (y != null) { cm.curOp.scrollTop = y } +} + +function scrollToRange(cm, range) { + resolveScrollToPos(cm) + cm.curOp.scrollToPos = range +} + +// When an operation has its scrollToPos property set, and another +// scroll action is applied before the end of the operation, this +// 'simulates' scrolling that position into view in a cheap way, so +// that the effect of intermediate scroll commands is not ignored. +function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos + if (range) { + cm.curOp.scrollToPos = null + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to) + scrollToCoordsRange(cm, from, to, range.margin) + } +} + +function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }) + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop) +} + +// Sync the scrollable area and scrollbars, ensure the viewport +// covers the visible area. +function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { return } + if (!gecko) { updateDisplaySimple(cm, {top: val}) } + setScrollTop(cm, val, true) + if (gecko) { updateDisplaySimple(cm) } + startWorker(cm, 100) +} + +function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val) + if (cm.display.scroller.scrollTop == val && !forceScroll) { return } + cm.doc.scrollTop = val + cm.display.scrollbars.setScrollTop(val) + if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val } +} + +// Sync scroller and scrollbar, ensure the gutter elements are +// aligned. +function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth) + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } + cm.doc.scrollLeft = val + alignHorizontally(cm) + if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val } + cm.display.scrollbars.setScrollLeft(val) +} + +// SCROLLBARS + +// Prepare DOM reads needed to update the scrollbars. Done in one +// shot to minimize update/measure roundtrips. +function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth + var docH = Math.round(cm.doc.height + paddingVert(cm.display)) + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + } +} + +var NativeScrollbars = function(place, scroll, cm) { + this.cm = cm + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar") + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar") + place(vert); place(horiz) + + on(vert, "scroll", function () { + if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") } + }) + on(horiz, "scroll", function () { + if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") } + }) + + this.checkedZeroWidth = false + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" } +}; + +NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1 + var needsV = measure.scrollHeight > measure.clientHeight + 1 + var sWidth = measure.nativeBarWidth + + if (needsV) { + this.vert.style.display = "block" + this.vert.style.bottom = needsH ? sWidth + "px" : "0" + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0) + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px" + } else { + this.vert.style.display = "" + this.vert.firstChild.style.height = "0" + } + + if (needsH) { + this.horiz.style.display = "block" + this.horiz.style.right = needsV ? sWidth + "px" : "0" + this.horiz.style.left = measure.barLeft + "px" + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0) + this.horiz.firstChild.style.width = + Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px" + } else { + this.horiz.style.display = "" + this.horiz.firstChild.style.width = "0" + } + + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { this.zeroWidthHack() } + this.checkedZeroWidth = true + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} +}; + +NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos } + if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz") } +}; + +NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos } + if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert") } +}; + +NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px" + this.horiz.style.height = this.vert.style.width = w + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none" + this.disableHoriz = new Delayed + this.disableVert = new Delayed +}; + +NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto" + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect() + var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) + : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1) + if (elt != bar) { bar.style.pointerEvents = "none" } + else { delay.set(1000, maybeDisable) } + } + delay.set(1000, maybeDisable) +}; + +NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode + parent.removeChild(this.horiz) + parent.removeChild(this.vert) +}; + +var NullScrollbars = function () {}; + +NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; +NullScrollbars.prototype.setScrollLeft = function () {}; +NullScrollbars.prototype.setScrollTop = function () {}; +NullScrollbars.prototype.clear = function () {}; + +function updateScrollbars(cm, measure) { + if (!measure) { measure = measureForScrollbars(cm) } + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight + updateScrollbarsInner(cm, measure) + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + { updateHeightsInViewport(cm) } + updateScrollbarsInner(cm, measureForScrollbars(cm)) + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight + } +} + +// Re-synchronize the fake scrollbars with the actual size of the +// content. +function updateScrollbarsInner(cm, measure) { + var d = cm.display + var sizes = d.scrollbars.update(measure) + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px" + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px" + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block" + d.scrollbarFiller.style.height = sizes.bottom + "px" + d.scrollbarFiller.style.width = sizes.right + "px" + } else { d.scrollbarFiller.style.display = "" } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block" + d.gutterFiller.style.height = sizes.bottom + "px" + d.gutterFiller.style.width = measure.gutterWidth + "px" + } else { d.gutterFiller.style.display = "" } +} + +var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars} + +function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear() + if (cm.display.scrollbars.addClass) + { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) } + } + + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller) + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) } + }) + node.setAttribute("cm-not-content", "true") + }, function (pos, axis) { + if (axis == "horizontal") { setScrollLeft(cm, pos) } + else { updateScrollTop(cm, pos) } + }, cm) + if (cm.display.scrollbars.addClass) + { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) } +} + +// Operations are used to wrap a series of changes to the editor +// state in such a way that each change won't have to update the +// cursor and display (which would be awkward, slow, and +// error-prone). Instead, display updates are batched and then all +// combined and executed at once. + +var nextOpId = 0 +// Start a new operation. +function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + } + pushOperation(cm.curOp) +} + +// Finish an operation, updating the display and signalling delayed events +function endOperation(cm) { + var op = cm.curOp + finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) + { group.ops[i].cm.curOp = null } + endOperations(group) + }) +} + +// The DOM updates done when an operation finishes are batched so +// that the minimum number of relayouts are required. +function endOperations(group) { + var ops = group.ops + for (var i = 0; i < ops.length; i++) // Read DOM + { endOperation_R1(ops[i]) } + for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) + { endOperation_W1(ops[i$1]) } + for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM + { endOperation_R2(ops[i$2]) } + for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) + { endOperation_W2(ops[i$3]) } + for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM + { endOperation_finish(ops[i$4]) } +} + +function endOperation_R1(op) { + var cm = op.cm, display = cm.display + maybeClipScrollbars(cm) + if (op.updateMaxLine) { findMaxLine(cm) } + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate) +} + +function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update) +} + +function endOperation_R2(op) { + var cm = op.cm, display = cm.display + if (op.updatedDisplay) { updateHeightsInViewport(cm) } + + op.barMeasure = measureForScrollbars(cm) + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3 + cm.display.sizerWidth = op.adjustWidthTo + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth) + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)) + } + + if (op.updatedDisplay || op.selectionChanged) + { op.preparedSelection = display.input.prepareSelection() } +} + +function endOperation_W2(op) { + var cm = op.cm + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px" + if (op.maxScrollLeft < cm.doc.scrollLeft) + { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) } + cm.display.maxLineChanged = false + } + + var takeFocus = op.focus && op.focus == activeElt() + if (op.preparedSelection) + { cm.display.input.showSelection(op.preparedSelection, takeFocus) } + if (op.updatedDisplay || op.startHeight != cm.doc.height) + { updateScrollbars(cm, op.barMeasure) } + if (op.updatedDisplay) + { setDocumentHeight(cm, op.barMeasure) } + + if (op.selectionChanged) { restartBlink(cm) } + + if (cm.state.focused && op.updateInput) + { cm.display.input.reset(op.typing) } + if (takeFocus) { ensureFocus(op.cm) } +} + +function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc + + if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + { display.wheelStartX = display.wheelStartY = null } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) } + + if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin) + maybeScrollWindow(cm, rect) + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers + if (hidden) { for (var i = 0; i < hidden.length; ++i) + { if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } } + if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) + { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } } + + if (display.wrapper.offsetHeight) + { doc.scrollTop = cm.display.scroller.scrollTop } + + // Fire change events, and delayed event handlers + if (op.changeObjs) + { signal(cm, "changes", cm, op.changeObjs) } + if (op.update) + { op.update.finish() } +} + +// Run the given function in an operation +function runInOp(cm, f) { + if (cm.curOp) { return f() } + startOperation(cm) + try { return f() } + finally { endOperation(cm) } +} +// Wraps a function in an operation. Returns the wrapped function. +function operation(cm, f) { + return function() { + if (cm.curOp) { return f.apply(cm, arguments) } + startOperation(cm) + try { return f.apply(cm, arguments) } + finally { endOperation(cm) } + } +} +// Used to add methods to editor and doc instances, wrapping them in +// operations. +function methodOp(f) { + return function() { + if (this.curOp) { return f.apply(this, arguments) } + startOperation(this) + try { return f.apply(this, arguments) } + finally { endOperation(this) } + } +} +function docMethodOp(f) { + return function() { + var cm = this.cm + if (!cm || cm.curOp) { return f.apply(this, arguments) } + startOperation(cm) + try { return f.apply(this, arguments) } + finally { endOperation(cm) } + } +} + +// Updates the display.view data structure for a given change to the +// document. From and to are in pre-change coordinates. Lendiff is +// the amount of lines added or subtracted by the change. This is +// used for changes that span multiple lines, or change the way +// lines are divided into visual lines. regLineChange (below) +// registers single-line changes. +function regChange(cm, from, to, lendiff) { + if (from == null) { from = cm.doc.first } + if (to == null) { to = cm.doc.first + cm.doc.size } + if (!lendiff) { lendiff = 0 } + + var display = cm.display + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + { display.updateLineNumbers = from } + + cm.curOp.viewChanged = true + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + { resetView(cm) } + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm) + } else { + display.viewFrom += lendiff + display.viewTo += lendiff + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm) + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1) + if (cut) { + display.view = display.view.slice(cut.index) + display.viewFrom = cut.lineN + display.viewTo += lendiff + } else { + resetView(cm) + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1) + if (cut$1) { + display.view = display.view.slice(0, cut$1.index) + display.viewTo = cut$1.lineN + } else { + resetView(cm) + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1) + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1) + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)) + display.viewTo += lendiff + } else { + resetView(cm) + } + } + + var ext = display.externalMeasured + if (ext) { + if (to < ext.lineN) + { ext.lineN += lendiff } + else if (from < ext.lineN + ext.size) + { display.externalMeasured = null } + } +} + +// Register a change to a single line. Type must be one of "text", +// "gutter", "class", "widget" +function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true + var display = cm.display, ext = cm.display.externalMeasured + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + { display.externalMeasured = null } + + if (line < display.viewFrom || line >= display.viewTo) { return } + var lineView = display.view[findViewIndex(cm, line)] + if (lineView.node == null) { return } + var arr = lineView.changes || (lineView.changes = []) + if (indexOf(arr, type) == -1) { arr.push(type) } +} + +// Clear the view. +function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first + cm.display.view = [] + cm.display.viewOffset = 0 +} + +function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + { return {index: index, lineN: newN} } + var n = cm.display.viewFrom + for (var i = 0; i < index; i++) + { n += view[i].size } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { return null } + diff = (n + view[index].size) - oldN + index++ + } else { + diff = n - oldN + } + oldN += diff; newN += diff + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { return null } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size + index += dir + } + return {index: index, lineN: newN} +} + +// Force the view to cover a given range, adding empty view element +// or clipping off existing ones as needed. +function adjustView(cm, from, to) { + var display = cm.display, view = display.view + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to) + display.viewFrom = from + } else { + if (display.viewFrom > from) + { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) } + else if (display.viewFrom < from) + { display.view = display.view.slice(findViewIndex(cm, from)) } + display.viewFrom = from + if (display.viewTo < to) + { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) } + else if (display.viewTo > to) + { display.view = display.view.slice(0, findViewIndex(cm, to)) } + } + display.viewTo = to +} + +// Count the number of lines in the view whose DOM representation is +// out of date (or nonexistent). +function countDirtyView(cm) { + var view = cm.display.view, dirty = 0 + for (var i = 0; i < view.length; i++) { + var lineView = view[i] + if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty } + } + return dirty +} + +// HIGHLIGHT WORKER + +function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) + { cm.state.highlight.set(time, bind(highlightWorker, cm)) } +} + +function highlightWorker(cm) { + var doc = cm.doc + if (doc.highlightFrontier >= cm.display.viewTo) { return } + var end = +new Date + cm.options.workTime + var context = getContextBefore(cm, doc.highlightFrontier) + var changedLines = [] + + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null + var highlighted = highlightLine(cm, line, context, true) + if (resetState) { context.state = resetState } + line.styles = highlighted.styles + var oldCls = line.styleClasses, newCls = highlighted.classes + if (newCls) { line.styleClasses = newCls } + else if (oldCls) { line.styleClasses = null } + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass) + for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] } + if (ischange) { changedLines.push(context.line) } + line.stateAfter = context.save() + context.nextLine() + } else { + if (line.text.length <= cm.options.maxHighlightLength) + { processLine(cm, line.text, context) } + line.stateAfter = context.line % 5 == 0 ? context.save() : null + context.nextLine() + } + if (+new Date > end) { + startWorker(cm, cm.options.workDelay) + return true + } + }) + doc.highlightFrontier = context.line + doc.modeFrontier = Math.max(doc.modeFrontier, context.line) + if (changedLines.length) { runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) + { regLineChange(cm, changedLines[i], "text") } + }) } +} + +// DISPLAY DRAWING + +var DisplayUpdate = function(cm, viewport, force) { + var display = cm.display + + this.viewport = viewport + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport) + this.editorIsHidden = !display.wrapper.offsetWidth + this.wrapperHeight = display.wrapper.clientHeight + this.wrapperWidth = display.wrapper.clientWidth + this.oldDisplayWidth = displayWidth(cm) + this.force = force + this.dims = getDimensions(cm) + this.events = [] +}; + +DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) + { this.events.push(arguments) } +}; +DisplayUpdate.prototype.finish = function () { + var this$1 = this; + + for (var i = 0; i < this.events.length; i++) + { signal.apply(null, this$1.events[i]) } +}; + +function maybeClipScrollbars(cm) { + var display = cm.display + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth + display.heightForcer.style.height = scrollGap(cm) + "px" + display.sizer.style.marginBottom = -display.nativeBarWidth + "px" + display.sizer.style.borderRightWidth = scrollGap(cm) + "px" + display.scrollbarsClipped = true + } +} + +function selectionSnapshot(cm) { + if (cm.hasFocus()) { return null } + var active = activeElt() + if (!active || !contains(cm.display.lineDiv, active)) { return null } + var result = {activeElt: active} + if (window.getSelection) { + var sel = window.getSelection() + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode + result.anchorOffset = sel.anchorOffset + result.focusNode = sel.focusNode + result.focusOffset = sel.focusOffset + } + } + return result +} + +function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } + snapshot.activeElt.focus() + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), range = document.createRange() + range.setEnd(snapshot.anchorNode, snapshot.anchorOffset) + range.collapse(false) + sel.removeAllRanges() + sel.addRange(range) + sel.extend(snapshot.focusNode, snapshot.focusOffset) + } +} + +// Does the actual updating of the line display. Bails out +// (returning false) when there is nothing to be done and forced is +// false. +function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc + + if (update.editorIsHidden) { + resetView(cm) + return false + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + { return false } + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm) + update.dims = getDimensions(cm) + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first) + var to = Math.min(end, update.visible.to + cm.options.viewportMargin) + if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) } + if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from) + to = visualLineEndNo(cm.doc, to) + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth + adjustView(cm, from, to) + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)) + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px" + + var toUpdate = countDirtyView(cm) + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + { return false } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm) + if (toUpdate > 4) { display.lineDiv.style.display = "none" } + patchDisplay(cm, display.updateLineNumbers, update.dims) + if (toUpdate > 4) { display.lineDiv.style.display = "" } + display.renderedView = display.view + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot) + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv) + removeChildren(display.selectionDiv) + display.gutters.style.height = display.sizer.style.minHeight = 0 + + if (different) { + display.lastWrapHeight = update.wrapperHeight + display.lastWrapWidth = update.wrapperWidth + startWorker(cm, 400) + } + + display.updateLineNumbers = null + + return true +} + +function postUpdateDisplay(cm, update) { + var viewport = update.viewport + + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport) + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + { break } + } + if (!updateDisplayIfNeeded(cm, update)) { break } + updateHeightsInViewport(cm) + var barMeasure = measureForScrollbars(cm) + updateSelection(cm) + updateScrollbars(cm, barMeasure) + setDocumentHeight(cm, barMeasure) + update.force = false + } + + update.signal(cm, "update", cm) + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo) + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo + } +} + +function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport) + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm) + postUpdateDisplay(cm, update) + var barMeasure = measureForScrollbars(cm) + updateSelection(cm) + updateScrollbars(cm, barMeasure) + setDocumentHeight(cm, barMeasure) + update.finish() + } +} + +// Sync the actual display DOM structure with display.view, removing +// nodes for lines that are no longer in view, and creating the ones +// that are not there yet, and updating the ones that are out of +// date. +function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers + var container = display.lineDiv, cur = container.firstChild + + function rm(node) { + var next = node.nextSibling + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + { node.style.display = "none" } + else + { node.parentNode.removeChild(node) } + return next + } + + var view = display.view, lineN = display.viewFrom + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i] + if (lineView.hidden) { + } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims) + container.insertBefore(node, cur) + } else { // Already drawn + while (cur != lineView.node) { cur = rm(cur) } + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false } + updateLineForChanges(cm, lineView, lineN, dims) + } + if (updateNumber) { + removeChildren(lineView.lineNumber) + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))) + } + cur = lineView.node.nextSibling + } + lineN += lineView.size + } + while (cur) { cur = rm(cur) } +} + +function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth + cm.display.sizer.style.marginLeft = width + "px" +} + +function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px" + cm.display.heightForcer.style.top = measure.docHeight + "px" + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px" +} + +// Rebuild the gutter elements, ensure the margin to the left of the +// code matches their width. +function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters + removeChildren(gutters) + var i = 0 + for (; i < specs.length; ++i) { + var gutterClass = specs[i] + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)) + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt + gElt.style.width = (cm.display.lineNumWidth || 1) + "px" + } + } + gutters.style.display = i ? "" : "none" + updateGutterSpace(cm) +} + +// Make sure the gutters options contains the element +// "CodeMirror-linenumbers" when the lineNumbers option is true. +function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers") + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]) + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0) + options.gutters.splice(found, 1) + } +} + +var wheelSamples = 0; +var wheelPixelsPerUnit = null; +// Fill in a browser-detected starting value on browsers where we +// know one. These don't have to be accurate -- the result of them +// being wrong would just be a slight flicker on the first wheel +// scroll (if it is large enough). +if (ie) { wheelPixelsPerUnit = -.53 } +else if (gecko) { wheelPixelsPerUnit = 15 } +else if (chrome) { wheelPixelsPerUnit = -.7 } +else if (safari) { wheelPixelsPerUnit = -1/3 } + +function wheelEventDelta(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail } + else if (dy == null) { dy = e.wheelDelta } + return {x: dx, y: dy} +} +function wheelEventPixels(e) { + var delta = wheelEventDelta(e) + delta.x *= wheelPixelsPerUnit + delta.y *= wheelPixelsPerUnit + return delta +} + +function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y + + var display = cm.display, scroll = display.scroller + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth + var canScrollY = scroll.scrollHeight > scroll.clientHeight + if (!(dx && canScrollX || dy && canScrollY)) { return } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur + break outer + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) + { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)) + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + { e_preventDefault(e) } + display.wheelStartX = null // Abort measurement, if in progress + return + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight + if (pixels < 0) { top = Math.max(0, top + pixels - 50) } + else { bot = Math.min(cm.doc.height, bot + pixels + 50) } + updateDisplaySimple(cm, {top: top, bottom: bot}) + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop + display.wheelDX = dx; display.wheelDY = dy + setTimeout(function () { + if (display.wheelStartX == null) { return } + var movedX = scroll.scrollLeft - display.wheelStartX + var movedY = scroll.scrollTop - display.wheelStartY + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX) + display.wheelStartX = display.wheelStartY = null + if (!sample) { return } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1) + ++wheelSamples + }, 200) + } else { + display.wheelDX += dx; display.wheelDY += dy + } + } +} + +// Selection objects are immutable. A new one is created every time +// the selection changes. A selection is one or more non-overlapping +// (and non-touching) ranges, sorted, and an integer that indicates +// which one is the primary selection (the one that's scrolled into +// view, that getCursor returns, etc). +var Selection = function(ranges, primIndex) { + this.ranges = ranges + this.primIndex = primIndex +}; + +Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; + +Selection.prototype.equals = function (other) { + var this$1 = this; + + if (other == this) { return true } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], there = other.ranges[i] + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } + } + return true +}; + +Selection.prototype.deepCopy = function () { + var this$1 = this; + + var out = [] + for (var i = 0; i < this.ranges.length; i++) + { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) } + return new Selection(out, this.primIndex) +}; + +Selection.prototype.somethingSelected = function () { + var this$1 = this; + + for (var i = 0; i < this.ranges.length; i++) + { if (!this$1.ranges[i].empty()) { return true } } + return false +}; + +Selection.prototype.contains = function (pos, end) { + var this$1 = this; + + if (!end) { end = pos } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i] + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + { return i } + } + return -1 +}; + +var Range = function(anchor, head) { + this.anchor = anchor; this.head = head +}; + +Range.prototype.from = function () { return minPos(this.anchor, this.head) }; +Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; +Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; + +// Take an unsorted, potentially overlapping set of ranges, and +// build a selection out of it. 'Consumes' ranges array (modifying +// it). +function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex] + ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }) + primIndex = indexOf(ranges, prim) + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1] + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()) + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head + if (i <= primIndex) { --primIndex } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)) + } + } + return new Selection(ranges, primIndex) +} + +function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0) +} + +// Compute the position of the end of a change (its 'to' property +// refers to the pre-change end). +function changeEnd(change) { + if (!change.text) { return change.to } + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) +} + +// Adjust a position to refer to the post-change position of the +// same text, or the end of the change if the change covers it. +function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { return pos } + if (cmp(pos, change.to) <= 0) { return changeEnd(change) } + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch + if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch } + return Pos(line, ch) +} + +function computeSelAfterChange(doc, change) { + var out = [] + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i] + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))) + } + return normalizeSelection(out, doc.sel.primIndex) +} + +function offsetPos(pos, old, nw) { + if (pos.line == old.line) + { return Pos(nw.line, pos.ch - old.ch + nw.ch) } + else + { return Pos(nw.line + (pos.line - old.line), pos.ch) } +} + +// Used by replaceSelections to allow moving the selection to the +// start or around the replaced test. Hint may be "start" or "around". +function computeReplacedSel(doc, changes, hint) { + var out = [] + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev + for (var i = 0; i < changes.length; i++) { + var change = changes[i] + var from = offsetPos(change.from, oldPrev, newPrev) + var to = offsetPos(changeEnd(change), oldPrev, newPrev) + oldPrev = change.to + newPrev = to + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0 + out[i] = new Range(inv ? to : from, inv ? from : to) + } else { + out[i] = new Range(from, from) + } + } + return new Selection(out, doc.sel.primIndex) +} + +// Used to get the editor into a consistent state again when options change. + +function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption) + resetModeState(cm) +} + +function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { line.stateAfter = null } + if (line.styles) { line.styles = null } + }) + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first + startWorker(cm, 100) + cm.state.modeGen++ + if (cm.curOp) { regChange(cm) } +} + +// DOCUMENT DATA STRUCTURE + +// By default, updates that start and end at the beginning of a line +// are treated specially, in order to make the association of line +// widgets and marker elements with the text behave more intuitive. +function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore) +} + +// Perform a change on the document data structure. +function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight) + signalLater(line, "change", line, change) + } + function linesFor(start, end) { + var result = [] + for (var i = start; i < end; ++i) + { result.push(new Line(text[i], spansFor(i), estimateHeight)) } + return result + } + + var from = change.from, to = change.to, text = change.text + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line) + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)) + doc.remove(text.length, doc.size - text.length) + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1) + update(lastLine, lastLine.text, lastSpans) + if (nlines) { doc.remove(from.line, nlines) } + if (added.length) { doc.insert(from.line, added) } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans) + } else { + var added$1 = linesFor(1, text.length - 1) + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)) + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) + doc.insert(from.line + 1, added$1) + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)) + doc.remove(from.line + 1, nlines) + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans) + var added$2 = linesFor(1, text.length - 1) + if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) } + doc.insert(from.line + 1, added$2) + } + + signalLater(doc, "change", doc, change) +} + +// Call f for all linked documents. +function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i] + if (rel.doc == skip) { continue } + var shared = sharedHist && rel.sharedHist + if (sharedHistOnly && !shared) { continue } + f(rel.doc, shared) + propagate(rel.doc, doc, shared) + } } + } + propagate(doc, null, true) +} + +// Attach a document to an editor. +function attachDoc(cm, doc) { + if (doc.cm) { throw new Error("This document is already in use.") } + cm.doc = doc + doc.cm = cm + estimateLineHeights(cm) + loadMode(cm) + setDirectionClass(cm) + if (!cm.options.lineWrapping) { findMaxLine(cm) } + cm.options.mode = doc.modeOption + regChange(cm) +} + +function setDirectionClass(cm) { + ;(cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl") +} + +function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm) + regChange(cm) + }) +} + +function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = [] + this.undoDepth = Infinity + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0 + this.lastOp = this.lastSelOp = null + this.lastOrigin = this.lastSelOrigin = null + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1 +} + +// Create a history change event from an updateDoc-style change +// object. +function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)} + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1) + linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true) + return histChange +} + +// Pop all selection events off the end of a history array. Stop at +// a change event. +function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array) + if (last.ranges) { array.pop() } + else { break } + } +} + +// Find the top change event in the history. Pop off selection +// events that are in the way. +function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done) + return lst(hist.done) + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done) + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop() + return lst(hist.done) + } +} + +// Register a change in the history. Merges changes that are within +// a single operation, or are close together with an origin that +// allows merging (starting with "+") into a single event. +function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history + hist.undone.length = 0 + var time = +new Date, cur + var last + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes) + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change) + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)) + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done) + if (!before || !before.ranges) + { pushSelectionToHistory(doc.sel, hist.done) } + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation} + hist.done.push(cur) + while (hist.done.length > hist.undoDepth) { + hist.done.shift() + if (!hist.done[0].ranges) { hist.done.shift() } + } + } + hist.done.push(selAfter) + hist.generation = ++hist.maxGeneration + hist.lastModTime = hist.lastSelTime = time + hist.lastOp = hist.lastSelOp = opId + hist.lastOrigin = hist.lastSelOrigin = change.origin + + if (!last) { signal(doc, "historyAdded") } +} + +function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0) + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) +} + +// Called whenever the selection changes, sets the new selection as +// the pending selection in the history, and pushes the old pending +// selection into the 'done' array when it was significantly +// different (in number of selected ranges, emptiness, or time). +function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + { hist.done[hist.done.length - 1] = sel } + else + { pushSelectionToHistory(sel, hist.done) } + + hist.lastSelTime = +new Date + hist.lastSelOrigin = origin + hist.lastSelOp = opId + if (options && options.clearRedo !== false) + { clearSelectionEvents(hist.undone) } +} + +function pushSelectionToHistory(sel, dest) { + var top = lst(dest) + if (!(top && top.ranges && top.equals(sel))) + { dest.push(sel) } +} + +// Used to store marked span information in the history. +function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0 + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) + { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans } + ++n + }) +} + +// When un/re-doing restores text containing marked spans, those +// that have been explicitly cleared should not be restored. +function removeClearedSpans(spans) { + if (!spans) { return null } + var out + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } } + else if (out) { out.push(spans[i]) } + } + return !out ? spans : out.length ? out : null +} + +// Retrieve and filter the old marked spans stored in a change event. +function getOldSpans(doc, change) { + var found = change["spans_" + doc.id] + if (!found) { return null } + var nw = [] + for (var i = 0; i < change.text.length; ++i) + { nw.push(removeClearedSpans(found[i])) } + return nw +} + +// Used for un/re-doing changes from the history. Combines the +// result of computing the existing spans with the set of spans that +// existed in the history (so that deleting around a span and then +// undoing brings back the span). +function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change) + var stretched = stretchSpansOverChange(doc, change) + if (!old) { return stretched } + if (!stretched) { return old } + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i] + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j] + for (var k = 0; k < oldCur.length; ++k) + { if (oldCur[k].marker == span.marker) { continue spans } } + oldCur.push(span) + } + } else if (stretchCur) { + old[i] = stretchCur + } + } + return old +} + +// Used both to provide a JSON-safe object in .getHistory, and, when +// detaching a document, to split the history in two +function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = [] + for (var i = 0; i < events.length; ++i) { + var event = events[i] + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event) + continue + } + var changes = event.changes, newChanges = [] + copy.push({changes: newChanges}) + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m = (void 0) + newChanges.push({from: change.from, to: change.to, text: change.text}) + if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop] + delete change[prop] + } + } } } + } + } + return copy +} + +// The 'scroll' parameter given to many of these indicated whether +// the new cursor position should be scrolled into view after +// modifying the selection. + +// If shift is held or the extend flag is set, extends a range to +// include a given position (and optionally a second position). +// Otherwise, simply returns the range between the given positions. +// Used for cursor motion and such. +function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor + if (other) { + var posBefore = cmp(head, anchor) < 0 + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head + head = other + } else if (posBefore != (cmp(head, other) < 0)) { + head = other + } + } + return new Range(anchor, head) + } else { + return new Range(other || head, head) + } +} + +// Extend the primary selection range, discard the rest. +function extendSelection(doc, head, other, options, extend) { + if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options) +} + +// Extend all selections (pos is an array of selections with length +// equal the number of selections) +function extendSelections(doc, heads, options) { + var out = [] + var extend = doc.cm && (doc.cm.display.shift || doc.extend) + for (var i = 0; i < doc.sel.ranges.length; i++) + { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) } + var newSel = normalizeSelection(out, doc.sel.primIndex) + setSelection(doc, newSel, options) +} + +// Updates a single range in the selection. +function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0) + ranges[i] = range + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options) +} + +// Reset the selection to a single range. +function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options) +} + +// Give beforeSelectionChange handlers a change to influence a +// selection update. +function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + var this$1 = this; + + this.ranges = [] + for (var i = 0; i < ranges.length; i++) + { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)) } + }, + origin: options && options.origin + } + signal(doc, "beforeSelectionChange", doc, obj) + if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) } + if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) } + else { return sel } +} + +function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done) + if (last && last.ranges) { + done[done.length - 1] = sel + setSelectionNoUndo(doc, sel, options) + } else { + setSelection(doc, sel, options) + } +} + +// Set a new selection. +function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options) + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options) +} + +function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + { sel = filterSelectionChange(doc, sel, options) } + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1) + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)) + + if (!(options && options.scroll === false) && doc.cm) + { ensureCursorVisible(doc.cm) } +} + +function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { return } + + doc.sel = sel + + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true + signalCursorActivity(doc.cm) + } + signalLater(doc, "cursorActivity", doc) +} + +// Verify that the selection does not partially select any atomic +// marked ranges. +function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)) +} + +// Return a selection that does not partially select any atomic +// ranges. +function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i] + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i] + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear) + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear) + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { out = sel.ranges.slice(0, i) } + out[i] = new Range(newAnchor, newHead) + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel +} + +function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line) + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter") + if (m.explicitlyCleared) { + if (!line.markedSpans) { break } + else {--i; continue} + } + } + if (!m.atomic) { continue } + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff = (void 0) + if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) + { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + { return skipAtomicInner(doc, near, pos, dir, mayClear) } + } + + var far = m.find(dir < 0 ? -1 : 1) + if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) + { far = movePos(doc, far, dir, far.line == pos.line ? line : null) } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null + } + } } + return pos +} + +// Ensure a given position is not inside an atomic range. +function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1 + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)) + if (!found) { + doc.cantEdit = true + return Pos(doc.first, 0) + } + return found +} + +function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } + else { return null } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } + else { return null } + } else { + return new Pos(pos.line, pos.ch + dir) + } +} + +function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll) +} + +// UPDATING + +// Allow "beforeChange" event handlers to influence a change +function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { return obj.canceled = true; } + } + if (update) { obj.update = function (from, to, text, origin) { + if (from) { obj.from = clipPos(doc, from) } + if (to) { obj.to = clipPos(doc, to) } + if (text) { obj.text = text } + if (origin !== undefined) { obj.origin = origin } + } } + signal(doc, "beforeChange", doc, obj) + if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) } + + if (obj.canceled) { return null } + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} +} + +// Apply a change to a document, and add it to the document's +// history, and propagating it to all linked documents. +function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } + if (doc.cm.state.suppressEdits) { return } + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true) + if (!change) { return } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to) + if (split) { + for (var i = split.length - 1; i >= 0; --i) + { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}) } + } else { + makeChangeInner(doc, change) + } +} + +function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } + var selAfter = computeSelAfterChange(doc, change) + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN) + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)) + var rebased = [] + + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change) + rebased.push(doc.history) + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)) + }) +} + +// Revert a change stored in a document's history. +function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return } + + var hist = doc.history, event, selAfter = doc.sel + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0 + for (; i < source.length; i++) { + event = source[i] + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + { break } + } + if (i == source.length) { return } + hist.lastOrigin = hist.lastSelOrigin = null + + for (;;) { + event = source.pop() + if (event.ranges) { + pushSelectionToHistory(event, dest) + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}) + return + } + selAfter = event + } + else { break } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = [] + pushSelectionToHistory(selAfter, dest) + dest.push({changes: antiChanges, generation: hist.generation}) + hist.generation = event.generation || ++hist.maxGeneration + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange") + + var loop = function ( i ) { + var change = event.changes[i] + change.origin = type + if (filter && !filterChange(doc, change, false)) { + source.length = 0 + return {} + } + + antiChanges.push(historyChangeFromChange(doc, change)) + + var after = i ? computeSelAfterChange(doc, change) : lst(source) + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)) + if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) } + var rebased = [] + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change) + rebased.push(doc.history) + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)) + }) + }; + + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop( i$1 ); + + if ( returned ) return returned.v; + } +} + +// Sub-views need their line numbers shifted when text is added +// above or below them in the parent document. +function shiftDoc(doc, distance) { + if (distance == 0) { return } + doc.first += distance + doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( + Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch) + ); }), doc.sel.primIndex) + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance) + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + { regLineChange(doc.cm, l, "gutter") } + } +} + +// More lower-level change function, handling only a single document +// (not linked ones). +function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)) + return + } + if (change.from.line > doc.lastLine()) { return } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line) + shiftDoc(doc, shift) + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin} + } + var last = doc.lastLine() + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin} + } + + change.removed = getBetween(doc, change.from, change.to) + + if (!selAfter) { selAfter = computeSelAfterChange(doc, change) } + if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) } + else { updateDoc(doc, change, spans) } + setSelectionNoUndo(doc, selAfter, sel_dontScroll) +} + +// Handle the interaction of a change to a document with the editor +// that this document is part of. +function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to + + var recomputeMaxLength = false, checkWidthStart = from.line + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))) + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true + return true + } + }) + } + + if (doc.sel.contains(change.from, change.to) > -1) + { signalCursorActivity(cm) } + + updateDoc(doc, change, spans, estimateHeight(cm)) + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line) + if (len > display.maxLineLength) { + display.maxLine = line + display.maxLineLength = len + display.maxLineChanged = true + recomputeMaxLength = false + } + }) + if (recomputeMaxLength) { cm.curOp.updateMaxLine = true } + } + + retreatFrontier(doc, from.line) + startWorker(cm, 400) + + var lendiff = change.text.length - (to.line - from.line) - 1 + // Remember that these lines changed, for updating the display + if (change.full) + { regChange(cm) } + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + { regLineChange(cm, from.line, "text") } + else + { regChange(cm, from.line, to.line + 1, lendiff) } + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change") + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + } + if (changeHandler) { signalLater(cm, "change", cm, obj) } + if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) } + } + cm.display.selForContextMenu = null +} + +function replaceRange(doc, code, from, to, origin) { + if (!to) { to = from } + if (cmp(to, from) < 0) { var assign; + (assign = [to, from], from = assign[0], to = assign[1], assign) } + if (typeof code == "string") { code = doc.splitLines(code) } + makeChange(doc, {from: from, to: to, text: code, origin: origin}) +} + +// Rebasing/resetting history to deal with externally-sourced changes + +function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff + } else if (from < pos.line) { + pos.line = from + pos.ch = 0 + } +} + +// Tries to rebase an array of history events given a change in the +// document. If the change touches the same lines as the event, the +// event, and everything 'behind' it, is discarded. If the change is +// before the event, the event's positions are updated. Uses a +// copy-on-write scheme for the positions, to avoid having to +// reallocate them all on every rebase, but also avoid problems with +// shared position objects being unsafely updated. +function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff) + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff) + } + continue + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1] + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch) + cur.to = Pos(cur.to.line + diff, cur.to.ch) + } else if (from <= cur.to.line) { + ok = false + break + } + } + if (!ok) { + array.splice(0, i + 1) + i = 0 + } + } +} + +function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1 + rebaseHistArray(hist.done, from, to, diff) + rebaseHistArray(hist.undone, from, to, diff) +} + +// Utility for applying a change to a line by handle or number, +// returning the number and optionally registering the line as +// changed. +function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle + if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) } + else { no = lineNo(handle) } + if (no == null) { return null } + if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) } + return line +} + +// The document is represented as a BTree consisting of leaves, with +// chunk of lines in them, and branches, with up to ten leaves or +// other branch nodes below them. The top node is always a branch +// node, and is the document object itself (meaning it has +// additional methods and properties). +// +// All nodes have parent links. The tree is used both to go from +// line numbers to line objects, and to go from objects to numbers. +// It also indexes by height, and is used to convert between height +// and line object, and to find the total height of the document. +// +// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + +function LeafChunk(lines) { + var this$1 = this; + + this.lines = lines + this.parent = null + var height = 0 + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1 + height += lines[i].height + } + this.height = height +} + +LeafChunk.prototype = { + chunkSize: function chunkSize() { return this.lines.length }, + + // Remove the n lines at offset 'at'. + removeInner: function removeInner(at, n) { + var this$1 = this; + + for (var i = at, e = at + n; i < e; ++i) { + var line = this$1.lines[i] + this$1.height -= line.height + cleanUpLine(line) + signalLater(line, "delete") + } + this.lines.splice(at, n) + }, + + // Helper used to collapse a small branch into a single leaf. + collapse: function collapse(lines) { + lines.push.apply(lines, this.lines) + }, + + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + + this.height += height + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)) + for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 } + }, + + // Used to iterate over a part of the tree. + iterN: function iterN(at, n, op) { + var this$1 = this; + + for (var e = at + n; at < e; ++at) + { if (op(this$1.lines[at])) { return true } } + } +} + +function BranchChunk(children) { + var this$1 = this; + + this.children = children + var size = 0, height = 0 + for (var i = 0; i < children.length; ++i) { + var ch = children[i] + size += ch.chunkSize(); height += ch.height + ch.parent = this$1 + } + this.size = size + this.height = height + this.parent = null +} + +BranchChunk.prototype = { + chunkSize: function chunkSize() { return this.size }, + + removeInner: function removeInner(at, n) { + var this$1 = this; + + this.size -= n + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize() + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height + child.removeInner(at, rm) + this$1.height -= oldHeight - child.height + if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null } + if ((n -= rm) == 0) { break } + at = 0 + } else { at -= sz } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = [] + this.collapse(lines) + this.children = [new LeafChunk(lines)] + this.children[0].parent = this + } + }, + + collapse: function collapse(lines) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) } + }, + + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + + this.size += lines.length + this.height += height + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize() + if (at <= sz) { + child.insertInner(at, lines, height) + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25 + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)) + child.height -= leaf.height + this$1.children.splice(++i, 0, leaf) + leaf.parent = this$1 + } + child.lines = child.lines.slice(0, remaining) + this$1.maybeSpill() + } + break + } + at -= sz + } + }, + + // When a node has grown, check whether it should be split. + maybeSpill: function maybeSpill() { + if (this.children.length <= 10) { return } + var me = this + do { + var spilled = me.children.splice(me.children.length - 5, 5) + var sibling = new BranchChunk(spilled) + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children) + copy.parent = me + me.children = [copy, sibling] + me = copy + } else { + me.size -= sibling.size + me.height -= sibling.height + var myIndex = indexOf(me.parent.children, me) + me.parent.children.splice(myIndex + 1, 0, sibling) + } + sibling.parent = me.parent + } while (me.children.length > 10) + me.parent.maybeSpill() + }, + + iterN: function iterN(at, n, op) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize() + if (at < sz) { + var used = Math.min(n, sz - at) + if (child.iterN(at, used, op)) { return true } + if ((n -= used) == 0) { break } + at = 0 + } else { at -= sz } + } + } +} + +// Line widgets are block elements displayed above or below a line. + +var LineWidget = function(doc, node, options) { + var this$1 = this; + + if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) + { this$1[opt] = options[opt] } } } + this.doc = doc + this.node = node +}; + +LineWidget.prototype.clear = function () { + var this$1 = this; + + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line) + if (no == null || !ws) { return } + for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } } + if (!ws.length) { line.widgets = null } + var height = widgetHeight(this) + updateLineHeight(line, Math.max(0, line.height - height)) + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height) + regLineChange(cm, no, "widget") + }) + signalLater(cm, "lineWidgetCleared", cm, this, no) + } +}; + +LineWidget.prototype.changed = function () { + var this$1 = this; + + var oldH = this.height, cm = this.doc.cm, line = this.line + this.height = null + var diff = widgetHeight(this) - oldH + if (!diff) { return } + updateLineHeight(line, line.height + diff) + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true + adjustScrollWhenAboveVisible(cm, line, diff) + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)) + }) + } +}; +eventMixin(LineWidget) + +function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + { addToScrollTop(cm, diff) } +} + +function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options) + var cm = doc.cm + if (cm && widget.noHScroll) { cm.display.alignWidgets = true } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []) + if (widget.insertAt == null) { widgets.push(widget) } + else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) } + widget.line = line + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop + updateLineHeight(line, line.height + widgetHeight(widget)) + if (aboveVisible) { addToScrollTop(cm, widget.height) } + cm.curOp.forceUpdate = true + } + return true + }) + signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)) + return widget +} + +// TEXTMARKERS + +// Created with markText and setBookmark methods. A TextMarker is a +// handle that can be used to clear or find a marked position in the +// document. Line objects hold arrays (markedSpans) containing +// {from, to, marker} object pointing to such marker objects, and +// indicating that such a marker is present on that line. Multiple +// lines may point to the same marker when it spans across lines. +// The spans will have null for their from/to properties when the +// marker continues beyond the start/end of the line. Markers have +// links back to the lines they currently touch. + +// Collapsed markers have unique ids, in order to be able to order +// them, which is needed for uniquely determining an outer marker +// when they overlap (they may nest, but not partially overlap). +var nextMarkerId = 0 + +var TextMarker = function(doc, type) { + this.lines = [] + this.type = type + this.doc = doc + this.id = ++nextMarkerId +}; + +// Clear the marker. +TextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + var cm = this.doc.cm, withOp = cm && !cm.curOp + if (withOp) { startOperation(cm) } + if (hasHandler(this, "clear")) { + var found = this.find() + if (found) { signalLater(this, "clear", found.from, found.to) } + } + var min = null, max = null + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i] + var span = getMarkedSpanFor(line.markedSpans, this$1) + if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") } + else if (cm) { + if (span.to != null) { max = lineNo(line) } + if (span.from != null) { min = lineNo(line) } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span) + if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) + { updateLineHeight(line, textHeight(cm.display)) } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual) + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual + cm.display.maxLineLength = len + cm.display.maxLineChanged = true + } + } } + + if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) } + this.lines.length = 0 + this.explicitlyCleared = true + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false + if (cm) { reCheckSelection(cm.doc) } + } + if (cm) { signalLater(cm, "markerCleared", cm, this, min, max) } + if (withOp) { endOperation(cm) } + if (this.parent) { this.parent.clear() } +}; + +// Find the position of the marker in the document. Returns a {from, +// to} object by default. Side can be passed to get a specific side +// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the +// Pos objects returned contain a line object, rather than a line +// number (used to prevent looking up the same line twice). +TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; + + if (side == null && this.type == "bookmark") { side = 1 } + var from, to + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i] + var span = getMarkedSpanFor(line.markedSpans, this$1) + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from) + if (side == -1) { return from } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to) + if (side == 1) { return to } + } + } + return from && {from: from, to: to} +}; + +// Signals that the marker's widget changed, and surrounding layout +// should be recomputed. +TextMarker.prototype.changed = function () { + var this$1 = this; + + var pos = this.find(-1, true), widget = this, cm = this.doc.cm + if (!pos || !cm) { return } + runInOp(cm, function () { + var line = pos.line, lineN = lineNo(pos.line) + var view = findViewForLine(cm, lineN) + if (view) { + clearLineMeasurementCacheFor(view) + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true + } + cm.curOp.updateMaxLine = true + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height + widget.height = null + var dHeight = widgetHeight(widget) - oldHeight + if (dHeight) + { updateLineHeight(line, line.height + dHeight) } + } + signalLater(cm, "markerChanged", cm, this$1) + }) +}; + +TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) } + } + this.lines.push(line) +}; + +TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1) + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this) + } +}; +eventMixin(TextMarker) + +// Create a marker, wire it up to the right lines, and +function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { return markTextShared(doc, from, to, options, type) } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } + + var marker = new TextMarker(doc, type), diff = cmp(from, to) + if (options) { copyObj(options, marker, false) } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + { return marker } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget") + if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") } + if (options.insertLeft) { marker.widgetNode.insertLeft = true } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + { throw new Error("Inserting collapsed marker partially overlapping an existing one") } + seeCollapsedSpans() + } + + if (marker.addToHistory) + { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) } + + var curLine = from.line, cm = doc.cm, updateMaxLine + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + { updateMaxLine = true } + if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) } + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)) + ++curLine + }) + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) } + }) } + + if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) } + + if (marker.readOnly) { + seeReadOnlySpans() + if (doc.history.done.length || doc.history.undone.length) + { doc.clearHistory() } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId + marker.atomic = true + } + if (cm) { + // Sync editor state + if (updateMaxLine) { cm.curOp.updateMaxLine = true } + if (marker.collapsed) + { regChange(cm, from.line, to.line + 1) } + else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) + { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } } + if (marker.atomic) { reCheckSelection(cm.doc) } + signalLater(cm, "markerAdded", cm, marker) + } + return marker +} + +// SHARED TEXTMARKERS + +// A shared marker spans multiple linked documents. It is +// implemented as a meta-marker-object controlling multiple normal +// markers. +var SharedTextMarker = function(markers, primary) { + var this$1 = this; + + this.markers = markers + this.primary = primary + for (var i = 0; i < markers.length; ++i) + { markers[i].parent = this$1 } +}; + +SharedTextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + this.explicitlyCleared = true + for (var i = 0; i < this.markers.length; ++i) + { this$1.markers[i].clear() } + signalLater(this, "clear") +}; + +SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj) +}; +eventMixin(SharedTextMarker) + +function markTextShared(doc, from, to, options, type) { + options = copyObj(options) + options.shared = false + var markers = [markText(doc, from, to, options, type)], primary = markers[0] + var widget = options.widgetNode + linkedDocs(doc, function (doc) { + if (widget) { options.widgetNode = widget.cloneNode(true) } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)) + for (var i = 0; i < doc.linked.length; ++i) + { if (doc.linked[i].isParent) { return } } + primary = lst(markers) + }) + return new SharedTextMarker(markers, primary) +} + +function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) +} + +function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find() + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to) + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type) + marker.markers.push(subMark) + subMark.parent = marker + } + } +} + +function detachSharedMarkers(markers) { + var loop = function ( i ) { + var marker = markers[i], linked = [marker.primary.doc] + linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }) + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j] + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null + marker.markers.splice(j--, 1) + } + } + }; + + for (var i = 0; i < markers.length; i++) loop( i ); +} + +var nextDocId = 0 +var Doc = function(text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } + if (firstLine == null) { firstLine = 0 } + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]) + this.first = firstLine + this.scrollTop = this.scrollLeft = 0 + this.cantEdit = false + this.cleanGeneration = 1 + this.modeFrontier = this.highlightFrontier = firstLine + var start = Pos(firstLine, 0) + this.sel = simpleSelection(start) + this.history = new History(null) + this.id = ++nextDocId + this.modeOption = mode + this.lineSep = lineSep + this.direction = (direction == "rtl") ? "rtl" : "ltr" + this.extend = false + + if (typeof text == "string") { text = this.splitLines(text) } + updateDoc(this, {from: start, to: start, text: text}) + setSelection(this, simpleSelection(start), sel_dontScroll) +} + +Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) { this.iterN(from - this.first, to - from, op) } + else { this.iterN(this.first, this.first + this.size, from) } + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0 + for (var i = 0; i < lines.length; ++i) { height += lines[i].height } + this.insertInner(at - this.first, lines, height) + }, + remove: function(at, n) { this.removeInner(at - this.first, n) }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size) + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1 + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), origin: "setValue", full: true}, true) + if (this.cm) { scrollToCoords(this.cm, 0, 0) } + setSelection(this, simpleSelection(top), sel_dontScroll) + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from) + to = to ? clipPos(this, to) : from + replaceRange(this, code, from, to, origin) + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)) + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, + + getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, + getLineNumber: function(line) {return lineNo(line)}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") { line = getLine(this, line) } + return visualLine(line) + }, + + lineCount: function() {return this.size}, + firstLine: function() {return this.first}, + lastLine: function() {return this.first + this.size - 1}, + + clipPos: function(pos) {return clipPos(this, pos)}, + + getCursor: function(start) { + var range = this.sel.primary(), pos + if (start == null || start == "head") { pos = range.head } + else if (start == "anchor") { pos = range.anchor } + else if (start == "end" || start == "to" || start === false) { pos = range.to() } + else { pos = range.from() } + return pos + }, + listSelections: function() { return this.sel.ranges }, + somethingSelected: function() {return this.sel.somethingSelected()}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options) + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options) + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options) + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads), options) + }), + extendSelectionsBy: docMethodOp(function(f, options) { + var heads = map(this.sel.ranges, f) + extendSelections(this, clipPosArray(this, heads), options) + }), + setSelections: docMethodOp(function(ranges, primary, options) { + var this$1 = this; + + if (!ranges.length) { return } + var out = [] + for (var i = 0; i < ranges.length; i++) + { out[i] = new Range(clipPos(this$1, ranges[i].anchor), + clipPos(this$1, ranges[i].head)) } + if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) } + setSelection(this, normalizeSelection(out, primary), options) + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0) + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))) + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options) + }), + + getSelection: function(lineSep) { + var this$1 = this; + + var ranges = this.sel.ranges, lines + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) + lines = lines ? lines.concat(sel) : sel + } + if (lineSep === false) { return lines } + else { return lines.join(lineSep || this.lineSeparator()) } + }, + getSelections: function(lineSep) { + var this$1 = this; + + var parts = [], ranges = this.sel.ranges + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) + if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) } + parts[i] = sel + } + return parts + }, + replaceSelection: function(code, collapse, origin) { + var dup = [] + for (var i = 0; i < this.sel.ranges.length; i++) + { dup[i] = code } + this.replaceSelections(dup, collapse, origin || "+input") + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var this$1 = this; + + var changes = [], sel = this.sel + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i] + changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin} + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse) + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) + { makeChange(this$1, changes[i$1]) } + if (newSel) { setSelectionReplaceHistory(this, newSel) } + else if (this.cm) { ensureCursorVisible(this.cm) } + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}), + + setExtending: function(val) {this.extend = val}, + getExtending: function() {return this.extend}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0 + for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } } + return {undo: done, redo: undone} + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration)}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true) + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null } + return this.history.generation + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration) + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)} + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration) + hist.done = copyHistoryArray(histData.done.slice(0), null, true) + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true) + }, + + setGutterMarker: docMethodOp(function(line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}) + markers[gutterID] = value + if (!value && isEmpty(markers)) { line.gutterMarkers = null } + return true + }) + }), + + clearGutter: docMethodOp(function(gutterID) { + var this$1 = this; + + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null + if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null } + return true + }) + } + }) + }), + + lineInfo: function(line) { + var n + if (typeof line == "number") { + if (!isLine(this, line)) { return null } + n = line + line = getLine(this, line) + if (!line) { return null } + } else { + n = lineNo(line) + if (n == null) { return null } + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets} + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass" + if (!line[prop]) { line[prop] = cls } + else if (classTest(cls).test(line[prop])) { return false } + else { line[prop] += " " + cls } + return true + }) + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass" + var cur = line[prop] + if (!cur) { return false } + else if (cls == null) { line[prop] = null } + else { + var found = cur.match(classTest(cls)) + if (!found) { return false } + var end = found.index + found[0].length + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null + } + return true + }) + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options) + }), + removeLineWidget: function(widget) { widget.clear() }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents} + pos = clipPos(this, pos) + return markText(this, pos, pos, realOpts, "bookmark") + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos) + var markers = [], spans = getLine(this, pos.line).markedSpans + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i] + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + { markers.push(span.marker.parent || span.marker) } + } } + return markers + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to) + var found = [], lineNo = from.line + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans + if (spans) { for (var i = 0; i < spans.length; i++) { + var span = spans[i] + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || + span.from == null && lineNo != from.line || + span.from != null && lineNo == to.line && span.from >= to.ch) && + (!filter || filter(span.marker))) + { found.push(span.marker.parent || span.marker) } + } } + ++lineNo + }) + return found + }, + getAllMarks: function() { + var markers = [] + this.iter(function (line) { + var sps = line.markedSpans + if (sps) { for (var i = 0; i < sps.length; ++i) + { if (sps[i].from != null) { markers.push(sps[i].marker) } } } + }) + return markers + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first, sepSize = this.lineSeparator().length + this.iter(function (line) { + var sz = line.text.length + sepSize + if (sz > off) { ch = off; return true } + off -= sz + ++lineNo + }) + return clipPos(this, Pos(lineNo, ch)) + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords) + var index = coords.ch + if (coords.line < this.first || coords.ch < 0) { return 0 } + var sepSize = this.lineSeparator().length + this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value + index += line.text.length + sepSize + }) + return index + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), + this.modeOption, this.first, this.lineSep, this.direction) + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft + doc.sel = this.sel + doc.extend = false + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth + doc.setHistory(this.getHistory()) + } + return doc + }, + + linkedDoc: function(options) { + if (!options) { options = {} } + var from = this.first, to = this.first + this.size + if (options.from != null && options.from > from) { from = options.from } + if (options.to != null && options.to < to) { to = options.to } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction) + if (options.sharedHist) { copy.history = this.history + ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}) + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}] + copySharedMarkers(copy, findSharedMarkers(this)) + return copy + }, + unlinkDoc: function(other) { + var this$1 = this; + + if (other instanceof CodeMirror) { other = other.doc } + if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { + var link = this$1.linked[i] + if (link.doc != other) { continue } + this$1.linked.splice(i, 1) + other.unlinkDoc(this$1) + detachSharedMarkers(findSharedMarkers(this$1)) + break + } } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id] + linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true) + other.history = new History(null) + other.history.done = copyHistoryArray(this.history.done, splitIds) + other.history.undone = copyHistoryArray(this.history.undone, splitIds) + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f)}, + + getMode: function() {return this.mode}, + getEditor: function() {return this.cm}, + + splitLines: function(str) { + if (this.lineSep) { return str.split(this.lineSep) } + return splitLinesAuto(str) + }, + lineSeparator: function() { return this.lineSep || "\n" }, + + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { dir = "ltr" } + if (dir == this.direction) { return } + this.direction = dir + this.iter(function (line) { return line.order = null; }) + if (this.cm) { directionChanged(this.cm) } + }) +}) + +// Public alias. +Doc.prototype.eachLine = Doc.prototype.iter + +// Kludge to work around strange IE behavior where it'll sometimes +// re-fire a series of drag-related events right after the drop (#1551) +var lastDrop = 0 + +function onDrop(e) { + var cm = this + clearDragCursor(cm) + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + { return } + e_preventDefault(e) + if (ie) { lastDrop = +new Date } + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files + if (!pos || cm.isReadOnly()) { return } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0 + var loadFile = function (file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) + { return } + + var reader = new FileReader + reader.onload = operation(cm, function () { + var content = reader.result + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" } + text[i] = content + if (++read == n) { + pos = clipPos(cm.doc, pos) + var change = {from: pos, to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste"} + makeChange(cm.doc, change) + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))) + } + }) + reader.readAsText(file) + } + for (var i = 0; i < n; ++i) { loadFile(files[i], i) } + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e) + // Ensure the editor is re-focused + setTimeout(function () { return cm.display.input.focus(); }, 20) + return + } + try { + var text$1 = e.dataTransfer.getData("Text") + if (text$1) { + var selected + if (cm.state.draggingText && !cm.state.draggingText.copy) + { selected = cm.listSelections() } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)) + if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) + { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } } + cm.replaceSelection(text$1, "around", "paste") + cm.display.input.focus() + } + } + catch(e){} + } +} + +function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } + + e.dataTransfer.setData("Text", cm.getSelection()) + e.dataTransfer.effectAllowed = "copyMove" + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;") + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" + if (presto) { + img.width = img.height = 1 + cm.display.wrapper.appendChild(img) + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop + } + e.dataTransfer.setDragImage(img, 0, 0) + if (presto) { img.parentNode.removeChild(img) } + } +} + +function onDragOver(cm, e) { + var pos = posFromMouse(cm, e) + if (!pos) { return } + var frag = document.createDocumentFragment() + drawSelectionCursor(cm, pos, frag) + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors") + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv) + } + removeChildrenAndAdd(cm.display.dragCursor, frag) +} + +function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor) + cm.display.dragCursor = null + } +} + +// These must be handled carefully, because naively registering a +// handler for each editor will cause the editors to never be +// garbage collected. + +function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { return } + var byClass = document.getElementsByClassName("CodeMirror") + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror + if (cm) { f(cm) } + } +} + +var globalsRegistered = false +function ensureGlobalHandlers() { + if (globalsRegistered) { return } + registerGlobalHandlers() + globalsRegistered = true +} +function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer + on(window, "resize", function () { + if (resizeTimer == null) { resizeTimer = setTimeout(function () { + resizeTimer = null + forEachCodeMirror(onResize) + }, 100) } + }) + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { return forEachCodeMirror(onBlur); }) +} +// Called when the window resizes +function onResize(cm) { + var d = cm.display + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) + { return } + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null + d.scrollbarsClipped = false + cm.setSize() +} + +var keyNames = { + 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" +} + +// Number keys +for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) } +// Alphabetic keys +for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) } +// Function keys +for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 } + +var keyMap = {} + +keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" +} +// Note that the save and find-related commands aren't defined by +// default. User code or addons can define them. Unknown commands +// are simply ignored. +keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + fallthrough: "basic" +} +// Very basic readline/emacs-style bindings, which are standard on Mac. +keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" +} +keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + fallthrough: ["basic", "emacsy"] +} +keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault + +// KEYMAP DISPATCH + +function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/) + name = parts[parts.length - 1] + var alt, ctrl, shift, cmd + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i] + if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true } + else if (/^a(lt)?$/i.test(mod)) { alt = true } + else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true } + else if (/^s(hift)?$/i.test(mod)) { shift = true } + else { throw new Error("Unrecognized modifier name: " + mod) } + } + if (alt) { name = "Alt-" + name } + if (ctrl) { name = "Ctrl-" + name } + if (cmd) { name = "Cmd-" + name } + if (shift) { name = "Shift-" + name } + return name +} + +// This is a kludge to keep keymaps mostly working as raw objects +// (backwards compatibility) while at the same time support features +// like normalization and multi-stroke key bindings. It compiles a +// new normalized keymap, and then updates the old object to reflect +// this. +function normalizeKeyMap(keymap) { + var copy = {} + for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname] + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } + if (value == "...") { delete keymap[keyname]; continue } + + var keys = map(keyname.split(" "), normalizeKeyName) + for (var i = 0; i < keys.length; i++) { + var val = (void 0), name = (void 0) + if (i == keys.length - 1) { + name = keys.join(" ") + val = value + } else { + name = keys.slice(0, i + 1).join(" ") + val = "..." + } + var prev = copy[name] + if (!prev) { copy[name] = val } + else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } + } + delete keymap[keyname] + } } + for (var prop in copy) { keymap[prop] = copy[prop] } + return keymap +} + +function lookupKey(key, map, handle, context) { + map = getKeyMap(map) + var found = map.call ? map.call(key, context) : map[key] + if (found === false) { return "nothing" } + if (found === "...") { return "multi" } + if (found != null && handle(found)) { return "handled" } + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + { return lookupKey(key, map.fallthrough, handle, context) } + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context) + if (result) { return result } + } + } +} + +// Modifier key presses don't count as 'real' key presses for the +// purpose of keymap fallthrough. +function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode] + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" +} + +function addModifierNames(name, event, noShift) { + var base = name + if (event.altKey && base != "Alt") { name = "Alt-" + name } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name } + if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name } + return name +} + +// Look up the name of a key as indicated by an event object. +function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { return false } + var name = keyNames[event.keyCode] + if (name == null || event.altGraphKey) { return false } + return addModifierNames(name, event, noShift) +} + +function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val +} + +// Helper for deleting text near the selection(s), used to implement +// backspace, delete, and similar functionality. +function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = [] + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]) + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop() + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from + break + } + } + kill.push(toKill) + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) + { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") } + ensureCursorVisible(cm) + }) +} + +function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir) + return target < 0 || target > line.text.length ? null : target +} + +function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir) + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") +} + +function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction) + if (order) { + var part = dir < 0 ? lst(order) : order[0] + var moveInStorageOrder = (dir < 0) == (part.level == 1) + var sticky = moveInStorageOrder ? "after" : "before" + var ch + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + var prep = prepareMeasureForLine(cm, lineObj) + ch = dir < 0 ? lineObj.text.length - 1 : 0 + var targetTop = measureCharPrepared(cm, prep, ch).top + ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch) + if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) } + } else { ch = dir < 0 ? part.to : part.from } + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") +} + +function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction) + if (!bidi) { return moveLogically(line, start, dir) } + if (start.ch >= line.text.length) { + start.ch = line.text.length + start.sticky = "before" + } else if (start.ch <= 0) { + start.ch = 0 + start.sticky = "after" + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos] + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); } + var prep + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } + prep = prep || prepareMeasureForLine(cm, line) + return wrappedLineExtentChar(cm, line, prep, ch) + } + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch) + + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = (part.level == 1) == (dir < 0) + var ch = mv(start, moveInStorageOrder ? 1 : -1) + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after" + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after"); } + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos] + var moveInStorageOrder = (dir > 0) == (part.level != 1) + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1) + if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } + ch = moveInStorageOrder ? part.from : mv(part.to, -1) + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } + } + } + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent) + if (res) { return res } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1) + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)) + if (res) { return res } + } + + // Case 4: Nowhere to move + return null +} + +// Commands are parameter-less actions that can be performed on an +// editor, mostly used for keybindings. +var commands = { + selectAll: selectAll, + singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, + killLine: function (cm) { return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length + if (range.head.ch == len && range.head.line < cm.lastLine()) + { return {from: range.head, to: Pos(range.head.line + 1, 0)} } + else + { return {from: range.head, to: Pos(range.head.line, len)} } + } else { + return {from: range.from(), to: range.to()} + } + }); }, + deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }); }); }, + delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), to: range.from() + }); }); }, + delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5 + var leftPos = cm.coordsChar({left: 0, top: top}, "div") + return {from: leftPos, to: range.from()} + }); }, + delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5 + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + return {from: range.from(), to: rightPos } + }); }, + undo: function (cm) { return cm.undo(); }, + redo: function (cm) { return cm.redo(); }, + undoSelection: function (cm) { return cm.undoSelection(); }, + redoSelection: function (cm) { return cm.redoSelection(); }, + goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, + goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, + goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1} + ); }, + goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, + {origin: "+move", bias: 1} + ); }, + goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1} + ); }, + goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5 + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + }, sel_move); }, + goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5 + return cm.coordsChar({left: 0, top: top}, "div") + }, sel_move); }, + goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5 + var pos = cm.coordsChar({left: 0, top: top}, "div") + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } + return pos + }, sel_move); }, + goLineUp: function (cm) { return cm.moveV(-1, "line"); }, + goLineDown: function (cm) { return cm.moveV(1, "line"); }, + goPageUp: function (cm) { return cm.moveV(-1, "page"); }, + goPageDown: function (cm) { return cm.moveV(1, "page"); }, + goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, + goCharRight: function (cm) { return cm.moveH(1, "char"); }, + goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, + goColumnRight: function (cm) { return cm.moveH(1, "column"); }, + goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, + goGroupRight: function (cm) { return cm.moveH(1, "group"); }, + goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, + goWordRight: function (cm) { return cm.moveH(1, "word"); }, + delCharBefore: function (cm) { return cm.deleteH(-1, "char"); }, + delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, + delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, + delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, + delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, + delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, + indentAuto: function (cm) { return cm.indentSelection("smart"); }, + indentMore: function (cm) { return cm.indentSelection("add"); }, + indentLess: function (cm) { return cm.indentSelection("subtract"); }, + insertTab: function (cm) { return cm.replaceSelection("\t"); }, + insertSoftTab: function (cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from() + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize) + spaces.push(spaceStr(tabSize - col % tabSize)) + } + cm.replaceSelections(spaces) + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { cm.indentSelection("add") } + else { cm.execCommand("insertTab") } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { return runInOp(cm, function () { + var ranges = cm.listSelections(), newSel = [] + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { continue } + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text + if (line) { + if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1) + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose") + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text + if (prev) { + cur = new Pos(cur.line, 1) + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), cur, "+transpose") + } + } + } + newSel.push(new Range(cur, cur)) + } + cm.setSelections(newSel) + }); }, + newlineAndIndent: function (cm) { return runInOp(cm, function () { + var sels = cm.listSelections() + for (var i = sels.length - 1; i >= 0; i--) + { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") } + sels = cm.listSelections() + for (var i$1 = 0; i$1 < sels.length; i$1++) + { cm.indentLine(sels[i$1].from().line, null, true) } + ensureCursorVisible(cm) + }); }, + openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, + toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } +} + + +function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN) + var visual = visualLine(line) + if (visual != line) { lineN = lineNo(visual) } + return endOfLine(true, cm, visual, lineN, 1) +} +function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN) + var visual = visualLineEnd(line) + if (visual != line) { lineN = lineNo(visual) } + return endOfLine(true, cm, line, lineN, -1) +} +function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line) + var line = getLine(cm.doc, start.line) + var order = getOrder(line, cm.doc.direction) + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)) + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) + } + return start +} + +// Run a handler that was bound to a key. +function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound] + if (!bound) { return false } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled() + var prevShift = cm.display.shift, done = false + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true } + if (dropShift) { cm.display.shift = false } + done = bound(cm) != Pass + } finally { + cm.display.shift = prevShift + cm.state.suppressEdits = false + } + return done +} + +function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm) + if (result) { return result } + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm) +} + +// Note that, despite the name, this function is also used to check +// for bound mouse clicks. + +var stopSeq = new Delayed + +function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq + if (seq) { + if (isModifierKey(name)) { return "handled" } + if (/\'$/.test(name)) + { cm.state.keySeq = null } + else + { stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null + cm.display.input.reset() + } + }) } + if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } + } + return dispatchKeyInner(cm, name, e, handle) +} + +function dispatchKeyInner(cm, name, e, handle) { + var result = lookupKeyForEditor(cm, name, handle) + + if (result == "multi") + { cm.state.keySeq = name } + if (result == "handled") + { signalLater(cm, "keyHandled", cm, name, e) } + + if (result == "handled" || result == "multi") { + e_preventDefault(e) + restartBlink(cm) + } + + return !!result +} + +// Handle a key from the keydown event. +function handleKeyBinding(cm, e) { + var name = keyName(e, true) + if (!name) { return false } + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) + || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + { return doHandleBinding(cm, b) } + }) + } else { + return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) + } +} + +// Handle a key from the keypress event +function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) +} + +var lastStoppedKey = null +function onKeyDown(e) { + var cm = this + cm.curOp.focus = activeElt() + if (signalDOMEvent(cm, e)) { return } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false } + var code = e.keyCode + cm.display.shift = code == 16 || e.shiftKey + var handled = handleKeyBinding(cm, e) + if (presto) { + lastStoppedKey = handled ? code : null + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + { cm.replaceSelection("", null, "cut") } + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + { showCrossHair(cm) } +} + +function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv + addClass(lineDiv, "CodeMirror-crosshair") + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair") + off(document, "keyup", up) + off(document, "mouseover", up) + } + } + on(document, "keyup", up) + on(document, "mouseover", up) +} + +function onKeyUp(e) { + if (e.keyCode == 16) { this.doc.sel.shift = false } + signalDOMEvent(this, e) +} + +function onKeyPress(e) { + var cm = this + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } + var keyCode = e.keyCode, charCode = e.charCode + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode) + // Some browsers fire keypress events for backspace + if (ch == "\x08") { return } + if (handleCharBinding(cm, e, ch)) { return } + cm.display.input.onKeyPress(e) +} + +var DOUBLECLICK_DELAY = 400 + +var PastClick = function(time, pos, button) { + this.time = time + this.pos = pos + this.button = button +}; + +PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && + cmp(pos, this.pos) == 0 && button == this.button +}; + +var lastClick; +var lastDoubleClick; +function clickRepeat(pos, button) { + var now = +new Date + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null + return "triple" + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button) + lastClick = null + return "double" + } else { + lastClick = new PastClick(now, pos, button) + lastDoubleClick = null + return "single" + } +} + +// A mouse down can be a single click, double click, triple click, +// start of selection drag, start of text drag, new cursor +// (ctrl-click), rectangle drag (alt-drag), or xwin +// middle-click-paste. Or it might be a click on something we should +// not interfere with, such as a scrollbar or widget. +function onMouseDown(e) { + var cm = this, display = cm.display + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } + display.input.ensurePolled() + display.shift = e.shiftKey + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false + setTimeout(function () { return display.scroller.draggable = true; }, 100) + } + return + } + if (clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single" + window.focus() + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) + { cm.state.selectingText(e) } + + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } + + if (button == 1) { + if (pos) { leftButtonDown(cm, pos, repeat, e) } + else if (e_target(e) == display.scroller) { e_preventDefault(e) } + } else if (button == 2) { + if (pos) { extendSelection(cm.doc, pos) } + setTimeout(function () { return display.input.focus(); }, 20) + } else if (button == 3) { + if (captureRightClick) { onContextMenu(cm, e) } + else { delayBlurEvent(cm) } + } +} + +function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click" + if (repeat == "double") { name = "Double" + name } + else if (repeat == "triple") { name = "Triple" + name } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name + + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { bound = commands[bound] } + if (!bound) { return false } + var done = false + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true } + done = bound(cm, pos) != Pass + } finally { + cm.state.suppressEdits = false + } + return done + }) +} + +function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse") + var value = option ? option(cm, repeat, event) : {} + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line" + } + if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey } + if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey } + if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) } + return value +} + +function leftButtonDown(cm, pos, repeat, event) { + if (ie) { setTimeout(bind(ensureFocus, cm), 0) } + else { cm.curOp.focus = activeElt() } + + var behavior = configureMouse(cm, repeat, event) + + var sel = cm.doc.sel, contained + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && + repeat == "single" && (contained = sel.contains(pos)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && + (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) + { leftButtonStartDrag(cm, event, pos, behavior) } + else + { leftButtonSelect(cm, event, pos, behavior) } +} + +// Start a text drag. When it ends, see if any dragging actually +// happen, and treat as a click if it didn't. +function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, moved = false + var dragEnd = operation(cm, function (e) { + if (webkit) { display.scroller.draggable = false } + cm.state.draggingText = false + off(document, "mouseup", dragEnd) + off(document, "mousemove", mouseMove) + off(display.scroller, "dragstart", dragStart) + off(display.scroller, "drop", dragEnd) + if (!moved) { + e_preventDefault(e) + if (!behavior.addNew) + { extendSelection(cm.doc, pos, null, null, behavior.extend) } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) } + else + { display.input.focus() } + } + }) + var mouseMove = function(e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10 + } + var dragStart = function () { return moved = true; } + // Let the drag handler handle this. + if (webkit) { display.scroller.draggable = true } + cm.state.draggingText = dragEnd + dragEnd.copy = !behavior.moveOnDrag + // IE's approach to draggable + if (display.scroller.dragDrop) { display.scroller.dragDrop() } + on(document, "mouseup", dragEnd) + on(document, "mousemove", mouseMove) + on(display.scroller, "dragstart", dragStart) + on(display.scroller, "drop", dragEnd) + + delayBlurEvent(cm) + setTimeout(function () { return display.input.focus(); }, 20) +} + +function rangeForUnit(cm, pos, unit) { + if (unit == "char") { return new Range(pos, pos) } + if (unit == "word") { return cm.findWordAt(pos) } + if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + var result = unit(cm, pos) + return new Range(result.from, result.to) +} + +// Normal selection, as opposed to text dragging. +function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, doc = cm.doc + e_preventDefault(event) + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start) + if (ourIndex > -1) + { ourRange = ranges[ourIndex] } + else + { ourRange = new Range(start, start) } + } else { + ourRange = doc.sel.primary() + ourIndex = doc.sel.primIndex + } + + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { ourRange = new Range(start, start) } + start = posFromMouse(cm, event, true, true) + ourIndex = -1 + } else { + var range = rangeForUnit(cm, start, behavior.unit) + if (behavior.extend) + { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) } + else + { ourRange = range } + } + + if (!behavior.addNew) { + ourIndex = 0 + setSelection(doc, new Selection([ourRange], 0), sel_mouse) + startSel = doc.sel + } else if (ourIndex == -1) { + ourIndex = ranges.length + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}) + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}) + startSel = doc.sel + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse) + } + + var lastPos = start + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { return } + lastPos = pos + + if (behavior.unit == "rectangle") { + var ranges = [], tabSize = cm.options.tabSize + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize) + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize) + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol) + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize) + if (left == right) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) } + else if (text.length > leftPos) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) } + } + if (!ranges.length) { ranges.push(new Range(start, start)) } + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}) + cm.scrollIntoView(pos) + } else { + var oldRange = ourRange + var range = rangeForUnit(cm, pos, behavior.unit) + var anchor = oldRange.anchor, head + if (cmp(range.anchor, anchor) > 0) { + head = range.head + anchor = minPos(oldRange.from(), range.anchor) + } else { + head = range.anchor + anchor = maxPos(oldRange.to(), range.head) + } + var ranges$1 = startSel.ranges.slice(0) + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)) + setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse) + } + } + + var editorSize = display.wrapper.getBoundingClientRect() + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0 + + function extend(e) { + var curCount = ++counter + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle") + if (!cur) { return } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt() + extendTo(cur) + var visible = visibleLines(display, doc) + if (cur.line >= visible.to || cur.line < visible.from) + { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0 + if (outside) { setTimeout(operation(cm, function () { + if (counter != curCount) { return } + display.scroller.scrollTop += outside + extend(e) + }), 50) } + } + } + + function done(e) { + cm.state.selectingText = false + counter = Infinity + e_preventDefault(e) + display.input.focus() + off(document, "mousemove", move) + off(document, "mouseup", up) + doc.history.lastSelOrigin = null + } + + var move = operation(cm, function (e) { + if (!e_button(e)) { done(e) } + else { extend(e) } + }) + var up = operation(cm, done) + cm.state.selectingText = up + on(document, "mousemove", move) + on(document, "mouseup", up) +} + +// Used when mouse-selecting to adjust the anchor to the proper side +// of a bidi jump depending on the visual position of the head. +function bidiSimplify(cm, range) { + var anchor = range.anchor; + var head = range.head; + var anchorLine = getLine(cm.doc, anchor.line) + if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range } + var order = getOrder(anchorLine) + if (!order) { return range } + var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index] + if (part.from != anchor.ch && part.to != anchor.ch) { return range } + var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1) + if (boundary == 0 || boundary == order.length) { return range } + + // Compute the relative visual position of the head compared to the + // anchor (<0 is to the left, >0 to the right) + var leftSide + if (head.line != anchor.line) { + leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0 + } else { + var headIndex = getBidiPartAt(order, head.ch, head.sticky) + var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1) + if (headIndex == boundary - 1 || headIndex == boundary) + { leftSide = dir < 0 } + else + { leftSide = dir > 0 } + } + + var usePart = order[boundary + (leftSide ? -1 : 0)] + var from = leftSide == (usePart.level == 1) + var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before" + return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head) +} + + +// Determines whether an event happened in the gutter, and fires the +// handlers for the corresponding event. +function gutterEvent(cm, e, type, prevent) { + var mX, mY + if (e.touches) { + mX = e.touches[0].clientX + mY = e.touches[0].clientY + } else { + try { mX = e.clientX; mY = e.clientY } + catch(e) { return false } + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } + if (prevent) { e_preventDefault(e) } + + var display = cm.display + var lineBox = display.lineDiv.getBoundingClientRect() + + if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } + mY -= lineBox.top - display.viewOffset + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i] + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY) + var gutter = cm.options.gutters[i] + signal(cm, type, cm, line, gutter, e) + return e_defaultPrevented(e) + } + } +} + +function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true) +} + +// CONTEXT MENU HANDLING + +// To make the context menu work, we need to briefly unhide the +// textarea (making it as unobtrusive as possible) to let the +// right-click take effect on it. +function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } + if (signalDOMEvent(cm, e, "contextmenu")) { return } + cm.display.input.onContextMenu(e) +} + +function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { return false } + return gutterEvent(cm, e, "gutterContextMenu", false) +} + +function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-") + clearCaches(cm) +} + +var Init = {toString: function(){return "CodeMirror.Init"}} + +var defaults = {} +var optionHandlers = {} + +function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt + if (handle) { optionHandlers[name] = + notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle } + } + + CodeMirror.defineOption = option + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { return cm.setValue(val); }, true) + option("mode", null, function (cm, val) { + cm.doc.modeOption = val + loadMode(cm) + }, true) + + option("indentUnit", 2, loadMode, true) + option("indentWithTabs", false) + option("smartIndent", true) + option("tabSize", 4, function (cm) { + resetModeState(cm) + clearCaches(cm) + regChange(cm) + }, true) + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val + if (!val) { return } + var newBreaks = [], lineNo = cm.doc.first + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos) + if (found == -1) { break } + pos = found + val.length + newBreaks.push(Pos(lineNo, found)) + } + lineNo++ + }) + for (var i = newBreaks.length - 1; i >= 0; i--) + { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) } + }) + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g") + if (old != Init) { cm.refresh() } + }) + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true) + option("electricChars", true) + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME + }, true) + option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true) + option("rtlMoveVisually", !windows) + option("wholeLineUpdateBefore", true) + + option("theme", "default", function (cm) { + themeChanged(cm) + guttersChanged(cm) + }, true) + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val) + var prev = old != Init && getKeyMap(old) + if (prev && prev.detach) { prev.detach(cm, next) } + if (next.attach) { next.attach(cm, prev || null) } + }) + option("extraKeys", null) + option("configureMouse", null) + + option("lineWrapping", false, wrappingChanged, true) + option("gutters", [], function (cm) { + setGuttersForLineNumbers(cm.options) + guttersChanged(cm) + }, true) + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0" + cm.refresh() + }, true) + option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true) + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm) + updateScrollbars(cm) + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop) + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft) + }, true) + option("lineNumbers", false, function (cm) { + setGuttersForLineNumbers(cm.options) + guttersChanged(cm) + }, true) + option("firstLineNumber", 1, guttersChanged, true) + option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true) + option("showCursorWhenSelecting", false, updateSelection, true) + + option("resetSelectionOnContextMenu", true) + option("lineWiseCopyCut", true) + option("pasteLinesPerSelection", true) + + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm) + cm.display.input.blur() + } + cm.display.input.readOnlyChanged(val) + }) + option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true) + option("dragDrop", true, dragDropChanged) + option("allowDropFileTypes", null) + + option("cursorBlinkRate", 530) + option("cursorScrollMargin", 0) + option("cursorHeight", 1, updateSelection, true) + option("singleCursorHeightPerLine", true, updateSelection, true) + option("workTime", 100) + option("workDelay", 100) + option("flattenSpans", true, resetModeState, true) + option("addModeClass", false, resetModeState, true) + option("pollInterval", 100) + option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }) + option("historyEventDelay", 1250) + option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true) + option("maxHighlightLength", 10000, resetModeState, true) + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { cm.display.input.resetPosition() } + }) + + option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }) + option("autofocus", null) + option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true) +} + +function guttersChanged(cm) { + updateGutters(cm) + regChange(cm) + alignHorizontally(cm) +} + +function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions + var toggle = value ? on : off + toggle(cm.display.scroller, "dragstart", funcs.start) + toggle(cm.display.scroller, "dragenter", funcs.enter) + toggle(cm.display.scroller, "dragover", funcs.over) + toggle(cm.display.scroller, "dragleave", funcs.leave) + toggle(cm.display.scroller, "drop", funcs.drop) + } +} + +function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap") + cm.display.sizer.style.minWidth = "" + cm.display.sizerWidth = null + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap") + findMaxLine(cm) + } + estimateLineHeights(cm) + regChange(cm) + clearCaches(cm) + setTimeout(function () { return updateScrollbars(cm); }, 100) +} + +// A CodeMirror instance represents an editor. This is the object +// that user code is usually dealing with. + +function CodeMirror(place, options) { + var this$1 = this; + + if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } + + this.options = options = options ? copyObj(options) : {} + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false) + setGuttersForLineNumbers(options) + + var doc = options.value + if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) } + this.doc = doc + + var input = new CodeMirror.inputStyles[options.inputStyle](this) + var display = this.display = new Display(place, doc, input) + display.wrapper.CodeMirror = this + updateGutters(this) + themeChanged(this) + if (options.lineWrapping) + { this.display.wrapper.className += " CodeMirror-wrap" } + initScrollbars(this) + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + } + + if (options.autofocus && !mobile) { display.input.focus() } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) } + + registerEventHandlers(this) + ensureGlobalHandlers() + + startOperation(this) + this.curOp.forceUpdate = true + attachDoc(this, doc) + + if ((options.autofocus && !mobile) || this.hasFocus()) + { setTimeout(bind(onFocus, this), 20) } + else + { onBlur(this) } + + for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) + { optionHandlers[opt](this$1, options[opt], Init) } } + maybeUpdateLineNumberWidth(this) + if (options.finishInit) { options.finishInit(this) } + for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) } + endOperation(this) + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + { display.lineDiv.style.textRendering = "auto" } +} + +// The default configuration options. +CodeMirror.defaults = defaults +// Functions to run when options are changed. +CodeMirror.optionHandlers = optionHandlers + +// Attach the necessary event handlers when initializing the editor +function registerEventHandlers(cm) { + var d = cm.display + on(d.scroller, "mousedown", operation(cm, onMouseDown)) + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + { on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { return } + var pos = posFromMouse(cm, e) + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } + e_preventDefault(e) + var word = cm.findWordAt(pos) + extendSelection(cm.doc, word.anchor, word.head) + })) } + else + { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) } + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0} + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000) + prevTouch = d.activeTouch + prevTouch.end = +new Date + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { return false } + var touch = e.touches[0] + return touch.radiusX <= 1 && touch.radiusY <= 1 + } + function farAway(touch, other) { + if (other.left == null) { return true } + var dx = other.left - touch.left, dy = other.top - touch.top + return dx * dx + dy * dy > 20 * 20 + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { + d.input.ensurePolled() + clearTimeout(touchFinished) + var now = +new Date + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null} + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX + d.activeTouch.top = e.touches[0].pageY + } + } + }) + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { d.activeTouch.moved = true } + }) + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + { range = new Range(pos, pos) } + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + { range = cm.findWordAt(pos) } + else // Triple tap + { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + cm.setSelection(range.anchor, range.head) + cm.focus() + e_preventDefault(e) + } + finishTouch() + }) + on(d.scroller, "touchcancel", finishTouch) + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop) + setScrollLeft(cm, d.scroller.scrollLeft, true) + signal(cm, "scroll", cm) + } + }) + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }) + on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }) + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }) + + d.dragFunctions = { + enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }}, + over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }}, + start: function (e) { return onDragStart(cm, e); }, + drop: operation(cm, onDrop), + leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }} + } + + var inp = d.input.getField() + on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }) + on(inp, "keydown", operation(cm, onKeyDown)) + on(inp, "keypress", operation(cm, onKeyPress)) + on(inp, "focus", function (e) { return onFocus(cm, e); }) + on(inp, "blur", function (e) { return onBlur(cm, e); }) +} + +var initHooks = [] +CodeMirror.defineInitHook = function (f) { return initHooks.push(f); } + +// Indent the given line. The how parameter can be "smart", +// "add"/null, "subtract", or "prev". When aggressive is false +// (typically set to true for forced single-line indents), empty +// lines are not indented, and places where the mode returns Pass +// are left alone. +function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state + if (how == null) { how = "add" } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { how = "prev" } + else { state = getContextBefore(cm, n).state } + } + + var tabSize = cm.options.tabSize + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize) + if (line.stateAfter) { line.stateAfter = null } + var curSpaceString = line.text.match(/^\s*/)[0], indentation + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0 + how = "not" + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text) + if (indentation == Pass || indentation > 150) { + if (!aggressive) { return } + how = "prev" + } + } + if (how == "prev") { + if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) } + else { indentation = 0 } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit + } else if (typeof how == "number") { + indentation = curSpace + how + } + indentation = Math.max(0, indentation) + + var indentString = "", pos = 0 + if (cm.options.indentWithTabs) + { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} } + if (pos < indentation) { indentString += spaceStr(indentation - pos) } + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input") + line.stateAfter = null + return true + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1] + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length) + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)) + break + } + } + } +} + +// This will be set to a {lineWise: bool, text: [string]} object, so +// that, when pasting, we know what kind of selections the copied +// text was made out of. +var lastCopied = null + +function setLastCopied(newLastCopied) { + lastCopied = newLastCopied +} + +function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc + cm.display.shift = false + if (!sel) { sel = doc.sel } + + var paste = cm.state.pasteIncoming || origin == "paste" + var textLines = splitLinesAuto(inserted), multiPaste = null + // When pasing N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = [] + for (var i = 0; i < lastCopied.text.length; i++) + { multiPaste.push(doc.splitLines(lastCopied.text[i])) } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { return [l]; }) + } + } + + var updateInput + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range = sel.ranges[i$1] + var from = range.from(), to = range.to() + if (range.empty()) { + if (deleted && deleted > 0) // Handle deletion + { from = Pos(from.line, from.ch - deleted) } + else if (cm.state.overwrite && !paste) // Handle overwrite + { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) } + else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + { from = to = Pos(from.line, 0) } + } + updateInput = cm.curOp.updateInput + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")} + makeChange(cm.doc, changeEvent) + signalLater(cm, "inputRead", cm, changeEvent) + } + if (inserted && !paste) + { triggerElectric(cm, inserted) } + + ensureCursorVisible(cm) + cm.curOp.updateInput = updateInput + cm.curOp.typing = true + cm.state.pasteIncoming = cm.state.cutIncoming = false +} + +function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text") + if (pasted) { + e.preventDefault() + if (!cm.isReadOnly() && !cm.options.disableInput) + { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) } + return true + } +} + +function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { return } + var sel = cm.doc.sel + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i] + if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } + var mode = cm.getModeAt(range.head) + var indented = false + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart") + break + } } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) + { indented = indentLine(cm, range.head.line, "smart") } + } + if (indented) { signalLater(cm, "electricInput", cm, range.head.line) } + } +} + +function copyableRanges(cm) { + var text = [], ranges = [] + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)} + ranges.push(lineRange) + text.push(cm.getRange(lineRange.anchor, lineRange.head)) + } + return {text: text, ranges: ranges} +} + +function disableBrowserMagic(field, spellcheck) { + field.setAttribute("autocorrect", "off") + field.setAttribute("autocapitalize", "off") + field.setAttribute("spellcheck", !!spellcheck) +} + +function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none") + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;") + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { te.style.width = "1000px" } + else { te.setAttribute("wrap", "off") } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { te.style.border = "1px solid black" } + disableBrowserMagic(te) + return div +} + +// The publicly visible API. Note that methodOp(f) means +// 'wrap f in an operation, performed on its `this` parameter'. + +// This is not the complete set of editor methods. Most of the +// methods defined on the Doc type are also injected into +// CodeMirror.prototype, for backwards compatibility and +// convenience. + +function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers + + var helpers = CodeMirror.helpers = {} + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus()}, + + setOption: function(option, value) { + var options = this.options, old = options[option] + if (options[option] == value && option != "mode") { return } + options[option] = value + if (optionHandlers.hasOwnProperty(option)) + { operation(this, optionHandlers[option])(this, value, old) } + signal(this, "optionChange", this, option) + }, + + getOption: function(option) {return this.options[option]}, + getDoc: function() {return this.doc}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)) + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps + for (var i = 0; i < maps.length; ++i) + { if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1) + return true + } } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec) + if (mode.startState) { throw new Error("Overlays may not be stateful.") } + insertSorted(this.state.overlays, + {mode: mode, modeSpec: spec, opaque: options && options.opaque, + priority: (options && options.priority) || 0}, + function (overlay) { return overlay.priority; }) + this.state.modeGen++ + regChange(this) + }), + removeOverlay: methodOp(function(spec) { + var this$1 = this; + + var overlays = this.state.overlays + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1) + this$1.state.modeGen++ + regChange(this$1) + return + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" } + else { dir = dir ? "add" : "subtract" } + } + if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) } + }), + indentSelection: methodOp(function(how) { + var this$1 = this; + + var ranges = this.doc.sel.ranges, end = -1 + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i] + if (!range.empty()) { + var from = range.from(), to = range.to() + var start = Math.max(end, from.line) + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1 + for (var j = start; j < end; ++j) + { indentLine(this$1, j, how) } + var newRanges = this$1.doc.sel.ranges + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) } + } else if (range.head.line > end) { + indentLine(this$1, range.head.line, how, true) + end = range.head.line + if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) } + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise) + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true) + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos) + var styles = getLineStyles(this, getLine(this.doc, pos.line)) + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch + var type + if (ch == 0) { type = styles[2] } + else { for (;;) { + var mid = (before + after) >> 1 + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid } + else if (styles[mid * 2 + 1] < ch) { before = mid + 1 } + else { type = styles[mid * 2 + 2]; break } + } } + var cut = type ? type.indexOf("overlay ") : -1 + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) + }, + + getModeAt: function(pos) { + var mode = this.doc.mode + if (!mode.innerMode) { return mode } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0] + }, + + getHelpers: function(pos, type) { + var this$1 = this; + + var found = [] + if (!helpers.hasOwnProperty(type)) { return found } + var help = helpers[type], mode = this.getModeAt(pos) + if (typeof mode[type] == "string") { + if (help[mode[type]]) { found.push(help[mode[type]]) } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]] + if (val) { found.push(val) } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]) + } else if (help[mode.name]) { + found.push(help[mode.name]) + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1] + if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) + { found.push(cur.val) } + } + return found + }, + + getStateAfter: function(line, precise) { + var doc = this.doc + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line) + return getContextBefore(this, line + 1, precise).state + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary() + if (start == null) { pos = range.head } + else if (typeof start == "object") { pos = clipPos(this.doc, start) } + else { pos = start ? range.from() : range.to() } + return cursorCoords(this, pos, mode || "page") + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page") + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page") + return coordsChar(this, coords.left, coords.top) + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top + return lineAtHeight(this.doc, height + this.display.viewOffset) + }, + heightAtLine: function(line, mode, includeWidgets) { + var end = false, lineObj + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1 + if (line < this.doc.first) { line = this.doc.first } + else if (line > last) { line = last; end = true } + lineObj = getLine(this.doc, line) + } else { + lineObj = line + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + + (end ? this.doc.height - heightAtLine(lineObj) : 0) + }, + + defaultTextHeight: function() { return textHeight(this.display) }, + defaultCharWidth: function() { return charWidth(this.display) }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display + pos = cursorCoords(this, clipPos(this.doc, pos)) + var top = pos.bottom, left = pos.left + node.style.position = "absolute" + node.setAttribute("cm-ignore-events", "true") + this.display.input.setUneditable(node) + display.sizer.appendChild(node) + if (vert == "over") { + top = pos.top + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth) + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + { top = pos.top - node.offsetHeight } + else if (pos.bottom + node.offsetHeight <= vspace) + { top = pos.bottom } + if (left + node.offsetWidth > hspace) + { left = hspace - node.offsetWidth } + } + node.style.top = top + "px" + node.style.left = node.style.right = "" + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth + node.style.right = "0px" + } else { + if (horiz == "left") { left = 0 } + else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 } + node.style.left = left + "px" + } + if (scroll) + { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) } + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + { return commands[cmd].call(null, this) } + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text) }), + + findPosH: function(from, amount, unit, visually) { + var this$1 = this; + + var dir = 1 + if (amount < 0) { dir = -1; amount = -amount } + var cur = clipPos(this.doc, from) + for (var i = 0; i < amount; ++i) { + cur = findPosH(this$1.doc, cur, dir, unit, visually) + if (cur.hitSide) { break } + } + return cur + }, + + moveH: methodOp(function(dir, unit) { + var this$1 = this; + + this.extendSelectionsBy(function (range) { + if (this$1.display.shift || this$1.doc.extend || range.empty()) + { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } + else + { return dir < 0 ? range.from() : range.to() } + }, sel_move) + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc + if (sel.somethingSelected()) + { doc.replaceSelection("", null, "+delete") } + else + { deleteNearSelection(this, function (range) { + var other = findPosH(doc, range.head, dir, unit, false) + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} + }) } + }), + + findPosV: function(from, amount, unit, goalColumn) { + var this$1 = this; + + var dir = 1, x = goalColumn + if (amount < 0) { dir = -1; amount = -amount } + var cur = clipPos(this.doc, from) + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this$1, cur, "div") + if (x == null) { x = coords.left } + else { coords.left = x } + cur = findPosV(this$1, coords, dir, unit) + if (cur.hitSide) { break } + } + return cur + }, + + moveV: methodOp(function(dir, unit) { + var this$1 = this; + + var doc = this.doc, goals = [] + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected() + doc.extendSelectionsBy(function (range) { + if (collapse) + { return dir < 0 ? range.from() : range.to() } + var headPos = cursorCoords(this$1, range.head, "div") + if (range.goalColumn != null) { headPos.left = range.goalColumn } + goals.push(headPos.left) + var pos = findPosV(this$1, headPos, dir, unit) + if (unit == "page" && range == doc.sel.primary()) + { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top) } + return pos + }, sel_move) + if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) + { doc.sel.ranges[i].goalColumn = goals[i] } } + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text + var start = pos.ch, end = pos.ch + if (line) { + var helper = this.getHelper(pos, "wordChars") + if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end } + var startChar = line.charAt(start) + var check = isWordChar(startChar, helper) + ? function (ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } + : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); } + while (start > 0 && check(line.charAt(start - 1))) { --start } + while (end < line.length && check(line.charAt(end))) { ++end } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)) + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) { return } + if (this.state.overwrite = !this.state.overwrite) + { addClass(this.display.cursorDiv, "CodeMirror-overwrite") } + else + { rmClass(this.display.cursorDiv, "CodeMirror-overwrite") } + + signal(this, "overwriteToggle", this, this.state.overwrite) + }, + hasFocus: function() { return this.display.input.getField() == activeElt() }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, + + scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }), + getScrollInfo: function() { + var scroller = this.display.scroller + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)} + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null} + if (margin == null) { margin = this.options.cursorScrollMargin } + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null} + } else if (range.from == null) { + range = {from: range, to: null} + } + if (!range.to) { range.to = range.from } + range.margin = margin || 0 + + if (range.from.line != null) { + scrollToRange(this, range) + } else { + scrollToCoordsRange(this, range.from, range.to, range.margin) + } + }), + + setSize: methodOp(function(width, height) { + var this$1 = this; + + var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; } + if (width != null) { this.display.wrapper.style.width = interpret(width) } + if (height != null) { this.display.wrapper.style.height = interpret(height) } + if (this.options.lineWrapping) { clearLineMeasurementCache(this) } + var lineNo = this.display.viewFrom + this.doc.iter(lineNo, this.display.viewTo, function (line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) + { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } + ++lineNo + }) + this.curOp.forceUpdate = true + signal(this, "refresh", this) + }), + + operation: function(f){return runInOp(this, f)}, + startOperation: function(){return startOperation(this)}, + endOperation: function(){return endOperation(this)}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight + regChange(this) + this.curOp.forceUpdate = true + clearCaches(this) + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop) + updateGutterSpace(this) + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + { estimateLineHeights(this) } + signal(this, "refresh", this) + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc + old.cm = null + attachDoc(this, doc) + clearCaches(this) + this.display.input.reset() + scrollToCoords(this, doc.scrollLeft, doc.scrollTop) + this.curOp.forceScroll = true + signalLater(this, "swapDoc", this, old) + return old + }), + + getInputField: function(){return this.display.input.getField()}, + getWrapperElement: function(){return this.display.wrapper}, + getScrollerElement: function(){return this.display.scroller}, + getGutterElement: function(){return this.display.gutters} + } + eventMixin(CodeMirror) + + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} } + helpers[type][name] = value + } + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value) + helpers[type]._global.push({pred: predicate, val: value}) + } +} + +// Used for horizontal relative motion. Dir is -1 or 1 (left or +// right), unit can be "char", "column" (like char, but doesn't +// cross line boundaries), "word" (across next word), or "group" (to +// the start of next group of word or non-word-non-whitespace +// chars). The visually param controls whether, in right-to-left +// text, direction 1 means to move towards the next index in the +// string, or towards the character to the right of the current +// position. The resulting position will have a hitSide=true +// property if it reached the end of the document. +function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos + var origDir = dir + var lineObj = getLine(doc, pos.line) + function findNextLine() { + var l = pos.line + dir + if (l < doc.first || l >= doc.first + doc.size) { return false } + pos = new Pos(l, pos.ch, pos.sticky) + return lineObj = getLine(doc, l) + } + function moveOnce(boundToLine) { + var next + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir) + } else { + next = moveLogically(lineObj, pos, dir) + } + if (next == null) { + if (!boundToLine && findNextLine()) + { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) } + else + { return false } + } else { + pos = next + } + return true + } + + if (unit == "char") { + moveOnce() + } else if (unit == "column") { + moveOnce(true) + } else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group" + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars") + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { break } + var cur = lineObj.text.charAt(pos.ch) || "\n" + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p" + if (group && !first && !type) { type = "s" } + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after"} + break + } + + if (type) { sawType = type } + if (dir > 0 && !moveOnce(!first)) { break } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true) + if (equalCursorPos(oldPos, result)) { result.hitSide = true } + return result +} + +// For relative vertical movement. Dir may be -1 or 1. Unit can be +// "page" or "line". The resulting position will have a hitSide=true +// property if it reached the end of the document. +function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight) + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3) + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount + + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3 + } + var target + for (;;) { + target = coordsChar(cm, x, y) + if (!target.outside) { break } + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } + y += dir * 5 + } + return target +} + +// CONTENTEDITABLE INPUT STYLE + +var ContentEditableInput = function(cm) { + this.cm = cm + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null + this.polling = new Delayed() + this.composing = null + this.gracePeriod = false + this.readDOMTimeout = null +}; + +ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = input.cm + var div = input.div = display.lineDiv + disableBrowserMagic(div, cm.options.spellcheck) + + on(div, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) } + }) + + on(div, "compositionstart", function (e) { + this$1.composing = {data: e.data, done: false} + }) + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { this$1.composing = {data: e.data, done: false} } + }) + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() } + this$1.composing.done = true + } + }) + + on(div, "touchstart", function () { return input.forceCompositionEnd(); }) + + on(div, "input", function () { + if (!this$1.composing) { this$1.readFromDOMSoon() } + }) + + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}) + if (e.type == "cut") { cm.replaceSelection("", null, "cut") } + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm) + setLastCopied({lineWise: true, text: ranges.text}) + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll) + cm.replaceSelection("", null, "cut") + }) + } + } + if (e.clipboardData) { + e.clipboardData.clearData() + var content = lastCopied.text.join("\n") + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content) + if (e.clipboardData.getData("Text") == content) { + e.preventDefault() + return + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild) + te.value = lastCopied.text.join("\n") + var hadFocus = document.activeElement + selectInput(te) + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge) + hadFocus.focus() + if (hadFocus == div) { input.showPrimarySelection() } + }, 50) + } + on(div, "copy", onCopyCut) + on(div, "cut", onCopyCut) +}; + +ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false) + result.focus = this.cm.state.focused + return result +}; + +ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { return } + if (info.focus || takeFocus) { this.showPrimarySelection() } + this.showMultipleSelections(info) +}; + +ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary() + var from = prim.from(), to = prim.to() + + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges() + return + } + + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset) + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), from) == 0 && + cmp(maxPos(curAnchor, curFocus), to) == 0) + { return } + + var view = cm.display.view + var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || + {node: view[0].measure.map[2], offset: 0} + var end = to.line < cm.display.viewTo && posToDOM(cm, to) + if (!end) { + var measure = view[view.length - 1].measure + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]} + } + + if (!start || !end) { + sel.removeAllRanges() + return + } + + var old = sel.rangeCount && sel.getRangeAt(0), rng + try { rng = range(start.node, start.offset, end.offset, end.node) } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset) + if (!rng.collapsed) { + sel.removeAllRanges() + sel.addRange(rng) + } + } else { + sel.removeAllRanges() + sel.addRange(rng) + } + if (old && sel.anchorNode == null) { sel.addRange(old) } + else if (gecko) { this.startGracePeriod() } + } + this.rememberSelection() +}; + +ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + + clearTimeout(this.gracePeriod) + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false + if (this$1.selectionChanged()) + { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) } + }, 20) +}; + +ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors) + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection) +}; + +ContentEditableInput.prototype.rememberSelection = function () { + var sel = window.getSelection() + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset +}; + +ContentEditableInput.prototype.selectionInEditor = function () { + var sel = window.getSelection() + if (!sel.rangeCount) { return false } + var node = sel.getRangeAt(0).commonAncestorContainer + return contains(this.div, node) +}; + +ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor()) + { this.showSelection(this.prepareSelection(), true) } + this.div.focus() + } +}; +ContentEditableInput.prototype.blur = function () { this.div.blur() }; +ContentEditableInput.prototype.getField = function () { return this.div }; + +ContentEditableInput.prototype.supportsTouch = function () { return true }; + +ContentEditableInput.prototype.receivedFocus = function () { + var input = this + if (this.selectionInEditor()) + { this.pollSelection() } + else + { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) } + + function poll() { + if (input.cm.state.focused) { + input.pollSelection() + input.polling.set(input.cm.options.pollInterval, poll) + } + } + this.polling.set(this.cm.options.pollInterval, poll) +}; + +ContentEditableInput.prototype.selectionChanged = function () { + var sel = window.getSelection() + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset +}; + +ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } + var sel = window.getSelection(), cm = this.cm + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}) + this.blur() + this.focus() + return + } + if (this.composing) { return } + this.rememberSelection() + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) + var head = domToPos(cm, sel.focusNode, sel.focusOffset) + if (anchor && head) { runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll) + if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true } + }) } +}; + +ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout) + this.readDOMTimeout = null + } + + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary() + var from = sel.from(), to = sel.to() + if (from.ch == 0 && from.line > cm.firstLine()) + { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) + { to = Pos(to.line + 1, 0) } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } + + var fromIndex, fromLine, fromNode + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line) + fromNode = display.view[0].node + } else { + fromLine = lineNo(display.view[fromIndex].line) + fromNode = display.view[fromIndex - 1].node.nextSibling + } + var toIndex = findViewIndex(cm, to.line) + var toLine, toNode + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1 + toNode = display.lineDiv.lastChild + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1 + toNode = display.view[toIndex + 1].node.previousSibling + } + + if (!fromNode) { return false } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)) + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)) + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ } + else { break } + } + + var cutFront = 0, cutEnd = 0 + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length) + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + { ++cutFront } + var newBot = lst(newText), oldBot = lst(oldText) + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)) + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + { ++cutEnd } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront-- + cutEnd++ + } + } + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "") + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "") + + var chFrom = Pos(fromLine, cutFront) + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0) + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input") + return true + } +}; + +ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd() +}; +ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd() +}; +ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { return } + clearTimeout(this.readDOMTimeout) + this.composing = null + this.updateFromDOM() + this.div.blur() + this.div.focus() +}; +ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + + if (this.readDOMTimeout != null) { return } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null + if (this$1.composing) { + if (this$1.composing.done) { this$1.composing = null } + else { return } + } + this$1.updateFromDOM() + }, 80) +}; + +ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + + if (this.cm.isReadOnly() || !this.pollContent()) + { runInOp(this.cm, function () { return regChange(this$1.cm); }) } +}; + +ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false" +}; + +ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0) { return } + e.preventDefault() + if (!this.cm.isReadOnly()) + { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) } +}; + +ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor") +}; + +ContentEditableInput.prototype.onContextMenu = function () {}; +ContentEditableInput.prototype.resetPosition = function () {}; + +ContentEditableInput.prototype.needsContentAttribute = true + +function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line) + if (!view || view.hidden) { return null } + var line = getLine(cm.doc, pos.line) + var info = mapFromLineView(view, line, pos.line) + + var order = getOrder(line, cm.doc.direction), side = "left" + if (order) { + var partPos = getBidiPartAt(order, pos.ch) + side = partPos % 2 ? "right" : "left" + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side) + result.offset = result.collapse == "right" ? result.end : result.start + return result +} + +function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) + { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } + return false +} + +function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } + +function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false, lineSep = cm.doc.lineSeparator() + function recognizeMarker(id) { return function (marker) { return marker.id == id; } } + function close() { + if (closing) { + text += lineSep + closing = false + } + } + function addText(str) { + if (str) { + close() + text += str + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text") + if (cmText != null) { + addText(cmText || node.textContent.replace(/\u200b/g, "")) + return + } + var markerID = node.getAttribute("cm-marker"), range + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)) + if (found.length && (range = found[0].find(0))) + { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) } + return + } + if (node.getAttribute("contenteditable") == "false") { return } + var isBlock = /^(pre|div|p)$/i.test(node.nodeName) + if (isBlock) { close() } + for (var i = 0; i < node.childNodes.length; i++) + { walk(node.childNodes[i]) } + if (isBlock) { closing = true } + } else if (node.nodeType == 3) { + addText(node.nodeValue) + } + } + for (;;) { + walk(from) + if (from == to) { break } + from = from.nextSibling + } + return text +} + +function domToPos(cm, node, offset) { + var lineNode + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset] + if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } + node = null; offset = 0 + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { return null } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i] + if (lineView.node == lineNode) + { return locateNodeInLineView(lineView, node, offset) } + } +} + +function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false + if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } + if (node == wrapper) { + bad = true + node = wrapper.childNodes[offset] + offset = 0 + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line + return badPos(Pos(lineNo(line), line.text.length), bad) + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild + if (offset) { offset = textNode.nodeValue.length } + } + while (topNode.parentNode != wrapper) { topNode = topNode.parentNode } + var measure = lineView.measure, maps = measure.maps + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i] + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2] + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]) + var ch = map[j] + offset + if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] } + return Pos(line, ch) + } + } + } + } + var found = find(textNode, topNode, offset) + if (found) { return badPos(found, bad) } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0) + if (found) + { return badPos(Pos(found.line, found.ch - dist), bad) } + else + { dist += after.textContent.length } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1) + if (found) + { return badPos(Pos(found.line, found.ch + dist$1), bad) } + else + { dist$1 += before.textContent.length } + } +} + +// TEXTAREA INPUT STYLE + +var TextareaInput = function(cm) { + this.cm = cm + // See input.poll and input.reset + this.prevInput = "" + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false + // Self-resetting timeout for the poller + this.polling = new Delayed() + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false + this.composing = null +}; + +TextareaInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = this.cm + + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea() + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild + display.wrapper.insertBefore(div, display.wrapper.firstChild) + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { te.style.width = "0px" } + + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null } + input.poll() + }) + + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + + cm.state.pasteIncoming = true + input.fastPoll() + }) + + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}) + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm) + setLastCopied({lineWise: true, text: ranges.text}) + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll) + } else { + input.prevInput = "" + te.value = ranges.text.join("\n") + selectInput(te) + } + } + if (e.type == "cut") { cm.state.cutIncoming = true } + } + on(te, "cut", prepareCopyCut) + on(te, "copy", prepareCopyCut) + + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } + cm.state.pasteIncoming = true + input.focus() + }) + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { e_preventDefault(e) } + }) + + on(te, "compositionstart", function () { + var start = cm.getCursor("from") + if (input.composing) { input.composing.range.clear() } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + } + }) + on(te, "compositionend", function () { + if (input.composing) { + input.poll() + input.composing.range.clear() + input.composing = null + } + }) +}; + +TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc + var result = prepareSelection(cm) + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div") + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect() + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)) + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)) + } + + return result +}; + +TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, display = cm.display + removeChildrenAndAdd(display.cursorDiv, drawn.cursors) + removeChildrenAndAdd(display.selectionDiv, drawn.selection) + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px" + this.wrapper.style.left = drawn.teLeft + "px" + } +}; + +// Reset the input to correspond to the selection (or to be empty, +// when not typing and nothing is selected) +TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing) { return } + var cm = this.cm + if (cm.somethingSelected()) { + this.prevInput = "" + var content = cm.getSelection() + this.textarea.value = content + if (cm.state.focused) { selectInput(this.textarea) } + if (ie && ie_version >= 9) { this.hasSelection = content } + } else if (!typing) { + this.prevInput = this.textarea.value = "" + if (ie && ie_version >= 9) { this.hasSelection = null } + } +}; + +TextareaInput.prototype.getField = function () { return this.textarea }; + +TextareaInput.prototype.supportsTouch = function () { return false }; + +TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus() } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } +}; + +TextareaInput.prototype.blur = function () { this.textarea.blur() }; + +TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0 +}; + +TextareaInput.prototype.receivedFocus = function () { this.slowPoll() }; + +// Poll for input changes, using the normal rate of polling. This +// runs as long as the editor is focused. +TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + + if (this.pollingFast) { return } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll() + if (this$1.cm.state.focused) { this$1.slowPoll() } + }) +}; + +// When an event has just come in that is likely to add or change +// something in the input textarea, we poll faster, to ensure that +// the change appears on the screen quickly. +TextareaInput.prototype.fastPoll = function () { + var missed = false, input = this + input.pollingFast = true + function p() { + var changed = input.poll() + if (!changed && !missed) {missed = true; input.polling.set(60, p)} + else {input.pollingFast = false; input.slowPoll()} + } + input.polling.set(20, p) +}; + +// Read input from the textarea, and update the document to match. +// When something is selected, it is present in the textarea, and +// selected (unless it is huge, in which case a placeholder is +// used). When nothing is selected, the cursor sits after previously +// seen text (can be empty), which is stored in prevInput (we must +// not reset the textarea when typing, because that breaks IME). +TextareaInput.prototype.poll = function () { + var this$1 = this; + + var cm = this.cm, input = this.textarea, prevInput = this.prevInput + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput && !this.composing) || + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) + { return false } + + var text = input.value + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { return false } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset() + return false + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0) + if (first == 0x200b && !prevInput) { prevInput = "\u200b" } + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length) + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same } + + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, this$1.composing ? "*compose" : null) + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" } + else { this$1.prevInput = text } + + if (this$1.composing) { + this$1.composing.range.clear() + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}) + } + }) + return true +}; + +TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { this.pollingFast = false } +}; + +TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { this.hasSelection = null } + this.fastPoll() +}; + +TextareaInput.prototype.onContextMenu = function (e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop + if (!pos || presto) { return } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu + if (reset && cm.doc.sel.contains(pos) == -1) + { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) } + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText + input.wrapper.style.cssText = "position: absolute" + var wrapperBox = input.wrapper.getBoundingClientRect() + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);" + var oldScrollY + if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712) + display.input.focus() + if (webkit) { window.scrollTo(null, oldScrollY) } + display.input.reset() + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { te.value = input.prevInput = " " } + input.contextMenuPending = true + display.selForContextMenu = cm.doc.sel + clearTimeout(display.detectingSelectAll) + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected() + var extval = "\u200b" + (selected ? te.value : "") + te.value = "\u21da" // Used to catch context-menu undo + te.value = extval + input.prevInput = selected ? "" : "\u200b" + te.selectionStart = 1; te.selectionEnd = extval.length + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel + } + } + function rehide() { + input.contextMenuPending = false + input.wrapper.style.cssText = oldWrapperCSS + te.style.cssText = oldCSS + if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() } + var i = 0, poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm) + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500) + } else { + display.selForContextMenu = null + display.input.reset() + } + } + display.detectingSelectAll = setTimeout(poll, 200) + } + } + + if (ie && ie_version >= 9) { prepareSelectAllHack() } + if (captureRightClick) { + e_stop(e) + var mouseup = function () { + off(window, "mouseup", mouseup) + setTimeout(rehide, 20) + } + on(window, "mouseup", mouseup) + } else { + setTimeout(rehide, 50) + } +}; + +TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { this.reset() } + this.textarea.disabled = val == "nocursor" +}; + +TextareaInput.prototype.setUneditable = function () {}; + +TextareaInput.prototype.needsContentAttribute = false + +function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {} + options.value = textarea.value + if (!options.tabindex && textarea.tabIndex) + { options.tabindex = textarea.tabIndex } + if (!options.placeholder && textarea.placeholder) + { options.placeholder = textarea.placeholder } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt() + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body + } + + function save() {textarea.value = cm.getValue()} + + var realSubmit + if (textarea.form) { + on(textarea.form, "submit", save) + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form + realSubmit = form.submit + try { + var wrappedSubmit = form.submit = function () { + save() + form.submit = realSubmit + form.submit() + form.submit = wrappedSubmit + } + } catch(e) {} + } + } + + options.finishInit = function (cm) { + cm.save = save + cm.getTextArea = function () { return textarea; } + cm.toTextArea = function () { + cm.toTextArea = isNaN // Prevent this from being ran twice + save() + textarea.parentNode.removeChild(cm.getWrapperElement()) + textarea.style.display = "" + if (textarea.form) { + off(textarea.form, "submit", save) + if (typeof textarea.form.submit == "function") + { textarea.form.submit = realSubmit } + } + } + } + + textarea.style.display = "none" + var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, + options) + return cm +} + +function addLegacyProps(CodeMirror) { + CodeMirror.off = off + CodeMirror.on = on + CodeMirror.wheelEventPixels = wheelEventPixels + CodeMirror.Doc = Doc + CodeMirror.splitLines = splitLinesAuto + CodeMirror.countColumn = countColumn + CodeMirror.findColumn = findColumn + CodeMirror.isWordChar = isWordCharBasic + CodeMirror.Pass = Pass + CodeMirror.signal = signal + CodeMirror.Line = Line + CodeMirror.changeEnd = changeEnd + CodeMirror.scrollbarModel = scrollbarModel + CodeMirror.Pos = Pos + CodeMirror.cmpPos = cmp + CodeMirror.modes = modes + CodeMirror.mimeModes = mimeModes + CodeMirror.resolveMode = resolveMode + CodeMirror.getMode = getMode + CodeMirror.modeExtensions = modeExtensions + CodeMirror.extendMode = extendMode + CodeMirror.copyState = copyState + CodeMirror.startState = startState + CodeMirror.innerMode = innerMode + CodeMirror.commands = commands + CodeMirror.keyMap = keyMap + CodeMirror.keyName = keyName + CodeMirror.isModifierKey = isModifierKey + CodeMirror.lookupKey = lookupKey + CodeMirror.normalizeKeyMap = normalizeKeyMap + CodeMirror.StringStream = StringStream + CodeMirror.SharedTextMarker = SharedTextMarker + CodeMirror.TextMarker = TextMarker + CodeMirror.LineWidget = LineWidget + CodeMirror.e_preventDefault = e_preventDefault + CodeMirror.e_stopPropagation = e_stopPropagation + CodeMirror.e_stop = e_stop + CodeMirror.addClass = addClass + CodeMirror.contains = contains + CodeMirror.rmClass = rmClass + CodeMirror.keyNames = keyNames +} + +// EDITOR CONSTRUCTOR + +defineOptions(CodeMirror) + +addEditorMethods(CodeMirror) + +// Set up methods on CodeMirror's prototype to redirect to the editor's document. +var dontDelegate = "iter insert remove copy getEditor constructor".split(" ") +for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + { CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments)} + })(Doc.prototype[prop]) } } + +eventMixin(Doc) + +// INPUT HANDLING + +CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput} + +// MODE DEFINITION AND QUERYING + +// Extra arguments are stored as the mode's dependencies, which is +// used by (legacy) mechanisms like loadmode.js to automatically +// load a mode. (Preferred mechanism is the require/define calls.) +CodeMirror.defineMode = function(name/*, mode, …*/) { + if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name } + defineMode.apply(this, arguments) +} + +CodeMirror.defineMIME = defineMIME + +// Minimal default mode. +CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }) +CodeMirror.defineMIME("text/plain", "null") + +// EXTENSIONS + +CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func +} +CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func +} + +CodeMirror.fromTextArea = fromTextArea + +addLegacyProps(CodeMirror) + +CodeMirror.version = "5.32.0" + +return CodeMirror; + +})));/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/lib/codemirror.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// This is CodeMirror (http://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.CodeMirror = factory()); +}(this, (function () { 'use strict'; + +// Kludges for bugs and behavior differences that can't be feature +// detected are enabled based on userAgent etc sniffing. +var userAgent = navigator.userAgent +var platform = navigator.platform + +var gecko = /gecko\/\d/i.test(userAgent) +var ie_upto10 = /MSIE \d/.test(userAgent) +var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent) +var edge = /Edge\/(\d+)/.exec(userAgent) +var ie = ie_upto10 || ie_11up || edge +var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]) +var webkit = !edge && /WebKit\//.test(userAgent) +var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent) +var chrome = !edge && /Chrome\//.test(userAgent) +var presto = /Opera\//.test(userAgent) +var safari = /Apple Computer/.test(navigator.vendor) +var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent) +var phantom = /PhantomJS/.test(userAgent) + +var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent) +var android = /Android/.test(userAgent) +// This is woefully incomplete. Suggestions for alternative methods welcome. +var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent) +var mac = ios || /Mac/.test(platform) +var chromeOS = /\bCrOS\b/.test(userAgent) +var windows = /win/i.test(platform) + +var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/) +if (presto_version) { presto_version = Number(presto_version[1]) } +if (presto_version && presto_version >= 15) { presto = false; webkit = true } +// Some browsers use the wrong event properties to signal cmd/ctrl on OS X +var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)) +var captureRightClick = gecko || (ie && ie_version >= 9) + +function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } + +var rmClass = function(node, cls) { + var current = node.className + var match = classTest(cls).exec(current) + if (match) { + var after = current.slice(match.index + match[0].length) + node.className = current.slice(0, match.index) + (after ? match[1] + after : "") + } +} + +function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + { e.removeChild(e.firstChild) } + return e +} + +function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e) +} + +function elt(tag, content, className, style) { + var e = document.createElement(tag) + if (className) { e.className = className } + if (style) { e.style.cssText = style } + if (typeof content == "string") { e.appendChild(document.createTextNode(content)) } + else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } } + return e +} +// wrapper for elt, which removes the elt from the accessibility tree +function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style) + e.setAttribute("role", "presentation") + return e +} + +var range +if (document.createRange) { range = function(node, start, end, endNode) { + var r = document.createRange() + r.setEnd(endNode || node, end) + r.setStart(node, start) + return r +} } +else { range = function(node, start, end) { + var r = document.body.createTextRange() + try { r.moveToElementText(node.parentNode) } + catch(e) { return r } + r.collapse(true) + r.moveEnd("character", end) + r.moveStart("character", start) + return r +} } + +function contains(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + { child = child.parentNode } + if (parent.contains) + { return parent.contains(child) } + do { + if (child.nodeType == 11) { child = child.host } + if (child == parent) { return true } + } while (child = child.parentNode) +} + +function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement + try { + activeElement = document.activeElement + } catch(e) { + activeElement = document.body || null + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) + { activeElement = activeElement.shadowRoot.activeElement } + return activeElement +} + +function addClass(node, cls) { + var current = node.className + if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls } +} +function joinClasses(a, b) { + var as = a.split(" ") + for (var i = 0; i < as.length; i++) + { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i] } } + return b +} + +var selectInput = function(node) { node.select() } +if (ios) // Mobile Safari apparently has a bug where select() is broken. + { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length } } +else if (ie) // Suppress mysterious IE10 errors + { selectInput = function(node) { try { node.select() } catch(_e) {} } } + +function bind(f) { + var args = Array.prototype.slice.call(arguments, 1) + return function(){return f.apply(null, args)} +} + +function copyObj(obj, target, overwrite) { + if (!target) { target = {} } + for (var prop in obj) + { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + { target[prop] = obj[prop] } } + return target +} + +// Counts the column offset in a string, taking tabs into account. +// Used mostly to find indentation. +function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/) + if (end == -1) { end = string.length } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i) + if (nextTab < 0 || nextTab >= end) + { return n + (end - i) } + n += nextTab - i + n += tabSize - (n % tabSize) + i = nextTab + 1 + } +} + +var Delayed = function() {this.id = null}; +Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id) + this.id = setTimeout(f, ms) +}; + +function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + { if (array[i] == elt) { return i } } + return -1 +} + +// Number of pixels added to scroller and sizer to hide scrollbar +var scrollerGap = 30 + +// Returned or thrown by various protocols to signal 'I'm not +// handling this'. +var Pass = {toString: function(){return "CodeMirror.Pass"}} + +// Reused option objects for setSelection & friends +var sel_dontScroll = {scroll: false}; +var sel_mouse = {origin: "*mouse"}; +var sel_move = {origin: "+move"}; +// The inverse of countColumn -- find the offset that corresponds to +// a particular column. +function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos) + if (nextTab == -1) { nextTab = string.length } + var skipped = nextTab - pos + if (nextTab == string.length || col + skipped >= goal) + { return pos + Math.min(skipped, goal - col) } + col += nextTab - pos + col += tabSize - (col % tabSize) + pos = nextTab + 1 + if (col >= goal) { return pos } + } +} + +var spaceStrs = [""] +function spaceStr(n) { + while (spaceStrs.length <= n) + { spaceStrs.push(lst(spaceStrs) + " ") } + return spaceStrs[n] +} + +function lst(arr) { return arr[arr.length-1] } + +function map(array, f) { + var out = [] + for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i) } + return out +} + +function insertSorted(array, value, score) { + var pos = 0, priority = score(value) + while (pos < array.length && score(array[pos]) <= priority) { pos++ } + array.splice(pos, 0, value) +} + +function nothing() {} + +function createObj(base, props) { + var inst + if (Object.create) { + inst = Object.create(base) + } else { + nothing.prototype = base + inst = new nothing() + } + if (props) { copyObj(props, inst) } + return inst +} + +var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/ +function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) +} +function isWordChar(ch, helper) { + if (!helper) { return isWordCharBasic(ch) } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } + return helper.test(ch) +} + +function isEmpty(obj) { + for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } + return true +} + +// Extending unicode characters. A series of a non-extending char + +// any number of extending chars is treated as a single unit as far +// as editing and measuring is concerned. This is not fully correct, +// since some scripts/fonts/browsers also treat other configurations +// of code points as a group. +var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/ +function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } + +// Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. +function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir } + return pos +} + +// Returns the value from the range [`from`; `to`] that satisfies +// `pred` and is closest to `from`. Assumes that at least `to` +// satisfies `pred`. Supports `from` being greater than `to`. +function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1 + for (;;) { + if (from == to) { return from } + var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF) + if (mid == from) { return pred(mid) ? from : to } + if (pred(mid)) { to = mid } + else { from = mid + dir } + } +} + +// The display handles the DOM integration, both for input reading +// and content drawing. It holds references to DOM nodes and +// display-related state. + +function Display(place, doc, input) { + var d = this + this.input = input + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler") + d.scrollbarFiller.setAttribute("cm-not-content", "true") + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler") + d.gutterFiller.setAttribute("cm-not-content", "true") + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code") + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1") + d.cursorDiv = elt("div", null, "CodeMirror-cursors") + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure") + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure") + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none") + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines") + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative") + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer") + d.sizerWidth = null + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;") + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters") + d.lineGutter = null + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll") + d.scroller.setAttribute("tabIndex", "-1") + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror") + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 } + if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true } + + if (place) { + if (place.appendChild) { place.appendChild(d.wrapper) } + else { place(d.wrapper) } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first + d.reportedViewFrom = d.reportedViewTo = doc.first + // Information about the rendered lines. + d.view = [] + d.renderedView = null + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null + // Empty space (in pixels) above the view + d.viewOffset = 0 + d.lastWrapHeight = d.lastWrapWidth = 0 + d.updateLineNumbers = null + + d.nativeBarWidth = d.barHeight = d.barWidth = 0 + d.scrollbarsClipped = false + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null + d.maxLineLength = 0 + d.maxLineChanged = false + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null + + // True when shift is held down. + d.shift = false + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null + + d.activeTouch = null + + input.init(d) +} + +// Find the line object corresponding to the given line number. +function getLine(doc, n) { + n -= doc.first + if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } + var chunk = doc + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize() + if (n < sz) { chunk = child; break } + n -= sz + } + } + return chunk.lines[n] +} + +// Get the part of a document between two positions, as an array of +// strings. +function getBetween(doc, start, end) { + var out = [], n = start.line + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text + if (n == end.line) { text = text.slice(0, end.ch) } + if (n == start.line) { text = text.slice(start.ch) } + out.push(text) + ++n + }) + return out +} +// Get the lines between from and to, as array of strings. +function getLines(doc, from, to) { + var out = [] + doc.iter(from, to, function (line) { out.push(line.text) }) // iter aborts when callback returns truthy value + return out +} + +// Update the height of a line, propagating the height change +// upwards to parent nodes. +function updateLineHeight(line, height) { + var diff = height - line.height + if (diff) { for (var n = line; n; n = n.parent) { n.height += diff } } +} + +// Given a line object, find its line number by walking up through +// its parent links. +function lineNo(line) { + if (line.parent == null) { return null } + var cur = line.parent, no = indexOf(cur.lines, line) + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { break } + no += chunk.children[i].chunkSize() + } + } + return no + cur.first +} + +// Find the line at the given vertical position, using the height +// information in the document tree. +function lineAtHeight(chunk, h) { + var n = chunk.first + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], ch = child.height + if (h < ch) { chunk = child; continue outer } + h -= ch + n += child.chunkSize() + } + return n + } while (!chunk.lines) + var i = 0 + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height + if (h < lh) { break } + h -= lh + } + return n + i +} + +function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} + +function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)) +} + +// A Pos instance represents a position within the text. +function Pos(line, ch, sticky) { + if ( sticky === void 0 ) sticky = null; + + if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } + this.line = line + this.ch = ch + this.sticky = sticky +} + +// Compare two positions, return 0 if they are the same, a negative +// number when a is less, and a positive number otherwise. +function cmp(a, b) { return a.line - b.line || a.ch - b.ch } + +function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } + +function copyPos(x) {return Pos(x.line, x.ch)} +function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } +function minPos(a, b) { return cmp(a, b) < 0 ? a : b } + +// Most of the external API clips given positions to make sure they +// actually exist within the document. +function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} +function clipPos(doc, pos) { + if (pos.line < doc.first) { return Pos(doc.first, 0) } + var last = doc.first + doc.size - 1 + if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } + return clipToLen(pos, getLine(doc, pos.line).text.length) +} +function clipToLen(pos, linelen) { + var ch = pos.ch + if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } + else if (ch < 0) { return Pos(pos.line, 0) } + else { return pos } +} +function clipPosArray(doc, array) { + var out = [] + for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]) } + return out +} + +// Optimize some code when these features are not used. +var sawReadOnlySpans = false; +var sawCollapsedSpans = false; +function seeReadOnlySpans() { + sawReadOnlySpans = true +} + +function seeCollapsedSpans() { + sawCollapsedSpans = true +} + +// TEXTMARKER SPANS + +function MarkedSpan(marker, from, to) { + this.marker = marker + this.from = from; this.to = to +} + +// Search an array of spans for a span matching the given marker. +function getMarkedSpanFor(spans, marker) { + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i] + if (span.marker == marker) { return span } + } } +} +// Remove a span from an array, returning undefined if no spans are +// left (we don't store arrays for lines without spans). +function removeMarkedSpan(spans, span) { + var r + for (var i = 0; i < spans.length; ++i) + { if (spans[i] != span) { (r || (r = [])).push(spans[i]) } } + return r +} +// Add a span to a line. +function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span] + span.marker.attachLine(line) +} + +// Used for the algorithm that adjusts markers for a change in the +// document. These functions cut an array of spans at a given +// character position, returning an array of remaining chunks (or +// undefined if nothing remains). +function markedSpansBefore(old, startCh, isInsert) { + var nw + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh) + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)) + } + } } + return nw +} +function markedSpansAfter(old, endCh, isInsert) { + var nw + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh) + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)) + } + } } + return nw +} + +// Given a change object, compute the new set of marker spans that +// cover the line in which the change took place. Removes spans +// entirely within the change, reconnects spans belonging to the +// same marker that appear on both sides of the change, and cuts off +// spans partially within the change. Returns an array of span +// arrays with one element for each line in (after) the change. +function stretchSpansOverChange(doc, change) { + if (change.full) { return null } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans + if (!oldFirst && !oldLast) { return null } + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0 + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert) + var last = markedSpansAfter(oldLast, endCh, isInsert) + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0) + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i] + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker) + if (!found) { span.to = startCh } + else if (sameLine) { span.to = found.to == null ? null : found.to + offset } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1] + if (span$1.to != null) { span$1.to += offset } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker) + if (!found$1) { + span$1.from = offset + if (sameLine) { (first || (first = [])).push(span$1) } + } + } else { + span$1.from += offset + if (sameLine) { (first || (first = [])).push(span$1) } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { first = clearEmptySpans(first) } + if (last && last != first) { last = clearEmptySpans(last) } + + var newMarkers = [first] + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers + if (gap > 0 && first) + { for (var i$2 = 0; i$2 < first.length; ++i$2) + { if (first[i$2].to == null) + { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)) } } } + for (var i$3 = 0; i$3 < gap; ++i$3) + { newMarkers.push(gapMarkers) } + newMarkers.push(last) + } + return newMarkers +} + +// Remove spans that are empty and don't have a clearWhenEmpty +// option of false. +function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i] + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + { spans.splice(i--, 1) } + } + if (!spans.length) { return null } + return spans +} + +// Used to 'clip' out readOnly ranges when making a change. +function removeReadOnlyRanges(doc, from, to) { + var markers = null + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + { (markers || (markers = [])).push(mark) } + } } + }) + if (!markers) { return null } + var parts = [{from: from, to: to}] + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0) + for (var j = 0; j < parts.length; ++j) { + var p = parts[j] + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to) + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + { newParts.push({from: p.from, to: m.from}) } + if (dto > 0 || !mk.inclusiveRight && !dto) + { newParts.push({from: m.to, to: p.to}) } + parts.splice.apply(parts, newParts) + j += newParts.length - 3 + } + } + return parts +} + +// Connect or disconnect spans from a line. +function detachMarkedSpans(line) { + var spans = line.markedSpans + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.detachLine(line) } + line.markedSpans = null +} +function attachMarkedSpans(line, spans) { + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.attachLine(line) } + line.markedSpans = spans +} + +// Helpers used when computing which overlapping collapsed span +// counts as the larger one. +function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } +function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } + +// Returns a number indicating which of two overlapping collapsed +// spans is larger (and thus includes the other). Falls back to +// comparing ids when the spans cover exactly the same range. +function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length + if (lenDiff != 0) { return lenDiff } + var aPos = a.find(), bPos = b.find() + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b) + if (fromCmp) { return -fromCmp } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b) + if (toCmp) { return toCmp } + return b.id - a.id +} + +// Find out whether a line ends or starts in a collapsed span. If +// so, return the marker for that span. +function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i] + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + { found = sp.marker } + } } + return found +} +function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } +function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } + +// Test whether there exists a collapsed span that partially +// overlaps (covers the start or end, but not both) of a new span. +// Such overlap is not allowed. +function conflictingCollapsedRange(doc, lineNo, from, to, marker) { + var line = getLine(doc, lineNo) + var sps = sawCollapsedSpans && line.markedSpans + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i] + if (!sp.marker.collapsed) { continue } + var found = sp.marker.find(0) + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker) + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker) + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) + { return true } + } } +} + +// A visual line is a line as drawn on the screen. Folding, for +// example, can cause multiple logical lines to appear on the same +// visual line. This finds the start of the visual line that the +// given line is part of (usually that is the line itself). +function visualLine(line) { + var merged + while (merged = collapsedSpanAtStart(line)) + { line = merged.find(-1, true).line } + return line +} + +function visualLineEnd(line) { + var merged + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line } + return line +} + +// Returns an array of logical lines that continue the visual line +// started by the argument, or undefined if there are no such lines. +function visualLineContinued(line) { + var merged, lines + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line + ;(lines || (lines = [])).push(line) + } + return lines +} + +// Get the line number of the start of the visual line that the +// given line number is part of. +function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line) + if (line == vis) { return lineN } + return lineNo(vis) +} + +// Get the line number of the start of the next visual line after +// the given line. +function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { return lineN } + var line = getLine(doc, lineN), merged + if (!lineIsHidden(doc, line)) { return lineN } + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line } + return lineNo(line) + 1 +} + +// Compute whether a line is hidden. Lines count as hidden when they +// are part of a visual line that starts with another line, or when +// they are entirely covered by collapsed, non-widget span. +function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i] + if (!sp.marker.collapsed) { continue } + if (sp.from == null) { return true } + if (sp.marker.widgetNode) { continue } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + { return true } + } } +} +function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true) + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) + } + if (span.marker.inclusiveRight && span.to == line.text.length) + { return true } + for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i] + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) { return true } + } +} + +// Find the height above the given line. +function heightAtLine(lineObj) { + lineObj = visualLine(lineObj) + + var h = 0, chunk = lineObj.parent + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i] + if (line == lineObj) { break } + else { h += line.height } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1] + if (cur == chunk) { break } + else { h += cur.height } + } + } + return h +} + +// Compute the character length of a line, taking into account +// collapsed ranges (see markText) that might hide parts, and join +// other lines onto it. +function lineLength(line) { + if (line.height == 0) { return 0 } + var len = line.text.length, merged, cur = line + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true) + cur = found.from.line + len += found.from.ch - found.to.ch + } + cur = line + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true) + len -= cur.text.length - found$1.from.ch + cur = found$1.to.line + len += cur.text.length - found$1.to.ch + } + return len +} + +// Find the longest line in the document. +function findMaxLine(cm) { + var d = cm.display, doc = cm.doc + d.maxLine = getLine(doc, doc.first) + d.maxLineLength = lineLength(d.maxLine) + d.maxLineChanged = true + doc.iter(function (line) { + var len = lineLength(line) + if (len > d.maxLineLength) { + d.maxLineLength = len + d.maxLine = line + } + }) +} + +// BIDI HELPERS + +function iterateBidiSections(order, from, to, f) { + if (!order) { return f(from, to, "ltr", 0) } + var found = false + for (var i = 0; i < order.length; ++i) { + var part = order[i] + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i) + found = true + } + } + if (!found) { f(from, to, "ltr") } +} + +var bidiOther = null +function getBidiPartAt(order, ch, sticky) { + var found + bidiOther = null + for (var i = 0; i < order.length; ++i) { + var cur = order[i] + if (cur.from < ch && cur.to > ch) { return i } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { found = i } + else { bidiOther = i } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { found = i } + else { bidiOther = i } + } + } + return found != null ? found : bidiOther +} + +// Bidirectional ordering algorithm +// See http://unicode.org/reports/tr9/tr9-13.html for the algorithm +// that this (partially) implements. + +// One-char codes used for character types: +// L (L): Left-to-Right +// R (R): Right-to-Left +// r (AL): Right-to-Left Arabic +// 1 (EN): European Number +// + (ES): European Number Separator +// % (ET): European Number Terminator +// n (AN): Arabic Number +// , (CS): Common Number Separator +// m (NSM): Non-Spacing Mark +// b (BN): Boundary Neutral +// s (B): Paragraph Separator +// t (S): Segment Separator +// w (WS): Whitespace +// N (ON): Other Neutrals + +// Returns null if characters are ordered as they appear +// (left-to-right), or an array of sections ({from, to, level} +// objects) in the order in which they occur visually. +var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN" + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111" + function charType(code) { + if (code <= 0xf7) { return lowTypes.charAt(code) } + else if (0x590 <= code && code <= 0x5f4) { return "R" } + else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } + else if (0x6ee <= code && code <= 0x8ac) { return "r" } + else if (0x2000 <= code && code <= 0x200b) { return "w" } + else if (code == 0x200c) { return "b" } + else { return "L" } + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/ + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/ + + function BidiSpan(level, from, to) { + this.level = level + this.from = from; this.to = to + } + + return function(str, direction) { + var outerType = direction == "ltr" ? "L" : "R" + + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } + var len = str.length, types = [] + for (var i = 0; i < len; ++i) + { types.push(charType(str.charCodeAt(i))) } + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1] + if (type == "m") { types[i$1] = prev } + else { prev = type } + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2] + if (type$1 == "1" && cur == "r") { types[i$2] = "n" } + else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R" } } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3] + if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1" } + else if (type$2 == "," && prev$1 == types[i$3+1] && + (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1 } + prev$1 = type$2 + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4] + if (type$3 == ",") { types[i$4] = "N" } + else if (type$3 == "%") { + var end = (void 0) + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N" + for (var j = i$4; j < end; ++j) { types[j] = replace } + i$4 = end - 1 + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5] + if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L" } + else if (isStrong.test(type$4)) { cur$1 = type$4 } + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = (void 0) + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6-1] : outerType) == "L" + var after = (end$1 < len ? types[end$1] : outerType) == "L" + var replace$1 = before == after ? (before ? "L" : "R") : outerType + for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 } + i$6 = end$1 - 1 + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7 + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)) + } else { + var pos = i$7, at = order.length + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)) } + var nstart = j$2 + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)) + pos = j$2 + } else { ++j$2 } + } + if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) } + } + } + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length + order.unshift(new BidiSpan(0, 0, m[0].length)) + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length + order.push(new BidiSpan(0, len - m[0].length, len)) + } + } + + return direction == "rtl" ? order.reverse() : order + } +})() + +// Get the bidi ordering for the given line (and cache it). Returns +// false for lines that are fully left-to-right, and an array of +// BidiSpan objects otherwise. +function getOrder(line, direction) { + var order = line.order + if (order == null) { order = line.order = bidiOrdering(line.text, direction) } + return order +} + +// EVENT HANDLING + +// Lightweight event framework. on/off also work on DOM nodes, +// registering native DOM handlers. + +var noHandlers = [] + +var on = function(emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false) + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f) + } else { + var map = emitter._handlers || (emitter._handlers = {}) + map[type] = (map[type] || noHandlers).concat(f) + } +} + +function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers +} + +function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false) + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f) + } else { + var map = emitter._handlers, arr = map && map[type] + if (arr) { + var index = indexOf(arr, f) + if (index > -1) + { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)) } + } + } +} + +function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type) + if (!handlers.length) { return } + var args = Array.prototype.slice.call(arguments, 2) + for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args) } +} + +// The DOM events that CodeMirror handles can be overridden by +// registering a (non-DOM) handler on the editor for the event name, +// and preventDefault-ing the event in that handler. +function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + { e = {type: e, preventDefault: function() { this.defaultPrevented = true }} } + signal(cm, override || e.type, cm, e) + return e_defaultPrevented(e) || e.codemirrorIgnore +} + +function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity + if (!arr) { return } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []) + for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) + { set.push(arr[i]) } } +} + +function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0 +} + +// Add on and off methods to a constructor's prototype, to make +// registering events on such objects more convenient. +function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f)} + ctor.prototype.off = function(type, f) {off(this, type, f)} +} + +// Due to the fact that we still support jurassic IE versions, some +// compatibility wrappers are needed. + +function e_preventDefault(e) { + if (e.preventDefault) { e.preventDefault() } + else { e.returnValue = false } +} +function e_stopPropagation(e) { + if (e.stopPropagation) { e.stopPropagation() } + else { e.cancelBubble = true } +} +function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false +} +function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)} + +function e_target(e) {return e.target || e.srcElement} +function e_button(e) { + var b = e.which + if (b == null) { + if (e.button & 1) { b = 1 } + else if (e.button & 2) { b = 3 } + else if (e.button & 4) { b = 2 } + } + if (mac && e.ctrlKey && b == 1) { b = 3 } + return b +} + +// Detect drag-and-drop +var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { return false } + var div = elt('div') + return "draggable" in div || "dragDrop" in div +}() + +var zwspSupported +function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b") + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])) + if (measure.firstChild.offsetHeight != 0) + { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8) } + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px") + node.setAttribute("cm-text", "") + return node +} + +// Feature-detect IE's crummy client rect reporting for bidi text +var badBidiRects +function hasBadBidiRects(measure) { + if (badBidiRects != null) { return badBidiRects } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")) + var r0 = range(txt, 0, 1).getBoundingClientRect() + var r1 = range(txt, 1, 2).getBoundingClientRect() + removeChildren(measure) + if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) + return badBidiRects = (r1.right - r0.right < 3) +} + +// See if "".split is the broken IE version, if so, provide an +// alternative way to split lines. +var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, result = [], l = string.length + while (pos <= l) { + var nl = string.indexOf("\n", pos) + if (nl == -1) { nl = string.length } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl) + var rt = line.indexOf("\r") + if (rt != -1) { + result.push(line.slice(0, rt)) + pos += rt + 1 + } else { + result.push(line) + pos = nl + 1 + } + } + return result +} : function (string) { return string.split(/\r\n?|\n/); } + +var hasSelection = window.getSelection ? function (te) { + try { return te.selectionStart != te.selectionEnd } + catch(e) { return false } +} : function (te) { + var range + try {range = te.ownerDocument.selection.createRange()} + catch(e) {} + if (!range || range.parentElement() != te) { return false } + return range.compareEndPoints("StartToEnd", range) != 0 +} + +var hasCopyEvent = (function () { + var e = elt("div") + if ("oncopy" in e) { return true } + e.setAttribute("oncopy", "return;") + return typeof e.oncopy == "function" +})() + +var badZoomedRects = null +function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { return badZoomedRects } + var node = removeChildrenAndAdd(measure, elt("span", "x")) + var normal = node.getBoundingClientRect() + var fromRange = range(node, 0, 1).getBoundingClientRect() + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 +} + +var modes = {}; +var mimeModes = {}; +// Extra arguments are stored as the mode's dependencies, which is +// used by (legacy) mechanisms like loadmode.js to automatically +// load a mode. (Preferred mechanism is the require/define calls.) +function defineMode(name, mode) { + if (arguments.length > 2) + { mode.dependencies = Array.prototype.slice.call(arguments, 2) } + modes[name] = mode +} + +function defineMIME(mime, spec) { + mimeModes[mime] = spec +} + +// Given a MIME type, a {name, ...options} config object, or a name +// string, return a mode config object. +function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec] + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name] + if (typeof found == "string") { found = {name: found} } + spec = createObj(found, spec) + spec.name = found.name + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml") + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json") + } + if (typeof spec == "string") { return {name: spec} } + else { return spec || {name: "null"} } +} + +// Given a mode spec (anything that resolveMode accepts), find and +// initialize an actual mode object. +function getMode(options, spec) { + spec = resolveMode(spec) + var mfactory = modes[spec.name] + if (!mfactory) { return getMode(options, "text/plain") } + var modeObj = mfactory(options, spec) + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name] + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { continue } + if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop] } + modeObj[prop] = exts[prop] + } + } + modeObj.name = spec.name + if (spec.helperType) { modeObj.helperType = spec.helperType } + if (spec.modeProps) { for (var prop$1 in spec.modeProps) + { modeObj[prop$1] = spec.modeProps[prop$1] } } + + return modeObj +} + +// This can be used to attach properties to mode objects from +// outside the actual mode definition. +var modeExtensions = {} +function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}) + copyObj(properties, exts) +} + +function copyState(mode, state) { + if (state === true) { return state } + if (mode.copyState) { return mode.copyState(state) } + var nstate = {} + for (var n in state) { + var val = state[n] + if (val instanceof Array) { val = val.concat([]) } + nstate[n] = val + } + return nstate +} + +// Given a mode and a state (for that mode), find the inner mode and +// state at the position that the state refers to. +function innerMode(mode, state) { + var info + while (mode.innerMode) { + info = mode.innerMode(state) + if (!info || info.mode == mode) { break } + state = info.state + mode = info.mode + } + return info || {mode: mode, state: state} +} + +function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true +} + +// STRING STREAM + +// Fed to the mode parsers, provides helper functions to make +// parsers more succinct. + +var StringStream = function(string, tabSize, lineOracle) { + this.pos = this.start = 0 + this.string = string + this.tabSize = tabSize || 8 + this.lastColumnPos = this.lastColumnValue = 0 + this.lineStart = 0 + this.lineOracle = lineOracle +}; + +StringStream.prototype.eol = function () {return this.pos >= this.string.length}; +StringStream.prototype.sol = function () {return this.pos == this.lineStart}; +StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; +StringStream.prototype.next = function () { + if (this.pos < this.string.length) + { return this.string.charAt(this.pos++) } +}; +StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos) + var ok + if (typeof match == "string") { ok = ch == match } + else { ok = ch && (match.test ? match.test(ch) : match(ch)) } + if (ok) {++this.pos; return ch} +}; +StringStream.prototype.eatWhile = function (match) { + var start = this.pos + while (this.eat(match)){} + return this.pos > start +}; +StringStream.prototype.eatSpace = function () { + var this$1 = this; + + var start = this.pos + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos } + return this.pos > start +}; +StringStream.prototype.skipToEnd = function () {this.pos = this.string.length}; +StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos) + if (found > -1) {this.pos = found; return true} +}; +StringStream.prototype.backUp = function (n) {this.pos -= n}; +StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue) + this.lastColumnPos = this.start + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) +}; +StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) +}; +StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; } + var substr = this.string.substr(this.pos, pattern.length) + if (cased(substr) == cased(pattern)) { + if (consume !== false) { this.pos += pattern.length } + return true + } + } else { + var match = this.string.slice(this.pos).match(pattern) + if (match && match.index > 0) { return null } + if (match && consume !== false) { this.pos += match[0].length } + return match + } +}; +StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; +StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n + try { return inner() } + finally { this.lineStart -= n } +}; +StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle + return oracle && oracle.lookAhead(n) +}; +StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle + return oracle && oracle.baseToken(this.pos) +}; + +var SavedContext = function(state, lookAhead) { + this.state = state + this.lookAhead = lookAhead +}; + +var Context = function(doc, state, line, lookAhead) { + this.state = state + this.doc = doc + this.line = line + this.maxLookAhead = lookAhead || 0 + this.baseTokens = null + this.baseTokenPos = 1 +}; + +Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n) + if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n } + return line +}; + +Context.prototype.baseToken = function (n) { + var this$1 = this; + + if (!this.baseTokens) { return null } + while (this.baseTokens[this.baseTokenPos] <= n) + { this$1.baseTokenPos += 2 } + var type = this.baseTokens[this.baseTokenPos + 1] + return {type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n} +}; + +Context.prototype.nextLine = function () { + this.line++ + if (this.maxLookAhead > 0) { this.maxLookAhead-- } +}; + +Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) + { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } + else + { return new Context(doc, copyState(doc.mode, saved), line) } +}; + +Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state +}; + + +// Compute a style array (an array starting with a mode generation +// -- for invalidation -- followed by pairs of end positions and +// style strings), which is used to highlight the tokens on the +// line. +function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {} + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, + lineClasses, forceToEnd) + var state = context.state + + // Run overlays, adjust style array. + var loop = function ( o ) { + context.baseTokens = st + var overlay = cm.state.overlays[o], i = 1, at = 0 + context.state = true + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i] + if (i_end > end) + { st.splice(i, 1, end, st[i+1], i_end) } + i += 2 + at = Math.min(end, i_end) + } + if (!style) { return } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style) + i = start + 2 + } else { + for (; start < i; start += 2) { + var cur = st[start+1] + st[start+1] = (cur ? cur + " " : "") + "overlay " + style + } + } + }, lineClasses) + context.state = state + context.baseTokens = null + context.baseTokenPos = 1 + }; + + for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} +} + +function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)) + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state) + var result = highlightLine(cm, line, context) + if (resetState) { context.state = resetState } + line.stateAfter = context.save(!resetState) + line.styles = result.styles + if (result.classes) { line.styleClasses = result.classes } + else if (line.styleClasses) { line.styleClasses = null } + if (updateFrontier === cm.doc.highlightFrontier) + { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) } + } + return line.styles +} + +function getContextBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display + if (!doc.mode.startState) { return new Context(doc, true, n) } + var start = findStartLine(cm, n, precise) + var saved = start > doc.first && getLine(doc, start - 1).stateAfter + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start) + + doc.iter(start, n, function (line) { + processLine(cm, line.text, context) + var pos = context.line + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null + context.nextLine() + }) + if (precise) { doc.modeFrontier = context.line } + return context +} + +// Lightweight form of highlight -- proceed over this line and +// update state, but don't save a style array. Used for lines that +// aren't currently visible. +function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode + var stream = new StringStream(text, cm.options.tabSize, context) + stream.start = stream.pos = startAt || 0 + if (text == "") { callBlankLine(mode, context.state) } + while (!stream.eol()) { + readToken(mode, stream, context.state) + stream.start = stream.pos + } +} + +function callBlankLine(mode, state) { + if (mode.blankLine) { return mode.blankLine(state) } + if (!mode.innerMode) { return } + var inner = innerMode(mode, state) + if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } +} + +function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { inner[0] = innerMode(mode, state).mode } + var style = mode.token(stream, state) + if (stream.pos > stream.start) { return style } + } + throw new Error("Mode " + mode.name + " failed to advance stream.") +} + +var Token = function(stream, type, state) { + this.start = stream.start; this.end = stream.pos + this.string = stream.current() + this.type = type || null + this.state = state +}; + +// Utility for getTokenAt and getLineTokens +function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, mode = doc.mode, style + pos = clipPos(doc, pos) + var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise) + var stream = new StringStream(line.text, cm.options.tabSize, context), tokens + if (asArray) { tokens = [] } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos + style = readToken(mode, stream, context.state) + if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) } + } + return asArray ? tokens : new Token(stream, style, context.state) +} + +function extractLineClasses(type, output) { + if (type) { for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/) + if (!lineClass) { break } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length) + var prop = lineClass[1] ? "bgClass" : "textClass" + if (output[prop] == null) + { output[prop] = lineClass[2] } + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + { output[prop] += " " + lineClass[2] } + } } + return type +} + +// Run the given mode's parser over a line, calling f for each token. +function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans + if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans } + var curStart = 0, curStyle = null + var stream = new StringStream(text, cm.options.tabSize, context), style + var inner = cm.options.addModeClass && [null] + if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false + if (forceToEnd) { processLine(cm, text, context, stream.pos) } + stream.pos = text.length + style = null + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses) + } + if (inner) { + var mName = inner[0].name + if (mName) { style = "m-" + (style ? mName + " " + style : mName) } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000) + f(curStart, curStyle) + } + curStyle = style + } + stream.start = stream.pos + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000) + f(pos, curStyle) + curStart = pos + } +} + +// Finds the line to start with when starting a parse. Tries to +// find a line with a stateAfter, so that it can start with a +// valid state. If that fails, it returns the line with the +// smallest indentation, which tends to need the least context to +// parse correctly. +function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100) + for (var search = n; search > lim; --search) { + if (search <= doc.first) { return doc.first } + var line = getLine(doc, search - 1), after = line.stateAfter + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) + { return search } + var indented = countColumn(line.text, null, cm.options.tabSize) + if (minline == null || minindent > indented) { + minline = search - 1 + minindent = indented + } + } + return minline +} + +function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n) + if (doc.highlightFrontier < n - 10) { return } + var start = doc.first + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1 + break + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start) +} + +// LINE DATA STRUCTURE + +// Line objects. These hold state related to a line, including +// highlighting info (the styles array). +var Line = function(text, markedSpans, estimateHeight) { + this.text = text + attachMarkedSpans(this, markedSpans) + this.height = estimateHeight ? estimateHeight(this) : 1 +}; + +Line.prototype.lineNo = function () { return lineNo(this) }; +eventMixin(Line) + +// Change the content (text, markers) of a line. Automatically +// invalidates cached information and tries to re-estimate the +// line's height. +function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text + if (line.stateAfter) { line.stateAfter = null } + if (line.styles) { line.styles = null } + if (line.order != null) { line.order = null } + detachMarkedSpans(line) + attachMarkedSpans(line, markedSpans) + var estHeight = estimateHeight ? estimateHeight(line) : 1 + if (estHeight != line.height) { updateLineHeight(line, estHeight) } +} + +// Detach a line from the document tree and its markers. +function cleanUpLine(line) { + line.parent = null + detachMarkedSpans(line) +} + +// Convert a style as returned by a mode (either null, or a string +// containing one or more styles) to a CSS style. This is cached, +// and also looks for line-wide styles. +var styleToClassCache = {}; +var styleToClassCacheWithMode = {}; +function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { return null } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")) +} + +// Render the DOM representation of the text of a line. Also builds +// up a 'line map', which points at the DOM nodes that represent +// specific stretches of text, and is used by the measuring code. +// The returned object contains the DOM node, this map, and +// information about line-wide styles that were set by the mode. +function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null) + var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + trailingSpace: false, + splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")} + lineView.measure = {} + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0) + builder.pos = 0 + builder.addToken = buildToken + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) + { builder.addToken = buildTokenBadBidi(builder.addToken, order) } + builder.map = [] + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line) + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)) + if (line.styleClasses) { + if (line.styleClasses.bgClass) + { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || "") } + if (line.styleClasses.textClass) + { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || "") } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))) } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map + lineView.measure.cache = {} + } else { + ;(lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) + ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}) + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + { builder.content.className = "cm-tab-wrap-hack" } + } + + signal(cm, "renderLine", cm, lineView.line, builder.pre) + if (builder.pre.className) + { builder.textClass = joinClasses(builder.pre.className, builder.textClass || "") } + + return builder +} + +function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar") + token.title = "\\u" + ch.charCodeAt(0).toString(16) + token.setAttribute("aria-label", token.title) + return token +} + +// Build up the DOM representation for a single token, and add it to +// the line map. Takes care to render special characters separately. +function buildToken(builder, text, style, startStyle, endStyle, title, css) { + if (!text) { return } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text + var special = builder.cm.state.specialChars, mustWrap = false + var content + if (!special.test(text)) { + builder.col += text.length + content = document.createTextNode(displayText) + builder.map.push(builder.pos, builder.pos + text.length, content) + if (ie && ie_version < 9) { mustWrap = true } + builder.pos += text.length + } else { + content = document.createDocumentFragment() + var pos = 0 + while (true) { + special.lastIndex = pos + var m = special.exec(text) + var skipped = m ? m.index - pos : text.length - pos + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)) + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])) } + else { content.appendChild(txt) } + builder.map.push(builder.pos, builder.pos + skipped, txt) + builder.col += skipped + builder.pos += skipped + } + if (!m) { break } + pos += skipped + 1 + var txt$1 = (void 0) + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")) + txt$1.setAttribute("role", "presentation") + txt$1.setAttribute("cm-text", "\t") + builder.col += tabWidth + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")) + txt$1.setAttribute("cm-text", m[0]) + builder.col += 1 + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]) + txt$1.setAttribute("cm-text", m[0]) + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])) } + else { content.appendChild(txt$1) } + builder.col += 1 + } + builder.map.push(builder.pos, builder.pos + 1, txt$1) + builder.pos++ + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32 + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || "" + if (startStyle) { fullStyle += startStyle } + if (endStyle) { fullStyle += endStyle } + var token = elt("span", [content], fullStyle, css) + if (title) { token.title = title } + return builder.content.appendChild(token) + } + builder.content.appendChild(content) +} + +function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { return text } + var spaceBefore = trailingBefore, result = "" + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i) + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) + { ch = "\u00a0" } + result += ch + spaceBefore = ch == " " + } + return result +} + +// Work around nonsense dimensions being reported for stretches of +// right-to-left text. +function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, title, css) { + style = style ? style + " cm-force-border" : "cm-force-border" + var start = builder.pos, end = start + text.length + for (;;) { + // Find the part that overlaps with the start of this text + var part = (void 0) + for (var i = 0; i < order.length; i++) { + part = order[i] + if (part.to > start && part.from <= start) { break } + } + if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, title, css) } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css) + startStyle = null + text = text.slice(part.to - start) + start = part.to + } + } +} + +function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode + if (widget) { builder.map.push(builder.pos, builder.pos + size, widget) } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + { widget = builder.content.appendChild(document.createElement("span")) } + widget.setAttribute("cm-marker", marker.id) + } + if (widget) { + builder.cm.display.input.setUneditable(widget) + builder.content.appendChild(widget) + } + builder.pos += size + builder.trailingSpace = false +} + +// Outputs a number of spans to make up a line, taking highlighting +// and marked text into account. +function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0 + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1+=2) + { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)) } + return + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, title, collapsed + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = title = css = "" + collapsed = null; nextChange = Infinity + var foundBookmarks = [], endStyles = (void 0) + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m) + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to + spanEndStyle = "" + } + if (m.className) { spanStyle += " " + m.className } + if (m.css) { css = (css ? css + ";" : "") + m.css } + if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle } + if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to) } + if (m.title && !title) { title = m.title } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + { collapsed = sp } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from + } + } + if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) + { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1] } } } + + if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) + { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]) } } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null) + if (collapsed.to == null) { return } + if (collapsed.to == pos) { collapsed = false } + } + } + if (pos >= len) { break } + + var upto = Math.min(len, nextChange) + while (true) { + if (text) { + var end = pos + text.length + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", title, css) + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} + pos = end + spanStartStyle = "" + } + text = allText.slice(at, at = styles[i++]) + style = interpretTokenStyle(styles[i++], builder.cm.options) + } + } +} + + +// These objects are used to represent the visible (currently drawn) +// part of the document. A LineView may correspond to multiple +// logical lines, if those are connected by collapsed ranges. +function LineView(doc, line, lineN) { + // The starting line + this.line = line + // Continuing lines, if any + this.rest = visualLineContinued(line) + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1 + this.node = this.text = null + this.hidden = lineIsHidden(doc, line) +} + +// Create a range of LineView objects for the given lines. +function buildViewArray(cm, from, to) { + var array = [], nextPos + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos) + nextPos = pos + view.size + array.push(view) + } + return array +} + +var operationGroup = null + +function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op) + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + } + } +} + +function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0 + do { + for (; i < callbacks.length; i++) + { callbacks[i].call(null) } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j] + if (op.cursorActivityHandlers) + { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm) } } + } + } while (i < callbacks.length) +} + +function finishOperation(op, endCb) { + var group = op.ownsGroup + if (!group) { return } + + try { fireCallbacksForOps(group) } + finally { + operationGroup = null + endCb(group) + } +} + +var orphanDelayedCallbacks = null + +// Often, we want to signal events at a point where we are in the +// middle of some work, but don't want the handler to start calling +// other methods on the editor, which might be in an inconsistent +// state or simply not expect any other events to happen. +// signalLater looks whether there are any handlers, and schedules +// them to be executed when the last operation ends, or, if no +// operation is active, when a timeout fires. +function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type) + if (!arr.length) { return } + var args = Array.prototype.slice.call(arguments, 2), list + if (operationGroup) { + list = operationGroup.delayedCallbacks + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks + } else { + list = orphanDelayedCallbacks = [] + setTimeout(fireOrphanDelayed, 0) + } + var loop = function ( i ) { + list.push(function () { return arr[i].apply(null, args); }) + }; + + for (var i = 0; i < arr.length; ++i) + loop( i ); +} + +function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks + orphanDelayedCallbacks = null + for (var i = 0; i < delayed.length; ++i) { delayed[i]() } +} + +// When an aspect of a line changes, a string is added to +// lineView.changes. This updates the relevant part of the line's +// DOM structure. +function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j] + if (type == "text") { updateLineText(cm, lineView) } + else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) } + else if (type == "class") { updateLineClasses(cm, lineView) } + else if (type == "widget") { updateLineWidgets(cm, lineView, dims) } + } + lineView.changes = null +} + +// Lines with gutter elements, widgets or a background class need to +// be wrapped, and have the extra elements added to the wrapper div +function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative") + if (lineView.text.parentNode) + { lineView.text.parentNode.replaceChild(lineView.node, lineView.text) } + lineView.node.appendChild(lineView.text) + if (ie && ie_version < 8) { lineView.node.style.zIndex = 2 } + } + return lineView.node +} + +function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass + if (cls) { cls += " CodeMirror-linebackground" } + if (lineView.background) { + if (cls) { lineView.background.className = cls } + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null } + } else if (cls) { + var wrap = ensureLineWrapped(lineView) + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild) + cm.display.input.setUneditable(lineView.background) + } +} + +// Wrapper around buildLineContent which will reuse the structure +// in display.externalMeasured when possible. +function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null + lineView.measure = ext.measure + return ext.built + } + return buildLineContent(cm, lineView) +} + +// Redraw the line's text. Interacts with the background and text +// classes because the mode may output tokens that influence these +// classes. +function updateLineText(cm, lineView) { + var cls = lineView.text.className + var built = getLineContent(cm, lineView) + if (lineView.text == lineView.node) { lineView.node = built.pre } + lineView.text.parentNode.replaceChild(built.pre, lineView.text) + lineView.text = built.pre + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass + lineView.textClass = built.textClass + updateLineClasses(cm, lineView) + } else if (cls) { + lineView.text.className = cls + } +} + +function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView) + if (lineView.line.wrapClass) + { ensureLineWrapped(lineView).className = lineView.line.wrapClass } + else if (lineView.node != lineView.text) + { lineView.node.className = "" } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass + lineView.text.className = textClass || "" +} + +function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter) + lineView.gutter = null + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground) + lineView.gutterBackground = null + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView) + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, + ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")) + cm.display.input.setUneditable(lineView.gutterBackground) + wrap.insertBefore(lineView.gutterBackground, lineView.text) + } + var markers = lineView.line.gutterMarkers + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView) + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")) + cm.display.input.setUneditable(gutterWrap) + wrap$1.insertBefore(gutterWrap, lineView.text) + if (lineView.line.gutterClass) + { gutterWrap.className += " " + lineView.line.gutterClass } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + { lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))) } + if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) { + var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id] + if (found) + { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))) } + } } + } +} + +function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { lineView.alignable = null } + for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { + next = node.nextSibling + if (node.className == "CodeMirror-linewidget") + { lineView.node.removeChild(node) } + } + insertLineWidgets(cm, lineView, dims) +} + +// Build a line's DOM representation from scratch +function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView) + lineView.text = lineView.node = built.pre + if (built.bgClass) { lineView.bgClass = built.bgClass } + if (built.textClass) { lineView.textClass = built.textClass } + + updateLineClasses(cm, lineView) + updateLineGutter(cm, lineView, lineN, dims) + insertLineWidgets(cm, lineView, dims) + return lineView.node +} + +// A lineView may contain multiple logical lines (when merged by +// collapsed spans). The widgets for all of them need to be drawn. +function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true) + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false) } } +} + +function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { return } + var wrap = ensureLineWrapped(lineView) + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget") + if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true") } + positionLineWidget(widget, node, lineView, dims) + cm.display.input.setUneditable(node) + if (allowAbove && widget.above) + { wrap.insertBefore(node, lineView.gutter || lineView.text) } + else + { wrap.appendChild(node) } + signalLater(widget, "redraw") + } +} + +function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + ;(lineView.alignable || (lineView.alignable = [])).push(node) + var width = dims.wrapperWidth + node.style.left = dims.fixedPos + "px" + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth + node.style.paddingLeft = dims.gutterTotalWidth + "px" + } + node.style.width = width + "px" + } + if (widget.coverGutter) { + node.style.zIndex = 5 + node.style.position = "relative" + if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px" } + } +} + +function widgetHeight(widget) { + if (widget.height != null) { return widget.height } + var cm = widget.doc.cm + if (!cm) { return 0 } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;" + if (widget.coverGutter) + { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" } + if (widget.noHScroll) + { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)) + } + return widget.height = widget.node.parentNode.offsetHeight +} + +// Return true when the given mouse event happened in a widget +function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + { return true } + } +} + +// POSITION MEASUREMENT + +function paddingTop(display) {return display.lineSpace.offsetTop} +function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} +function paddingH(display) { + if (display.cachedPaddingH) { return display.cachedPaddingH } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x")) + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)} + if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data } + return data +} + +function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } +function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth +} +function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight +} + +// Ensure the lineView.wrapping.heights array is populated. This is +// an array of bottom offsets for the lines that make up a drawn +// line. When lineWrapping is on, there might be more than one +// height. +function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping + var curWidth = wrapping && displayWidth(cm) + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = [] + if (wrapping) { + lineView.measure.width = curWidth + var rects = lineView.text.firstChild.getClientRects() + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1] + if (Math.abs(cur.bottom - next.bottom) > 2) + { heights.push((cur.bottom + next.top) / 2 - rect.top) } + } + } + heights.push(rect.bottom - rect.top) + } +} + +// Find a line map (mapping character offsets to text nodes) and a +// measurement cache for the given line number. (A line view might +// contain multiple lines when collapsed ranges are present.) +function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + { return {map: lineView.measure.map, cache: lineView.measure.cache} } + for (var i = 0; i < lineView.rest.length; i++) + { if (lineView.rest[i] == line) + { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) + { if (lineNo(lineView.rest[i$1]) > lineN) + { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } +} + +// Render a line into the hidden node display.externalMeasured. Used +// when measurement is needed for a line that's not in the viewport. +function updateExternalMeasurement(cm, line) { + line = visualLine(line) + var lineN = lineNo(line) + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN) + view.lineN = lineN + var built = view.built = buildLineContent(cm, view) + view.text = built.pre + removeChildrenAndAdd(cm.display.lineMeasure, built.pre) + return view +} + +// Get a {top, bottom, left, right} box (in line-local coordinates) +// for a given character. +function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) +} + +// Find a line view that corresponds to the given line number. +function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + { return cm.display.view[findViewIndex(cm, lineN)] } + var ext = cm.display.externalMeasured + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + { return ext } +} + +// Measurement can be split in two steps, the set-up work that +// applies to the whole line, and the measurement of the actual +// character. Functions like coordsChar, that need to do a lot of +// measurements in a row, can thus ensure that the set-up work is +// only done once. +function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line) + var view = findViewForLine(cm, lineN) + if (view && !view.text) { + view = null + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)) + cm.curOp.forceUpdate = true + } + if (!view) + { view = updateExternalMeasurement(cm, line) } + + var info = mapFromLineView(view, line, lineN) + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + } +} + +// Given a prepared measurement object, measures the position of an +// actual character (or fetches it from the cache). +function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { ch = -1 } + var key = ch + (bias || ""), found + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key] + } else { + if (!prepared.rect) + { prepared.rect = prepared.view.text.getBoundingClientRect() } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect) + prepared.hasHeights = true + } + found = measureCharInner(cm, prepared, ch, bias) + if (!found.bogus) { prepared.cache[key] = found } + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom} +} + +var nullRect = {left: 0, right: 0, top: 0, bottom: 0} + +function nodeAndOffsetInLineMap(map, ch, bias) { + var node, start, end, collapse, mStart, mEnd + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map.length; i += 3) { + mStart = map[i] + mEnd = map[i + 1] + if (ch < mStart) { + start = 0; end = 1 + collapse = "left" + } else if (ch < mEnd) { + start = ch - mStart + end = start + 1 + } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { + end = mEnd - mStart + start = end - 1 + if (ch >= mEnd) { collapse = "right" } + } + if (start != null) { + node = map[i + 2] + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + { collapse = bias } + if (bias == "left" && start == 0) + { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { + node = map[(i -= 3) + 2] + collapse = "left" + } } + if (bias == "right" && start == mEnd - mStart) + { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { + node = map[(i += 3) + 2] + collapse = "right" + } } + break + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} +} + +function getUsefulRect(rects, bias) { + var rect = nullRect + if (bias == "left") { for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { break } + } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { break } + } } + return rect +} + +function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias) + var node = place.node, start = place.start, end = place.end, collapse = place.collapse + + var rect + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) + { rect = node.parentNode.getBoundingClientRect() } + else + { rect = getUsefulRect(range(node, start, end).getClientRects(), bias) } + if (rect.left || rect.right || start == 0) { break } + end = start + start = start - 1 + collapse = "right" + } + if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect) } + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) { collapse = bias = "right" } + var rects + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + { rect = rects[bias == "right" ? rects.length - 1 : 0] } + else + { rect = node.getBoundingClientRect() } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0] + if (rSpan) + { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom} } + else + { rect = nullRect } + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top + var mid = (rtop + rbot) / 2 + var heights = prepared.view.measure.heights + var i = 0 + for (; i < heights.length - 1; i++) + { if (mid < heights[i]) { break } } + var top = i ? heights[i - 1] : 0, bot = heights[i] + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot} + if (!rect.left && !rect.right) { result.bogus = true } + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot } + + return result +} + +// Work around problem with bounding client rects on ranges being +// returned incorrectly when zoomed on IE10 and below. +function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + { return rect } + var scaleX = screen.logicalXDPI / screen.deviceXDPI + var scaleY = screen.logicalYDPI / screen.deviceYDPI + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY} +} + +function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {} + lineView.measure.heights = null + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { lineView.measure.caches[i] = {} } } + } +} + +function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null + removeChildren(cm.display.lineMeasure) + for (var i = 0; i < cm.display.view.length; i++) + { clearLineMeasurementCacheFor(cm.display.view[i]) } +} + +function clearCaches(cm) { + clearLineMeasurementCache(cm) + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null + if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true } + cm.display.lineNumChars = null +} + +function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft +} +function pageScrollY() { + if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } + return window.pageYOffset || (document.documentElement || document.body).scrollTop +} + +function widgetTopHeight(lineObj) { + var height = 0 + if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) + { height += widgetHeight(lineObj.widgets[i]) } } } + return height +} + +// Converts a {top, bottom, left, right} box from line-local +// coordinates into another coordinate system. Context may be one of +// "line", "div" (display.lineDiv), "local"./null (editor), "window", +// or "page". +function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets) { + var height = widgetTopHeight(lineObj) + rect.top += height; rect.bottom += height + } + if (context == "line") { return rect } + if (!context) { context = "local" } + var yOff = heightAtLine(lineObj) + if (context == "local") { yOff += paddingTop(cm.display) } + else { yOff -= cm.display.viewOffset } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect() + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()) + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()) + rect.left += xOff; rect.right += xOff + } + rect.top += yOff; rect.bottom += yOff + return rect +} + +// Coverts a box from "div" coords to another coordinate system. +// Context may be "window", "page", "div", or "local"./null. +function fromCoordSystem(cm, coords, context) { + if (context == "div") { return coords } + var left = coords.left, top = coords.top + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX() + top -= pageScrollY() + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect() + left += localBox.left + top += localBox.top + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect() + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} +} + +function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { lineObj = getLine(cm.doc, pos.line) } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) +} + +// Returns a box for a given cursor position, which may have an +// 'other' property containing the position of the secondary cursor +// on a bidi boundary. +// A cursor Pos(line, char, "before") is on the same visual line as `char - 1` +// and after `char - 1` in writing order of `char - 1` +// A cursor Pos(line, char, "after") is on the same visual line as `char` +// and before `char` in writing order of `char` +// Examples (upper-case letters are RTL, lower-case are LTR): +// Pos(0, 1, ...) +// before after +// ab a|b a|b +// aB a|B aB| +// Ab |Ab A|b +// AB B|A B|A +// Every position after the last character on a line is considered to stick +// to the last character on the line. +function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line) + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight) + if (right) { m.left = m.right; } else { m.right = m.left } + return intoCoordSystem(cm, lineObj, m, context) + } + var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky + if (ch >= lineObj.text.length) { + ch = lineObj.text.length + sticky = "before" + } else if (ch <= 0) { + ch = 0 + sticky = "after" + } + if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } + + function getBidi(ch, partPos, invert) { + var part = order[partPos], right = part.level == 1 + return get(invert ? ch - 1 : ch, right != invert) + } + var partPos = getBidiPartAt(order, ch, sticky) + var other = bidiOther + var val = getBidi(ch, partPos, sticky == "before") + if (other != null) { val.other = getBidi(ch, other, sticky != "before") } + return val +} + +// Used to cheaply estimate the coordinates for a position. Used for +// intermediate scroll updates. +function estimateCoords(cm, pos) { + var left = 0 + pos = clipPos(cm.doc, pos) + if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch } + var lineObj = getLine(cm.doc, pos.line) + var top = heightAtLine(lineObj) + paddingTop(cm.display) + return {left: left, right: left, top: top, bottom: top + lineObj.height} +} + +// Positions returned by coordsChar contain some extra information. +// xRel is the relative x position of the input coordinates compared +// to the found position (so xRel > 0 means the coordinates are to +// the right of the character position, for example). When outside +// is true, that means the coordinates lie outside the line's +// vertical range. +function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky) + pos.xRel = xRel + if (outside) { pos.outside = true } + return pos +} + +// Compute the character position closest to the given coordinates. +// Input must be lineSpace-local ("div" coordinate system). +function coordsChar(cm, x, y) { + var doc = cm.doc + y += cm.display.viewOffset + if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) } + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1 + if (lineN > last) + { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) } + if (x < 0) { x = 0 } + + var lineObj = getLine(doc, lineN) + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y) + var merged = collapsedSpanAtEnd(lineObj) + var mergedPos = merged && merged.find(0, true) + if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0)) + { lineN = lineNo(lineObj = mergedPos.to.line) } + else + { return found } + } +} + +function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj) + var end = lineObj.text.length + var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0) + end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end) + return {begin: begin, end: end} +} + +function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) +} + +// Returns true if the given side of a box is after the given +// coordinates, in top-to-bottom, left-to-right order. +function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x +} + +function coordsCharInner(cm, lineObj, lineNo, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj) + var preparedMeasure = prepareMeasureForLine(cm, lineObj) + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight = widgetTopHeight(lineObj) + var begin = 0, end = lineObj.text.length, ltr = true + + var order = getOrder(lineObj, cm.doc.direction) + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) + (cm, lineObj, lineNo, preparedMeasure, order, x, y) + ltr = part.level != 1 + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1 + end = ltr ? part.to : part.from - 1 + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, boxAround = null + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch) + box.top += widgetHeight; box.bottom += widgetHeight + if (!boxIsAfter(box, x, y, false)) { return false } + if (box.top <= y && box.left <= x) { + chAround = ch + boxAround = box + } + return true + }, begin, end) + + var baseX, sticky, outside = false + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr + ch = chAround + (atStart ? 0 : 1) + sticky = atStart ? "after" : "before" + baseX = atLeft ? boxAround.left : boxAround.right + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { ch++ } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : + (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ? + "after" : "before" + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure) + baseX = coords.left + outside = y < coords.top || y >= coords.bottom + } + + ch = skipExtendingChars(lineObj.text, ch, 1) + return PosWithInfo(lineNo, ch, sticky, outside, x - baseX) +} + +function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], ltr = part.level != 1 + return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), + "line", lineObj, preparedMeasure), x, y, true) + }, 0, order.length - 1) + var part = order[index] + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1 + var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), + "line", lineObj, preparedMeasure) + if (boxIsAfter(start, x, y, true) && start.top > y) + { part = order[index - 1] } + } + return part +} + +function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { end-- } + var part = null, closestDist = null + for (var i = 0; i < order.length; i++) { + var p = order[i] + if (p.from >= end || p.to <= begin) { continue } + var ltr = p.level != 1 + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x + if (!part || closestDist > dist) { + part = p + closestDist = dist + } + } + if (!part) { part = order[order.length - 1] } + // Clip the part to the wrapped line. + if (part.from < begin) { part = {from: begin, to: part.to, level: part.level} } + if (part.to > end) { part = {from: part.from, to: end, level: part.level} } + return part +} + +var measureText +// Compute the default text height. +function textHeight(display) { + if (display.cachedTextHeight != null) { return display.cachedTextHeight } + if (measureText == null) { + measureText = elt("pre") + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")) + measureText.appendChild(elt("br")) + } + measureText.appendChild(document.createTextNode("x")) + } + removeChildrenAndAdd(display.measure, measureText) + var height = measureText.offsetHeight / 50 + if (height > 3) { display.cachedTextHeight = height } + removeChildren(display.measure) + return height || 1 +} + +// Compute the default character width. +function charWidth(display) { + if (display.cachedCharWidth != null) { return display.cachedCharWidth } + var anchor = elt("span", "xxxxxxxxxx") + var pre = elt("pre", [anchor]) + removeChildrenAndAdd(display.measure, pre) + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10 + if (width > 2) { display.cachedCharWidth = width } + return width || 10 +} + +// Do a bulk-read of the DOM positions and sizes needed to draw the +// view, so that we don't interleave reading and writing to the DOM. +function getDimensions(cm) { + var d = cm.display, left = {}, width = {} + var gutterLeft = d.gutters.clientLeft + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft + width[cm.options.gutters[i]] = n.clientWidth + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth} +} + +// Computes display.scroller.scrollLeft + display.gutters.offsetWidth, +// but using getBoundingClientRect to get a sub-pixel-accurate +// result. +function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left +} + +// Returns a function that estimates the height of a line, to use as +// first approximation until the line becomes visible (and is thus +// properly measurable). +function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3) + return function (line) { + if (lineIsHidden(cm.doc, line)) { return 0 } + + var widgetsHeight = 0 + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height } + } } + + if (wrapping) + { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } + else + { return widgetsHeight + th } + } +} + +function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm) + doc.iter(function (line) { + var estHeight = est(line) + if (estHeight != line.height) { updateLineHeight(line, estHeight) } + }) +} + +// Given a mouse event, find the corresponding position. If liberal +// is false, it checks whether a gutter or scrollbar was clicked, +// and returns null if it was. forRect is used by rectangular +// selections, and tries to estimate a character position even for +// coordinates beyond the right of the text. +function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } + + var x, y, space = display.lineSpace.getBoundingClientRect() + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top } + catch (e) { return null } + var coords = coordsChar(cm, x, y), line + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)) + } + return coords +} + +// Find the view element corresponding to a given line. Return null +// when the line isn't visible. +function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { return null } + n -= cm.display.viewFrom + if (n < 0) { return null } + var view = cm.display.view + for (var i = 0; i < view.length; i++) { + n -= view[i].size + if (n < 0) { return i } + } +} + +function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()) +} + +function prepareSelection(cm, primary) { + if ( primary === void 0 ) primary = true; + + var doc = cm.doc, result = {} + var curFragment = result.cursors = document.createDocumentFragment() + var selFragment = result.selection = document.createDocumentFragment() + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (!primary && i == doc.sel.primIndex) { continue } + var range = doc.sel.ranges[i] + if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } + var collapsed = range.empty() + if (collapsed || cm.options.showCursorWhenSelecting) + { drawSelectionCursor(cm, range.head, curFragment) } + if (!collapsed) + { drawSelectionRange(cm, range, selFragment) } + } + return result +} + +// Draws a cursor for the given range +function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine) + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")) + cursor.style.left = pos.left + "px" + cursor.style.top = pos.top + "px" + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px" + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")) + otherCursor.style.display = "" + otherCursor.style.left = pos.other.left + "px" + otherCursor.style.top = pos.other.top + "px" + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px" + } +} + +function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } + +// Draws the given range as a highlighted selection +function drawSelectionRange(cm, range, output) { + var display = cm.display, doc = cm.doc + var fragment = document.createDocumentFragment() + var padding = paddingH(cm.display), leftSide = padding.left + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right + var docLTR = doc.direction == "ltr" + + function add(left, top, width, bottom) { + if (top < 0) { top = 0 } + top = Math.round(top) + bottom = Math.round(bottom) + fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))) + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line) + var lineLen = lineObj.text.length + var start, end + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias) + } + + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos) + var prop = (dir == "ltr") == (side == "after") ? "left" : "right" + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1) + return coords(ch, prop)[prop] + } + + var order = getOrder(lineObj, doc.direction) + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr" + var fromPos = coords(from, ltr ? "left" : "right") + var toPos = coords(to - 1, ltr ? "right" : "left") + + var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen + var first = i == 0, last = !order || i == order.length - 1 + if (toPos.top - fromPos.top <= 3) { // Single line + var openLeft = (docLTR ? openStart : openEnd) && first + var openRight = (docLTR ? openEnd : openStart) && last + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right + add(left, fromPos.top, right - left, fromPos.bottom) + } else { // Multiple lines + var topLeft, topRight, botLeft, botRight + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left + topRight = docLTR ? rightSide : wrapX(from, dir, "before") + botLeft = docLTR ? leftSide : wrapX(to, dir, "after") + botRight = docLTR && openEnd && last ? rightSide : toPos.right + } else { + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before") + topRight = !docLTR && openStart && first ? rightSide : fromPos.right + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left + botRight = !docLTR ? rightSide : wrapX(to, dir, "after") + } + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom) + if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top) } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom) + } + + if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos } + if (cmpCoords(toPos, start) < 0) { start = toPos } + if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos } + if (cmpCoords(toPos, end) < 0) { end = toPos } + }) + return {start: start, end: end} + } + + var sFrom = range.from(), sTo = range.to() + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch) + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line) + var singleVLine = visualLine(fromLine) == visualLine(toLine) + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom) + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom) + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom) + } + } + if (leftEnd.bottom < rightStart.top) + { add(leftSide, leftEnd.bottom, null, rightStart.top) } + } + + output.appendChild(fragment) +} + +// Cursor-blinking +function restartBlink(cm) { + if (!cm.state.focused) { return } + var display = cm.display + clearInterval(display.blinker) + var on = true + display.cursorDiv.style.visibility = "" + if (cm.options.cursorBlinkRate > 0) + { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, + cm.options.cursorBlinkRate) } + else if (cm.options.cursorBlinkRate < 0) + { display.cursorDiv.style.visibility = "hidden" } +} + +function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm) } +} + +function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true + setTimeout(function () { if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false + onBlur(cm) + } }, 100) +} + +function onFocus(cm, e) { + if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false } + + if (cm.options.readOnly == "nocursor") { return } + if (!cm.state.focused) { + signal(cm, "focus", cm, e) + cm.state.focused = true + addClass(cm.display.wrapper, "CodeMirror-focused") + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset() + if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20) } // Issue #1730 + } + cm.display.input.receivedFocus() + } + restartBlink(cm) +} +function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { return } + + if (cm.state.focused) { + signal(cm, "blur", cm, e) + cm.state.focused = false + rmClass(cm.display.wrapper, "CodeMirror-focused") + } + clearInterval(cm.display.blinker) + setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150) +} + +// Read the actual heights of the rendered lines, and update their +// stored heights to match. +function updateHeightsInViewport(cm) { + var display = cm.display + var prevBottom = display.lineDiv.offsetTop + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], height = (void 0) + if (cur.hidden) { continue } + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight + height = bot - prevBottom + prevBottom = bot + } else { + var box = cur.node.getBoundingClientRect() + height = box.bottom - box.top + } + var diff = cur.line.height - height + if (height < 2) { height = textHeight(display) } + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height) + updateWidgetHeight(cur.line) + if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) + { updateWidgetHeight(cur.rest[j]) } } + } + } +} + +// Read and store the height of line widgets associated with the +// given line. +function updateWidgetHeight(line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], parent = w.node.parentNode + if (parent) { w.height = parent.offsetHeight } + } } +} + +// Compute the lines that are visible in a given viewport (defaults +// the the current scroll position). viewport may contain top, +// height, and ensure (see op.scrollToPos) properties. +function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop + top = Math.floor(top - paddingTop(display)) + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom) + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line + if (ensureFrom < from) { + from = ensureFrom + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight) + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight) + to = ensureTo + } + } + return {from: from, to: Math.max(to, from + 1)} +} + +// Re-align line numbers and gutter marks to compensate for +// horizontal scrolling. +function alignHorizontally(cm) { + var display = cm.display, view = display.view + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft + var gutterW = display.gutters.offsetWidth, left = comp + "px" + for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) + { view[i].gutter.style.left = left } + if (view[i].gutterBackground) + { view[i].gutterBackground.style.left = left } + } + var align = view[i].alignable + if (align) { for (var j = 0; j < align.length; j++) + { align[j].style.left = left } } + } } + if (cm.options.fixedGutter) + { display.gutters.style.left = (comp + gutterW) + "px" } +} + +// Used to ensure that the line number gutter is still the right +// size for the current document size. Returns true when an update +// is needed. +function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { return false } + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")) + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW + display.lineGutter.style.width = "" + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1 + display.lineNumWidth = display.lineNumInnerWidth + padding + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1 + display.lineGutter.style.width = display.lineNumWidth + "px" + updateGutterSpace(cm) + return true + } + return false +} + +// SCROLLING THINGS INTO VIEW + +// If an editor sits on the top or bottom of the window, partially +// scrolled out of view, this ensures that the cursor is visible. +function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null + if (rect.top + box.top < 0) { doScroll = true } + else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")) + cm.display.lineSpace.appendChild(scrollNode) + scrollNode.scrollIntoView(doScroll) + cm.display.lineSpace.removeChild(scrollNode) + } +} + +// Scroll a given position into view (immediately), verifying that +// it actually became visible (as line heights are accurately +// measured, the position of something may 'drift' during drawing). +function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { margin = 0 } + var rect + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos + } + for (var limit = 0; limit < 5; limit++) { + var changed = false + var coords = cursorCoords(cm, pos) + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end) + rect = {left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin} + var scrollPos = calculateScrollPos(cm, rect) + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop) + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft) + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true } + } + if (!changed) { break } + } + return rect +} + +// Scroll a given set of coordinates into view (immediately). +function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect) + if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) } + if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) } +} + +// Calculate a new scroll position needed to scroll the given +// rectangle into view. Returns an object with scrollTop and +// scrollLeft properties. When these are undefined, the +// vertical/horizontal position does not need to be adjusted. +function calculateScrollPos(cm, rect) { + var display = cm.display, snapMargin = textHeight(cm.display) + if (rect.top < 0) { rect.top = 0 } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop + var screen = displayHeight(cm), result = {} + if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen } + var docBottom = cm.doc.height + paddingVert(display) + var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen) + if (newTop != screentop) { result.scrollTop = newTop } + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0) + var tooWide = rect.right - rect.left > screenw + if (tooWide) { rect.right = rect.left + screenw } + if (rect.left < 10) + { result.scrollLeft = 0 } + else if (rect.left < screenleft) + { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) } + else if (rect.right > screenw + screenleft - 3) + { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw } + return result +} + +// Store a relative adjustment to the scroll position in the current +// operation (to be applied when the operation finishes). +function addToScrollTop(cm, top) { + if (top == null) { return } + resolveScrollToPos(cm) + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top +} + +// Make sure that at the end of the operation the current cursor is +// shown. +function ensureCursorVisible(cm) { + resolveScrollToPos(cm) + var cur = cm.getCursor() + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin} +} + +function scrollToCoords(cm, x, y) { + if (x != null || y != null) { resolveScrollToPos(cm) } + if (x != null) { cm.curOp.scrollLeft = x } + if (y != null) { cm.curOp.scrollTop = y } +} + +function scrollToRange(cm, range) { + resolveScrollToPos(cm) + cm.curOp.scrollToPos = range +} + +// When an operation has its scrollToPos property set, and another +// scroll action is applied before the end of the operation, this +// 'simulates' scrolling that position into view in a cheap way, so +// that the effect of intermediate scroll commands is not ignored. +function resolveScrollToPos(cm) { + var range = cm.curOp.scrollToPos + if (range) { + cm.curOp.scrollToPos = null + var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to) + scrollToCoordsRange(cm, from, to, range.margin) + } +} + +function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }) + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop) +} + +// Sync the scrollable area and scrollbars, ensure the viewport +// covers the visible area. +function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { return } + if (!gecko) { updateDisplaySimple(cm, {top: val}) } + setScrollTop(cm, val, true) + if (gecko) { updateDisplaySimple(cm) } + startWorker(cm, 100) +} + +function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val) + if (cm.display.scroller.scrollTop == val && !forceScroll) { return } + cm.doc.scrollTop = val + cm.display.scrollbars.setScrollTop(val) + if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val } +} + +// Sync scroller and scrollbar, ensure the gutter elements are +// aligned. +function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth) + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } + cm.doc.scrollLeft = val + alignHorizontally(cm) + if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val } + cm.display.scrollbars.setScrollLeft(val) +} + +// SCROLLBARS + +// Prepare DOM reads needed to update the scrollbars. Done in one +// shot to minimize update/measure roundtrips. +function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth + var docH = Math.round(cm.doc.height + paddingVert(cm.display)) + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + } +} + +var NativeScrollbars = function(place, scroll, cm) { + this.cm = cm + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar") + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar") + place(vert); place(horiz) + + on(vert, "scroll", function () { + if (vert.clientHeight) { scroll(vert.scrollTop, "vertical") } + }) + on(horiz, "scroll", function () { + if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal") } + }) + + this.checkedZeroWidth = false + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px" } +}; + +NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1 + var needsV = measure.scrollHeight > measure.clientHeight + 1 + var sWidth = measure.nativeBarWidth + + if (needsV) { + this.vert.style.display = "block" + this.vert.style.bottom = needsH ? sWidth + "px" : "0" + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0) + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px" + } else { + this.vert.style.display = "" + this.vert.firstChild.style.height = "0" + } + + if (needsH) { + this.horiz.style.display = "block" + this.horiz.style.right = needsV ? sWidth + "px" : "0" + this.horiz.style.left = measure.barLeft + "px" + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0) + this.horiz.firstChild.style.width = + Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px" + } else { + this.horiz.style.display = "" + this.horiz.firstChild.style.width = "0" + } + + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { this.zeroWidthHack() } + this.checkedZeroWidth = true + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} +}; + +NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos } + if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz") } +}; + +NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos } + if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert") } +}; + +NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px" + this.horiz.style.height = this.vert.style.width = w + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none" + this.disableHoriz = new Delayed + this.disableVert = new Delayed +}; + +NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto" + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect() + var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) + : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1) + if (elt != bar) { bar.style.pointerEvents = "none" } + else { delay.set(1000, maybeDisable) } + } + delay.set(1000, maybeDisable) +}; + +NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode + parent.removeChild(this.horiz) + parent.removeChild(this.vert) +}; + +var NullScrollbars = function () {}; + +NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; +NullScrollbars.prototype.setScrollLeft = function () {}; +NullScrollbars.prototype.setScrollTop = function () {}; +NullScrollbars.prototype.clear = function () {}; + +function updateScrollbars(cm, measure) { + if (!measure) { measure = measureForScrollbars(cm) } + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight + updateScrollbarsInner(cm, measure) + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + { updateHeightsInViewport(cm) } + updateScrollbarsInner(cm, measureForScrollbars(cm)) + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight + } +} + +// Re-synchronize the fake scrollbars with the actual size of the +// content. +function updateScrollbarsInner(cm, measure) { + var d = cm.display + var sizes = d.scrollbars.update(measure) + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px" + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px" + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent" + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block" + d.scrollbarFiller.style.height = sizes.bottom + "px" + d.scrollbarFiller.style.width = sizes.right + "px" + } else { d.scrollbarFiller.style.display = "" } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block" + d.gutterFiller.style.height = sizes.bottom + "px" + d.gutterFiller.style.width = measure.gutterWidth + "px" + } else { d.gutterFiller.style.display = "" } +} + +var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars} + +function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear() + if (cm.display.scrollbars.addClass) + { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass) } + } + + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller) + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0) } + }) + node.setAttribute("cm-not-content", "true") + }, function (pos, axis) { + if (axis == "horizontal") { setScrollLeft(cm, pos) } + else { updateScrollTop(cm, pos) } + }, cm) + if (cm.display.scrollbars.addClass) + { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) } +} + +// Operations are used to wrap a series of changes to the editor +// state in such a way that each change won't have to update the +// cursor and display (which would be awkward, slow, and +// error-prone). Instead, display updates are batched and then all +// combined and executed at once. + +var nextOpId = 0 +// Start a new operation. +function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: null, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + } + pushOperation(cm.curOp) +} + +// Finish an operation, updating the display and signalling delayed events +function endOperation(cm) { + var op = cm.curOp + finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) + { group.ops[i].cm.curOp = null } + endOperations(group) + }) +} + +// The DOM updates done when an operation finishes are batched so +// that the minimum number of relayouts are required. +function endOperations(group) { + var ops = group.ops + for (var i = 0; i < ops.length; i++) // Read DOM + { endOperation_R1(ops[i]) } + for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) + { endOperation_W1(ops[i$1]) } + for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM + { endOperation_R2(ops[i$2]) } + for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) + { endOperation_W2(ops[i$3]) } + for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM + { endOperation_finish(ops[i$4]) } +} + +function endOperation_R1(op) { + var cm = op.cm, display = cm.display + maybeClipScrollbars(cm) + if (op.updateMaxLine) { findMaxLine(cm) } + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate) +} + +function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update) +} + +function endOperation_R2(op) { + var cm = op.cm, display = cm.display + if (op.updatedDisplay) { updateHeightsInViewport(cm) } + + op.barMeasure = measureForScrollbars(cm) + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3 + cm.display.sizerWidth = op.adjustWidthTo + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth) + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)) + } + + if (op.updatedDisplay || op.selectionChanged) + { op.preparedSelection = display.input.prepareSelection() } +} + +function endOperation_W2(op) { + var cm = op.cm + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px" + if (op.maxScrollLeft < cm.doc.scrollLeft) + { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true) } + cm.display.maxLineChanged = false + } + + var takeFocus = op.focus && op.focus == activeElt() + if (op.preparedSelection) + { cm.display.input.showSelection(op.preparedSelection, takeFocus) } + if (op.updatedDisplay || op.startHeight != cm.doc.height) + { updateScrollbars(cm, op.barMeasure) } + if (op.updatedDisplay) + { setDocumentHeight(cm, op.barMeasure) } + + if (op.selectionChanged) { restartBlink(cm) } + + if (cm.state.focused && op.updateInput) + { cm.display.input.reset(op.typing) } + if (takeFocus) { ensureFocus(op.cm) } +} + +function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc + + if (op.updatedDisplay) { postUpdateDisplay(cm, op.update) } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + { display.wheelStartX = display.wheelStartY = null } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) } + + if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin) + maybeScrollWindow(cm, rect) + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers + if (hidden) { for (var i = 0; i < hidden.length; ++i) + { if (!hidden[i].lines.length) { signal(hidden[i], "hide") } } } + if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) + { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide") } } } + + if (display.wrapper.offsetHeight) + { doc.scrollTop = cm.display.scroller.scrollTop } + + // Fire change events, and delayed event handlers + if (op.changeObjs) + { signal(cm, "changes", cm, op.changeObjs) } + if (op.update) + { op.update.finish() } +} + +// Run the given function in an operation +function runInOp(cm, f) { + if (cm.curOp) { return f() } + startOperation(cm) + try { return f() } + finally { endOperation(cm) } +} +// Wraps a function in an operation. Returns the wrapped function. +function operation(cm, f) { + return function() { + if (cm.curOp) { return f.apply(cm, arguments) } + startOperation(cm) + try { return f.apply(cm, arguments) } + finally { endOperation(cm) } + } +} +// Used to add methods to editor and doc instances, wrapping them in +// operations. +function methodOp(f) { + return function() { + if (this.curOp) { return f.apply(this, arguments) } + startOperation(this) + try { return f.apply(this, arguments) } + finally { endOperation(this) } + } +} +function docMethodOp(f) { + return function() { + var cm = this.cm + if (!cm || cm.curOp) { return f.apply(this, arguments) } + startOperation(cm) + try { return f.apply(this, arguments) } + finally { endOperation(cm) } + } +} + +// Updates the display.view data structure for a given change to the +// document. From and to are in pre-change coordinates. Lendiff is +// the amount of lines added or subtracted by the change. This is +// used for changes that span multiple lines, or change the way +// lines are divided into visual lines. regLineChange (below) +// registers single-line changes. +function regChange(cm, from, to, lendiff) { + if (from == null) { from = cm.doc.first } + if (to == null) { to = cm.doc.first + cm.doc.size } + if (!lendiff) { lendiff = 0 } + + var display = cm.display + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + { display.updateLineNumbers = from } + + cm.curOp.viewChanged = true + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + { resetView(cm) } + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm) + } else { + display.viewFrom += lendiff + display.viewTo += lendiff + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm) + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1) + if (cut) { + display.view = display.view.slice(cut.index) + display.viewFrom = cut.lineN + display.viewTo += lendiff + } else { + resetView(cm) + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1) + if (cut$1) { + display.view = display.view.slice(0, cut$1.index) + display.viewTo = cut$1.lineN + } else { + resetView(cm) + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1) + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1) + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)) + display.viewTo += lendiff + } else { + resetView(cm) + } + } + + var ext = display.externalMeasured + if (ext) { + if (to < ext.lineN) + { ext.lineN += lendiff } + else if (from < ext.lineN + ext.size) + { display.externalMeasured = null } + } +} + +// Register a change to a single line. Type must be one of "text", +// "gutter", "class", "widget" +function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true + var display = cm.display, ext = cm.display.externalMeasured + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + { display.externalMeasured = null } + + if (line < display.viewFrom || line >= display.viewTo) { return } + var lineView = display.view[findViewIndex(cm, line)] + if (lineView.node == null) { return } + var arr = lineView.changes || (lineView.changes = []) + if (indexOf(arr, type) == -1) { arr.push(type) } +} + +// Clear the view. +function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first + cm.display.view = [] + cm.display.viewOffset = 0 +} + +function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + { return {index: index, lineN: newN} } + var n = cm.display.viewFrom + for (var i = 0; i < index; i++) + { n += view[i].size } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { return null } + diff = (n + view[index].size) - oldN + index++ + } else { + diff = n - oldN + } + oldN += diff; newN += diff + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { return null } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size + index += dir + } + return {index: index, lineN: newN} +} + +// Force the view to cover a given range, adding empty view element +// or clipping off existing ones as needed. +function adjustView(cm, from, to) { + var display = cm.display, view = display.view + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to) + display.viewFrom = from + } else { + if (display.viewFrom > from) + { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) } + else if (display.viewFrom < from) + { display.view = display.view.slice(findViewIndex(cm, from)) } + display.viewFrom = from + if (display.viewTo < to) + { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) } + else if (display.viewTo > to) + { display.view = display.view.slice(0, findViewIndex(cm, to)) } + } + display.viewTo = to +} + +// Count the number of lines in the view whose DOM representation is +// out of date (or nonexistent). +function countDirtyView(cm) { + var view = cm.display.view, dirty = 0 + for (var i = 0; i < view.length; i++) { + var lineView = view[i] + if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty } + } + return dirty +} + +// HIGHLIGHT WORKER + +function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) + { cm.state.highlight.set(time, bind(highlightWorker, cm)) } +} + +function highlightWorker(cm) { + var doc = cm.doc + if (doc.highlightFrontier >= cm.display.viewTo) { return } + var end = +new Date + cm.options.workTime + var context = getContextBefore(cm, doc.highlightFrontier) + var changedLines = [] + + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null + var highlighted = highlightLine(cm, line, context, true) + if (resetState) { context.state = resetState } + line.styles = highlighted.styles + var oldCls = line.styleClasses, newCls = highlighted.classes + if (newCls) { line.styleClasses = newCls } + else if (oldCls) { line.styleClasses = null } + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass) + for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] } + if (ischange) { changedLines.push(context.line) } + line.stateAfter = context.save() + context.nextLine() + } else { + if (line.text.length <= cm.options.maxHighlightLength) + { processLine(cm, line.text, context) } + line.stateAfter = context.line % 5 == 0 ? context.save() : null + context.nextLine() + } + if (+new Date > end) { + startWorker(cm, cm.options.workDelay) + return true + } + }) + doc.highlightFrontier = context.line + doc.modeFrontier = Math.max(doc.modeFrontier, context.line) + if (changedLines.length) { runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) + { regLineChange(cm, changedLines[i], "text") } + }) } +} + +// DISPLAY DRAWING + +var DisplayUpdate = function(cm, viewport, force) { + var display = cm.display + + this.viewport = viewport + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport) + this.editorIsHidden = !display.wrapper.offsetWidth + this.wrapperHeight = display.wrapper.clientHeight + this.wrapperWidth = display.wrapper.clientWidth + this.oldDisplayWidth = displayWidth(cm) + this.force = force + this.dims = getDimensions(cm) + this.events = [] +}; + +DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) + { this.events.push(arguments) } +}; +DisplayUpdate.prototype.finish = function () { + var this$1 = this; + + for (var i = 0; i < this.events.length; i++) + { signal.apply(null, this$1.events[i]) } +}; + +function maybeClipScrollbars(cm) { + var display = cm.display + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth + display.heightForcer.style.height = scrollGap(cm) + "px" + display.sizer.style.marginBottom = -display.nativeBarWidth + "px" + display.sizer.style.borderRightWidth = scrollGap(cm) + "px" + display.scrollbarsClipped = true + } +} + +function selectionSnapshot(cm) { + if (cm.hasFocus()) { return null } + var active = activeElt() + if (!active || !contains(cm.display.lineDiv, active)) { return null } + var result = {activeElt: active} + if (window.getSelection) { + var sel = window.getSelection() + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode + result.anchorOffset = sel.anchorOffset + result.focusNode = sel.focusNode + result.focusOffset = sel.focusOffset + } + } + return result +} + +function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } + snapshot.activeElt.focus() + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), range = document.createRange() + range.setEnd(snapshot.anchorNode, snapshot.anchorOffset) + range.collapse(false) + sel.removeAllRanges() + sel.addRange(range) + sel.extend(snapshot.focusNode, snapshot.focusOffset) + } +} + +// Does the actual updating of the line display. Bails out +// (returning false) when there is nothing to be done and forced is +// false. +function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc + + if (update.editorIsHidden) { + resetView(cm) + return false + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + { return false } + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm) + update.dims = getDimensions(cm) + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first) + var to = Math.min(end, update.visible.to + cm.options.viewportMargin) + if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom) } + if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo) } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from) + to = visualLineEndNo(cm.doc, to) + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth + adjustView(cm, from, to) + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)) + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px" + + var toUpdate = countDirtyView(cm) + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + { return false } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm) + if (toUpdate > 4) { display.lineDiv.style.display = "none" } + patchDisplay(cm, display.updateLineNumbers, update.dims) + if (toUpdate > 4) { display.lineDiv.style.display = "" } + display.renderedView = display.view + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot) + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv) + removeChildren(display.selectionDiv) + display.gutters.style.height = display.sizer.style.minHeight = 0 + + if (different) { + display.lastWrapHeight = update.wrapperHeight + display.lastWrapWidth = update.wrapperWidth + startWorker(cm, 400) + } + + display.updateLineNumbers = null + + return true +} + +function postUpdateDisplay(cm, update) { + var viewport = update.viewport + + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)} } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport) + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + { break } + } + if (!updateDisplayIfNeeded(cm, update)) { break } + updateHeightsInViewport(cm) + var barMeasure = measureForScrollbars(cm) + updateSelection(cm) + updateScrollbars(cm, barMeasure) + setDocumentHeight(cm, barMeasure) + update.force = false + } + + update.signal(cm, "update", cm) + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo) + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo + } +} + +function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport) + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm) + postUpdateDisplay(cm, update) + var barMeasure = measureForScrollbars(cm) + updateSelection(cm) + updateScrollbars(cm, barMeasure) + setDocumentHeight(cm, barMeasure) + update.finish() + } +} + +// Sync the actual display DOM structure with display.view, removing +// nodes for lines that are no longer in view, and creating the ones +// that are not there yet, and updating the ones that are out of +// date. +function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers + var container = display.lineDiv, cur = container.firstChild + + function rm(node) { + var next = node.nextSibling + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + { node.style.display = "none" } + else + { node.parentNode.removeChild(node) } + return next + } + + var view = display.view, lineN = display.viewFrom + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i] + if (lineView.hidden) { + } else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims) + container.insertBefore(node, cur) + } else { // Already drawn + while (cur != lineView.node) { cur = rm(cur) } + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false } + updateLineForChanges(cm, lineView, lineN, dims) + } + if (updateNumber) { + removeChildren(lineView.lineNumber) + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))) + } + cur = lineView.node.nextSibling + } + lineN += lineView.size + } + while (cur) { cur = rm(cur) } +} + +function updateGutterSpace(cm) { + var width = cm.display.gutters.offsetWidth + cm.display.sizer.style.marginLeft = width + "px" +} + +function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px" + cm.display.heightForcer.style.top = measure.docHeight + "px" + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px" +} + +// Rebuild the gutter elements, ensure the margin to the left of the +// code matches their width. +function updateGutters(cm) { + var gutters = cm.display.gutters, specs = cm.options.gutters + removeChildren(gutters) + var i = 0 + for (; i < specs.length; ++i) { + var gutterClass = specs[i] + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)) + if (gutterClass == "CodeMirror-linenumbers") { + cm.display.lineGutter = gElt + gElt.style.width = (cm.display.lineNumWidth || 1) + "px" + } + } + gutters.style.display = i ? "" : "none" + updateGutterSpace(cm) +} + +// Make sure the gutters options contains the element +// "CodeMirror-linenumbers" when the lineNumbers option is true. +function setGuttersForLineNumbers(options) { + var found = indexOf(options.gutters, "CodeMirror-linenumbers") + if (found == -1 && options.lineNumbers) { + options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]) + } else if (found > -1 && !options.lineNumbers) { + options.gutters = options.gutters.slice(0) + options.gutters.splice(found, 1) + } +} + +var wheelSamples = 0; +var wheelPixelsPerUnit = null; +// Fill in a browser-detected starting value on browsers where we +// know one. These don't have to be accurate -- the result of them +// being wrong would just be a slight flicker on the first wheel +// scroll (if it is large enough). +if (ie) { wheelPixelsPerUnit = -.53 } +else if (gecko) { wheelPixelsPerUnit = 15 } +else if (chrome) { wheelPixelsPerUnit = -.7 } +else if (safari) { wheelPixelsPerUnit = -1/3 } + +function wheelEventDelta(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail } + else if (dy == null) { dy = e.wheelDelta } + return {x: dx, y: dy} +} +function wheelEventPixels(e) { + var delta = wheelEventDelta(e) + delta.x *= wheelPixelsPerUnit + delta.y *= wheelPixelsPerUnit + return delta +} + +function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y + + var display = cm.display, scroll = display.scroller + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth + var canScrollY = scroll.scrollHeight > scroll.clientHeight + if (!(dx && canScrollX || dy && canScrollY)) { return } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur + break outer + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) + { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)) + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + { e_preventDefault(e) } + display.wheelStartX = null // Abort measurement, if in progress + return + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight + if (pixels < 0) { top = Math.max(0, top + pixels - 50) } + else { bot = Math.min(cm.doc.height, bot + pixels + 50) } + updateDisplaySimple(cm, {top: top, bottom: bot}) + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop + display.wheelDX = dx; display.wheelDY = dy + setTimeout(function () { + if (display.wheelStartX == null) { return } + var movedX = scroll.scrollLeft - display.wheelStartX + var movedY = scroll.scrollTop - display.wheelStartY + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX) + display.wheelStartX = display.wheelStartY = null + if (!sample) { return } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1) + ++wheelSamples + }, 200) + } else { + display.wheelDX += dx; display.wheelDY += dy + } + } +} + +// Selection objects are immutable. A new one is created every time +// the selection changes. A selection is one or more non-overlapping +// (and non-touching) ranges, sorted, and an integer that indicates +// which one is the primary selection (the one that's scrolled into +// view, that getCursor returns, etc). +var Selection = function(ranges, primIndex) { + this.ranges = ranges + this.primIndex = primIndex +}; + +Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; + +Selection.prototype.equals = function (other) { + var this$1 = this; + + if (other == this) { return true } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], there = other.ranges[i] + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } + } + return true +}; + +Selection.prototype.deepCopy = function () { + var this$1 = this; + + var out = [] + for (var i = 0; i < this.ranges.length; i++) + { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)) } + return new Selection(out, this.primIndex) +}; + +Selection.prototype.somethingSelected = function () { + var this$1 = this; + + for (var i = 0; i < this.ranges.length; i++) + { if (!this$1.ranges[i].empty()) { return true } } + return false +}; + +Selection.prototype.contains = function (pos, end) { + var this$1 = this; + + if (!end) { end = pos } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i] + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + { return i } + } + return -1 +}; + +var Range = function(anchor, head) { + this.anchor = anchor; this.head = head +}; + +Range.prototype.from = function () { return minPos(this.anchor, this.head) }; +Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; +Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; + +// Take an unsorted, potentially overlapping set of ranges, and +// build a selection out of it. 'Consumes' ranges array (modifying +// it). +function normalizeSelection(ranges, primIndex) { + var prim = ranges[primIndex] + ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }) + primIndex = indexOf(ranges, prim) + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1] + if (cmp(prev.to(), cur.from()) >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()) + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head + if (i <= primIndex) { --primIndex } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)) + } + } + return new Selection(ranges, primIndex) +} + +function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0) +} + +// Compute the position of the end of a change (its 'to' property +// refers to the pre-change end). +function changeEnd(change) { + if (!change.text) { return change.to } + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) +} + +// Adjust a position to refer to the post-change position of the +// same text, or the end of the change if the change covers it. +function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { return pos } + if (cmp(pos, change.to) <= 0) { return changeEnd(change) } + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch + if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch } + return Pos(line, ch) +} + +function computeSelAfterChange(doc, change) { + var out = [] + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i] + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))) + } + return normalizeSelection(out, doc.sel.primIndex) +} + +function offsetPos(pos, old, nw) { + if (pos.line == old.line) + { return Pos(nw.line, pos.ch - old.ch + nw.ch) } + else + { return Pos(nw.line + (pos.line - old.line), pos.ch) } +} + +// Used by replaceSelections to allow moving the selection to the +// start or around the replaced test. Hint may be "start" or "around". +function computeReplacedSel(doc, changes, hint) { + var out = [] + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev + for (var i = 0; i < changes.length; i++) { + var change = changes[i] + var from = offsetPos(change.from, oldPrev, newPrev) + var to = offsetPos(changeEnd(change), oldPrev, newPrev) + oldPrev = change.to + newPrev = to + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0 + out[i] = new Range(inv ? to : from, inv ? from : to) + } else { + out[i] = new Range(from, from) + } + } + return new Selection(out, doc.sel.primIndex) +} + +// Used to get the editor into a consistent state again when options change. + +function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption) + resetModeState(cm) +} + +function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { line.stateAfter = null } + if (line.styles) { line.styles = null } + }) + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first + startWorker(cm, 100) + cm.state.modeGen++ + if (cm.curOp) { regChange(cm) } +} + +// DOCUMENT DATA STRUCTURE + +// By default, updates that start and end at the beginning of a line +// are treated specially, in order to make the association of line +// widgets and marker elements with the text behave more intuitive. +function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore) +} + +// Perform a change on the document data structure. +function updateDoc(doc, change, markedSpans, estimateHeight) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight) + signalLater(line, "change", line, change) + } + function linesFor(start, end) { + var result = [] + for (var i = start; i < end; ++i) + { result.push(new Line(text[i], spansFor(i), estimateHeight)) } + return result + } + + var from = change.from, to = change.to, text = change.text + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line) + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)) + doc.remove(text.length, doc.size - text.length) + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1) + update(lastLine, lastLine.text, lastSpans) + if (nlines) { doc.remove(from.line, nlines) } + if (added.length) { doc.insert(from.line, added) } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans) + } else { + var added$1 = linesFor(1, text.length - 1) + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)) + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) + doc.insert(from.line + 1, added$1) + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)) + doc.remove(from.line + 1, nlines) + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)) + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans) + var added$2 = linesFor(1, text.length - 1) + if (nlines > 1) { doc.remove(from.line + 1, nlines - 1) } + doc.insert(from.line + 1, added$2) + } + + signalLater(doc, "change", doc, change) +} + +// Call f for all linked documents. +function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i] + if (rel.doc == skip) { continue } + var shared = sharedHist && rel.sharedHist + if (sharedHistOnly && !shared) { continue } + f(rel.doc, shared) + propagate(rel.doc, doc, shared) + } } + } + propagate(doc, null, true) +} + +// Attach a document to an editor. +function attachDoc(cm, doc) { + if (doc.cm) { throw new Error("This document is already in use.") } + cm.doc = doc + doc.cm = cm + estimateLineHeights(cm) + loadMode(cm) + setDirectionClass(cm) + if (!cm.options.lineWrapping) { findMaxLine(cm) } + cm.options.mode = doc.modeOption + regChange(cm) +} + +function setDirectionClass(cm) { + ;(cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl") +} + +function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm) + regChange(cm) + }) +} + +function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = [] + this.undoDepth = Infinity + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0 + this.lastOp = this.lastSelOp = null + this.lastOrigin = this.lastSelOrigin = null + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1 +} + +// Create a history change event from an updateDoc-style change +// object. +function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)} + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1) + linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true) + return histChange +} + +// Pop all selection events off the end of a history array. Stop at +// a change event. +function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array) + if (last.ranges) { array.pop() } + else { break } + } +} + +// Find the top change event in the history. Pop off selection +// events that are in the way. +function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done) + return lst(hist.done) + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done) + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop() + return lst(hist.done) + } +} + +// Register a change in the history. Merges changes that are within +// a single operation, or are close together with an origin that +// allows merging (starting with "+") into a single event. +function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history + hist.undone.length = 0 + var time = +new Date, cur + var last + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes) + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change) + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)) + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done) + if (!before || !before.ranges) + { pushSelectionToHistory(doc.sel, hist.done) } + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation} + hist.done.push(cur) + while (hist.done.length > hist.undoDepth) { + hist.done.shift() + if (!hist.done[0].ranges) { hist.done.shift() } + } + } + hist.done.push(selAfter) + hist.generation = ++hist.maxGeneration + hist.lastModTime = hist.lastSelTime = time + hist.lastOp = hist.lastSelOp = opId + hist.lastOrigin = hist.lastSelOrigin = change.origin + + if (!last) { signal(doc, "historyAdded") } +} + +function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0) + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) +} + +// Called whenever the selection changes, sets the new selection as +// the pending selection in the history, and pushes the old pending +// selection into the 'done' array when it was significantly +// different (in number of selected ranges, emptiness, or time). +function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + { hist.done[hist.done.length - 1] = sel } + else + { pushSelectionToHistory(sel, hist.done) } + + hist.lastSelTime = +new Date + hist.lastSelOrigin = origin + hist.lastSelOp = opId + if (options && options.clearRedo !== false) + { clearSelectionEvents(hist.undone) } +} + +function pushSelectionToHistory(sel, dest) { + var top = lst(dest) + if (!(top && top.ranges && top.equals(sel))) + { dest.push(sel) } +} + +// Used to store marked span information in the history. +function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0 + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) + { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans } + ++n + }) +} + +// When un/re-doing restores text containing marked spans, those +// that have been explicitly cleared should not be restored. +function removeClearedSpans(spans) { + if (!spans) { return null } + var out + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i) } } + else if (out) { out.push(spans[i]) } + } + return !out ? spans : out.length ? out : null +} + +// Retrieve and filter the old marked spans stored in a change event. +function getOldSpans(doc, change) { + var found = change["spans_" + doc.id] + if (!found) { return null } + var nw = [] + for (var i = 0; i < change.text.length; ++i) + { nw.push(removeClearedSpans(found[i])) } + return nw +} + +// Used for un/re-doing changes from the history. Combines the +// result of computing the existing spans with the set of spans that +// existed in the history (so that deleting around a span and then +// undoing brings back the span). +function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change) + var stretched = stretchSpansOverChange(doc, change) + if (!old) { return stretched } + if (!stretched) { return old } + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i] + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j] + for (var k = 0; k < oldCur.length; ++k) + { if (oldCur[k].marker == span.marker) { continue spans } } + oldCur.push(span) + } + } else if (stretchCur) { + old[i] = stretchCur + } + } + return old +} + +// Used both to provide a JSON-safe object in .getHistory, and, when +// detaching a document, to split the history in two +function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = [] + for (var i = 0; i < events.length; ++i) { + var event = events[i] + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event) + continue + } + var changes = event.changes, newChanges = [] + copy.push({changes: newChanges}) + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m = (void 0) + newChanges.push({from: change.from, to: change.to, text: change.text}) + if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop] + delete change[prop] + } + } } } + } + } + return copy +} + +// The 'scroll' parameter given to many of these indicated whether +// the new cursor position should be scrolled into view after +// modifying the selection. + +// If shift is held or the extend flag is set, extends a range to +// include a given position (and optionally a second position). +// Otherwise, simply returns the range between the given positions. +// Used for cursor motion and such. +function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor + if (other) { + var posBefore = cmp(head, anchor) < 0 + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head + head = other + } else if (posBefore != (cmp(head, other) < 0)) { + head = other + } + } + return new Range(anchor, head) + } else { + return new Range(other || head, head) + } +} + +// Extend the primary selection range, discard the rest. +function extendSelection(doc, head, other, options, extend) { + if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options) +} + +// Extend all selections (pos is an array of selections with length +// equal the number of selections) +function extendSelections(doc, heads, options) { + var out = [] + var extend = doc.cm && (doc.cm.display.shift || doc.extend) + for (var i = 0; i < doc.sel.ranges.length; i++) + { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) } + var newSel = normalizeSelection(out, doc.sel.primIndex) + setSelection(doc, newSel, options) +} + +// Updates a single range in the selection. +function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0) + ranges[i] = range + setSelection(doc, normalizeSelection(ranges, doc.sel.primIndex), options) +} + +// Reset the selection to a single range. +function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options) +} + +// Give beforeSelectionChange handlers a change to influence a +// selection update. +function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + var this$1 = this; + + this.ranges = [] + for (var i = 0; i < ranges.length; i++) + { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)) } + }, + origin: options && options.origin + } + signal(doc, "beforeSelectionChange", doc, obj) + if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj) } + if (obj.ranges != sel.ranges) { return normalizeSelection(obj.ranges, obj.ranges.length - 1) } + else { return sel } +} + +function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done) + if (last && last.ranges) { + done[done.length - 1] = sel + setSelectionNoUndo(doc, sel, options) + } else { + setSelection(doc, sel, options) + } +} + +// Set a new selection. +function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options) + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options) +} + +function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + { sel = filterSelectionChange(doc, sel, options) } + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1) + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)) + + if (!(options && options.scroll === false) && doc.cm) + { ensureCursorVisible(doc.cm) } +} + +function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { return } + + doc.sel = sel + + if (doc.cm) { + doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged = true + signalCursorActivity(doc.cm) + } + signalLater(doc, "cursorActivity", doc) +} + +// Verify that the selection does not partially select any atomic +// marked ranges. +function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)) +} + +// Return a selection that does not partially select any atomic +// ranges. +function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i] + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i] + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear) + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear) + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { out = sel.ranges.slice(0, i) } + out[i] = new Range(newAnchor, newHead) + } + } + return out ? normalizeSelection(out, sel.primIndex) : sel +} + +function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line) + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker + if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter") + if (m.explicitlyCleared) { + if (!line.markedSpans) { break } + else {--i; continue} + } + } + if (!m.atomic) { continue } + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff = (void 0) + if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) + { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null) } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + { return skipAtomicInner(doc, near, pos, dir, mayClear) } + } + + var far = m.find(dir < 0 ? -1 : 1) + if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight) + { far = movePos(doc, far, dir, far.line == pos.line ? line : null) } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null + } + } } + return pos +} + +// Ensure a given position is not inside an atomic range. +function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1 + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)) + if (!found) { + doc.cantEdit = true + return Pos(doc.first, 0) + } + return found +} + +function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } + else { return null } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } + else { return null } + } else { + return new Pos(pos.line, pos.ch + dir) + } +} + +function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll) +} + +// UPDATING + +// Allow "beforeChange" event handlers to influence a change +function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { return obj.canceled = true; } + } + if (update) { obj.update = function (from, to, text, origin) { + if (from) { obj.from = clipPos(doc, from) } + if (to) { obj.to = clipPos(doc, to) } + if (text) { obj.text = text } + if (origin !== undefined) { obj.origin = origin } + } } + signal(doc, "beforeChange", doc, obj) + if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj) } + + if (obj.canceled) { return null } + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} +} + +// Apply a change to a document, and add it to the document's +// history, and propagating it to all linked documents. +function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } + if (doc.cm.state.suppressEdits) { return } + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true) + if (!change) { return } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to) + if (split) { + for (var i = split.length - 1; i >= 0; --i) + { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}) } + } else { + makeChangeInner(doc, change) + } +} + +function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } + var selAfter = computeSelAfterChange(doc, change) + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN) + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)) + var rebased = [] + + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change) + rebased.push(doc.history) + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)) + }) +} + +// Revert a change stored in a document's history. +function makeChangeFromHistory(doc, type, allowSelectionOnly) { + if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return } + + var hist = doc.history, event, selAfter = doc.sel + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0 + for (; i < source.length; i++) { + event = source[i] + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + { break } + } + if (i == source.length) { return } + hist.lastOrigin = hist.lastSelOrigin = null + + for (;;) { + event = source.pop() + if (event.ranges) { + pushSelectionToHistory(event, dest) + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}) + return + } + selAfter = event + } + else { break } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = [] + pushSelectionToHistory(selAfter, dest) + dest.push({changes: antiChanges, generation: hist.generation}) + hist.generation = event.generation || ++hist.maxGeneration + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange") + + var loop = function ( i ) { + var change = event.changes[i] + change.origin = type + if (filter && !filterChange(doc, change, false)) { + source.length = 0 + return {} + } + + antiChanges.push(historyChangeFromChange(doc, change)) + + var after = i ? computeSelAfterChange(doc, change) : lst(source) + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)) + if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}) } + var rebased = [] + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change) + rebased.push(doc.history) + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)) + }) + }; + + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop( i$1 ); + + if ( returned ) return returned.v; + } +} + +// Sub-views need their line numbers shifted when text is added +// above or below them in the parent document. +function shiftDoc(doc, distance) { + if (distance == 0) { return } + doc.first += distance + doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( + Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch) + ); }), doc.sel.primIndex) + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance) + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + { regLineChange(doc.cm, l, "gutter") } + } +} + +// More lower-level change function, handling only a single document +// (not linked ones). +function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)) + return + } + if (change.from.line > doc.lastLine()) { return } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line) + shiftDoc(doc, shift) + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin} + } + var last = doc.lastLine() + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin} + } + + change.removed = getBetween(doc, change.from, change.to) + + if (!selAfter) { selAfter = computeSelAfterChange(doc, change) } + if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans) } + else { updateDoc(doc, change, spans) } + setSelectionNoUndo(doc, selAfter, sel_dontScroll) +} + +// Handle the interaction of a change to a document with the editor +// that this document is part of. +function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to + + var recomputeMaxLength = false, checkWidthStart = from.line + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))) + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true + return true + } + }) + } + + if (doc.sel.contains(change.from, change.to) > -1) + { signalCursorActivity(cm) } + + updateDoc(doc, change, spans, estimateHeight(cm)) + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line) + if (len > display.maxLineLength) { + display.maxLine = line + display.maxLineLength = len + display.maxLineChanged = true + recomputeMaxLength = false + } + }) + if (recomputeMaxLength) { cm.curOp.updateMaxLine = true } + } + + retreatFrontier(doc, from.line) + startWorker(cm, 400) + + var lendiff = change.text.length - (to.line - from.line) - 1 + // Remember that these lines changed, for updating the display + if (change.full) + { regChange(cm) } + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + { regLineChange(cm, from.line, "text") } + else + { regChange(cm, from.line, to.line + 1, lendiff) } + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change") + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + } + if (changeHandler) { signalLater(cm, "change", cm, obj) } + if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj) } + } + cm.display.selForContextMenu = null +} + +function replaceRange(doc, code, from, to, origin) { + if (!to) { to = from } + if (cmp(to, from) < 0) { var assign; + (assign = [to, from], from = assign[0], to = assign[1], assign) } + if (typeof code == "string") { code = doc.splitLines(code) } + makeChange(doc, {from: from, to: to, text: code, origin: origin}) +} + +// Rebasing/resetting history to deal with externally-sourced changes + +function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff + } else if (from < pos.line) { + pos.line = from + pos.ch = 0 + } +} + +// Tries to rebase an array of history events given a change in the +// document. If the change touches the same lines as the event, the +// event, and everything 'behind' it, is discarded. If the change is +// before the event, the event's positions are updated. Uses a +// copy-on-write scheme for the positions, to avoid having to +// reallocate them all on every rebase, but also avoid problems with +// shared position objects being unsafely updated. +function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff) + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff) + } + continue + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1] + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch) + cur.to = Pos(cur.to.line + diff, cur.to.ch) + } else if (from <= cur.to.line) { + ok = false + break + } + } + if (!ok) { + array.splice(0, i + 1) + i = 0 + } + } +} + +function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1 + rebaseHistArray(hist.done, from, to, diff) + rebaseHistArray(hist.undone, from, to, diff) +} + +// Utility for applying a change to a line by handle or number, +// returning the number and optionally registering the line as +// changed. +function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle + if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)) } + else { no = lineNo(handle) } + if (no == null) { return null } + if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType) } + return line +} + +// The document is represented as a BTree consisting of leaves, with +// chunk of lines in them, and branches, with up to ten leaves or +// other branch nodes below them. The top node is always a branch +// node, and is the document object itself (meaning it has +// additional methods and properties). +// +// All nodes have parent links. The tree is used both to go from +// line numbers to line objects, and to go from objects to numbers. +// It also indexes by height, and is used to convert between height +// and line object, and to find the total height of the document. +// +// See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + +function LeafChunk(lines) { + var this$1 = this; + + this.lines = lines + this.parent = null + var height = 0 + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1 + height += lines[i].height + } + this.height = height +} + +LeafChunk.prototype = { + chunkSize: function chunkSize() { return this.lines.length }, + + // Remove the n lines at offset 'at'. + removeInner: function removeInner(at, n) { + var this$1 = this; + + for (var i = at, e = at + n; i < e; ++i) { + var line = this$1.lines[i] + this$1.height -= line.height + cleanUpLine(line) + signalLater(line, "delete") + } + this.lines.splice(at, n) + }, + + // Helper used to collapse a small branch into a single leaf. + collapse: function collapse(lines) { + lines.push.apply(lines, this.lines) + }, + + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + + this.height += height + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)) + for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 } + }, + + // Used to iterate over a part of the tree. + iterN: function iterN(at, n, op) { + var this$1 = this; + + for (var e = at + n; at < e; ++at) + { if (op(this$1.lines[at])) { return true } } + } +} + +function BranchChunk(children) { + var this$1 = this; + + this.children = children + var size = 0, height = 0 + for (var i = 0; i < children.length; ++i) { + var ch = children[i] + size += ch.chunkSize(); height += ch.height + ch.parent = this$1 + } + this.size = size + this.height = height + this.parent = null +} + +BranchChunk.prototype = { + chunkSize: function chunkSize() { return this.size }, + + removeInner: function removeInner(at, n) { + var this$1 = this; + + this.size -= n + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize() + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height + child.removeInner(at, rm) + this$1.height -= oldHeight - child.height + if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null } + if ((n -= rm) == 0) { break } + at = 0 + } else { at -= sz } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = [] + this.collapse(lines) + this.children = [new LeafChunk(lines)] + this.children[0].parent = this + } + }, + + collapse: function collapse(lines) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) } + }, + + insertInner: function insertInner(at, lines, height) { + var this$1 = this; + + this.size += lines.length + this.height += height + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize() + if (at <= sz) { + child.insertInner(at, lines, height) + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25 + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)) + child.height -= leaf.height + this$1.children.splice(++i, 0, leaf) + leaf.parent = this$1 + } + child.lines = child.lines.slice(0, remaining) + this$1.maybeSpill() + } + break + } + at -= sz + } + }, + + // When a node has grown, check whether it should be split. + maybeSpill: function maybeSpill() { + if (this.children.length <= 10) { return } + var me = this + do { + var spilled = me.children.splice(me.children.length - 5, 5) + var sibling = new BranchChunk(spilled) + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children) + copy.parent = me + me.children = [copy, sibling] + me = copy + } else { + me.size -= sibling.size + me.height -= sibling.height + var myIndex = indexOf(me.parent.children, me) + me.parent.children.splice(myIndex + 1, 0, sibling) + } + sibling.parent = me.parent + } while (me.children.length > 10) + me.parent.maybeSpill() + }, + + iterN: function iterN(at, n, op) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize() + if (at < sz) { + var used = Math.min(n, sz - at) + if (child.iterN(at, used, op)) { return true } + if ((n -= used) == 0) { break } + at = 0 + } else { at -= sz } + } + } +} + +// Line widgets are block elements displayed above or below a line. + +var LineWidget = function(doc, node, options) { + var this$1 = this; + + if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) + { this$1[opt] = options[opt] } } } + this.doc = doc + this.node = node +}; + +LineWidget.prototype.clear = function () { + var this$1 = this; + + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line) + if (no == null || !ws) { return } + for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1) } } + if (!ws.length) { line.widgets = null } + var height = widgetHeight(this) + updateLineHeight(line, Math.max(0, line.height - height)) + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height) + regLineChange(cm, no, "widget") + }) + signalLater(cm, "lineWidgetCleared", cm, this, no) + } +}; + +LineWidget.prototype.changed = function () { + var this$1 = this; + + var oldH = this.height, cm = this.doc.cm, line = this.line + this.height = null + var diff = widgetHeight(this) - oldH + if (!diff) { return } + updateLineHeight(line, line.height + diff) + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true + adjustScrollWhenAboveVisible(cm, line, diff) + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)) + }) + } +}; +eventMixin(LineWidget) + +function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + { addToScrollTop(cm, diff) } +} + +function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options) + var cm = doc.cm + if (cm && widget.noHScroll) { cm.display.alignWidgets = true } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []) + if (widget.insertAt == null) { widgets.push(widget) } + else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget) } + widget.line = line + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop + updateLineHeight(line, line.height + widgetHeight(widget)) + if (aboveVisible) { addToScrollTop(cm, widget.height) } + cm.curOp.forceUpdate = true + } + return true + }) + signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)) + return widget +} + +// TEXTMARKERS + +// Created with markText and setBookmark methods. A TextMarker is a +// handle that can be used to clear or find a marked position in the +// document. Line objects hold arrays (markedSpans) containing +// {from, to, marker} object pointing to such marker objects, and +// indicating that such a marker is present on that line. Multiple +// lines may point to the same marker when it spans across lines. +// The spans will have null for their from/to properties when the +// marker continues beyond the start/end of the line. Markers have +// links back to the lines they currently touch. + +// Collapsed markers have unique ids, in order to be able to order +// them, which is needed for uniquely determining an outer marker +// when they overlap (they may nest, but not partially overlap). +var nextMarkerId = 0 + +var TextMarker = function(doc, type) { + this.lines = [] + this.type = type + this.doc = doc + this.id = ++nextMarkerId +}; + +// Clear the marker. +TextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + var cm = this.doc.cm, withOp = cm && !cm.curOp + if (withOp) { startOperation(cm) } + if (hasHandler(this, "clear")) { + var found = this.find() + if (found) { signalLater(this, "clear", found.from, found.to) } + } + var min = null, max = null + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i] + var span = getMarkedSpanFor(line.markedSpans, this$1) + if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text") } + else if (cm) { + if (span.to != null) { max = lineNo(line) } + if (span.from != null) { min = lineNo(line) } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span) + if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) + { updateLineHeight(line, textHeight(cm.display)) } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual) + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual + cm.display.maxLineLength = len + cm.display.maxLineChanged = true + } + } } + + if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1) } + this.lines.length = 0 + this.explicitlyCleared = true + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false + if (cm) { reCheckSelection(cm.doc) } + } + if (cm) { signalLater(cm, "markerCleared", cm, this, min, max) } + if (withOp) { endOperation(cm) } + if (this.parent) { this.parent.clear() } +}; + +// Find the position of the marker in the document. Returns a {from, +// to} object by default. Side can be passed to get a specific side +// -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the +// Pos objects returned contain a line object, rather than a line +// number (used to prevent looking up the same line twice). +TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; + + if (side == null && this.type == "bookmark") { side = 1 } + var from, to + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i] + var span = getMarkedSpanFor(line.markedSpans, this$1) + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from) + if (side == -1) { return from } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to) + if (side == 1) { return to } + } + } + return from && {from: from, to: to} +}; + +// Signals that the marker's widget changed, and surrounding layout +// should be recomputed. +TextMarker.prototype.changed = function () { + var this$1 = this; + + var pos = this.find(-1, true), widget = this, cm = this.doc.cm + if (!pos || !cm) { return } + runInOp(cm, function () { + var line = pos.line, lineN = lineNo(pos.line) + var view = findViewForLine(cm, lineN) + if (view) { + clearLineMeasurementCacheFor(view) + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true + } + cm.curOp.updateMaxLine = true + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height + widget.height = null + var dHeight = widgetHeight(widget) - oldHeight + if (dHeight) + { updateLineHeight(line, line.height + dHeight) } + } + signalLater(cm, "markerChanged", cm, this$1) + }) +}; + +TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this) } + } + this.lines.push(line) +}; + +TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1) + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this) + } +}; +eventMixin(TextMarker) + +// Create a marker, wire it up to the right lines, and +function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { return markTextShared(doc, from, to, options, type) } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } + + var marker = new TextMarker(doc, type), diff = cmp(from, to) + if (options) { copyObj(options, marker, false) } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + { return marker } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget") + if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") } + if (options.insertLeft) { marker.widgetNode.insertLeft = true } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + { throw new Error("Inserting collapsed marker partially overlapping an existing one") } + seeCollapsedSpans() + } + + if (marker.addToHistory) + { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN) } + + var curLine = from.line, cm = doc.cm, updateMaxLine + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + { updateMaxLine = true } + if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0) } + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)) + ++curLine + }) + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { updateLineHeight(line, 0) } + }) } + + if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }) } + + if (marker.readOnly) { + seeReadOnlySpans() + if (doc.history.done.length || doc.history.undone.length) + { doc.clearHistory() } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId + marker.atomic = true + } + if (cm) { + // Sync editor state + if (updateMaxLine) { cm.curOp.updateMaxLine = true } + if (marker.collapsed) + { regChange(cm, from.line, to.line + 1) } + else if (marker.className || marker.title || marker.startStyle || marker.endStyle || marker.css) + { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text") } } + if (marker.atomic) { reCheckSelection(cm.doc) } + signalLater(cm, "markerAdded", cm, marker) + } + return marker +} + +// SHARED TEXTMARKERS + +// A shared marker spans multiple linked documents. It is +// implemented as a meta-marker-object controlling multiple normal +// markers. +var SharedTextMarker = function(markers, primary) { + var this$1 = this; + + this.markers = markers + this.primary = primary + for (var i = 0; i < markers.length; ++i) + { markers[i].parent = this$1 } +}; + +SharedTextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + this.explicitlyCleared = true + for (var i = 0; i < this.markers.length; ++i) + { this$1.markers[i].clear() } + signalLater(this, "clear") +}; + +SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj) +}; +eventMixin(SharedTextMarker) + +function markTextShared(doc, from, to, options, type) { + options = copyObj(options) + options.shared = false + var markers = [markText(doc, from, to, options, type)], primary = markers[0] + var widget = options.widgetNode + linkedDocs(doc, function (doc) { + if (widget) { options.widgetNode = widget.cloneNode(true) } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)) + for (var i = 0; i < doc.linked.length; ++i) + { if (doc.linked[i].isParent) { return } } + primary = lst(markers) + }) + return new SharedTextMarker(markers, primary) +} + +function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) +} + +function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find() + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to) + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type) + marker.markers.push(subMark) + subMark.parent = marker + } + } +} + +function detachSharedMarkers(markers) { + var loop = function ( i ) { + var marker = markers[i], linked = [marker.primary.doc] + linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }) + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j] + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null + marker.markers.splice(j--, 1) + } + } + }; + + for (var i = 0; i < markers.length; i++) loop( i ); +} + +var nextDocId = 0 +var Doc = function(text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } + if (firstLine == null) { firstLine = 0 } + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]) + this.first = firstLine + this.scrollTop = this.scrollLeft = 0 + this.cantEdit = false + this.cleanGeneration = 1 + this.modeFrontier = this.highlightFrontier = firstLine + var start = Pos(firstLine, 0) + this.sel = simpleSelection(start) + this.history = new History(null) + this.id = ++nextDocId + this.modeOption = mode + this.lineSep = lineSep + this.direction = (direction == "rtl") ? "rtl" : "ltr" + this.extend = false + + if (typeof text == "string") { text = this.splitLines(text) } + updateDoc(this, {from: start, to: start, text: text}) + setSelection(this, simpleSelection(start), sel_dontScroll) +} + +Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) { this.iterN(from - this.first, to - from, op) } + else { this.iterN(this.first, this.first + this.size, from) } + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0 + for (var i = 0; i < lines.length; ++i) { height += lines[i].height } + this.insertInner(at - this.first, lines, height) + }, + remove: function(at, n) { this.removeInner(at - this.first, n) }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size) + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1 + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), origin: "setValue", full: true}, true) + if (this.cm) { scrollToCoords(this.cm, 0, 0) } + setSelection(this, simpleSelection(top), sel_dontScroll) + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from) + to = to ? clipPos(this, to) : from + replaceRange(this, code, from, to, origin) + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)) + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, + + getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, + getLineNumber: function(line) {return lineNo(line)}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") { line = getLine(this, line) } + return visualLine(line) + }, + + lineCount: function() {return this.size}, + firstLine: function() {return this.first}, + lastLine: function() {return this.first + this.size - 1}, + + clipPos: function(pos) {return clipPos(this, pos)}, + + getCursor: function(start) { + var range = this.sel.primary(), pos + if (start == null || start == "head") { pos = range.head } + else if (start == "anchor") { pos = range.anchor } + else if (start == "end" || start == "to" || start === false) { pos = range.to() } + else { pos = range.from() } + return pos + }, + listSelections: function() { return this.sel.ranges }, + somethingSelected: function() {return this.sel.somethingSelected()}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options) + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options) + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options) + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads), options) + }), + extendSelectionsBy: docMethodOp(function(f, options) { + var heads = map(this.sel.ranges, f) + extendSelections(this, clipPosArray(this, heads), options) + }), + setSelections: docMethodOp(function(ranges, primary, options) { + var this$1 = this; + + if (!ranges.length) { return } + var out = [] + for (var i = 0; i < ranges.length; i++) + { out[i] = new Range(clipPos(this$1, ranges[i].anchor), + clipPos(this$1, ranges[i].head)) } + if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex) } + setSelection(this, normalizeSelection(out, primary), options) + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0) + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))) + setSelection(this, normalizeSelection(ranges, ranges.length - 1), options) + }), + + getSelection: function(lineSep) { + var this$1 = this; + + var ranges = this.sel.ranges, lines + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) + lines = lines ? lines.concat(sel) : sel + } + if (lineSep === false) { return lines } + else { return lines.join(lineSep || this.lineSeparator()) } + }, + getSelections: function(lineSep) { + var this$1 = this; + + var parts = [], ranges = this.sel.ranges + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()) + if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()) } + parts[i] = sel + } + return parts + }, + replaceSelection: function(code, collapse, origin) { + var dup = [] + for (var i = 0; i < this.sel.ranges.length; i++) + { dup[i] = code } + this.replaceSelections(dup, collapse, origin || "+input") + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var this$1 = this; + + var changes = [], sel = this.sel + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i] + changes[i] = {from: range.from(), to: range.to(), text: this$1.splitLines(code[i]), origin: origin} + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse) + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) + { makeChange(this$1, changes[i$1]) } + if (newSel) { setSelectionReplaceHistory(this, newSel) } + else if (this.cm) { ensureCursorVisible(this.cm) } + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo")}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo")}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true)}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true)}), + + setExtending: function(val) {this.extend = val}, + getExtending: function() {return this.extend}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0 + for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done } } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone } } + return {undo: done, redo: undone} + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration)}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true) + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null } + return this.history.generation + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration) + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)} + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration) + hist.done = copyHistoryArray(histData.done.slice(0), null, true) + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true) + }, + + setGutterMarker: docMethodOp(function(line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}) + markers[gutterID] = value + if (!value && isEmpty(markers)) { line.gutterMarkers = null } + return true + }) + }), + + clearGutter: docMethodOp(function(gutterID) { + var this$1 = this; + + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null + if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null } + return true + }) + } + }) + }), + + lineInfo: function(line) { + var n + if (typeof line == "number") { + if (!isLine(this, line)) { return null } + n = line + line = getLine(this, line) + if (!line) { return null } + } else { + n = lineNo(line) + if (n == null) { return null } + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets} + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass" + if (!line[prop]) { line[prop] = cls } + else if (classTest(cls).test(line[prop])) { return false } + else { line[prop] += " " + cls } + return true + }) + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass" + var cur = line[prop] + if (!cur) { return false } + else if (cls == null) { line[prop] = null } + else { + var found = cur.match(classTest(cls)) + if (!found) { return false } + var end = found.index + found[0].length + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null + } + return true + }) + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options) + }), + removeLineWidget: function(widget) { widget.clear() }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents} + pos = clipPos(this, pos) + return markText(this, pos, pos, realOpts, "bookmark") + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos) + var markers = [], spans = getLine(this, pos.line).markedSpans + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i] + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + { markers.push(span.marker.parent || span.marker) } + } } + return markers + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to) + var found = [], lineNo = from.line + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans + if (spans) { for (var i = 0; i < spans.length; i++) { + var span = spans[i] + if (!(span.to != null && lineNo == from.line && from.ch >= span.to || + span.from == null && lineNo != from.line || + span.from != null && lineNo == to.line && span.from >= to.ch) && + (!filter || filter(span.marker))) + { found.push(span.marker.parent || span.marker) } + } } + ++lineNo + }) + return found + }, + getAllMarks: function() { + var markers = [] + this.iter(function (line) { + var sps = line.markedSpans + if (sps) { for (var i = 0; i < sps.length; ++i) + { if (sps[i].from != null) { markers.push(sps[i].marker) } } } + }) + return markers + }, + + posFromIndex: function(off) { + var ch, lineNo = this.first, sepSize = this.lineSeparator().length + this.iter(function (line) { + var sz = line.text.length + sepSize + if (sz > off) { ch = off; return true } + off -= sz + ++lineNo + }) + return clipPos(this, Pos(lineNo, ch)) + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords) + var index = coords.ch + if (coords.line < this.first || coords.ch < 0) { return 0 } + var sepSize = this.lineSeparator().length + this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value + index += line.text.length + sepSize + }) + return index + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), + this.modeOption, this.first, this.lineSep, this.direction) + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft + doc.sel = this.sel + doc.extend = false + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth + doc.setHistory(this.getHistory()) + } + return doc + }, + + linkedDoc: function(options) { + if (!options) { options = {} } + var from = this.first, to = this.first + this.size + if (options.from != null && options.from > from) { from = options.from } + if (options.to != null && options.to < to) { to = options.to } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction) + if (options.sharedHist) { copy.history = this.history + ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}) + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}] + copySharedMarkers(copy, findSharedMarkers(this)) + return copy + }, + unlinkDoc: function(other) { + var this$1 = this; + + if (other instanceof CodeMirror) { other = other.doc } + if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { + var link = this$1.linked[i] + if (link.doc != other) { continue } + this$1.linked.splice(i, 1) + other.unlinkDoc(this$1) + detachSharedMarkers(findSharedMarkers(this$1)) + break + } } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id] + linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true) + other.history = new History(null) + other.history.done = copyHistoryArray(this.history.done, splitIds) + other.history.undone = copyHistoryArray(this.history.undone, splitIds) + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f)}, + + getMode: function() {return this.mode}, + getEditor: function() {return this.cm}, + + splitLines: function(str) { + if (this.lineSep) { return str.split(this.lineSep) } + return splitLinesAuto(str) + }, + lineSeparator: function() { return this.lineSep || "\n" }, + + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { dir = "ltr" } + if (dir == this.direction) { return } + this.direction = dir + this.iter(function (line) { return line.order = null; }) + if (this.cm) { directionChanged(this.cm) } + }) +}) + +// Public alias. +Doc.prototype.eachLine = Doc.prototype.iter + +// Kludge to work around strange IE behavior where it'll sometimes +// re-fire a series of drag-related events right after the drop (#1551) +var lastDrop = 0 + +function onDrop(e) { + var cm = this + clearDragCursor(cm) + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + { return } + e_preventDefault(e) + if (ie) { lastDrop = +new Date } + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files + if (!pos || cm.isReadOnly()) { return } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0 + var loadFile = function (file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) + { return } + + var reader = new FileReader + reader.onload = operation(cm, function () { + var content = reader.result + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = "" } + text[i] = content + if (++read == n) { + pos = clipPos(cm.doc, pos) + var change = {from: pos, to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste"} + makeChange(cm.doc, change) + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))) + } + }) + reader.readAsText(file) + } + for (var i = 0; i < n; ++i) { loadFile(files[i], i) } + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e) + // Ensure the editor is re-focused + setTimeout(function () { return cm.display.input.focus(); }, 20) + return + } + try { + var text$1 = e.dataTransfer.getData("Text") + if (text$1) { + var selected + if (cm.state.draggingText && !cm.state.draggingText.copy) + { selected = cm.listSelections() } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)) + if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) + { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag") } } + cm.replaceSelection(text$1, "around", "paste") + cm.display.input.focus() + } + } + catch(e){} + } +} + +function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } + + e.dataTransfer.setData("Text", cm.getSelection()) + e.dataTransfer.effectAllowed = "copyMove" + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;") + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" + if (presto) { + img.width = img.height = 1 + cm.display.wrapper.appendChild(img) + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop + } + e.dataTransfer.setDragImage(img, 0, 0) + if (presto) { img.parentNode.removeChild(img) } + } +} + +function onDragOver(cm, e) { + var pos = posFromMouse(cm, e) + if (!pos) { return } + var frag = document.createDocumentFragment() + drawSelectionCursor(cm, pos, frag) + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors") + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv) + } + removeChildrenAndAdd(cm.display.dragCursor, frag) +} + +function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor) + cm.display.dragCursor = null + } +} + +// These must be handled carefully, because naively registering a +// handler for each editor will cause the editors to never be +// garbage collected. + +function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { return } + var byClass = document.getElementsByClassName("CodeMirror") + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror + if (cm) { f(cm) } + } +} + +var globalsRegistered = false +function ensureGlobalHandlers() { + if (globalsRegistered) { return } + registerGlobalHandlers() + globalsRegistered = true +} +function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer + on(window, "resize", function () { + if (resizeTimer == null) { resizeTimer = setTimeout(function () { + resizeTimer = null + forEachCodeMirror(onResize) + }, 100) } + }) + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { return forEachCodeMirror(onBlur); }) +} +// Called when the window resizes +function onResize(cm) { + var d = cm.display + if (d.lastWrapHeight == d.wrapper.clientHeight && d.lastWrapWidth == d.wrapper.clientWidth) + { return } + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null + d.scrollbarsClipped = false + cm.setSize() +} + +var keyNames = { + 3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" +} + +// Number keys +for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i) } +// Alphabetic keys +for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1) } +// Function keys +for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2 } + +var keyMap = {} + +keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" +} +// Note that the save and find-related commands aren't defined by +// default. User code or addons can define them. Unknown commands +// are simply ignored. +keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + fallthrough: "basic" +} +// Very basic readline/emacs-style bindings, which are standard on Mac. +keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" +} +keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + fallthrough: ["basic", "emacsy"] +} +keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault + +// KEYMAP DISPATCH + +function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/) + name = parts[parts.length - 1] + var alt, ctrl, shift, cmd + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i] + if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true } + else if (/^a(lt)?$/i.test(mod)) { alt = true } + else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true } + else if (/^s(hift)?$/i.test(mod)) { shift = true } + else { throw new Error("Unrecognized modifier name: " + mod) } + } + if (alt) { name = "Alt-" + name } + if (ctrl) { name = "Ctrl-" + name } + if (cmd) { name = "Cmd-" + name } + if (shift) { name = "Shift-" + name } + return name +} + +// This is a kludge to keep keymaps mostly working as raw objects +// (backwards compatibility) while at the same time support features +// like normalization and multi-stroke key bindings. It compiles a +// new normalized keymap, and then updates the old object to reflect +// this. +function normalizeKeyMap(keymap) { + var copy = {} + for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname] + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } + if (value == "...") { delete keymap[keyname]; continue } + + var keys = map(keyname.split(" "), normalizeKeyName) + for (var i = 0; i < keys.length; i++) { + var val = (void 0), name = (void 0) + if (i == keys.length - 1) { + name = keys.join(" ") + val = value + } else { + name = keys.slice(0, i + 1).join(" ") + val = "..." + } + var prev = copy[name] + if (!prev) { copy[name] = val } + else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } + } + delete keymap[keyname] + } } + for (var prop in copy) { keymap[prop] = copy[prop] } + return keymap +} + +function lookupKey(key, map, handle, context) { + map = getKeyMap(map) + var found = map.call ? map.call(key, context) : map[key] + if (found === false) { return "nothing" } + if (found === "...") { return "multi" } + if (found != null && handle(found)) { return "handled" } + + if (map.fallthrough) { + if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") + { return lookupKey(key, map.fallthrough, handle, context) } + for (var i = 0; i < map.fallthrough.length; i++) { + var result = lookupKey(key, map.fallthrough[i], handle, context) + if (result) { return result } + } + } +} + +// Modifier key presses don't count as 'real' key presses for the +// purpose of keymap fallthrough. +function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode] + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" +} + +function addModifierNames(name, event, noShift) { + var base = name + if (event.altKey && base != "Alt") { name = "Alt-" + name } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name } + if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name } + return name +} + +// Look up the name of a key as indicated by an event object. +function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { return false } + var name = keyNames[event.keyCode] + if (name == null || event.altGraphKey) { return false } + return addModifierNames(name, event, noShift) +} + +function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val +} + +// Helper for deleting text near the selection(s), used to implement +// backspace, delete, and similar functionality. +function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = [] + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]) + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop() + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from + break + } + } + kill.push(toKill) + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) + { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") } + ensureCursorVisible(cm) + }) +} + +function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir) + return target < 0 || target > line.text.length ? null : target +} + +function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir) + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") +} + +function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction) + if (order) { + var part = dir < 0 ? lst(order) : order[0] + var moveInStorageOrder = (dir < 0) == (part.level == 1) + var sticky = moveInStorageOrder ? "after" : "before" + var ch + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + var prep = prepareMeasureForLine(cm, lineObj) + ch = dir < 0 ? lineObj.text.length - 1 : 0 + var targetTop = measureCharPrepared(cm, prep, ch).top + ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch) + if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) } + } else { ch = dir < 0 ? part.to : part.from } + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") +} + +function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction) + if (!bidi) { return moveLogically(line, start, dir) } + if (start.ch >= line.text.length) { + start.ch = line.text.length + start.sticky = "before" + } else if (start.ch <= 0) { + start.ch = 0 + start.sticky = "after" + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos] + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); } + var prep + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } + prep = prep || prepareMeasureForLine(cm, line) + return wrappedLineExtentChar(cm, line, prep, ch) + } + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch) + + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = (part.level == 1) == (dir < 0) + var ch = mv(start, moveInStorageOrder ? 1 : -1) + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after" + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after"); } + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos] + var moveInStorageOrder = (dir > 0) == (part.level != 1) + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1) + if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } + ch = moveInStorageOrder ? part.from : mv(part.to, -1) + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } + } + } + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent) + if (res) { return res } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1) + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)) + if (res) { return res } + } + + // Case 4: Nowhere to move + return null +} + +// Commands are parameter-less actions that can be performed on an +// editor, mostly used for keybindings. +var commands = { + selectAll: selectAll, + singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, + killLine: function (cm) { return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length + if (range.head.ch == len && range.head.line < cm.lastLine()) + { return {from: range.head, to: Pos(range.head.line + 1, 0)} } + else + { return {from: range.head, to: Pos(range.head.line, len)} } + } else { + return {from: range.from(), to: range.to()} + } + }); }, + deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }); }); }, + delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), to: range.from() + }); }); }, + delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5 + var leftPos = cm.coordsChar({left: 0, top: top}, "div") + return {from: leftPos, to: range.from()} + }); }, + delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5 + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + return {from: range.from(), to: rightPos } + }); }, + undo: function (cm) { return cm.undo(); }, + redo: function (cm) { return cm.redo(); }, + undoSelection: function (cm) { return cm.undoSelection(); }, + redoSelection: function (cm) { return cm.redoSelection(); }, + goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, + goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, + goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1} + ); }, + goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, + {origin: "+move", bias: 1} + ); }, + goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1} + ); }, + goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5 + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + }, sel_move); }, + goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5 + return cm.coordsChar({left: 0, top: top}, "div") + }, sel_move); }, + goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5 + var pos = cm.coordsChar({left: 0, top: top}, "div") + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } + return pos + }, sel_move); }, + goLineUp: function (cm) { return cm.moveV(-1, "line"); }, + goLineDown: function (cm) { return cm.moveV(1, "line"); }, + goPageUp: function (cm) { return cm.moveV(-1, "page"); }, + goPageDown: function (cm) { return cm.moveV(1, "page"); }, + goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, + goCharRight: function (cm) { return cm.moveH(1, "char"); }, + goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, + goColumnRight: function (cm) { return cm.moveH(1, "column"); }, + goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, + goGroupRight: function (cm) { return cm.moveH(1, "group"); }, + goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, + goWordRight: function (cm) { return cm.moveH(1, "word"); }, + delCharBefore: function (cm) { return cm.deleteH(-1, "char"); }, + delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, + delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, + delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, + delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, + delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, + indentAuto: function (cm) { return cm.indentSelection("smart"); }, + indentMore: function (cm) { return cm.indentSelection("add"); }, + indentLess: function (cm) { return cm.indentSelection("subtract"); }, + insertTab: function (cm) { return cm.replaceSelection("\t"); }, + insertSoftTab: function (cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from() + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize) + spaces.push(spaceStr(tabSize - col % tabSize)) + } + cm.replaceSelections(spaces) + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { cm.indentSelection("add") } + else { cm.execCommand("insertTab") } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { return runInOp(cm, function () { + var ranges = cm.listSelections(), newSel = [] + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { continue } + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text + if (line) { + if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1) } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1) + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose") + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text + if (prev) { + cur = new Pos(cur.line, 1) + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), cur, "+transpose") + } + } + } + newSel.push(new Range(cur, cur)) + } + cm.setSelections(newSel) + }); }, + newlineAndIndent: function (cm) { return runInOp(cm, function () { + var sels = cm.listSelections() + for (var i = sels.length - 1; i >= 0; i--) + { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input") } + sels = cm.listSelections() + for (var i$1 = 0; i$1 < sels.length; i$1++) + { cm.indentLine(sels[i$1].from().line, null, true) } + ensureCursorVisible(cm) + }); }, + openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, + toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } +} + + +function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN) + var visual = visualLine(line) + if (visual != line) { lineN = lineNo(visual) } + return endOfLine(true, cm, visual, lineN, 1) +} +function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN) + var visual = visualLineEnd(line) + if (visual != line) { lineN = lineNo(visual) } + return endOfLine(true, cm, line, lineN, -1) +} +function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line) + var line = getLine(cm.doc, start.line) + var order = getOrder(line, cm.doc.direction) + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)) + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) + } + return start +} + +// Run a handler that was bound to a key. +function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound] + if (!bound) { return false } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled() + var prevShift = cm.display.shift, done = false + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true } + if (dropShift) { cm.display.shift = false } + done = bound(cm) != Pass + } finally { + cm.display.shift = prevShift + cm.state.suppressEdits = false + } + return done +} + +function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm) + if (result) { return result } + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm) +} + +// Note that, despite the name, this function is also used to check +// for bound mouse clicks. + +var stopSeq = new Delayed + +function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq + if (seq) { + if (isModifierKey(name)) { return "handled" } + if (/\'$/.test(name)) + { cm.state.keySeq = null } + else + { stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null + cm.display.input.reset() + } + }) } + if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } + } + return dispatchKeyInner(cm, name, e, handle) +} + +function dispatchKeyInner(cm, name, e, handle) { + var result = lookupKeyForEditor(cm, name, handle) + + if (result == "multi") + { cm.state.keySeq = name } + if (result == "handled") + { signalLater(cm, "keyHandled", cm, name, e) } + + if (result == "handled" || result == "multi") { + e_preventDefault(e) + restartBlink(cm) + } + + return !!result +} + +// Handle a key from the keydown event. +function handleKeyBinding(cm, e) { + var name = keyName(e, true) + if (!name) { return false } + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) + || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + { return doHandleBinding(cm, b) } + }) + } else { + return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) + } +} + +// Handle a key from the keypress event +function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) +} + +var lastStoppedKey = null +function onKeyDown(e) { + var cm = this + cm.curOp.focus = activeElt() + if (signalDOMEvent(cm, e)) { return } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false } + var code = e.keyCode + cm.display.shift = code == 16 || e.shiftKey + var handled = handleKeyBinding(cm, e) + if (presto) { + lastStoppedKey = handled ? code : null + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + { cm.replaceSelection("", null, "cut") } + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + { showCrossHair(cm) } +} + +function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv + addClass(lineDiv, "CodeMirror-crosshair") + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair") + off(document, "keyup", up) + off(document, "mouseover", up) + } + } + on(document, "keyup", up) + on(document, "mouseover", up) +} + +function onKeyUp(e) { + if (e.keyCode == 16) { this.doc.sel.shift = false } + signalDOMEvent(this, e) +} + +function onKeyPress(e) { + var cm = this + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } + var keyCode = e.keyCode, charCode = e.charCode + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode) + // Some browsers fire keypress events for backspace + if (ch == "\x08") { return } + if (handleCharBinding(cm, e, ch)) { return } + cm.display.input.onKeyPress(e) +} + +var DOUBLECLICK_DELAY = 400 + +var PastClick = function(time, pos, button) { + this.time = time + this.pos = pos + this.button = button +}; + +PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && + cmp(pos, this.pos) == 0 && button == this.button +}; + +var lastClick; +var lastDoubleClick; +function clickRepeat(pos, button) { + var now = +new Date + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null + return "triple" + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button) + lastClick = null + return "double" + } else { + lastClick = new PastClick(now, pos, button) + lastDoubleClick = null + return "single" + } +} + +// A mouse down can be a single click, double click, triple click, +// start of selection drag, start of text drag, new cursor +// (ctrl-click), rectangle drag (alt-drag), or xwin +// middle-click-paste. Or it might be a click on something we should +// not interfere with, such as a scrollbar or widget. +function onMouseDown(e) { + var cm = this, display = cm.display + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } + display.input.ensurePolled() + display.shift = e.shiftKey + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false + setTimeout(function () { return display.scroller.draggable = true; }, 100) + } + return + } + if (clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single" + window.focus() + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) + { cm.state.selectingText(e) } + + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } + + if (button == 1) { + if (pos) { leftButtonDown(cm, pos, repeat, e) } + else if (e_target(e) == display.scroller) { e_preventDefault(e) } + } else if (button == 2) { + if (pos) { extendSelection(cm.doc, pos) } + setTimeout(function () { return display.input.focus(); }, 20) + } else if (button == 3) { + if (captureRightClick) { onContextMenu(cm, e) } + else { delayBlurEvent(cm) } + } +} + +function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click" + if (repeat == "double") { name = "Double" + name } + else if (repeat == "triple") { name = "Triple" + name } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name + + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { bound = commands[bound] } + if (!bound) { return false } + var done = false + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true } + done = bound(cm, pos) != Pass + } finally { + cm.state.suppressEdits = false + } + return done + }) +} + +function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse") + var value = option ? option(cm, repeat, event) : {} + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line" + } + if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey } + if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey } + if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) } + return value +} + +function leftButtonDown(cm, pos, repeat, event) { + if (ie) { setTimeout(bind(ensureFocus, cm), 0) } + else { cm.curOp.focus = activeElt() } + + var behavior = configureMouse(cm, repeat, event) + + var sel = cm.doc.sel, contained + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && + repeat == "single" && (contained = sel.contains(pos)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && + (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) + { leftButtonStartDrag(cm, event, pos, behavior) } + else + { leftButtonSelect(cm, event, pos, behavior) } +} + +// Start a text drag. When it ends, see if any dragging actually +// happen, and treat as a click if it didn't. +function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, moved = false + var dragEnd = operation(cm, function (e) { + if (webkit) { display.scroller.draggable = false } + cm.state.draggingText = false + off(document, "mouseup", dragEnd) + off(document, "mousemove", mouseMove) + off(display.scroller, "dragstart", dragStart) + off(display.scroller, "drop", dragEnd) + if (!moved) { + e_preventDefault(e) + if (!behavior.addNew) + { extendSelection(cm.doc, pos, null, null, behavior.extend) } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) } + else + { display.input.focus() } + } + }) + var mouseMove = function(e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10 + } + var dragStart = function () { return moved = true; } + // Let the drag handler handle this. + if (webkit) { display.scroller.draggable = true } + cm.state.draggingText = dragEnd + dragEnd.copy = !behavior.moveOnDrag + // IE's approach to draggable + if (display.scroller.dragDrop) { display.scroller.dragDrop() } + on(document, "mouseup", dragEnd) + on(document, "mousemove", mouseMove) + on(display.scroller, "dragstart", dragStart) + on(display.scroller, "drop", dragEnd) + + delayBlurEvent(cm) + setTimeout(function () { return display.input.focus(); }, 20) +} + +function rangeForUnit(cm, pos, unit) { + if (unit == "char") { return new Range(pos, pos) } + if (unit == "word") { return cm.findWordAt(pos) } + if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + var result = unit(cm, pos) + return new Range(result.from, result.to) +} + +// Normal selection, as opposed to text dragging. +function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, doc = cm.doc + e_preventDefault(event) + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start) + if (ourIndex > -1) + { ourRange = ranges[ourIndex] } + else + { ourRange = new Range(start, start) } + } else { + ourRange = doc.sel.primary() + ourIndex = doc.sel.primIndex + } + + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { ourRange = new Range(start, start) } + start = posFromMouse(cm, event, true, true) + ourIndex = -1 + } else { + var range = rangeForUnit(cm, start, behavior.unit) + if (behavior.extend) + { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) } + else + { ourRange = range } + } + + if (!behavior.addNew) { + ourIndex = 0 + setSelection(doc, new Selection([ourRange], 0), sel_mouse) + startSel = doc.sel + } else if (ourIndex == -1) { + ourIndex = ranges.length + setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}) + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}) + startSel = doc.sel + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse) + } + + var lastPos = start + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { return } + lastPos = pos + + if (behavior.unit == "rectangle") { + var ranges = [], tabSize = cm.options.tabSize + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize) + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize) + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol) + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize) + if (left == right) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) } + else if (text.length > leftPos) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) } + } + if (!ranges.length) { ranges.push(new Range(start, start)) } + setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}) + cm.scrollIntoView(pos) + } else { + var oldRange = ourRange + var range = rangeForUnit(cm, pos, behavior.unit) + var anchor = oldRange.anchor, head + if (cmp(range.anchor, anchor) > 0) { + head = range.head + anchor = minPos(oldRange.from(), range.anchor) + } else { + head = range.anchor + anchor = maxPos(oldRange.to(), range.head) + } + var ranges$1 = startSel.ranges.slice(0) + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)) + setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse) + } + } + + var editorSize = display.wrapper.getBoundingClientRect() + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0 + + function extend(e) { + var curCount = ++counter + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle") + if (!cur) { return } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt() + extendTo(cur) + var visible = visibleLines(display, doc) + if (cur.line >= visible.to || cur.line < visible.from) + { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0 + if (outside) { setTimeout(operation(cm, function () { + if (counter != curCount) { return } + display.scroller.scrollTop += outside + extend(e) + }), 50) } + } + } + + function done(e) { + cm.state.selectingText = false + counter = Infinity + e_preventDefault(e) + display.input.focus() + off(document, "mousemove", move) + off(document, "mouseup", up) + doc.history.lastSelOrigin = null + } + + var move = operation(cm, function (e) { + if (!e_button(e)) { done(e) } + else { extend(e) } + }) + var up = operation(cm, done) + cm.state.selectingText = up + on(document, "mousemove", move) + on(document, "mouseup", up) +} + +// Used when mouse-selecting to adjust the anchor to the proper side +// of a bidi jump depending on the visual position of the head. +function bidiSimplify(cm, range) { + var anchor = range.anchor; + var head = range.head; + var anchorLine = getLine(cm.doc, anchor.line) + if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range } + var order = getOrder(anchorLine) + if (!order) { return range } + var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index] + if (part.from != anchor.ch && part.to != anchor.ch) { return range } + var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1) + if (boundary == 0 || boundary == order.length) { return range } + + // Compute the relative visual position of the head compared to the + // anchor (<0 is to the left, >0 to the right) + var leftSide + if (head.line != anchor.line) { + leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0 + } else { + var headIndex = getBidiPartAt(order, head.ch, head.sticky) + var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1) + if (headIndex == boundary - 1 || headIndex == boundary) + { leftSide = dir < 0 } + else + { leftSide = dir > 0 } + } + + var usePart = order[boundary + (leftSide ? -1 : 0)] + var from = leftSide == (usePart.level == 1) + var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before" + return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head) +} + + +// Determines whether an event happened in the gutter, and fires the +// handlers for the corresponding event. +function gutterEvent(cm, e, type, prevent) { + var mX, mY + if (e.touches) { + mX = e.touches[0].clientX + mY = e.touches[0].clientY + } else { + try { mX = e.clientX; mY = e.clientY } + catch(e) { return false } + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } + if (prevent) { e_preventDefault(e) } + + var display = cm.display + var lineBox = display.lineDiv.getBoundingClientRect() + + if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } + mY -= lineBox.top - display.viewOffset + + for (var i = 0; i < cm.options.gutters.length; ++i) { + var g = display.gutters.childNodes[i] + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY) + var gutter = cm.options.gutters[i] + signal(cm, type, cm, line, gutter, e) + return e_defaultPrevented(e) + } + } +} + +function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true) +} + +// CONTEXT MENU HANDLING + +// To make the context menu work, we need to briefly unhide the +// textarea (making it as unobtrusive as possible) to let the +// right-click take effect on it. +function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } + if (signalDOMEvent(cm, e, "contextmenu")) { return } + cm.display.input.onContextMenu(e) +} + +function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { return false } + return gutterEvent(cm, e, "gutterContextMenu", false) +} + +function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-") + clearCaches(cm) +} + +var Init = {toString: function(){return "CodeMirror.Init"}} + +var defaults = {} +var optionHandlers = {} + +function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt + if (handle) { optionHandlers[name] = + notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old) }} : handle } + } + + CodeMirror.defineOption = option + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { return cm.setValue(val); }, true) + option("mode", null, function (cm, val) { + cm.doc.modeOption = val + loadMode(cm) + }, true) + + option("indentUnit", 2, loadMode, true) + option("indentWithTabs", false) + option("smartIndent", true) + option("tabSize", 4, function (cm) { + resetModeState(cm) + clearCaches(cm) + regChange(cm) + }, true) + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val + if (!val) { return } + var newBreaks = [], lineNo = cm.doc.first + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos) + if (found == -1) { break } + pos = found + val.length + newBreaks.push(Pos(lineNo, found)) + } + lineNo++ + }) + for (var i = newBreaks.length - 1; i >= 0; i--) + { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) } + }) + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g") + if (old != Init) { cm.refresh() } + }) + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true) + option("electricChars", true) + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME + }, true) + option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true) + option("rtlMoveVisually", !windows) + option("wholeLineUpdateBefore", true) + + option("theme", "default", function (cm) { + themeChanged(cm) + guttersChanged(cm) + }, true) + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val) + var prev = old != Init && getKeyMap(old) + if (prev && prev.detach) { prev.detach(cm, next) } + if (next.attach) { next.attach(cm, prev || null) } + }) + option("extraKeys", null) + option("configureMouse", null) + + option("lineWrapping", false, wrappingChanged, true) + option("gutters", [], function (cm) { + setGuttersForLineNumbers(cm.options) + guttersChanged(cm) + }, true) + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0" + cm.refresh() + }, true) + option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true) + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm) + updateScrollbars(cm) + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop) + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft) + }, true) + option("lineNumbers", false, function (cm) { + setGuttersForLineNumbers(cm.options) + guttersChanged(cm) + }, true) + option("firstLineNumber", 1, guttersChanged, true) + option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true) + option("showCursorWhenSelecting", false, updateSelection, true) + + option("resetSelectionOnContextMenu", true) + option("lineWiseCopyCut", true) + option("pasteLinesPerSelection", true) + + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm) + cm.display.input.blur() + } + cm.display.input.readOnlyChanged(val) + }) + option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset() }}, true) + option("dragDrop", true, dragDropChanged) + option("allowDropFileTypes", null) + + option("cursorBlinkRate", 530) + option("cursorScrollMargin", 0) + option("cursorHeight", 1, updateSelection, true) + option("singleCursorHeightPerLine", true, updateSelection, true) + option("workTime", 100) + option("workDelay", 100) + option("flattenSpans", true, resetModeState, true) + option("addModeClass", false, resetModeState, true) + option("pollInterval", 100) + option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }) + option("historyEventDelay", 1250) + option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true) + option("maxHighlightLength", 10000, resetModeState, true) + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { cm.display.input.resetPosition() } + }) + + option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }) + option("autofocus", null) + option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true) +} + +function guttersChanged(cm) { + updateGutters(cm) + regChange(cm) + alignHorizontally(cm) +} + +function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions + var toggle = value ? on : off + toggle(cm.display.scroller, "dragstart", funcs.start) + toggle(cm.display.scroller, "dragenter", funcs.enter) + toggle(cm.display.scroller, "dragover", funcs.over) + toggle(cm.display.scroller, "dragleave", funcs.leave) + toggle(cm.display.scroller, "drop", funcs.drop) + } +} + +function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap") + cm.display.sizer.style.minWidth = "" + cm.display.sizerWidth = null + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap") + findMaxLine(cm) + } + estimateLineHeights(cm) + regChange(cm) + clearCaches(cm) + setTimeout(function () { return updateScrollbars(cm); }, 100) +} + +// A CodeMirror instance represents an editor. This is the object +// that user code is usually dealing with. + +function CodeMirror(place, options) { + var this$1 = this; + + if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } + + this.options = options = options ? copyObj(options) : {} + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false) + setGuttersForLineNumbers(options) + + var doc = options.value + if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) } + this.doc = doc + + var input = new CodeMirror.inputStyles[options.inputStyle](this) + var display = this.display = new Display(place, doc, input) + display.wrapper.CodeMirror = this + updateGutters(this) + themeChanged(this) + if (options.lineWrapping) + { this.display.wrapper.className += " CodeMirror-wrap" } + initScrollbars(this) + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + } + + if (options.autofocus && !mobile) { display.input.focus() } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20) } + + registerEventHandlers(this) + ensureGlobalHandlers() + + startOperation(this) + this.curOp.forceUpdate = true + attachDoc(this, doc) + + if ((options.autofocus && !mobile) || this.hasFocus()) + { setTimeout(bind(onFocus, this), 20) } + else + { onBlur(this) } + + for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) + { optionHandlers[opt](this$1, options[opt], Init) } } + maybeUpdateLineNumberWidth(this) + if (options.finishInit) { options.finishInit(this) } + for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1) } + endOperation(this) + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + { display.lineDiv.style.textRendering = "auto" } +} + +// The default configuration options. +CodeMirror.defaults = defaults +// Functions to run when options are changed. +CodeMirror.optionHandlers = optionHandlers + +// Attach the necessary event handlers when initializing the editor +function registerEventHandlers(cm) { + var d = cm.display + on(d.scroller, "mousedown", operation(cm, onMouseDown)) + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + { on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { return } + var pos = posFromMouse(cm, e) + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } + e_preventDefault(e) + var word = cm.findWordAt(pos) + extendSelection(cm.doc, word.anchor, word.head) + })) } + else + { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }) } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + if (!captureRightClick) { on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }) } + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0} + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000) + prevTouch = d.activeTouch + prevTouch.end = +new Date + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { return false } + var touch = e.touches[0] + return touch.radiusX <= 1 && touch.radiusY <= 1 + } + function farAway(touch, other) { + if (other.left == null) { return true } + var dx = other.left - touch.left, dy = other.top - touch.top + return dx * dx + dy * dy > 20 * 20 + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { + d.input.ensurePolled() + clearTimeout(touchFinished) + var now = +new Date + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null} + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX + d.activeTouch.top = e.touches[0].pageY + } + } + }) + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { d.activeTouch.moved = true } + }) + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + { range = new Range(pos, pos) } + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + { range = cm.findWordAt(pos) } + else // Triple tap + { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + cm.setSelection(range.anchor, range.head) + cm.focus() + e_preventDefault(e) + } + finishTouch() + }) + on(d.scroller, "touchcancel", finishTouch) + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop) + setScrollLeft(cm, d.scroller.scrollLeft, true) + signal(cm, "scroll", cm) + } + }) + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }) + on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }) + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }) + + d.dragFunctions = { + enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e) }}, + over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e) }}, + start: function (e) { return onDragStart(cm, e); }, + drop: operation(cm, onDrop), + leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm) }} + } + + var inp = d.input.getField() + on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }) + on(inp, "keydown", operation(cm, onKeyDown)) + on(inp, "keypress", operation(cm, onKeyPress)) + on(inp, "focus", function (e) { return onFocus(cm, e); }) + on(inp, "blur", function (e) { return onBlur(cm, e); }) +} + +var initHooks = [] +CodeMirror.defineInitHook = function (f) { return initHooks.push(f); } + +// Indent the given line. The how parameter can be "smart", +// "add"/null, "subtract", or "prev". When aggressive is false +// (typically set to true for forced single-line indents), empty +// lines are not indented, and places where the mode returns Pass +// are left alone. +function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state + if (how == null) { how = "add" } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { how = "prev" } + else { state = getContextBefore(cm, n).state } + } + + var tabSize = cm.options.tabSize + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize) + if (line.stateAfter) { line.stateAfter = null } + var curSpaceString = line.text.match(/^\s*/)[0], indentation + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0 + how = "not" + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text) + if (indentation == Pass || indentation > 150) { + if (!aggressive) { return } + how = "prev" + } + } + if (how == "prev") { + if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize) } + else { indentation = 0 } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit + } else if (typeof how == "number") { + indentation = curSpace + how + } + indentation = Math.max(0, indentation) + + var indentString = "", pos = 0 + if (cm.options.indentWithTabs) + { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t"} } + if (pos < indentation) { indentString += spaceStr(indentation - pos) } + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input") + line.stateAfter = null + return true + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1] + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length) + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)) + break + } + } + } +} + +// This will be set to a {lineWise: bool, text: [string]} object, so +// that, when pasting, we know what kind of selections the copied +// text was made out of. +var lastCopied = null + +function setLastCopied(newLastCopied) { + lastCopied = newLastCopied +} + +function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc + cm.display.shift = false + if (!sel) { sel = doc.sel } + + var paste = cm.state.pasteIncoming || origin == "paste" + var textLines = splitLinesAuto(inserted), multiPaste = null + // When pasing N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = [] + for (var i = 0; i < lastCopied.text.length; i++) + { multiPaste.push(doc.splitLines(lastCopied.text[i])) } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { return [l]; }) + } + } + + var updateInput + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range = sel.ranges[i$1] + var from = range.from(), to = range.to() + if (range.empty()) { + if (deleted && deleted > 0) // Handle deletion + { from = Pos(from.line, from.ch - deleted) } + else if (cm.state.overwrite && !paste) // Handle overwrite + { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)) } + else if (lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + { from = to = Pos(from.line, 0) } + } + updateInput = cm.curOp.updateInput + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")} + makeChange(cm.doc, changeEvent) + signalLater(cm, "inputRead", cm, changeEvent) + } + if (inserted && !paste) + { triggerElectric(cm, inserted) } + + ensureCursorVisible(cm) + cm.curOp.updateInput = updateInput + cm.curOp.typing = true + cm.state.pasteIncoming = cm.state.cutIncoming = false +} + +function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text") + if (pasted) { + e.preventDefault() + if (!cm.isReadOnly() && !cm.options.disableInput) + { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }) } + return true + } +} + +function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { return } + var sel = cm.doc.sel + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range = sel.ranges[i] + if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } + var mode = cm.getModeAt(range.head) + var indented = false + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range.head.line, "smart") + break + } } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) + { indented = indentLine(cm, range.head.line, "smart") } + } + if (indented) { signalLater(cm, "electricInput", cm, range.head.line) } + } +} + +function copyableRanges(cm) { + var text = [], ranges = [] + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)} + ranges.push(lineRange) + text.push(cm.getRange(lineRange.anchor, lineRange.head)) + } + return {text: text, ranges: ranges} +} + +function disableBrowserMagic(field, spellcheck) { + field.setAttribute("autocorrect", "off") + field.setAttribute("autocapitalize", "off") + field.setAttribute("spellcheck", !!spellcheck) +} + +function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none") + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;") + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { te.style.width = "1000px" } + else { te.setAttribute("wrap", "off") } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { te.style.border = "1px solid black" } + disableBrowserMagic(te) + return div +} + +// The publicly visible API. Note that methodOp(f) means +// 'wrap f in an operation, performed on its `this` parameter'. + +// This is not the complete set of editor methods. Most of the +// methods defined on the Doc type are also injected into +// CodeMirror.prototype, for backwards compatibility and +// convenience. + +function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers + + var helpers = CodeMirror.helpers = {} + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus()}, + + setOption: function(option, value) { + var options = this.options, old = options[option] + if (options[option] == value && option != "mode") { return } + options[option] = value + if (optionHandlers.hasOwnProperty(option)) + { operation(this, optionHandlers[option])(this, value, old) } + signal(this, "optionChange", this, option) + }, + + getOption: function(option) {return this.options[option]}, + getDoc: function() {return this.doc}, + + addKeyMap: function(map, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)) + }, + removeKeyMap: function(map) { + var maps = this.state.keyMaps + for (var i = 0; i < maps.length; ++i) + { if (maps[i] == map || maps[i].name == map) { + maps.splice(i, 1) + return true + } } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec) + if (mode.startState) { throw new Error("Overlays may not be stateful.") } + insertSorted(this.state.overlays, + {mode: mode, modeSpec: spec, opaque: options && options.opaque, + priority: (options && options.priority) || 0}, + function (overlay) { return overlay.priority; }) + this.state.modeGen++ + regChange(this) + }), + removeOverlay: methodOp(function(spec) { + var this$1 = this; + + var overlays = this.state.overlays + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1) + this$1.state.modeGen++ + regChange(this$1) + return + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev" } + else { dir = dir ? "add" : "subtract" } + } + if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive) } + }), + indentSelection: methodOp(function(how) { + var this$1 = this; + + var ranges = this.doc.sel.ranges, end = -1 + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i] + if (!range.empty()) { + var from = range.from(), to = range.to() + var start = Math.max(end, from.line) + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1 + for (var j = start; j < end; ++j) + { indentLine(this$1, j, how) } + var newRanges = this$1.doc.sel.ranges + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll) } + } else if (range.head.line > end) { + indentLine(this$1, range.head.line, how, true) + end = range.head.line + if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1) } + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise) + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true) + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos) + var styles = getLineStyles(this, getLine(this.doc, pos.line)) + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch + var type + if (ch == 0) { type = styles[2] } + else { for (;;) { + var mid = (before + after) >> 1 + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid } + else if (styles[mid * 2 + 1] < ch) { before = mid + 1 } + else { type = styles[mid * 2 + 2]; break } + } } + var cut = type ? type.indexOf("overlay ") : -1 + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) + }, + + getModeAt: function(pos) { + var mode = this.doc.mode + if (!mode.innerMode) { return mode } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0] + }, + + getHelpers: function(pos, type) { + var this$1 = this; + + var found = [] + if (!helpers.hasOwnProperty(type)) { return found } + var help = helpers[type], mode = this.getModeAt(pos) + if (typeof mode[type] == "string") { + if (help[mode[type]]) { found.push(help[mode[type]]) } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]] + if (val) { found.push(val) } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]) + } else if (help[mode.name]) { + found.push(help[mode.name]) + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1] + if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) + { found.push(cur.val) } + } + return found + }, + + getStateAfter: function(line, precise) { + var doc = this.doc + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line) + return getContextBefore(this, line + 1, precise).state + }, + + cursorCoords: function(start, mode) { + var pos, range = this.doc.sel.primary() + if (start == null) { pos = range.head } + else if (typeof start == "object") { pos = clipPos(this.doc, start) } + else { pos = start ? range.from() : range.to() } + return cursorCoords(this, pos, mode || "page") + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page") + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page") + return coordsChar(this, coords.left, coords.top) + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top + return lineAtHeight(this.doc, height + this.display.viewOffset) + }, + heightAtLine: function(line, mode, includeWidgets) { + var end = false, lineObj + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1 + if (line < this.doc.first) { line = this.doc.first } + else if (line > last) { line = last; end = true } + lineObj = getLine(this.doc, line) + } else { + lineObj = line + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + + (end ? this.doc.height - heightAtLine(lineObj) : 0) + }, + + defaultTextHeight: function() { return textHeight(this.display) }, + defaultCharWidth: function() { return charWidth(this.display) }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display + pos = cursorCoords(this, clipPos(this.doc, pos)) + var top = pos.bottom, left = pos.left + node.style.position = "absolute" + node.setAttribute("cm-ignore-events", "true") + this.display.input.setUneditable(node) + display.sizer.appendChild(node) + if (vert == "over") { + top = pos.top + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth) + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + { top = pos.top - node.offsetHeight } + else if (pos.bottom + node.offsetHeight <= vspace) + { top = pos.bottom } + if (left + node.offsetWidth > hspace) + { left = hspace - node.offsetWidth } + } + node.style.top = top + "px" + node.style.left = node.style.right = "" + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth + node.style.right = "0px" + } else { + if (horiz == "left") { left = 0 } + else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2 } + node.style.left = left + "px" + } + if (scroll) + { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) } + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + { return commands[cmd].call(null, this) } + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text) }), + + findPosH: function(from, amount, unit, visually) { + var this$1 = this; + + var dir = 1 + if (amount < 0) { dir = -1; amount = -amount } + var cur = clipPos(this.doc, from) + for (var i = 0; i < amount; ++i) { + cur = findPosH(this$1.doc, cur, dir, unit, visually) + if (cur.hitSide) { break } + } + return cur + }, + + moveH: methodOp(function(dir, unit) { + var this$1 = this; + + this.extendSelectionsBy(function (range) { + if (this$1.display.shift || this$1.doc.extend || range.empty()) + { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } + else + { return dir < 0 ? range.from() : range.to() } + }, sel_move) + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc + if (sel.somethingSelected()) + { doc.replaceSelection("", null, "+delete") } + else + { deleteNearSelection(this, function (range) { + var other = findPosH(doc, range.head, dir, unit, false) + return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} + }) } + }), + + findPosV: function(from, amount, unit, goalColumn) { + var this$1 = this; + + var dir = 1, x = goalColumn + if (amount < 0) { dir = -1; amount = -amount } + var cur = clipPos(this.doc, from) + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this$1, cur, "div") + if (x == null) { x = coords.left } + else { coords.left = x } + cur = findPosV(this$1, coords, dir, unit) + if (cur.hitSide) { break } + } + return cur + }, + + moveV: methodOp(function(dir, unit) { + var this$1 = this; + + var doc = this.doc, goals = [] + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected() + doc.extendSelectionsBy(function (range) { + if (collapse) + { return dir < 0 ? range.from() : range.to() } + var headPos = cursorCoords(this$1, range.head, "div") + if (range.goalColumn != null) { headPos.left = range.goalColumn } + goals.push(headPos.left) + var pos = findPosV(this$1, headPos, dir, unit) + if (unit == "page" && range == doc.sel.primary()) + { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top) } + return pos + }, sel_move) + if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) + { doc.sel.ranges[i].goalColumn = goals[i] } } + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text + var start = pos.ch, end = pos.ch + if (line) { + var helper = this.getHelper(pos, "wordChars") + if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end } + var startChar = line.charAt(start) + var check = isWordChar(startChar, helper) + ? function (ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } + : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); } + while (start > 0 && check(line.charAt(start - 1))) { --start } + while (end < line.length && check(line.charAt(end))) { ++end } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)) + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) { return } + if (this.state.overwrite = !this.state.overwrite) + { addClass(this.display.cursorDiv, "CodeMirror-overwrite") } + else + { rmClass(this.display.cursorDiv, "CodeMirror-overwrite") } + + signal(this, "overwriteToggle", this, this.state.overwrite) + }, + hasFocus: function() { return this.display.input.getField() == activeElt() }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, + + scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }), + getScrollInfo: function() { + var scroller = this.display.scroller + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)} + }, + + scrollIntoView: methodOp(function(range, margin) { + if (range == null) { + range = {from: this.doc.sel.primary().head, to: null} + if (margin == null) { margin = this.options.cursorScrollMargin } + } else if (typeof range == "number") { + range = {from: Pos(range, 0), to: null} + } else if (range.from == null) { + range = {from: range, to: null} + } + if (!range.to) { range.to = range.from } + range.margin = margin || 0 + + if (range.from.line != null) { + scrollToRange(this, range) + } else { + scrollToCoordsRange(this, range.from, range.to, range.margin) + } + }), + + setSize: methodOp(function(width, height) { + var this$1 = this; + + var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; } + if (width != null) { this.display.wrapper.style.width = interpret(width) } + if (height != null) { this.display.wrapper.style.height = interpret(height) } + if (this.options.lineWrapping) { clearLineMeasurementCache(this) } + var lineNo = this.display.viewFrom + this.doc.iter(lineNo, this.display.viewTo, function (line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) + { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } + ++lineNo + }) + this.curOp.forceUpdate = true + signal(this, "refresh", this) + }), + + operation: function(f){return runInOp(this, f)}, + startOperation: function(){return startOperation(this)}, + endOperation: function(){return endOperation(this)}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight + regChange(this) + this.curOp.forceUpdate = true + clearCaches(this) + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop) + updateGutterSpace(this) + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + { estimateLineHeights(this) } + signal(this, "refresh", this) + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc + old.cm = null + attachDoc(this, doc) + clearCaches(this) + this.display.input.reset() + scrollToCoords(this, doc.scrollLeft, doc.scrollTop) + this.curOp.forceScroll = true + signalLater(this, "swapDoc", this, old) + return old + }), + + getInputField: function(){return this.display.input.getField()}, + getWrapperElement: function(){return this.display.wrapper}, + getScrollerElement: function(){return this.display.scroller}, + getGutterElement: function(){return this.display.gutters} + } + eventMixin(CodeMirror) + + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []} } + helpers[type][name] = value + } + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value) + helpers[type]._global.push({pred: predicate, val: value}) + } +} + +// Used for horizontal relative motion. Dir is -1 or 1 (left or +// right), unit can be "char", "column" (like char, but doesn't +// cross line boundaries), "word" (across next word), or "group" (to +// the start of next group of word or non-word-non-whitespace +// chars). The visually param controls whether, in right-to-left +// text, direction 1 means to move towards the next index in the +// string, or towards the character to the right of the current +// position. The resulting position will have a hitSide=true +// property if it reached the end of the document. +function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos + var origDir = dir + var lineObj = getLine(doc, pos.line) + function findNextLine() { + var l = pos.line + dir + if (l < doc.first || l >= doc.first + doc.size) { return false } + pos = new Pos(l, pos.ch, pos.sticky) + return lineObj = getLine(doc, l) + } + function moveOnce(boundToLine) { + var next + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir) + } else { + next = moveLogically(lineObj, pos, dir) + } + if (next == null) { + if (!boundToLine && findNextLine()) + { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir) } + else + { return false } + } else { + pos = next + } + return true + } + + if (unit == "char") { + moveOnce() + } else if (unit == "column") { + moveOnce(true) + } else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group" + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars") + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { break } + var cur = lineObj.text.charAt(pos.ch) || "\n" + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p" + if (group && !first && !type) { type = "s" } + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after"} + break + } + + if (type) { sawType = type } + if (dir > 0 && !moveOnce(!first)) { break } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true) + if (equalCursorPos(oldPos, result)) { result.hitSide = true } + return result +} + +// For relative vertical movement. Dir may be -1 or 1. Unit can be +// "page" or "line". The resulting position will have a hitSide=true +// property if it reached the end of the document. +function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight) + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3) + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount + + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3 + } + var target + for (;;) { + target = coordsChar(cm, x, y) + if (!target.outside) { break } + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } + y += dir * 5 + } + return target +} + +// CONTENTEDITABLE INPUT STYLE + +var ContentEditableInput = function(cm) { + this.cm = cm + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null + this.polling = new Delayed() + this.composing = null + this.gracePeriod = false + this.readDOMTimeout = null +}; + +ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = input.cm + var div = input.div = display.lineDiv + disableBrowserMagic(div, cm.options.spellcheck) + + on(div, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) } + }) + + on(div, "compositionstart", function (e) { + this$1.composing = {data: e.data, done: false} + }) + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { this$1.composing = {data: e.data, done: false} } + }) + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() } + this$1.composing.done = true + } + }) + + on(div, "touchstart", function () { return input.forceCompositionEnd(); }) + + on(div, "input", function () { + if (!this$1.composing) { this$1.readFromDOMSoon() } + }) + + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}) + if (e.type == "cut") { cm.replaceSelection("", null, "cut") } + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm) + setLastCopied({lineWise: true, text: ranges.text}) + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll) + cm.replaceSelection("", null, "cut") + }) + } + } + if (e.clipboardData) { + e.clipboardData.clearData() + var content = lastCopied.text.join("\n") + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content) + if (e.clipboardData.getData("Text") == content) { + e.preventDefault() + return + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild) + te.value = lastCopied.text.join("\n") + var hadFocus = document.activeElement + selectInput(te) + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge) + hadFocus.focus() + if (hadFocus == div) { input.showPrimarySelection() } + }, 50) + } + on(div, "copy", onCopyCut) + on(div, "cut", onCopyCut) +}; + +ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false) + result.focus = this.cm.state.focused + return result +}; + +ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { return } + if (info.focus || takeFocus) { this.showPrimarySelection() } + this.showMultipleSelections(info) +}; + +ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary() + var from = prim.from(), to = prim.to() + + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges() + return + } + + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset) + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), from) == 0 && + cmp(maxPos(curAnchor, curFocus), to) == 0) + { return } + + var view = cm.display.view + var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || + {node: view[0].measure.map[2], offset: 0} + var end = to.line < cm.display.viewTo && posToDOM(cm, to) + if (!end) { + var measure = view[view.length - 1].measure + var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map + end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]} + } + + if (!start || !end) { + sel.removeAllRanges() + return + } + + var old = sel.rangeCount && sel.getRangeAt(0), rng + try { rng = range(start.node, start.offset, end.offset, end.node) } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset) + if (!rng.collapsed) { + sel.removeAllRanges() + sel.addRange(rng) + } + } else { + sel.removeAllRanges() + sel.addRange(rng) + } + if (old && sel.anchorNode == null) { sel.addRange(old) } + else if (gecko) { this.startGracePeriod() } + } + this.rememberSelection() +}; + +ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + + clearTimeout(this.gracePeriod) + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false + if (this$1.selectionChanged()) + { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }) } + }, 20) +}; + +ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors) + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection) +}; + +ContentEditableInput.prototype.rememberSelection = function () { + var sel = window.getSelection() + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset +}; + +ContentEditableInput.prototype.selectionInEditor = function () { + var sel = window.getSelection() + if (!sel.rangeCount) { return false } + var node = sel.getRangeAt(0).commonAncestorContainer + return contains(this.div, node) +}; + +ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor()) + { this.showSelection(this.prepareSelection(), true) } + this.div.focus() + } +}; +ContentEditableInput.prototype.blur = function () { this.div.blur() }; +ContentEditableInput.prototype.getField = function () { return this.div }; + +ContentEditableInput.prototype.supportsTouch = function () { return true }; + +ContentEditableInput.prototype.receivedFocus = function () { + var input = this + if (this.selectionInEditor()) + { this.pollSelection() } + else + { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }) } + + function poll() { + if (input.cm.state.focused) { + input.pollSelection() + input.polling.set(input.cm.options.pollInterval, poll) + } + } + this.polling.set(this.cm.options.pollInterval, poll) +}; + +ContentEditableInput.prototype.selectionChanged = function () { + var sel = window.getSelection() + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset +}; + +ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } + var sel = window.getSelection(), cm = this.cm + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}) + this.blur() + this.focus() + return + } + if (this.composing) { return } + this.rememberSelection() + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset) + var head = domToPos(cm, sel.focusNode, sel.focusOffset) + if (anchor && head) { runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll) + if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true } + }) } +}; + +ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout) + this.readDOMTimeout = null + } + + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary() + var from = sel.from(), to = sel.to() + if (from.ch == 0 && from.line > cm.firstLine()) + { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length) } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) + { to = Pos(to.line + 1, 0) } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } + + var fromIndex, fromLine, fromNode + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line) + fromNode = display.view[0].node + } else { + fromLine = lineNo(display.view[fromIndex].line) + fromNode = display.view[fromIndex - 1].node.nextSibling + } + var toIndex = findViewIndex(cm, to.line) + var toLine, toNode + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1 + toNode = display.lineDiv.lastChild + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1 + toNode = display.view[toIndex + 1].node.previousSibling + } + + if (!fromNode) { return false } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)) + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)) + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine-- } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++ } + else { break } + } + + var cutFront = 0, cutEnd = 0 + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length) + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + { ++cutFront } + var newBot = lst(newText), oldBot = lst(oldText) + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)) + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + { ++cutEnd } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront-- + cutEnd++ + } + } + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "") + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "") + + var chFrom = Pos(fromLine, cutFront) + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0) + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input") + return true + } +}; + +ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd() +}; +ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd() +}; +ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { return } + clearTimeout(this.readDOMTimeout) + this.composing = null + this.updateFromDOM() + this.div.blur() + this.div.focus() +}; +ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + + if (this.readDOMTimeout != null) { return } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null + if (this$1.composing) { + if (this$1.composing.done) { this$1.composing = null } + else { return } + } + this$1.updateFromDOM() + }, 80) +}; + +ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + + if (this.cm.isReadOnly() || !this.pollContent()) + { runInOp(this.cm, function () { return regChange(this$1.cm); }) } +}; + +ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false" +}; + +ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0) { return } + e.preventDefault() + if (!this.cm.isReadOnly()) + { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0) } +}; + +ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor") +}; + +ContentEditableInput.prototype.onContextMenu = function () {}; +ContentEditableInput.prototype.resetPosition = function () {}; + +ContentEditableInput.prototype.needsContentAttribute = true + +function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line) + if (!view || view.hidden) { return null } + var line = getLine(cm.doc, pos.line) + var info = mapFromLineView(view, line, pos.line) + + var order = getOrder(line, cm.doc.direction), side = "left" + if (order) { + var partPos = getBidiPartAt(order, pos.ch) + side = partPos % 2 ? "right" : "left" + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side) + result.offset = result.collapse == "right" ? result.end : result.start + return result +} + +function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) + { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } + return false +} + +function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } + +function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false, lineSep = cm.doc.lineSeparator() + function recognizeMarker(id) { return function (marker) { return marker.id == id; } } + function close() { + if (closing) { + text += lineSep + closing = false + } + } + function addText(str) { + if (str) { + close() + text += str + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text") + if (cmText != null) { + addText(cmText || node.textContent.replace(/\u200b/g, "")) + return + } + var markerID = node.getAttribute("cm-marker"), range + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)) + if (found.length && (range = found[0].find(0))) + { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) } + return + } + if (node.getAttribute("contenteditable") == "false") { return } + var isBlock = /^(pre|div|p)$/i.test(node.nodeName) + if (isBlock) { close() } + for (var i = 0; i < node.childNodes.length; i++) + { walk(node.childNodes[i]) } + if (isBlock) { closing = true } + } else if (node.nodeType == 3) { + addText(node.nodeValue) + } + } + for (;;) { + walk(from) + if (from == to) { break } + from = from.nextSibling + } + return text +} + +function domToPos(cm, node, offset) { + var lineNode + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset] + if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } + node = null; offset = 0 + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { return null } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i] + if (lineView.node == lineNode) + { return locateNodeInLineView(lineView, node, offset) } + } +} + +function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false + if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } + if (node == wrapper) { + bad = true + node = wrapper.childNodes[offset] + offset = 0 + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line + return badPos(Pos(lineNo(line), line.text.length), bad) + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild + if (offset) { offset = textNode.nodeValue.length } + } + while (topNode.parentNode != wrapper) { topNode = topNode.parentNode } + var measure = lineView.measure, maps = measure.maps + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map = i < 0 ? measure.map : maps[i] + for (var j = 0; j < map.length; j += 3) { + var curNode = map[j + 2] + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]) + var ch = map[j] + offset + if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)] } + return Pos(line, ch) + } + } + } + } + var found = find(textNode, topNode, offset) + if (found) { return badPos(found, bad) } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0) + if (found) + { return badPos(Pos(found.line, found.ch - dist), bad) } + else + { dist += after.textContent.length } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1) + if (found) + { return badPos(Pos(found.line, found.ch + dist$1), bad) } + else + { dist$1 += before.textContent.length } + } +} + +// TEXTAREA INPUT STYLE + +var TextareaInput = function(cm) { + this.cm = cm + // See input.poll and input.reset + this.prevInput = "" + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false + // Self-resetting timeout for the poller + this.polling = new Delayed() + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false + this.composing = null +}; + +TextareaInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = this.cm + + // Wraps and hides input textarea + var div = this.wrapper = hiddenTextarea() + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + var te = this.textarea = div.firstChild + display.wrapper.insertBefore(div, display.wrapper.firstChild) + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { te.style.width = "0px" } + + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null } + input.poll() + }) + + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + + cm.state.pasteIncoming = true + input.fastPoll() + }) + + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}) + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm) + setLastCopied({lineWise: true, text: ranges.text}) + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll) + } else { + input.prevInput = "" + te.value = ranges.text.join("\n") + selectInput(te) + } + } + if (e.type == "cut") { cm.state.cutIncoming = true } + } + on(te, "cut", prepareCopyCut) + on(te, "copy", prepareCopyCut) + + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } + cm.state.pasteIncoming = true + input.focus() + }) + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { e_preventDefault(e) } + }) + + on(te, "compositionstart", function () { + var start = cm.getCursor("from") + if (input.composing) { input.composing.range.clear() } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + } + }) + on(te, "compositionend", function () { + if (input.composing) { + input.poll() + input.composing.range.clear() + input.composing = null + } + }) +}; + +TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc + var result = prepareSelection(cm) + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div") + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect() + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)) + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)) + } + + return result +}; + +TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, display = cm.display + removeChildrenAndAdd(display.cursorDiv, drawn.cursors) + removeChildrenAndAdd(display.selectionDiv, drawn.selection) + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px" + this.wrapper.style.left = drawn.teLeft + "px" + } +}; + +// Reset the input to correspond to the selection (or to be empty, +// when not typing and nothing is selected) +TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing) { return } + var cm = this.cm + if (cm.somethingSelected()) { + this.prevInput = "" + var content = cm.getSelection() + this.textarea.value = content + if (cm.state.focused) { selectInput(this.textarea) } + if (ie && ie_version >= 9) { this.hasSelection = content } + } else if (!typing) { + this.prevInput = this.textarea.value = "" + if (ie && ie_version >= 9) { this.hasSelection = null } + } +}; + +TextareaInput.prototype.getField = function () { return this.textarea }; + +TextareaInput.prototype.supportsTouch = function () { return false }; + +TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus() } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } +}; + +TextareaInput.prototype.blur = function () { this.textarea.blur() }; + +TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0 +}; + +TextareaInput.prototype.receivedFocus = function () { this.slowPoll() }; + +// Poll for input changes, using the normal rate of polling. This +// runs as long as the editor is focused. +TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + + if (this.pollingFast) { return } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll() + if (this$1.cm.state.focused) { this$1.slowPoll() } + }) +}; + +// When an event has just come in that is likely to add or change +// something in the input textarea, we poll faster, to ensure that +// the change appears on the screen quickly. +TextareaInput.prototype.fastPoll = function () { + var missed = false, input = this + input.pollingFast = true + function p() { + var changed = input.poll() + if (!changed && !missed) {missed = true; input.polling.set(60, p)} + else {input.pollingFast = false; input.slowPoll()} + } + input.polling.set(20, p) +}; + +// Read input from the textarea, and update the document to match. +// When something is selected, it is present in the textarea, and +// selected (unless it is huge, in which case a placeholder is +// used). When nothing is selected, the cursor sits after previously +// seen text (can be empty), which is stored in prevInput (we must +// not reset the textarea when typing, because that breaks IME). +TextareaInput.prototype.poll = function () { + var this$1 = this; + + var cm = this.cm, input = this.textarea, prevInput = this.prevInput + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput && !this.composing) || + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) + { return false } + + var text = input.value + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { return false } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset() + return false + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0) + if (first == 0x200b && !prevInput) { prevInput = "\u200b" } + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length) + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same } + + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, this$1.composing ? "*compose" : null) + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = "" } + else { this$1.prevInput = text } + + if (this$1.composing) { + this$1.composing.range.clear() + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}) + } + }) + return true +}; + +TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { this.pollingFast = false } +}; + +TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { this.hasSelection = null } + this.fastPoll() +}; + +TextareaInput.prototype.onContextMenu = function (e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop + if (!pos || presto) { return } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu + if (reset && cm.doc.sel.contains(pos) == -1) + { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll) } + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText + input.wrapper.style.cssText = "position: absolute" + var wrapperBox = input.wrapper.getBoundingClientRect() + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);" + var oldScrollY + if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712) + display.input.focus() + if (webkit) { window.scrollTo(null, oldScrollY) } + display.input.reset() + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { te.value = input.prevInput = " " } + input.contextMenuPending = true + display.selForContextMenu = cm.doc.sel + clearTimeout(display.detectingSelectAll) + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected() + var extval = "\u200b" + (selected ? te.value : "") + te.value = "\u21da" // Used to catch context-menu undo + te.value = extval + input.prevInput = selected ? "" : "\u200b" + te.selectionStart = 1; te.selectionEnd = extval.length + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel + } + } + function rehide() { + input.contextMenuPending = false + input.wrapper.style.cssText = oldWrapperCSS + te.style.cssText = oldCSS + if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() } + var i = 0, poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm) + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500) + } else { + display.selForContextMenu = null + display.input.reset() + } + } + display.detectingSelectAll = setTimeout(poll, 200) + } + } + + if (ie && ie_version >= 9) { prepareSelectAllHack() } + if (captureRightClick) { + e_stop(e) + var mouseup = function () { + off(window, "mouseup", mouseup) + setTimeout(rehide, 20) + } + on(window, "mouseup", mouseup) + } else { + setTimeout(rehide, 50) + } +}; + +TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { this.reset() } + this.textarea.disabled = val == "nocursor" +}; + +TextareaInput.prototype.setUneditable = function () {}; + +TextareaInput.prototype.needsContentAttribute = false + +function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {} + options.value = textarea.value + if (!options.tabindex && textarea.tabIndex) + { options.tabindex = textarea.tabIndex } + if (!options.placeholder && textarea.placeholder) + { options.placeholder = textarea.placeholder } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt() + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body + } + + function save() {textarea.value = cm.getValue()} + + var realSubmit + if (textarea.form) { + on(textarea.form, "submit", save) + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form + realSubmit = form.submit + try { + var wrappedSubmit = form.submit = function () { + save() + form.submit = realSubmit + form.submit() + form.submit = wrappedSubmit + } + } catch(e) {} + } + } + + options.finishInit = function (cm) { + cm.save = save + cm.getTextArea = function () { return textarea; } + cm.toTextArea = function () { + cm.toTextArea = isNaN // Prevent this from being ran twice + save() + textarea.parentNode.removeChild(cm.getWrapperElement()) + textarea.style.display = "" + if (textarea.form) { + off(textarea.form, "submit", save) + if (typeof textarea.form.submit == "function") + { textarea.form.submit = realSubmit } + } + } + } + + textarea.style.display = "none" + var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, + options) + return cm +} + +function addLegacyProps(CodeMirror) { + CodeMirror.off = off + CodeMirror.on = on + CodeMirror.wheelEventPixels = wheelEventPixels + CodeMirror.Doc = Doc + CodeMirror.splitLines = splitLinesAuto + CodeMirror.countColumn = countColumn + CodeMirror.findColumn = findColumn + CodeMirror.isWordChar = isWordCharBasic + CodeMirror.Pass = Pass + CodeMirror.signal = signal + CodeMirror.Line = Line + CodeMirror.changeEnd = changeEnd + CodeMirror.scrollbarModel = scrollbarModel + CodeMirror.Pos = Pos + CodeMirror.cmpPos = cmp + CodeMirror.modes = modes + CodeMirror.mimeModes = mimeModes + CodeMirror.resolveMode = resolveMode + CodeMirror.getMode = getMode + CodeMirror.modeExtensions = modeExtensions + CodeMirror.extendMode = extendMode + CodeMirror.copyState = copyState + CodeMirror.startState = startState + CodeMirror.innerMode = innerMode + CodeMirror.commands = commands + CodeMirror.keyMap = keyMap + CodeMirror.keyName = keyName + CodeMirror.isModifierKey = isModifierKey + CodeMirror.lookupKey = lookupKey + CodeMirror.normalizeKeyMap = normalizeKeyMap + CodeMirror.StringStream = StringStream + CodeMirror.SharedTextMarker = SharedTextMarker + CodeMirror.TextMarker = TextMarker + CodeMirror.LineWidget = LineWidget + CodeMirror.e_preventDefault = e_preventDefault + CodeMirror.e_stopPropagation = e_stopPropagation + CodeMirror.e_stop = e_stop + CodeMirror.addClass = addClass + CodeMirror.contains = contains + CodeMirror.rmClass = rmClass + CodeMirror.keyNames = keyNames +} + +// EDITOR CONSTRUCTOR + +defineOptions(CodeMirror) + +addEditorMethods(CodeMirror) + +// Set up methods on CodeMirror's prototype to redirect to the editor's document. +var dontDelegate = "iter insert remove copy getEditor constructor".split(" ") +for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + { CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments)} + })(Doc.prototype[prop]) } } + +eventMixin(Doc) + +// INPUT HANDLING + +CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput} + +// MODE DEFINITION AND QUERYING + +// Extra arguments are stored as the mode's dependencies, which is +// used by (legacy) mechanisms like loadmode.js to automatically +// load a mode. (Preferred mechanism is the require/define calls.) +CodeMirror.defineMode = function(name/*, mode, …*/) { + if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name } + defineMode.apply(this, arguments) +} + +CodeMirror.defineMIME = defineMIME + +// Minimal default mode. +CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }) +CodeMirror.defineMIME("text/plain", "null") + +// EXTENSIONS + +CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func +} +CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func +} + +CodeMirror.fromTextArea = fromTextArea + +addLegacyProps(CodeMirror) + +CodeMirror.version = "5.32.0" + +return CodeMirror; + +})));/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/handlebars/handlebars.min.js */ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/smalltalk/smalltalk.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('smalltalk', function(config) { + + var specialChars = /[+\-\/\\*~<>=@%|&?!.,:;^]/; + var keywords = /true|false|nil|self|super|thisContext/; + + var Context = function(tokenizer, parent) { + this.next = tokenizer; + this.parent = parent; + }; + + var Token = function(name, context, eos) { + this.name = name; + this.context = context; + this.eos = eos; + }; + + var State = function() { + this.context = new Context(next, null); + this.expectVariable = true; + this.indentation = 0; + this.userIndentationDelta = 0; + }; + + State.prototype.userIndent = function(indentation) { + this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; + }; + + var next = function(stream, context, state) { + var token = new Token(null, context, false); + var aChar = stream.next(); + + if (aChar === '"') { + token = nextComment(stream, new Context(nextComment, context)); + + } else if (aChar === '\'') { + token = nextString(stream, new Context(nextString, context)); + + } else if (aChar === '#') { + if (stream.peek() === '\'') { + stream.next(); + token = nextSymbol(stream, new Context(nextSymbol, context)); + } else { + if (stream.eatWhile(/[^\s.{}\[\]()]/)) + token.name = 'string-2'; + else + token.name = 'meta'; + } + + } else if (aChar === '$') { + if (stream.next() === '<') { + stream.eatWhile(/[^\s>]/); + stream.next(); + } + token.name = 'string-2'; + + } else if (aChar === '|' && state.expectVariable) { + token.context = new Context(nextTemporaries, context); + + } else if (/[\[\]{}()]/.test(aChar)) { + token.name = 'bracket'; + token.eos = /[\[{(]/.test(aChar); + + if (aChar === '[') { + state.indentation++; + } else if (aChar === ']') { + state.indentation = Math.max(0, state.indentation - 1); + } + + } else if (specialChars.test(aChar)) { + stream.eatWhile(specialChars); + token.name = 'operator'; + token.eos = aChar !== ';'; // ; cascaded message expression + + } else if (/\d/.test(aChar)) { + stream.eatWhile(/[\w\d]/); + token.name = 'number'; + + } else if (/[\w_]/.test(aChar)) { + stream.eatWhile(/[\w\d_]/); + token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; + + } else { + token.eos = state.expectVariable; + } + + return token; + }; + + var nextComment = function(stream, context) { + stream.eatWhile(/[^"]/); + return new Token('comment', stream.eat('"') ? context.parent : context, true); + }; + + var nextString = function(stream, context) { + stream.eatWhile(/[^']/); + return new Token('string', stream.eat('\'') ? context.parent : context, false); + }; + + var nextSymbol = function(stream, context) { + stream.eatWhile(/[^']/); + return new Token('string-2', stream.eat('\'') ? context.parent : context, false); + }; + + var nextTemporaries = function(stream, context) { + var token = new Token(null, context, false); + var aChar = stream.next(); + + if (aChar === '|') { + token.context = context.parent; + token.eos = true; + + } else { + stream.eatWhile(/[^|]/); + token.name = 'variable'; + } + + return token; + }; + + return { + startState: function() { + return new State; + }, + + token: function(stream, state) { + state.userIndent(stream.indentation()); + + if (stream.eatSpace()) { + return null; + } + + var token = state.context.next(stream, state.context, state); + state.context = token.context; + state.expectVariable = token.eos; + + return token.name; + }, + + blankLine: function(state) { + state.userIndent(0); + }, + + indent: function(state, textAfter) { + var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; + return (state.indentation + i) * config.indentUnit; + }, + + electricChars: ']' + }; + +}); + +CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/php/php.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../clike/clike")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../clike/clike"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + // Helper for phpString + function matchSequence(list, end, escapes) { + if (list.length == 0) return phpString(end); + return function (stream, state) { + var patterns = list[0]; + for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) { + state.tokenize = matchSequence(list.slice(1), end); + return patterns[i][1]; + } + state.tokenize = phpString(end, escapes); + return "string"; + }; + } + function phpString(closing, escapes) { + return function(stream, state) { return phpString_(stream, state, closing, escapes); }; + } + function phpString_(stream, state, closing, escapes) { + // "Complex" syntax + if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) { + state.tokenize = null; + return "string"; + } + + // Simple syntax + if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) { + // After the variable name there may appear array or object operator. + if (stream.match("[", false)) { + // Match array operator + state.tokenize = matchSequence([ + [["[", null]], + [[/\d[\w\.]*/, "number"], + [/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"], + [/[\w\$]+/, "variable"]], + [["]", null]] + ], closing, escapes); + } + if (stream.match(/\-\>\w/, false)) { + // Match object operator + state.tokenize = matchSequence([ + [["->", null]], + [[/[\w]+/, "variable"]] + ], closing, escapes); + } + return "variable-2"; + } + + var escaped = false; + // Normal string + while (!stream.eol() && + (escaped || escapes === false || + (!stream.match("{$", false) && + !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) { + if (!escaped && stream.match(closing)) { + state.tokenize = null; + state.tokStack.pop(); state.tokStack.pop(); + break; + } + escaped = stream.next() == "\\" && !escaped; + } + return "string"; + } + + var phpKeywords = "abstract and array as break case catch class clone const continue declare default " + + "do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final " + + "for foreach function global goto if implements interface instanceof namespace " + + "new or private protected public static switch throw trait try use var while xor " + + "die echo empty exit eval include include_once isset list require require_once return " + + "print unset __halt_compiler self static parent yield insteadof finally"; + var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; + var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; + CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); + CodeMirror.registerHelper("wordChars", "php", /[\w$]/); + + var phpConfig = { + name: "clike", + helperType: "php", + keywords: keywords(phpKeywords), + blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"), + defKeywords: keywords("class function interface namespace trait"), + atoms: keywords(phpAtoms), + builtin: keywords(phpBuiltin), + multiLineStrings: true, + hooks: { + "$": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "variable-2"; + }, + "<": function(stream, state) { + var before; + if (before = stream.match(/<<\s*/)) { + var quoted = stream.eat(/['"]/); + stream.eatWhile(/[\w\.]/); + var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1)); + if (quoted) stream.eat(quoted); + if (delim) { + (state.tokStack || (state.tokStack = [])).push(delim, 0); + state.tokenize = phpString(delim, quoted != "'"); + return "string"; + } + } + return false; + }, + "#": function(stream) { + while (!stream.eol() && !stream.match("?>", false)) stream.next(); + return "comment"; + }, + "/": function(stream) { + if (stream.eat("/")) { + while (!stream.eol() && !stream.match("?>", false)) stream.next(); + return "comment"; + } + return false; + }, + '"': function(_stream, state) { + (state.tokStack || (state.tokStack = [])).push('"', 0); + state.tokenize = phpString('"'); + return "string"; + }, + "{": function(_stream, state) { + if (state.tokStack && state.tokStack.length) + state.tokStack[state.tokStack.length - 1]++; + return false; + }, + "}": function(_stream, state) { + if (state.tokStack && state.tokStack.length > 0 && + !--state.tokStack[state.tokStack.length - 1]) { + state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]); + } + return false; + } + } + }; + + CodeMirror.defineMode("php", function(config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, (parserConfig && parserConfig.htmlMode) || "text/html"); + var phpMode = CodeMirror.getMode(config, phpConfig); + + function dispatch(stream, state) { + var isPHP = state.curMode == phpMode; + if (stream.sol() && state.pending && state.pending != '"' && state.pending != "'") state.pending = null; + if (!isPHP) { + if (stream.match(/^<\?\w*/)) { + state.curMode = phpMode; + if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, "")) + state.curState = state.php; + return "meta"; + } + if (state.pending == '"' || state.pending == "'") { + while (!stream.eol() && stream.next() != state.pending) {} + var style = "string"; + } else if (state.pending && stream.pos < state.pending.end) { + stream.pos = state.pending.end; + var style = state.pending.style; + } else { + var style = htmlMode.token(stream, state.curState); + } + if (state.pending) state.pending = null; + var cur = stream.current(), openPHP = cur.search(/<\?/), m; + if (openPHP != -1) { + if (style == "string" && (m = cur.match(/[\'\"]$/)) && !/\?>/.test(cur)) state.pending = m[0]; + else state.pending = {end: stream.pos, style: style}; + stream.backUp(cur.length - openPHP); + } + return style; + } else if (isPHP && state.php.tokenize == null && stream.match("?>")) { + state.curMode = htmlMode; + state.curState = state.html; + if (!state.php.context.prev) state.php = null; + return "meta"; + } else { + return phpMode.token(stream, state.curState); + } + } + + return { + startState: function() { + var html = CodeMirror.startState(htmlMode) + var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null + return {html: html, + php: php, + curMode: parserConfig.startOpen ? phpMode : htmlMode, + curState: parserConfig.startOpen ? php : html, + pending: null}; + }, + + copyState: function(state) { + var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), + php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur; + if (state.curMode == htmlMode) cur = htmlNew; + else cur = phpNew; + return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, + pending: state.pending}; + }, + + token: dispatch, + + indent: function(state, textAfter) { + if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || + (state.curMode == phpMode && /^\?>/.test(textAfter))) + return htmlMode.indent(state.html, textAfter); + return state.curMode.indent(state.curState, textAfter); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//", + + innerMode: function(state) { return {state: state.curState, mode: state.curMode}; } + }; + }, "htmlmixed", "clike"); + + CodeMirror.defineMIME("application/x-httpd-php", "php"); + CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); + CodeMirror.defineMIME("text/x-php", phpConfig); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/cobol/cobol.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Author: Gautam Mehta + * Branched from CodeMirror's Scheme mode + */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("cobol", function () { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", + ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header", + COBOLLINENUM = "def", PERIOD = "link"; + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES "); + var keywords = makeKeywords( + "ACCEPT ACCESS ACQUIRE ADD ADDRESS " + + "ADVANCING AFTER ALIAS ALL ALPHABET " + + "ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " + + "ALSO ALTER ALTERNATE AND ANY " + + "ARE AREA AREAS ARITHMETIC ASCENDING " + + "ASSIGN AT ATTRIBUTE AUTHOR AUTO " + + "AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " + + "B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " + + "BEFORE BELL BINARY BIT BITS " + + "BLANK BLINK BLOCK BOOLEAN BOTTOM " + + "BY CALL CANCEL CD CF " + + "CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " + + "CLOSE COBOL CODE CODE-SET COL " + + "COLLATING COLUMN COMMA COMMIT COMMITMENT " + + "COMMON COMMUNICATION COMP COMP-0 COMP-1 " + + "COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " + + "COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " + + "COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " + + "COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " + + "CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " + + "CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " + + "CONVERTING COPY CORR CORRESPONDING COUNT " + + "CRT CRT-UNDER CURRENCY CURRENT CURSOR " + + "DATA DATE DATE-COMPILED DATE-WRITTEN DAY " + + "DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " + + "DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " + + "DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " + + "DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " + + "DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " + + "DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " + + "DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " + + "DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " + + "DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " + + "DOWN DROP DUPLICATE DUPLICATES DYNAMIC " + + "EBCDIC EGI EJECT ELSE EMI " + + "EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " + + "END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " + + "END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " + + "END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " + + "END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " + + "END-UNSTRING END-WRITE END-XML ENTER ENTRY " + + "ENVIRONMENT EOP EQUAL EQUALS ERASE " + + "ERROR ESI EVALUATE EVERY EXCEEDS " + + "EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " + + "EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " + + "FILE-STREAM FILES FILLER FINAL FIND " + + "FINISH FIRST FOOTING FOR FOREGROUND-COLOR " + + "FOREGROUND-COLOUR FORMAT FREE FROM FULL " + + "FUNCTION GENERATE GET GIVING GLOBAL " + + "GO GOBACK GREATER GROUP HEADING " + + "HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " + + "ID IDENTIFICATION IF IN INDEX " + + "INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " + + "INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " + + "INDIC INDICATE INDICATOR INDICATORS INITIAL " + + "INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " + + "INSTALLATION INTO INVALID INVOKE IS " + + "JUST JUSTIFIED KANJI KEEP KEY " + + "LABEL LAST LD LEADING LEFT " + + "LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " + + "LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " + + "LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " + + "LOCALE LOCALLY LOCK " + + "MEMBER MEMORY MERGE MESSAGE METACLASS " + + "MODE MODIFIED MODIFY MODULES MOVE " + + "MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " + + "NEXT NO NO-ECHO NONE NOT " + + "NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " + + "NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " + + "OF OFF OMITTED ON ONLY " + + "OPEN OPTIONAL OR ORDER ORGANIZATION " + + "OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " + + "PADDING PAGE PAGE-COUNTER PARSE PERFORM " + + "PF PH PIC PICTURE PLUS " + + "POINTER POSITION POSITIVE PREFIX PRESENT " + + "PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " + + "PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " + + "PROMPT PROTECTED PURGE QUEUE QUOTE " + + "QUOTES RANDOM RD READ READY " + + "REALM RECEIVE RECONNECT RECORD RECORD-NAME " + + "RECORDS RECURSIVE REDEFINES REEL REFERENCE " + + "REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " + + "REMAINDER REMOVAL RENAMES REPEATED REPLACE " + + "REPLACING REPORT REPORTING REPORTS REPOSITORY " + + "REQUIRED RERUN RESERVE RESET RETAINING " + + "RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " + + "REVERSED REWIND REWRITE RF RH " + + "RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " + + "RUN SAME SCREEN SD SEARCH " + + "SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " + + "SELECT SEND SENTENCE SEPARATE SEQUENCE " + + "SEQUENTIAL SET SHARED SIGN SIZE " + + "SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " + + "SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " + + "SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " + + "START STARTING STATUS STOP STORE " + + "STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " + + "SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " + + "SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " + + "TABLE TALLYING TAPE TENANT TERMINAL " + + "TERMINATE TEST TEXT THAN THEN " + + "THROUGH THRU TIME TIMES TITLE " + + "TO TOP TRAILING TRAILING-SIGN TRANSACTION " + + "TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " + + "UNSTRING UNTIL UP UPDATE UPON " + + "USAGE USAGE-MODE USE USING VALID " + + "VALIDATE VALUE VALUES VARYING VLR " + + "WAIT WHEN WHEN-COMPILED WITH WITHIN " + + "WORDS WORKING-STORAGE WRITE XML XML-CODE " + + "XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " ); + + var builtins = makeKeywords("- * ** / + < <= = > >= "); + var tests = { + digit: /\d/, + digit_or_colon: /[\d:]/, + hex: /[0-9a-f]/i, + sign: /[+-]/, + exponent: /e/i, + keyword_char: /[^\s\(\[\;\)\]]/, + symbol: /[\w*+\-]/ + }; + function isNumber(ch, stream){ + // hex + if ( ch === '0' && stream.eat(/x/i) ) { + stream.eatWhile(tests.hex); + return true; + } + // leading sign + if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { + stream.eat(tests.sign); + ch = stream.next(); + } + if ( tests.digit.test(ch) ) { + stream.eat(ch); + stream.eatWhile(tests.digit); + if ( '.' == stream.peek()) { + stream.eat('.'); + stream.eatWhile(tests.digit); + } + if ( stream.eat(tests.exponent) ) { + stream.eat(tests.sign); + stream.eatWhile(tests.digit); + } + return true; + } + return false; + } + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false + }; + }, + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = 6 ; //stream.indentation(); + } + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + switch(state.mode){ + case "string": // multi-line string parsing mode + var next = false; + while ((next = stream.next()) != null) { + if (next == "\"" || next == "\'") { + state.mode = false; + break; + } + } + returnType = STRING; // continue on in string mode + break; + default: // default parsing mode + var ch = stream.next(); + var col = stream.column(); + if (col >= 0 && col <= 5) { + returnType = COBOLLINENUM; + } else if (col >= 72 && col <= 79) { + stream.skipToEnd(); + returnType = MODTAG; + } else if (ch == "*" && col == 6) { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (ch == "\"" || ch == "\'") { + state.mode = "string"; + returnType = STRING; + } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { + returnType = ATOM; + } else if (ch == ".") { + returnType = PERIOD; + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else { + if (stream.current().match(tests.symbol)) { + while (col < 71) { + if (stream.eat(tests.symbol) === undefined) { + break; + } else { + col++; + } + } + } + if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { + returnType = KEYWORD; + } else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) { + returnType = BUILTIN; + } else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) { + returnType = ATOM; + } else returnType = null; + } + } + return returnType; + }, + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + } + }; +}); + +CodeMirror.defineMIME("text/x-cobol", "cobol"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/haskell/haskell.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("haskell", function(_config, modeConfig) { + + function switchState(source, setState, f) { + setState(f); + return f(source, setState); + } + + // These should all be Unicode extended, as per the Haskell 2010 report + var smallRE = /[a-z_]/; + var largeRE = /[A-Z]/; + var digitRE = /\d/; + var hexitRE = /[0-9A-Fa-f]/; + var octitRE = /[0-7]/; + var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/; + var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; + var specialRE = /[(),;[\]`{}]/; + var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer + + function normal(source, setState) { + if (source.eatWhile(whiteCharRE)) { + return null; + } + + var ch = source.next(); + if (specialRE.test(ch)) { + if (ch == '{' && source.eat('-')) { + var t = "comment"; + if (source.eat('#')) { + t = "meta"; + } + return switchState(source, setState, ncomment(t, 1)); + } + return null; + } + + if (ch == '\'') { + if (source.eat('\\')) { + source.next(); // should handle other escapes here + } + else { + source.next(); + } + if (source.eat('\'')) { + return "string"; + } + return "string error"; + } + + if (ch == '"') { + return switchState(source, setState, stringLiteral); + } + + if (largeRE.test(ch)) { + source.eatWhile(idRE); + if (source.eat('.')) { + return "qualifier"; + } + return "variable-2"; + } + + if (smallRE.test(ch)) { + source.eatWhile(idRE); + return "variable"; + } + + if (digitRE.test(ch)) { + if (ch == '0') { + if (source.eat(/[xX]/)) { + source.eatWhile(hexitRE); // should require at least 1 + return "integer"; + } + if (source.eat(/[oO]/)) { + source.eatWhile(octitRE); // should require at least 1 + return "number"; + } + } + source.eatWhile(digitRE); + var t = "number"; + if (source.match(/^\.\d+/)) { + t = "number"; + } + if (source.eat(/[eE]/)) { + t = "number"; + source.eat(/[-+]/); + source.eatWhile(digitRE); // should require at least 1 + } + return t; + } + + if (ch == "." && source.eat(".")) + return "keyword"; + + if (symbolRE.test(ch)) { + if (ch == '-' && source.eat(/-/)) { + source.eatWhile(/-/); + if (!source.eat(symbolRE)) { + source.skipToEnd(); + return "comment"; + } + } + var t = "variable"; + if (ch == ':') { + t = "variable-2"; + } + source.eatWhile(symbolRE); + return t; + } + + return "error"; + } + + function ncomment(type, nest) { + if (nest == 0) { + return normal; + } + return function(source, setState) { + var currNest = nest; + while (!source.eol()) { + var ch = source.next(); + if (ch == '{' && source.eat('-')) { + ++currNest; + } + else if (ch == '-' && source.eat('}')) { + --currNest; + if (currNest == 0) { + setState(normal); + return type; + } + } + } + setState(ncomment(type, currNest)); + return type; + }; + } + + function stringLiteral(source, setState) { + while (!source.eol()) { + var ch = source.next(); + if (ch == '"') { + setState(normal); + return "string"; + } + if (ch == '\\') { + if (source.eol() || source.eat(whiteCharRE)) { + setState(stringGap); + return "string"; + } + if (source.eat('&')) { + } + else { + source.next(); // should handle other escapes here + } + } + } + setState(normal); + return "string error"; + } + + function stringGap(source, setState) { + if (source.eat('\\')) { + return switchState(source, setState, stringLiteral); + } + source.next(); + setState(normal); + return "error"; + } + + + var wellKnownWords = (function() { + var wkw = {}; + function setType(t) { + return function () { + for (var i = 0; i < arguments.length; i++) + wkw[arguments[i]] = t; + }; + } + + setType("keyword")( + "case", "class", "data", "default", "deriving", "do", "else", "foreign", + "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", + "module", "newtype", "of", "then", "type", "where", "_"); + + setType("keyword")( + "\.\.", ":", "::", "=", "\\", "<-", "->", "@", "~", "=>"); + + setType("builtin")( + "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", + "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); + + setType("builtin")( + "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", + "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", + "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", + "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", + "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", + "String", "True"); + + setType("builtin")( + "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", + "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", + "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", + "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", + "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", + "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", + "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", + "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", + "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", + "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", + "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", + "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", + "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", + "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", + "otherwise", "pi", "pred", "print", "product", "properFraction", + "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", + "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", + "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", + "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", + "sequence", "sequence_", "show", "showChar", "showList", "showParen", + "showString", "shows", "showsPrec", "significand", "signum", "sin", + "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", + "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", + "toRational", "truncate", "uncurry", "undefined", "unlines", "until", + "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", + "zip3", "zipWith", "zipWith3"); + + var override = modeConfig.overrideKeywords; + if (override) for (var word in override) if (override.hasOwnProperty(word)) + wkw[word] = override[word]; + + return wkw; + })(); + + + + return { + startState: function () { return { f: normal }; }, + copyState: function (s) { return { f: s.f }; }, + + token: function(stream, state) { + var t = state.f(stream, function(s) { state.f = s; }); + var w = stream.current(); + return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t; + }, + + blockCommentStart: "{-", + blockCommentEnd: "-}", + lineComment: "--" + }; + +}); + +CodeMirror.defineMIME("text/x-haskell", "haskell"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/mathematica/mathematica.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Mathematica mode copyright (c) 2015 by Calin Barbat +// Based on code by Patrick Scheibe (halirutan) +// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('mathematica', function(_config, _parserConfig) { + + // used pattern building blocks + var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*'; + var pBase = "(?:\\d+)"; + var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)"; + var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)"; + var pPrecision = "(?:`(?:`?"+pFloat+")?)"; + + // regular expressions + var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))'); + var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)'); + var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)'); + + function tokenBase(stream, state) { + var ch; + + // get next character + ch = stream.next(); + + // string + if (ch === '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + + // comment + if (ch === '(') { + if (stream.eat('*')) { + state.commentLevel++; + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + } + + // go back one character + stream.backUp(1); + + // look for numbers + // Numbers in a baseform + if (stream.match(reBaseForm, true, false)) { + return 'number'; + } + + // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition + // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow. + if (stream.match(reFloatForm, true, false)) { + return 'number'; + } + + /* In[23] and Out[34] */ + if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) { + return 'atom'; + } + + // usage + if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) { + return 'meta'; + } + + // message + if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) { + return 'string-2'; + } + + // this makes a look-ahead match for something like variable:{_Integer} + // the match is then forwarded to the mma-patterns tokenizer. + if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) { + return 'variable-2'; + } + + // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___) + // Cannot start with a number, but can have numbers at any other position. Examples + // blub__Integer, a1_, b34_Integer32 + if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { + return 'variable-2'; + } + if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) { + return 'variable-2'; + } + if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) { + return 'variable-2'; + } + + // Named characters in Mathematica, like \[Gamma]. + if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) { + return 'variable-3'; + } + + // Match all braces separately + if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { + return 'bracket'; + } + + // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match + // only one. + if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) { + return 'variable-2'; + } + + // Literals like variables, keywords, functions + if (stream.match(reIdInContext, true, false)) { + return 'keyword'; + } + + // operators. Note that operators like @@ or /; are matched separately for each symbol. + if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) { + return 'operator'; + } + + // everything else is an error + stream.next(); // advance the stream. + return 'error'; + } + + function tokenString(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === '"' && !escaped) { + end = true; + break; + } + escaped = !escaped && next === '\\'; + } + if (end && !escaped) { + state.tokenize = tokenBase; + } + return 'string'; + }; + + function tokenComment(stream, state) { + var prev, next; + while(state.commentLevel > 0 && (next = stream.next()) != null) { + if (prev === '(' && next === '*') state.commentLevel++; + if (prev === '*' && next === ')') state.commentLevel--; + prev = next; + } + if (state.commentLevel <= 0) { + state.tokenize = tokenBase; + } + return 'comment'; + } + + return { + startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + }, + blockCommentStart: "(*", + blockCommentEnd: "*)" + }; +}); + +CodeMirror.defineMIME('text/x-mathematica', { + name: 'mathematica' +}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/pug/pug.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("pug", function (config) { + // token types + var KEYWORD = 'keyword'; + var DOCTYPE = 'meta'; + var ID = 'builtin'; + var CLASS = 'qualifier'; + + var ATTRS_NEST = { + '{': '}', + '(': ')', + '[': ']' + }; + + var jsMode = CodeMirror.getMode(config, 'javascript'); + + function State() { + this.javaScriptLine = false; + this.javaScriptLineExcludesColon = false; + + this.javaScriptArguments = false; + this.javaScriptArgumentsDepth = 0; + + this.isInterpolating = false; + this.interpolationNesting = 0; + + this.jsState = CodeMirror.startState(jsMode); + + this.restOfLine = ''; + + this.isIncludeFiltered = false; + this.isEach = false; + + this.lastTag = ''; + this.scriptType = ''; + + // Attributes Mode + this.isAttrs = false; + this.attrsNest = []; + this.inAttributeName = true; + this.attributeIsType = false; + this.attrValue = ''; + + // Indented Mode + this.indentOf = Infinity; + this.indentToken = ''; + + this.innerMode = null; + this.innerState = null; + + this.innerModeForLine = false; + } + /** + * Safely copy a state + * + * @return {State} + */ + State.prototype.copy = function () { + var res = new State(); + res.javaScriptLine = this.javaScriptLine; + res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon; + res.javaScriptArguments = this.javaScriptArguments; + res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; + res.isInterpolating = this.isInterpolating; + res.interpolationNesting = this.interpolationNesting; + + res.jsState = CodeMirror.copyState(jsMode, this.jsState); + + res.innerMode = this.innerMode; + if (this.innerMode && this.innerState) { + res.innerState = CodeMirror.copyState(this.innerMode, this.innerState); + } + + res.restOfLine = this.restOfLine; + + res.isIncludeFiltered = this.isIncludeFiltered; + res.isEach = this.isEach; + res.lastTag = this.lastTag; + res.scriptType = this.scriptType; + res.isAttrs = this.isAttrs; + res.attrsNest = this.attrsNest.slice(); + res.inAttributeName = this.inAttributeName; + res.attributeIsType = this.attributeIsType; + res.attrValue = this.attrValue; + res.indentOf = this.indentOf; + res.indentToken = this.indentToken; + + res.innerModeForLine = this.innerModeForLine; + + return res; + }; + + function javaScript(stream, state) { + if (stream.sol()) { + // if javaScriptLine was set at end of line, ignore it + state.javaScriptLine = false; + state.javaScriptLineExcludesColon = false; + } + if (state.javaScriptLine) { + if (state.javaScriptLineExcludesColon && stream.peek() === ':') { + state.javaScriptLine = false; + state.javaScriptLineExcludesColon = false; + return; + } + var tok = jsMode.token(stream, state.jsState); + if (stream.eol()) state.javaScriptLine = false; + return tok || true; + } + } + function javaScriptArguments(stream, state) { + if (state.javaScriptArguments) { + if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') { + state.javaScriptArguments = false; + return; + } + if (stream.peek() === '(') { + state.javaScriptArgumentsDepth++; + } else if (stream.peek() === ')') { + state.javaScriptArgumentsDepth--; + } + if (state.javaScriptArgumentsDepth === 0) { + state.javaScriptArguments = false; + return; + } + + var tok = jsMode.token(stream, state.jsState); + return tok || true; + } + } + + function yieldStatement(stream) { + if (stream.match(/^yield\b/)) { + return 'keyword'; + } + } + + function doctype(stream) { + if (stream.match(/^(?:doctype) *([^\n]+)?/)) { + return DOCTYPE; + } + } + + function interpolation(stream, state) { + if (stream.match('#{')) { + state.isInterpolating = true; + state.interpolationNesting = 0; + return 'punctuation'; + } + } + + function interpolationContinued(stream, state) { + if (state.isInterpolating) { + if (stream.peek() === '}') { + state.interpolationNesting--; + if (state.interpolationNesting < 0) { + stream.next(); + state.isInterpolating = false; + return 'punctuation'; + } + } else if (stream.peek() === '{') { + state.interpolationNesting++; + } + return jsMode.token(stream, state.jsState) || true; + } + } + + function caseStatement(stream, state) { + if (stream.match(/^case\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function when(stream, state) { + if (stream.match(/^when\b/)) { + state.javaScriptLine = true; + state.javaScriptLineExcludesColon = true; + return KEYWORD; + } + } + + function defaultStatement(stream) { + if (stream.match(/^default\b/)) { + return KEYWORD; + } + } + + function extendsStatement(stream, state) { + if (stream.match(/^extends?\b/)) { + state.restOfLine = 'string'; + return KEYWORD; + } + } + + function append(stream, state) { + if (stream.match(/^append\b/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + function prepend(stream, state) { + if (stream.match(/^prepend\b/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + function block(stream, state) { + if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) { + state.restOfLine = 'variable'; + return KEYWORD; + } + } + + function include(stream, state) { + if (stream.match(/^include\b/)) { + state.restOfLine = 'string'; + return KEYWORD; + } + } + + function includeFiltered(stream, state) { + if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) { + state.isIncludeFiltered = true; + return KEYWORD; + } + } + + function includeFilteredContinued(stream, state) { + if (state.isIncludeFiltered) { + var tok = filter(stream, state); + state.isIncludeFiltered = false; + state.restOfLine = 'string'; + return tok; + } + } + + function mixin(stream, state) { + if (stream.match(/^mixin\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function call(stream, state) { + if (stream.match(/^\+([-\w]+)/)) { + if (!stream.match(/^\( *[-\w]+ *=/, false)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + } + return 'variable'; + } + if (stream.match(/^\+#{/, false)) { + stream.next(); + state.mixinCallAfter = true; + return interpolation(stream, state); + } + } + function callArguments(stream, state) { + if (state.mixinCallAfter) { + state.mixinCallAfter = false; + if (!stream.match(/^\( *[-\w]+ *=/, false)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + } + return true; + } + } + + function conditional(stream, state) { + if (stream.match(/^(if|unless|else if|else)\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function each(stream, state) { + if (stream.match(/^(- *)?(each|for)\b/)) { + state.isEach = true; + return KEYWORD; + } + } + function eachContinued(stream, state) { + if (state.isEach) { + if (stream.match(/^ in\b/)) { + state.javaScriptLine = true; + state.isEach = false; + return KEYWORD; + } else if (stream.sol() || stream.eol()) { + state.isEach = false; + } else if (stream.next()) { + while (!stream.match(/^ in\b/, false) && stream.next()); + return 'variable'; + } + } + } + + function whileStatement(stream, state) { + if (stream.match(/^while\b/)) { + state.javaScriptLine = true; + return KEYWORD; + } + } + + function tag(stream, state) { + var captures; + if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) { + state.lastTag = captures[1].toLowerCase(); + if (state.lastTag === 'script') { + state.scriptType = 'application/javascript'; + } + return 'tag'; + } + } + + function filter(stream, state) { + if (stream.match(/^:([\w\-]+)/)) { + var innerMode; + if (config && config.innerModes) { + innerMode = config.innerModes(stream.current().substring(1)); + } + if (!innerMode) { + innerMode = stream.current().substring(1); + } + if (typeof innerMode === 'string') { + innerMode = CodeMirror.getMode(config, innerMode); + } + setInnerMode(stream, state, innerMode); + return 'atom'; + } + } + + function code(stream, state) { + if (stream.match(/^(!?=|-)/)) { + state.javaScriptLine = true; + return 'punctuation'; + } + } + + function id(stream) { + if (stream.match(/^#([\w-]+)/)) { + return ID; + } + } + + function className(stream) { + if (stream.match(/^\.([\w-]+)/)) { + return CLASS; + } + } + + function attrs(stream, state) { + if (stream.peek() == '(') { + stream.next(); + state.isAttrs = true; + state.attrsNest = []; + state.inAttributeName = true; + state.attrValue = ''; + state.attributeIsType = false; + return 'punctuation'; + } + } + + function attrsContinued(stream, state) { + if (state.isAttrs) { + if (ATTRS_NEST[stream.peek()]) { + state.attrsNest.push(ATTRS_NEST[stream.peek()]); + } + if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) { + state.attrsNest.pop(); + } else if (stream.eat(')')) { + state.isAttrs = false; + return 'punctuation'; + } + if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { + if (stream.peek() === '=' || stream.peek() === '!') { + state.inAttributeName = false; + state.jsState = CodeMirror.startState(jsMode); + if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') { + state.attributeIsType = true; + } else { + state.attributeIsType = false; + } + } + return 'attribute'; + } + + var tok = jsMode.token(stream, state.jsState); + if (state.attributeIsType && tok === 'string') { + state.scriptType = stream.current().toString(); + } + if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) { + try { + Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, '')); + state.inAttributeName = true; + state.attrValue = ''; + stream.backUp(stream.current().length); + return attrsContinued(stream, state); + } catch (ex) { + //not the end of an attribute + } + } + state.attrValue += stream.current(); + return tok || true; + } + } + + function attributesBlock(stream, state) { + if (stream.match(/^&attributes\b/)) { + state.javaScriptArguments = true; + state.javaScriptArgumentsDepth = 0; + return 'keyword'; + } + } + + function indent(stream) { + if (stream.sol() && stream.eatSpace()) { + return 'indent'; + } + } + + function comment(stream, state) { + if (stream.match(/^ *\/\/(-)?([^\n]*)/)) { + state.indentOf = stream.indentation(); + state.indentToken = 'comment'; + return 'comment'; + } + } + + function colon(stream) { + if (stream.match(/^: */)) { + return 'colon'; + } + } + + function text(stream, state) { + if (stream.match(/^(?:\| ?| )([^\n]+)/)) { + return 'string'; + } + if (stream.match(/^(<[^\n]*)/, false)) { + // html string + setInnerMode(stream, state, 'htmlmixed'); + state.innerModeForLine = true; + return innerMode(stream, state, true); + } + } + + function dot(stream, state) { + if (stream.eat('.')) { + var innerMode = null; + if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) { + innerMode = state.scriptType.toLowerCase().replace(/"|'/g, ''); + } else if (state.lastTag === 'style') { + innerMode = 'css'; + } + setInnerMode(stream, state, innerMode); + return 'dot'; + } + } + + function fail(stream) { + stream.next(); + return null; + } + + + function setInnerMode(stream, state, mode) { + mode = CodeMirror.mimeModes[mode] || mode; + mode = config.innerModes ? config.innerModes(mode) || mode : mode; + mode = CodeMirror.mimeModes[mode] || mode; + mode = CodeMirror.getMode(config, mode); + state.indentOf = stream.indentation(); + + if (mode && mode.name !== 'null') { + state.innerMode = mode; + } else { + state.indentToken = 'string'; + } + } + function innerMode(stream, state, force) { + if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) { + if (state.innerMode) { + if (!state.innerState) { + state.innerState = state.innerMode.startState ? CodeMirror.startState(state.innerMode, stream.indentation()) : {}; + } + return stream.hideFirstChars(state.indentOf + 2, function () { + return state.innerMode.token(stream, state.innerState) || true; + }); + } else { + stream.skipToEnd(); + return state.indentToken; + } + } else if (stream.sol()) { + state.indentOf = Infinity; + state.indentToken = null; + state.innerMode = null; + state.innerState = null; + } + } + function restOfLine(stream, state) { + if (stream.sol()) { + // if restOfLine was set at end of line, ignore it + state.restOfLine = ''; + } + if (state.restOfLine) { + stream.skipToEnd(); + var tok = state.restOfLine; + state.restOfLine = ''; + return tok; + } + } + + + function startState() { + return new State(); + } + function copyState(state) { + return state.copy(); + } + /** + * Get the next token in the stream + * + * @param {Stream} stream + * @param {State} state + */ + function nextToken(stream, state) { + var tok = innerMode(stream, state) + || restOfLine(stream, state) + || interpolationContinued(stream, state) + || includeFilteredContinued(stream, state) + || eachContinued(stream, state) + || attrsContinued(stream, state) + || javaScript(stream, state) + || javaScriptArguments(stream, state) + || callArguments(stream, state) + + || yieldStatement(stream, state) + || doctype(stream, state) + || interpolation(stream, state) + || caseStatement(stream, state) + || when(stream, state) + || defaultStatement(stream, state) + || extendsStatement(stream, state) + || append(stream, state) + || prepend(stream, state) + || block(stream, state) + || include(stream, state) + || includeFiltered(stream, state) + || mixin(stream, state) + || call(stream, state) + || conditional(stream, state) + || each(stream, state) + || whileStatement(stream, state) + || tag(stream, state) + || filter(stream, state) + || code(stream, state) + || id(stream, state) + || className(stream, state) + || attrs(stream, state) + || attributesBlock(stream, state) + || indent(stream, state) + || text(stream, state) + || comment(stream, state) + || colon(stream, state) + || dot(stream, state) + || fail(stream, state); + + return tok === true ? null : tok; + } + return { + startState: startState, + copyState: copyState, + token: nextToken + }; +}, 'javascript', 'css', 'htmlmixed'); + +CodeMirror.defineMIME('text/x-pug', 'pug'); +CodeMirror.defineMIME('text/x-jade', 'pug'); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/livescript/livescript.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Link to the project's GitHub page: + * https://github.com/duralog/CodeMirror + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode('livescript', function(){ + var tokenBase = function(stream, state) { + var next_rule = state.next || "start"; + if (next_rule) { + state.next = state.next; + var nr = Rules[next_rule]; + if (nr.splice) { + for (var i$ = 0; i$ < nr.length; ++i$) { + var r = nr[i$]; + if (r.regex && stream.match(r.regex)) { + state.next = r.next || state.next; + return r.token; + } + } + stream.next(); + return 'error'; + } + if (stream.match(r = Rules[next_rule])) { + if (r.regex && stream.match(r.regex)) { + state.next = r.next; + return r.token; + } else { + stream.next(); + return 'error'; + } + } + } + stream.next(); + return 'error'; + }; + var external = { + startState: function(){ + return { + next: 'start', + lastToken: {style: null, indent: 0, content: ""} + }; + }, + token: function(stream, state){ + while (stream.pos == stream.start) + var style = tokenBase(stream, state); + state.lastToken = { + style: style, + indent: stream.indentation(), + content: stream.current() + }; + return style.replace(/\./g, ' '); + }, + indent: function(state){ + var indentation = state.lastToken.indent; + if (state.lastToken.content.match(indenter)) { + indentation += 2; + } + return indentation; + } + }; + return external; + }); + + var identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; + var indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); + var keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; + var stringfill = { + token: 'string', + regex: '.+' + }; + var Rules = { + start: [ + { + token: 'comment.doc', + regex: '/\\*', + next: 'comment' + }, { + token: 'comment', + regex: '#.*' + }, { + token: 'keyword', + regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend + }, { + token: 'constant.language', + regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend + }, { + token: 'invalid.illegal', + regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend + }, { + token: 'language.support.class', + regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend + }, { + token: 'language.support.function', + regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend + }, { + token: 'variable.language', + regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend + }, { + token: 'identifier', + regex: identifier + '\\s*:(?![:=])' + }, { + token: 'variable', + regex: identifier + }, { + token: 'keyword.operator', + regex: '(?:\\.{3}|\\s+\\?)' + }, { + token: 'keyword.variable', + regex: '(?:@+|::|\\.\\.)', + next: 'key' + }, { + token: 'keyword.operator', + regex: '\\.\\s*', + next: 'key' + }, { + token: 'string', + regex: '\\\\\\S[^\\s,;)}\\]]*' + }, { + token: 'string.doc', + regex: '\'\'\'', + next: 'qdoc' + }, { + token: 'string.doc', + regex: '"""', + next: 'qqdoc' + }, { + token: 'string', + regex: '\'', + next: 'qstring' + }, { + token: 'string', + regex: '"', + next: 'qqstring' + }, { + token: 'string', + regex: '`', + next: 'js' + }, { + token: 'string', + regex: '<\\[', + next: 'words' + }, { + token: 'string.regex', + regex: '//', + next: 'heregex' + }, { + token: 'string.regex', + regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}', + next: 'key' + }, { + token: 'constant.numeric', + regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)' + }, { + token: 'lparen', + regex: '[({[]' + }, { + token: 'rparen', + regex: '[)}\\]]', + next: 'key' + }, { + token: 'keyword.operator', + regex: '\\S+' + }, { + token: 'text', + regex: '\\s+' + } + ], + heregex: [ + { + token: 'string.regex', + regex: '.*?//[gimy$?]{0,4}', + next: 'start' + }, { + token: 'string.regex', + regex: '\\s*#{' + }, { + token: 'comment.regex', + regex: '\\s+(?:#.*)?' + }, { + token: 'string.regex', + regex: '\\S+' + } + ], + key: [ + { + token: 'keyword.operator', + regex: '[.?@!]+' + }, { + token: 'identifier', + regex: identifier, + next: 'start' + }, { + token: 'text', + regex: '', + next: 'start' + } + ], + comment: [ + { + token: 'comment.doc', + regex: '.*?\\*/', + next: 'start' + }, { + token: 'comment.doc', + regex: '.+' + } + ], + qdoc: [ + { + token: 'string', + regex: ".*?'''", + next: 'key' + }, stringfill + ], + qqdoc: [ + { + token: 'string', + regex: '.*?"""', + next: 'key' + }, stringfill + ], + qstring: [ + { + token: 'string', + regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'', + next: 'key' + }, stringfill + ], + qqstring: [ + { + token: 'string', + regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', + next: 'key' + }, stringfill + ], + js: [ + { + token: 'string', + regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`', + next: 'key' + }, stringfill + ], + words: [ + { + token: 'string', + regex: '.*?\\]>', + next: 'key' + }, stringfill + ] + }; + for (var idx in Rules) { + var r = Rules[idx]; + if (r.splice) { + for (var i = 0, len = r.length; i < len; ++i) { + var rr = r[i]; + if (typeof rr.regex === 'string') { + Rules[idx][i].regex = new RegExp('^' + rr.regex); + } + } + } else if (typeof rr.regex === 'string') { + Rules[idx].regex = new RegExp('^' + r.regex); + } + } + + CodeMirror.defineMIME('text/x-livescript', 'livescript'); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../yaml/yaml")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../yaml/yaml"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + + var START = 0, FRONTMATTER = 1, BODY = 2 + + // a mixed mode for Markdown text with an optional YAML front matter + CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) { + var yamlMode = CodeMirror.getMode(config, "yaml") + var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm") + + function curMode(state) { + return state.state == BODY ? innerMode : yamlMode + } + + return { + startState: function () { + return { + state: START, + inner: CodeMirror.startState(yamlMode) + } + }, + copyState: function (state) { + return { + state: state.state, + inner: CodeMirror.copyState(curMode(state), state.inner) + } + }, + token: function (stream, state) { + if (state.state == START) { + if (stream.match(/---/, false)) { + state.state = FRONTMATTER + return yamlMode.token(stream, state.inner) + } else { + state.state = BODY + state.inner = CodeMirror.startState(innerMode) + return innerMode.token(stream, state.inner) + } + } else if (state.state == FRONTMATTER) { + var end = stream.sol() && stream.match(/---/, false) + var style = yamlMode.token(stream, state.inner) + if (end) { + state.state = BODY + state.inner = CodeMirror.startState(innerMode) + } + return style + } else { + return innerMode.token(stream, state.inner) + } + }, + innerMode: function (state) { + return {mode: curMode(state), state: state.inner} + }, + blankLine: function (state) { + var mode = curMode(state) + if (mode.blankLine) return mode.blankLine(state.inner) + } + } + }) +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/stylus/stylus.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Stylus mode created by Dmitry Kiselyov http://git.io/AaRB + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("stylus", function(config) { + var indentUnit = config.indentUnit, + indentUnitString = '', + tagKeywords = keySet(tagKeywords_), + tagVariablesRegexp = /^(a|b|i|s|col|em)$/i, + propertyKeywords = keySet(propertyKeywords_), + nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_), + valueKeywords = keySet(valueKeywords_), + colorKeywords = keySet(colorKeywords_), + documentTypes = keySet(documentTypes_), + documentTypesRegexp = wordRegexp(documentTypes_), + mediaFeatures = keySet(mediaFeatures_), + mediaTypes = keySet(mediaTypes_), + fontProperties = keySet(fontProperties_), + operatorsRegexp = /^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/, + wordOperatorKeywordsRegexp = wordRegexp(wordOperatorKeywords_), + blockKeywords = keySet(blockKeywords_), + vendorPrefixesRegexp = new RegExp(/^\-(moz|ms|o|webkit)-/i), + commonAtoms = keySet(commonAtoms_), + firstWordMatch = "", + states = {}, + ch, + style, + type, + override; + + while (indentUnitString.length < indentUnit) indentUnitString += ' '; + + /** + * Tokenizers + */ + function tokenBase(stream, state) { + firstWordMatch = stream.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/); + state.context.line.firstWord = firstWordMatch ? firstWordMatch[0].replace(/^\s*/, "") : ""; + state.context.line.indent = stream.indentation(); + ch = stream.peek(); + + // Line comment + if (stream.match("//")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } + // Block comment + if (stream.match("/*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + // String + if (ch == "\"" || ch == "'") { + stream.next(); + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + // Def + if (ch == "@") { + stream.next(); + stream.eatWhile(/[\w\\-]/); + return ["def", stream.current()]; + } + // ID selector or Hex color + if (ch == "#") { + stream.next(); + // Hex color + if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) { + return ["atom", "atom"]; + } + // ID selector + if (stream.match(/^[a-z][\w-]*/i)) { + return ["builtin", "hash"]; + } + } + // Vendor prefixes + if (stream.match(vendorPrefixesRegexp)) { + return ["meta", "vendor-prefixes"]; + } + // Numbers + if (stream.match(/^-?[0-9]?\.?[0-9]/)) { + stream.eatWhile(/[a-z%]/i); + return ["number", "unit"]; + } + // !important|optional + if (ch == "!") { + stream.next(); + return [stream.match(/^(important|optional)/i) ? "keyword": "operator", "important"]; + } + // Class + if (ch == "." && stream.match(/^\.[a-z][\w-]*/i)) { + return ["qualifier", "qualifier"]; + } + // url url-prefix domain regexp + if (stream.match(documentTypesRegexp)) { + if (stream.peek() == "(") state.tokenize = tokenParenthesized; + return ["property", "word"]; + } + // Mixins / Functions + if (stream.match(/^[a-z][\w-]*\(/i)) { + stream.backUp(1); + return ["keyword", "mixin"]; + } + // Block mixins + if (stream.match(/^(\+|-)[a-z][\w-]*\(/i)) { + stream.backUp(1); + return ["keyword", "block-mixin"]; + } + // Parent Reference BEM naming + if (stream.string.match(/^\s*&/) && stream.match(/^[-_]+[a-z][\w-]*/)) { + return ["qualifier", "qualifier"]; + } + // / Root Reference & Parent Reference + if (stream.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)) { + stream.backUp(1); + return ["variable-3", "reference"]; + } + if (stream.match(/^&{1}\s*$/)) { + return ["variable-3", "reference"]; + } + // Word operator + if (stream.match(wordOperatorKeywordsRegexp)) { + return ["operator", "operator"]; + } + // Word + if (stream.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)) { + // Variable + if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { + if (!wordIsTag(stream.current())) { + stream.match(/\./); + return ["variable-2", "variable-name"]; + } + } + return ["variable-2", "word"]; + } + // Operators + if (stream.match(operatorsRegexp)) { + return ["operator", stream.current()]; + } + // Delimiters + if (/[:;,{}\[\]\(\)]/.test(ch)) { + stream.next(); + return [null, ch]; + } + // Non-detected items + stream.next(); + return [null, null]; + } + + /** + * Token comment + */ + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + /** + * Token string + */ + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + if (quote == ")") stream.backUp(1); + break; + } + escaped = !escaped && ch == "\\"; + } + if (ch == quote || !escaped && quote != ")") state.tokenize = null; + return ["string", "string"]; + }; + } + + /** + * Token parenthesized + */ + function tokenParenthesized(stream, state) { + stream.next(); // Must be "(" + if (!stream.match(/\s*[\"\')]/, false)) + state.tokenize = tokenString(")"); + else + state.tokenize = null; + return [null, "("]; + } + + /** + * Context management + */ + function Context(type, indent, prev, line) { + this.type = type; + this.indent = indent; + this.prev = prev; + this.line = line || {firstWord: "", indent: 0}; + } + + function pushContext(state, stream, type, indent) { + indent = indent >= 0 ? indent : indentUnit; + state.context = new Context(type, stream.indentation() + indent, state.context); + return type; + } + + function popContext(state, currentIndent) { + var contextIndent = state.context.indent - indentUnit; + currentIndent = currentIndent || false; + state.context = state.context.prev; + if (currentIndent) state.context.indent = contextIndent; + return state.context.type; + } + + function pass(type, stream, state) { + return states[state.context.type](type, stream, state); + } + + function popAndPass(type, stream, state, n) { + for (var i = n || 1; i > 0; i--) + state.context = state.context.prev; + return pass(type, stream, state); + } + + + /** + * Parser + */ + function wordIsTag(word) { + return word.toLowerCase() in tagKeywords; + } + + function wordIsProperty(word) { + word = word.toLowerCase(); + return word in propertyKeywords || word in fontProperties; + } + + function wordIsBlock(word) { + return word.toLowerCase() in blockKeywords; + } + + function wordIsVendorPrefix(word) { + return word.toLowerCase().match(vendorPrefixesRegexp); + } + + function wordAsValue(word) { + var wordLC = word.toLowerCase(); + var override = "variable-2"; + if (wordIsTag(word)) override = "tag"; + else if (wordIsBlock(word)) override = "block-keyword"; + else if (wordIsProperty(word)) override = "property"; + else if (wordLC in valueKeywords || wordLC in commonAtoms) override = "atom"; + else if (wordLC == "return" || wordLC in colorKeywords) override = "keyword"; + + // Font family + else if (word.match(/^[A-Z]/)) override = "string"; + return override; + } + + function typeIsBlock(type, stream) { + return ((endOfLine(stream) && (type == "{" || type == "]" || type == "hash" || type == "qualifier")) || type == "block-mixin"); + } + + function typeIsInterpolation(type, stream) { + return type == "{" && stream.match(/^\s*\$?[\w-]+/i, false); + } + + function typeIsPseudo(type, stream) { + return type == ":" && stream.match(/^[a-z-]+/, false); + } + + function startOfLine(stream) { + return stream.sol() || stream.string.match(new RegExp("^\\s*" + escapeRegExp(stream.current()))); + } + + function endOfLine(stream) { + return stream.eol() || stream.match(/^\s*$/, false); + } + + function firstWordOfLine(line) { + var re = /^\s*[-_]*[a-z0-9]+[\w-]*/i; + var result = typeof line == "string" ? line.match(re) : line.string.match(re); + return result ? result[0].replace(/^\s*/, "") : ""; + } + + + /** + * Block + */ + states.block = function(type, stream, state) { + if ((type == "comment" && startOfLine(stream)) || + (type == "," && endOfLine(stream)) || + type == "mixin") { + return pushContext(state, stream, "block", 0); + } + if (typeIsInterpolation(type, stream)) { + return pushContext(state, stream, "interpolation"); + } + if (endOfLine(stream) && type == "]") { + if (!/^\s*(\.|#|:|\[|\*|&)/.test(stream.string) && !wordIsTag(firstWordOfLine(stream))) { + return pushContext(state, stream, "block", 0); + } + } + if (typeIsBlock(type, stream)) { + return pushContext(state, stream, "block"); + } + if (type == "}" && endOfLine(stream)) { + return pushContext(state, stream, "block", 0); + } + if (type == "variable-name") { + if (stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/) || wordIsBlock(firstWordOfLine(stream))) { + return pushContext(state, stream, "variableName"); + } + else { + return pushContext(state, stream, "variableName", 0); + } + } + if (type == "=") { + if (!endOfLine(stream) && !wordIsBlock(firstWordOfLine(stream))) { + return pushContext(state, stream, "block", 0); + } + return pushContext(state, stream, "block"); + } + if (type == "*") { + if (endOfLine(stream) || stream.match(/\s*(,|\.|#|\[|:|{)/,false)) { + override = "tag"; + return pushContext(state, stream, "block"); + } + } + if (typeIsPseudo(type, stream)) { + return pushContext(state, stream, "pseudo"); + } + if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { + return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); + } + if (/@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { + return pushContext(state, stream, "keyframes"); + } + if (/@extends?/.test(type)) { + return pushContext(state, stream, "extend", 0); + } + if (type && type.charAt(0) == "@") { + + // Property Lookup + if (stream.indentation() > 0 && wordIsProperty(stream.current().slice(1))) { + override = "variable-2"; + return "block"; + } + if (/(@import|@require|@charset)/.test(type)) { + return pushContext(state, stream, "block", 0); + } + return pushContext(state, stream, "block"); + } + if (type == "reference" && endOfLine(stream)) { + return pushContext(state, stream, "block"); + } + if (type == "(") { + return pushContext(state, stream, "parens"); + } + + if (type == "vendor-prefixes") { + return pushContext(state, stream, "vendorPrefixes"); + } + if (type == "word") { + var word = stream.current(); + override = wordAsValue(word); + + if (override == "property") { + if (startOfLine(stream)) { + return pushContext(state, stream, "block", 0); + } else { + override = "atom"; + return "block"; + } + } + + if (override == "tag") { + + // tag is a css value + if (/embed|menu|pre|progress|sub|table/.test(word)) { + if (wordIsProperty(firstWordOfLine(stream))) { + override = "atom"; + return "block"; + } + } + + // tag is an attribute + if (stream.string.match(new RegExp("\\[\\s*" + word + "|" + word +"\\s*\\]"))) { + override = "atom"; + return "block"; + } + + // tag is a variable + if (tagVariablesRegexp.test(word)) { + if ((startOfLine(stream) && stream.string.match(/=/)) || + (!startOfLine(stream) && + !stream.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/) && + !wordIsTag(firstWordOfLine(stream)))) { + override = "variable-2"; + if (wordIsBlock(firstWordOfLine(stream))) return "block"; + return pushContext(state, stream, "block", 0); + } + } + + if (endOfLine(stream)) return pushContext(state, stream, "block"); + } + if (override == "block-keyword") { + override = "keyword"; + + // Postfix conditionals + if (stream.current(/(if|unless)/) && !startOfLine(stream)) { + return "block"; + } + return pushContext(state, stream, "block"); + } + if (word == "return") return pushContext(state, stream, "block", 0); + + // Placeholder selector + if (override == "variable-2" && stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)) { + return pushContext(state, stream, "block"); + } + } + return state.context.type; + }; + + + /** + * Parens + */ + states.parens = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "parens"); + if (type == ")") { + if (state.context.prev.type == "parens") { + return popContext(state); + } + if ((stream.string.match(/^[a-z][\w-]*\(/i) && endOfLine(stream)) || + wordIsBlock(firstWordOfLine(stream)) || + /(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(firstWordOfLine(stream)) || + (!stream.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/) && + wordIsTag(firstWordOfLine(stream)))) { + return pushContext(state, stream, "block"); + } + if (stream.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/) || + stream.string.match(/^\s*(\(|\)|[0-9])/) || + stream.string.match(/^\s+[a-z][\w-]*\(/i) || + stream.string.match(/^\s+[\$-]?[a-z]/i)) { + return pushContext(state, stream, "block", 0); + } + if (endOfLine(stream)) return pushContext(state, stream, "block"); + else return pushContext(state, stream, "block", 0); + } + if (type && type.charAt(0) == "@" && wordIsProperty(stream.current().slice(1))) { + override = "variable-2"; + } + if (type == "word") { + var word = stream.current(); + override = wordAsValue(word); + if (override == "tag" && tagVariablesRegexp.test(word)) { + override = "variable-2"; + } + if (override == "property" || word == "to") override = "atom"; + } + if (type == "variable-name") { + return pushContext(state, stream, "variableName"); + } + if (typeIsPseudo(type, stream)) { + return pushContext(state, stream, "pseudo"); + } + return state.context.type; + }; + + + /** + * Vendor prefixes + */ + states.vendorPrefixes = function(type, stream, state) { + if (type == "word") { + override = "property"; + return pushContext(state, stream, "block", 0); + } + return popContext(state); + }; + + + /** + * Pseudo + */ + states.pseudo = function(type, stream, state) { + if (!wordIsProperty(firstWordOfLine(stream.string))) { + stream.match(/^[a-z-]+/); + override = "variable-3"; + if (endOfLine(stream)) return pushContext(state, stream, "block"); + return popContext(state); + } + return popAndPass(type, stream, state); + }; + + + /** + * atBlock + */ + states.atBlock = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "atBlock_parens"); + if (typeIsBlock(type, stream)) { + return pushContext(state, stream, "block"); + } + if (typeIsInterpolation(type, stream)) { + return pushContext(state, stream, "interpolation"); + } + if (type == "word") { + var word = stream.current().toLowerCase(); + if (/^(only|not|and|or)$/.test(word)) + override = "keyword"; + else if (documentTypes.hasOwnProperty(word)) + override = "tag"; + else if (mediaTypes.hasOwnProperty(word)) + override = "attribute"; + else if (mediaFeatures.hasOwnProperty(word)) + override = "property"; + else if (nonStandardPropertyKeywords.hasOwnProperty(word)) + override = "string-2"; + else override = wordAsValue(stream.current()); + if (override == "tag" && endOfLine(stream)) { + return pushContext(state, stream, "block"); + } + } + if (type == "operator" && /^(not|and|or)$/.test(stream.current())) { + override = "keyword"; + } + return state.context.type; + }; + + states.atBlock_parens = function(type, stream, state) { + if (type == "{" || type == "}") return state.context.type; + if (type == ")") { + if (endOfLine(stream)) return pushContext(state, stream, "block"); + else return pushContext(state, stream, "atBlock"); + } + if (type == "word") { + var word = stream.current().toLowerCase(); + override = wordAsValue(word); + if (/^(max|min)/.test(word)) override = "property"; + if (override == "tag") { + tagVariablesRegexp.test(word) ? override = "variable-2" : override = "atom"; + } + return state.context.type; + } + return states.atBlock(type, stream, state); + }; + + + /** + * Keyframes + */ + states.keyframes = function(type, stream, state) { + if (stream.indentation() == "0" && ((type == "}" && startOfLine(stream)) || type == "]" || type == "hash" + || type == "qualifier" || wordIsTag(stream.current()))) { + return popAndPass(type, stream, state); + } + if (type == "{") return pushContext(state, stream, "keyframes"); + if (type == "}") { + if (startOfLine(stream)) return popContext(state, true); + else return pushContext(state, stream, "keyframes"); + } + if (type == "unit" && /^[0-9]+\%$/.test(stream.current())) { + return pushContext(state, stream, "keyframes"); + } + if (type == "word") { + override = wordAsValue(stream.current()); + if (override == "block-keyword") { + override = "keyword"; + return pushContext(state, stream, "keyframes"); + } + } + if (/@(font-face|media|supports|(-moz-)?document)/.test(type)) { + return pushContext(state, stream, endOfLine(stream) ? "block" : "atBlock"); + } + if (type == "mixin") { + return pushContext(state, stream, "block", 0); + } + return state.context.type; + }; + + + /** + * Interpolation + */ + states.interpolation = function(type, stream, state) { + if (type == "{") popContext(state) && pushContext(state, stream, "block"); + if (type == "}") { + if (stream.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i) || + (stream.string.match(/^\s*[a-z]/i) && wordIsTag(firstWordOfLine(stream)))) { + return pushContext(state, stream, "block"); + } + if (!stream.string.match(/^(\{|\s*\&)/) || + stream.match(/\s*[\w-]/,false)) { + return pushContext(state, stream, "block", 0); + } + return pushContext(state, stream, "block"); + } + if (type == "variable-name") { + return pushContext(state, stream, "variableName", 0); + } + if (type == "word") { + override = wordAsValue(stream.current()); + if (override == "tag") override = "atom"; + } + return state.context.type; + }; + + + /** + * Extend/s + */ + states.extend = function(type, stream, state) { + if (type == "[" || type == "=") return "extend"; + if (type == "]") return popContext(state); + if (type == "word") { + override = wordAsValue(stream.current()); + return "extend"; + } + return popContext(state); + }; + + + /** + * Variable name + */ + states.variableName = function(type, stream, state) { + if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) { + if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2"; + return "variableName"; + } + return popAndPass(type, stream, state); + }; + + + return { + startState: function(base) { + return { + tokenize: null, + state: "block", + context: new Context("block", base || 0, null) + }; + }, + token: function(stream, state) { + if (!state.tokenize && stream.eatSpace()) return null; + style = (state.tokenize || tokenBase)(stream, state); + if (style && typeof style == "object") { + type = style[1]; + style = style[0]; + } + override = style; + state.state = states[state.state](type, stream, state); + return override; + }, + indent: function(state, textAfter, line) { + + var cx = state.context, + ch = textAfter && textAfter.charAt(0), + indent = cx.indent, + lineFirstWord = firstWordOfLine(textAfter), + lineIndent = line.match(/^\s*/)[0].replace(/\t/g, indentUnitString).length, + prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "", + prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent; + + if (cx.prev && + (ch == "}" && (cx.type == "block" || cx.type == "atBlock" || cx.type == "keyframes") || + ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at"))) { + indent = cx.indent - indentUnit; + } else if (!(/(\})/.test(ch))) { + if (/@|\$|\d/.test(ch) || + /^\{/.test(textAfter) || +/^\s*\/(\/|\*)/.test(textAfter) || + /^\s*\/\*/.test(prevLineFirstWord) || + /^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(textAfter) || +/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) || +/^return/.test(textAfter) || + wordIsBlock(lineFirstWord)) { + indent = lineIndent; + } else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) { + if (/\,\s*$/.test(prevLineFirstWord)) { + indent = prevLineIndent; + } else if (/^\s+/.test(line) && (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(prevLineFirstWord) || wordIsTag(prevLineFirstWord))) { + indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; + } else { + indent = lineIndent; + } + } else if (!/,\s*$/.test(line) && (wordIsVendorPrefix(lineFirstWord) || wordIsProperty(lineFirstWord))) { + if (wordIsBlock(prevLineFirstWord)) { + indent = lineIndent <= prevLineIndent ? prevLineIndent : prevLineIndent + indentUnit; + } else if (/^\{/.test(prevLineFirstWord)) { + indent = lineIndent <= prevLineIndent ? lineIndent : prevLineIndent + indentUnit; + } else if (wordIsVendorPrefix(prevLineFirstWord) || wordIsProperty(prevLineFirstWord)) { + indent = lineIndent >= prevLineIndent ? prevLineIndent : lineIndent; + } else if (/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(prevLineFirstWord) || + /=\s*$/.test(prevLineFirstWord) || + wordIsTag(prevLineFirstWord) || + /^\$[\w-\.\[\]\'\"]/.test(prevLineFirstWord)) { + indent = prevLineIndent + indentUnit; + } else { + indent = lineIndent; + } + } + } + return indent; + }, + electricChars: "}", + lineComment: "//", + fold: "indent" + }; + }); + + // developer.mozilla.org/en-US/docs/Web/HTML/Element + var tagKeywords_ = ["a","abbr","address","area","article","aside","audio", "b", "base","bdi", "bdo","bgsound","blockquote","body","br","button","canvas","caption","cite", "code","col","colgroup","data","datalist","dd","del","details","dfn","div", "dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1", "h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe", "img","input","ins","kbd","keygen","label","legend","li","link","main","map", "mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes", "noscript","object","ol","optgroup","option","output","p","param","pre", "progress","q","rp","rt","ruby","s","samp","script","section","select", "small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track", "u","ul","var","video"]; + + // github.com/codemirror/CodeMirror/blob/master/mode/css/css.js + var documentTypes_ = ["domain", "regexp", "url", "url-prefix"]; + var mediaTypes_ = ["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]; + var mediaFeatures_ = ["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]; + var propertyKeywords_ = ["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"]; + var nonStandardPropertyKeywords_ = ["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]; + var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]; + var colorKeywords_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; + var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around", "unset"]; + + var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"], + blockKeywords_ = ["for","if","else","unless", "from", "to"], + commonAtoms_ = ["null","true","false","href","title","type","not-allowed","readonly","disabled"], + commonDef_ = ["@font-face", "@keyframes", "@media", "@viewport", "@page", "@host", "@supports", "@block", "@css"]; + + var hintWords = tagKeywords_.concat(documentTypes_,mediaTypes_,mediaFeatures_, + propertyKeywords_,nonStandardPropertyKeywords_, + colorKeywords_,valueKeywords_,fontProperties_, + wordOperatorKeywords_,blockKeywords_, + commonAtoms_,commonDef_); + + function wordRegexp(words) { + words = words.sort(function(a,b){return b > a;}); + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) keys[array[i]] = true; + return keys; + } + + function escapeRegExp(text) { + return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + + CodeMirror.registerHelper("hintWords", "stylus", hintWords); + CodeMirror.defineMIME("text/x-styl", "stylus"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/markdown/markdown.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../meta"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + + var htmlMode = CodeMirror.getMode(cmCfg, "text/html"); + var htmlModeMissing = htmlMode.name == "null" + + function getMode(name) { + if (CodeMirror.findModeByName) { + var found = CodeMirror.findModeByName(name); + if (found) name = found.mime || found.mimes[0]; + } + var mode = CodeMirror.getMode(cmCfg, name); + return mode.name == "null" ? null : mode; + } + + // Should characters that affect highlighting be highlighted separate? + // Does not include characters that will be output (such as `1.` and `-` for lists) + if (modeCfg.highlightFormatting === undefined) + modeCfg.highlightFormatting = false; + + // Maximum number of nested blockquotes. Set to 0 for infinite nesting. + // Excess `>` will emit `error` token. + if (modeCfg.maxBlockquoteDepth === undefined) + modeCfg.maxBlockquoteDepth = 0; + + // Turn on task lists? ("- [ ] " and "- [x] ") + if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; + + // Turn on strikethrough syntax + if (modeCfg.strikethrough === undefined) + modeCfg.strikethrough = false; + + if (modeCfg.emoji === undefined) + modeCfg.emoji = false; + + if (modeCfg.fencedCodeBlockHighlighting === undefined) + modeCfg.fencedCodeBlockHighlighting = true; + + if (modeCfg.xml === undefined) + modeCfg.xml = true; + + // Allow token types to be overridden by user-provided token types. + if (modeCfg.tokenTypeOverrides === undefined) + modeCfg.tokenTypeOverrides = {}; + + var tokenTypes = { + header: "header", + code: "comment", + quote: "quote", + list1: "variable-2", + list2: "variable-3", + list3: "keyword", + hr: "hr", + image: "image", + imageAltText: "image-alt-text", + imageMarker: "image-marker", + formatting: "formatting", + linkInline: "link", + linkEmail: "link", + linkText: "link", + linkHref: "string", + em: "em", + strong: "strong", + strikethrough: "strikethrough", + emoji: "builtin" + }; + + for (var tokenType in tokenTypes) { + if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) { + tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType]; + } + } + + var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ + , listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/ + , taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE + , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/ + , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ + , textRE = /^[^#!\[\]*_\\<>` "'(~:]+/ + , fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/ + , linkDefRE = /^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/ // naive link-definition + , punctuation = /[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/ + , expandedTab = " " // CommonMark specifies tab as 4 spaces + + function switchInline(stream, state, f) { + state.f = state.inline = f; + return f(stream, state); + } + + function switchBlock(stream, state, f) { + state.f = state.block = f; + return f(stream, state); + } + + function lineIsEmpty(line) { + return !line || !/\S/.test(line.string) + } + + // Blocks + + function blankLine(state) { + // Reset linkTitle state + state.linkTitle = false; + // Reset EM state + state.em = false; + // Reset STRONG state + state.strong = false; + // Reset strikethrough state + state.strikethrough = false; + // Reset state.quote + state.quote = 0; + // Reset state.indentedCode + state.indentedCode = false; + if (state.f == htmlBlock) { + state.f = inlineNormal; + state.block = blockNormal; + } + // Reset state.trailingSpace + state.trailingSpace = 0; + state.trailingSpaceNewLine = false; + // Mark this line as blank + state.prevLine = state.thisLine + state.thisLine = {stream: null} + return null; + } + + function blockNormal(stream, state) { + var firstTokenOnLine = stream.column() === state.indentation; + var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream); + var prevLineIsIndentedCode = state.indentedCode; + var prevLineIsHr = state.prevLine.hr; + var prevLineIsList = state.list !== false; + var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3; + + state.indentedCode = false; + + var lineIndentation = state.indentation; + // compute once per line (on first token) + if (state.indentationDiff === null) { + state.indentationDiff = state.indentation; + if (prevLineIsList) { + state.list = null; + // While this list item's marker's indentation is less than the deepest + // list item's content's indentation,pop the deepest list item + // indentation off the stack, and update block indentation state + while (lineIndentation < state.listStack[state.listStack.length - 1]) { + state.listStack.pop(); + if (state.listStack.length) { + state.indentation = state.listStack[state.listStack.length - 1]; + // less than the first list's indent -> the line is no longer a list + } else { + state.list = false; + } + } + if (state.list !== false) { + state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1] + } + } + } + + // not comprehensive (currently only for setext detection purposes) + var allowsInlineContinuation = ( + !prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header && + (!prevLineIsList || !prevLineIsIndentedCode) && + !state.prevLine.fencedCodeEnd + ); + + var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) && + state.indentation <= maxNonCodeIndentation && stream.match(hrRE); + + var match = null; + if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd || + state.prevLine.header || prevLineLineIsEmpty)) { + stream.skipToEnd(); + state.indentedCode = true; + return tokenTypes.code; + } else if (stream.eatSpace()) { + return null; + } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) { + state.quote = 0; + state.header = match[1].length; + state.thisLine.header = true; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); + } else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) { + state.quote = firstTokenOnLine ? 1 : state.quote + 1; + if (modeCfg.highlightFormatting) state.formatting = "quote"; + stream.eatSpace(); + return getType(state); + } else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) { + var listType = match[1] ? "ol" : "ul"; + + state.indentation = lineIndentation + stream.current().length; + state.list = true; + state.quote = 0; + + // Add this list item's content's indentation to the stack + state.listStack.push(state.indentation); + + if (modeCfg.taskLists && stream.match(taskListRE, false)) { + state.taskList = true; + } + state.f = state.inline; + if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; + return getType(state); + } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) { + state.quote = 0; + state.fencedEndRE = new RegExp(match[1] + "+ *$"); + // try switching mode + state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]); + if (state.localMode) state.localState = CodeMirror.startState(state.localMode); + state.f = state.block = local; + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = -1 + return getType(state); + // SETEXT has lowest block-scope precedence after HR, so check it after + // the others (code, blockquote, list...) + } else if ( + // if setext set, indicates line after ---/=== + state.setext || ( + // line before ---/=== + (!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false && + !state.code && !isHr && !linkDefRE.test(stream.string) && + (match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE)) + ) + ) { + if ( !state.setext ) { + state.header = match[0].charAt(0) == '=' ? 1 : 2; + state.setext = state.header; + } else { + state.header = state.setext; + // has no effect on type so we can reset it now + state.setext = 0; + stream.skipToEnd(); + if (modeCfg.highlightFormatting) state.formatting = "header"; + } + state.thisLine.header = true; + state.f = state.inline; + return getType(state); + } else if (isHr) { + stream.skipToEnd(); + state.hr = true; + state.thisLine.hr = true; + return tokenTypes.hr; + } else if (stream.peek() === '[') { + return switchInline(stream, state, footnoteLink); + } + + return switchInline(stream, state, state.inline); + } + + function htmlBlock(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (!htmlModeMissing) { + var inner = CodeMirror.innerMode(htmlMode, state.htmlState) + if ((inner.mode.name == "xml" && inner.state.tagStart === null && + (!inner.state.context && inner.state.tokenize.isInText)) || + (state.md_inside && stream.current().indexOf(">") > -1)) { + state.f = inlineNormal; + state.block = blockNormal; + state.htmlState = null; + } + } + return style; + } + + function local(stream, state) { + var currListInd = state.listStack[state.listStack.length - 1] || 0; + var hasExitedList = state.indentation < currListInd; + var maxFencedEndInd = currListInd + 3; + if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) { + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + var returnType; + if (!hasExitedList) returnType = getType(state) + state.localMode = state.localState = null; + state.block = blockNormal; + state.f = inlineNormal; + state.fencedEndRE = null; + state.code = 0 + state.thisLine.fencedCodeEnd = true; + if (hasExitedList) return switchBlock(stream, state, state.block); + return returnType; + } else if (state.localMode) { + return state.localMode.token(stream, state.localState); + } else { + stream.skipToEnd(); + return tokenTypes.code; + } + } + + // Inline + function getType(state) { + var styles = []; + + if (state.formatting) { + styles.push(tokenTypes.formatting); + + if (typeof state.formatting === "string") state.formatting = [state.formatting]; + + for (var i = 0; i < state.formatting.length; i++) { + styles.push(tokenTypes.formatting + "-" + state.formatting[i]); + + if (state.formatting[i] === "header") { + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header); + } + + // Add `formatting-quote` and `formatting-quote-#` for blockquotes + // Add `error` instead if the maximum blockquote nesting depth is passed + if (state.formatting[i] === "quote") { + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote); + } else { + styles.push("error"); + } + } + } + } + + if (state.taskOpen) { + styles.push("meta"); + return styles.length ? styles.join(' ') : null; + } + if (state.taskClosed) { + styles.push("property"); + return styles.length ? styles.join(' ') : null; + } + + if (state.linkHref) { + styles.push(tokenTypes.linkHref, "url"); + } else { // Only apply inline styles to non-url text + if (state.strong) { styles.push(tokenTypes.strong); } + if (state.em) { styles.push(tokenTypes.em); } + if (state.strikethrough) { styles.push(tokenTypes.strikethrough); } + if (state.emoji) { styles.push(tokenTypes.emoji); } + if (state.linkText) { styles.push(tokenTypes.linkText); } + if (state.code) { styles.push(tokenTypes.code); } + if (state.image) { styles.push(tokenTypes.image); } + if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); } + if (state.imageMarker) { styles.push(tokenTypes.imageMarker); } + } + + if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); } + + if (state.quote) { + styles.push(tokenTypes.quote); + + // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(tokenTypes.quote + "-" + state.quote); + } else { + styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth); + } + } + + if (state.list !== false) { + var listMod = (state.listStack.length - 1) % 3; + if (!listMod) { + styles.push(tokenTypes.list1); + } else if (listMod === 1) { + styles.push(tokenTypes.list2); + } else { + styles.push(tokenTypes.list3); + } + } + + if (state.trailingSpaceNewLine) { + styles.push("trailing-space-new-line"); + } else if (state.trailingSpace) { + styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b")); + } + + return styles.length ? styles.join(' ') : null; + } + + function handleText(stream, state) { + if (stream.match(textRE, true)) { + return getType(state); + } + return undefined; + } + + function inlineNormal(stream, state) { + var style = state.text(stream, state); + if (typeof style !== 'undefined') + return style; + + if (state.list) { // List marker (*, +, -, 1., etc) + state.list = null; + return getType(state); + } + + if (state.taskList) { + var taskOpen = stream.match(taskListRE, true)[1] === " "; + if (taskOpen) state.taskOpen = true; + else state.taskClosed = true; + if (modeCfg.highlightFormatting) state.formatting = "task"; + state.taskList = false; + return getType(state); + } + + state.taskOpen = false; + state.taskClosed = false; + + if (state.header && stream.match(/^#+$/, true)) { + if (modeCfg.highlightFormatting) state.formatting = "header"; + return getType(state); + } + + var ch = stream.next(); + + // Matches link titles present on next line + if (state.linkTitle) { + state.linkTitle = false; + var matchCh = ch; + if (ch === '(') { + matchCh = ')'; + } + matchCh = (matchCh+'').replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1"); + var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; + if (stream.match(new RegExp(regex), true)) { + return tokenTypes.linkHref; + } + } + + // If this block is changed, it may need to be updated in GFM mode + if (ch === '`') { + var previousFormatting = state.formatting; + if (modeCfg.highlightFormatting) state.formatting = "code"; + stream.eatWhile('`'); + var count = stream.current().length + if (state.code == 0 && (!state.quote || count == 1)) { + state.code = count + return getType(state) + } else if (count == state.code) { // Must be exact + var t = getType(state) + state.code = 0 + return t + } else { + state.formatting = previousFormatting + return getType(state) + } + } else if (state.code) { + return getType(state); + } + + if (ch === '\\') { + stream.next(); + if (modeCfg.highlightFormatting) { + var type = getType(state); + var formattingEscape = tokenTypes.formatting + "-escape"; + return type ? type + " " + formattingEscape : formattingEscape; + } + } + + if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { + state.imageMarker = true; + state.image = true; + if (modeCfg.highlightFormatting) state.formatting = "image"; + return getType(state); + } + + if (ch === '[' && state.imageMarker && stream.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/, false)) { + state.imageMarker = false; + state.imageAltText = true + if (modeCfg.highlightFormatting) state.formatting = "image"; + return getType(state); + } + + if (ch === ']' && state.imageAltText) { + if (modeCfg.highlightFormatting) state.formatting = "image"; + var type = getType(state); + state.imageAltText = false; + state.image = false; + state.inline = state.f = linkHref; + return type; + } + + if (ch === '[' && !state.image) { + state.linkText = true; + if (modeCfg.highlightFormatting) state.formatting = "link"; + return getType(state); + } + + if (ch === ']' && state.linkText) { + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + state.linkText = false; + state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal + return type; + } + + if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkInline; + } + + if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkEmail; + } + + if (modeCfg.xml && ch === '<' && stream.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i, false)) { + var end = stream.string.indexOf(">", stream.pos); + if (end != -1) { + var atts = stream.string.substring(stream.start, end); + if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true; + } + stream.backUp(1); + state.htmlState = CodeMirror.startState(htmlMode); + return switchBlock(stream, state, htmlBlock); + } + + if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) { + state.md_inside = false; + return "tag"; + } else if (ch === "*" || ch === "_") { + var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2) + while (len < 3 && stream.eat(ch)) len++ + var after = stream.peek() || " " + // See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis + var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before)) + var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after)) + var setEm = null, setStrong = null + if (len % 2) { // Em + if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before))) + setEm = true + else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after))) + setEm = false + } + if (len > 1) { // Strong + if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before))) + setStrong = true + else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after))) + setStrong = false + } + if (setStrong != null || setEm != null) { + if (modeCfg.highlightFormatting) state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em" + if (setEm === true) state.em = ch + if (setStrong === true) state.strong = ch + var t = getType(state) + if (setEm === false) state.em = false + if (setStrong === false) state.strong = false + return t + } + } else if (ch === ' ') { + if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(1); + } + } + } + + if (modeCfg.strikethrough) { + if (ch === '~' && stream.eatWhile(ch)) { + if (state.strikethrough) {// Remove strikethrough + if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; + var t = getType(state); + state.strikethrough = false; + return t; + } else if (stream.match(/^[^\s]/, false)) {// Add strikethrough + state.strikethrough = true; + if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; + return getType(state); + } + } else if (ch === ' ') { + if (stream.match(/^~~/, true)) { // Probably surrounded by space + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(2); + } + } + } + } + + if (modeCfg.emoji && ch === ":" && stream.match(/^[a-z_\d+-]+:/)) { + state.emoji = true; + if (modeCfg.highlightFormatting) state.formatting = "emoji"; + var retType = getType(state); + state.emoji = false; + return retType; + } + + if (ch === ' ') { + if (stream.match(/ +$/, false)) { + state.trailingSpace++; + } else if (state.trailingSpace) { + state.trailingSpaceNewLine = true; + } + } + + return getType(state); + } + + function linkInline(stream, state) { + var ch = stream.next(); + + if (ch === ">") { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkInline; + } + + stream.match(/^[^>]+/, true); + + return tokenTypes.linkInline; + } + + function linkHref(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + var ch = stream.next(); + if (ch === '(' || ch === '[') { + state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]"); + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + state.linkHref = true; + return getType(state); + } + return 'error'; + } + + var linkRE = { + ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/, + "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/ + } + + function getLinkHrefInside(endChar) { + return function(stream, state) { + var ch = stream.next(); + + if (ch === endChar) { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + var returnState = getType(state); + state.linkHref = false; + return returnState; + } + + stream.match(linkRE[endChar]) + state.linkHref = true; + return getType(state); + }; + } + + function footnoteLink(stream, state) { + if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) { + state.f = footnoteLinkInside; + stream.next(); // Consume [ + if (modeCfg.highlightFormatting) state.formatting = "link"; + state.linkText = true; + return getType(state); + } + return switchInline(stream, state, inlineNormal); + } + + function footnoteLinkInside(stream, state) { + if (stream.match(/^\]:/, true)) { + state.f = state.inline = footnoteUrl; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var returnType = getType(state); + state.linkText = false; + return returnType; + } + + stream.match(/^([^\]\\]|\\.)+/, true); + + return tokenTypes.linkText; + } + + function footnoteUrl(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + // Match URL + stream.match(/^[^\s]+/, true); + // Check for link title + if (stream.peek() === undefined) { // End of line, set flag to check next line + state.linkTitle = true; + } else { // More content on line, check if link title + stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); + } + state.f = state.inline = inlineNormal; + return tokenTypes.linkHref + " url"; + } + + var mode = { + startState: function() { + return { + f: blockNormal, + + prevLine: {stream: null}, + thisLine: {stream: null}, + + block: blockNormal, + htmlState: null, + indentation: 0, + + inline: inlineNormal, + text: handleText, + + formatting: false, + linkText: false, + linkHref: false, + linkTitle: false, + code: 0, + em: false, + strong: false, + header: 0, + setext: 0, + hr: false, + taskList: false, + list: false, + listStack: [], + quote: 0, + trailingSpace: 0, + trailingSpaceNewLine: false, + strikethrough: false, + emoji: false, + fencedEndRE: null + }; + }, + + copyState: function(s) { + return { + f: s.f, + + prevLine: s.prevLine, + thisLine: s.thisLine, + + block: s.block, + htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), + indentation: s.indentation, + + localMode: s.localMode, + localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, + + inline: s.inline, + text: s.text, + formatting: false, + linkText: s.linkText, + linkTitle: s.linkTitle, + code: s.code, + em: s.em, + strong: s.strong, + strikethrough: s.strikethrough, + emoji: s.emoji, + header: s.header, + setext: s.setext, + hr: s.hr, + taskList: s.taskList, + list: s.list, + listStack: s.listStack.slice(0), + quote: s.quote, + indentedCode: s.indentedCode, + trailingSpace: s.trailingSpace, + trailingSpaceNewLine: s.trailingSpaceNewLine, + md_inside: s.md_inside, + fencedEndRE: s.fencedEndRE + }; + }, + + token: function(stream, state) { + + // Reset state.formatting + state.formatting = false; + + if (stream != state.thisLine.stream) { + state.header = 0; + state.hr = false; + + if (stream.match(/^\s*$/, true)) { + blankLine(state); + return null; + } + + state.prevLine = state.thisLine + state.thisLine = {stream: stream} + + // Reset state.taskList + state.taskList = false; + + // Reset state.trailingSpace + state.trailingSpace = 0; + state.trailingSpaceNewLine = false; + + if (!state.localState) { + state.f = state.block; + if (state.f != htmlBlock) { + var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length; + state.indentation = indentation; + state.indentationDiff = null; + if (indentation > 0) return null; + } + } + } + return state.f(stream, state); + }, + + innerMode: function(state) { + if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; + if (state.localState) return {state: state.localState, mode: state.localMode}; + return {state: state, mode: mode}; + }, + + indent: function(state, textAfter, line) { + if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line) + if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line) + return CodeMirror.Pass + }, + + blankLine: blankLine, + + getType: getType, + + closeBrackets: "()[]{}''\"\"``", + fold: "markdown" + }; + return mode; +}, "xml"); + +CodeMirror.defineMIME("text/x-markdown", "markdown"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/jsx/jsx.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod) + else // Plain browser env + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + + // Depth means the amount of open braces in JS context, in XML + // context 0 means not in tag, 1 means in tag, and 2 means in tag + // and js block comment. + function Context(state, mode, depth, prev) { + this.state = state; this.mode = mode; this.depth = depth; this.prev = prev + } + + function copyContext(context) { + return new Context(CodeMirror.copyState(context.mode, context.state), + context.mode, + context.depth, + context.prev && copyContext(context.prev)) + } + + CodeMirror.defineMode("jsx", function(config, modeConfig) { + var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false}) + var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript") + + function flatXMLIndent(state) { + var tagName = state.tagName + state.tagName = null + var result = xmlMode.indent(state, "") + state.tagName = tagName + return result + } + + function token(stream, state) { + if (state.context.mode == xmlMode) + return xmlToken(stream, state, state.context) + else + return jsToken(stream, state, state.context) + } + + function xmlToken(stream, state, cx) { + if (cx.depth == 2) { // Inside a JS /* */ comment + if (stream.match(/^.*?\*\//)) cx.depth = 1 + else stream.skipToEnd() + return "comment" + } + + if (stream.peek() == "{") { + xmlMode.skipAttribute(cx.state) + + var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context + // If JS starts on same line as tag + if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) { + while (xmlContext.prev && !xmlContext.startOfLine) + xmlContext = xmlContext.prev + // If tag starts the line, use XML indentation level + if (xmlContext.startOfLine) indent -= config.indentUnit + // Else use JS indentation level + else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented + // Else if inside of tag + } else if (cx.depth == 1) { + indent += config.indentUnit + } + + state.context = new Context(CodeMirror.startState(jsMode, indent), + jsMode, 0, state.context) + return null + } + + if (cx.depth == 1) { // Inside of tag + if (stream.peek() == "<") { // Tag inside of tag + xmlMode.skipAttribute(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)), + xmlMode, 0, state.context) + return null + } else if (stream.match("//")) { + stream.skipToEnd() + return "comment" + } else if (stream.match("/*")) { + cx.depth = 2 + return token(stream, state) + } + } + + var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop + if (/\btag\b/.test(style)) { + if (/>$/.test(cur)) { + if (cx.state.context) cx.depth = 0 + else state.context = state.context.prev + } else if (/^</.test(cur)) { + cx.depth = 1 + } + } else if (!style && (stop = cur.indexOf("{")) > -1) { + stream.backUp(cur.length - stop) + } + return style + } + + function jsToken(stream, state, cx) { + if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) { + jsMode.skipExpression(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")), + xmlMode, 0, state.context) + return null + } + + var style = jsMode.token(stream, cx.state) + if (!style && cx.depth != null) { + var cur = stream.current() + if (cur == "{") { + cx.depth++ + } else if (cur == "}") { + if (--cx.depth == 0) state.context = state.context.prev + } + } + return style + } + + return { + startState: function() { + return {context: new Context(CodeMirror.startState(jsMode), jsMode)} + }, + + copyState: function(state) { + return {context: copyContext(state.context)} + }, + + token: token, + + indent: function(state, textAfter, fullLine) { + return state.context.mode.indent(state.context.state, textAfter, fullLine) + }, + + innerMode: function(state) { + return state.context + } + } + }, "xml", "javascript") + + CodeMirror.defineMIME("text/jsx", "jsx") + CodeMirror.defineMIME("text/typescript-jsx", {name: "jsx", base: {name: "javascript", typescript: true}}) +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/velocity/velocity.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("velocity", function() { + function parseWords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var keywords = parseWords("#end #else #break #stop #[[ #]] " + + "#{end} #{else} #{break} #{stop}"); + var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + + "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); + var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"); + var isOperatorChar = /[+\-*&%=<>!?:\/|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + function tokenBase(stream, state) { + var beforeParams = state.beforeParams; + state.beforeParams = false; + var ch = stream.next(); + // start of unparsed string? + if ((ch == "'") && !state.inString && state.inParams) { + state.lastTokenWasBuiltin = false; + return chain(stream, state, tokenString(ch)); + } + // start of parsed string? + else if ((ch == '"')) { + state.lastTokenWasBuiltin = false; + if (state.inString) { + state.inString = false; + return "string"; + } + else if (state.inParams) + return chain(stream, state, tokenString(ch)); + } + // is it one of the special signs []{}().,;? Seperator? + else if (/[\[\]{}\(\),;\.]/.test(ch)) { + if (ch == "(" && beforeParams) + state.inParams = true; + else if (ch == ")") { + state.inParams = false; + state.lastTokenWasBuiltin = true; + } + return null; + } + // start of a number value? + else if (/\d/.test(ch)) { + state.lastTokenWasBuiltin = false; + stream.eatWhile(/[\w\.]/); + return "number"; + } + // multi line comment? + else if (ch == "#" && stream.eat("*")) { + state.lastTokenWasBuiltin = false; + return chain(stream, state, tokenComment); + } + // unparsed content? + else if (ch == "#" && stream.match(/ *\[ *\[/)) { + state.lastTokenWasBuiltin = false; + return chain(stream, state, tokenUnparsed); + } + // single line comment? + else if (ch == "#" && stream.eat("#")) { + state.lastTokenWasBuiltin = false; + stream.skipToEnd(); + return "comment"; + } + // variable? + else if (ch == "$") { + stream.eatWhile(/[\w\d\$_\.{}]/); + // is it one of the specials? + if (specials && specials.propertyIsEnumerable(stream.current())) { + return "keyword"; + } + else { + state.lastTokenWasBuiltin = true; + state.beforeParams = true; + return "builtin"; + } + } + // is it a operator? + else if (isOperatorChar.test(ch)) { + state.lastTokenWasBuiltin = false; + stream.eatWhile(isOperatorChar); + return "operator"; + } + else { + // get the whole word + stream.eatWhile(/[\w\$_{}@]/); + var word = stream.current(); + // is it one of the listed keywords? + if (keywords && keywords.propertyIsEnumerable(word)) + return "keyword"; + // is it one of the listed functions? + if (functions && functions.propertyIsEnumerable(word) || + (stream.current().match(/^#@?[a-z0-9_]+ *$/i) && stream.peek()=="(") && + !(functions && functions.propertyIsEnumerable(word.toLowerCase()))) { + state.beforeParams = true; + state.lastTokenWasBuiltin = false; + return "keyword"; + } + if (state.inString) { + state.lastTokenWasBuiltin = false; + return "string"; + } + if (stream.pos > word.length && stream.string.charAt(stream.pos-word.length-1)=="." && state.lastTokenWasBuiltin) + return "builtin"; + // default: just a "word" + state.lastTokenWasBuiltin = false; + return null; + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if ((next == quote) && !escaped) { + end = true; + break; + } + if (quote=='"' && stream.peek() == '$' && !escaped) { + state.inString = true; + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end) state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "#" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenUnparsed(stream, state) { + var maybeEnd = 0, ch; + while (ch = stream.next()) { + if (ch == "#" && maybeEnd == 2) { + state.tokenize = tokenBase; + break; + } + if (ch == "]") + maybeEnd++; + else if (ch != " ") + maybeEnd = 0; + } + return "meta"; + } + // Interface + + return { + startState: function() { + return { + tokenize: tokenBase, + beforeParams: false, + inParams: false, + inString: false, + lastTokenWasBuiltin: false + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + }, + blockCommentStart: "#*", + blockCommentEnd: "*#", + lineComment: "##", + fold: "velocity" + }; +}); + +CodeMirror.defineMIME("text/velocity", "velocity"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/fortran/fortran.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("fortran", function() { + function words(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i]] = true; + } + return keys; + } + + var keywords = words([ + "abstract", "accept", "allocatable", "allocate", + "array", "assign", "asynchronous", "backspace", + "bind", "block", "byte", "call", "case", + "class", "close", "common", "contains", + "continue", "cycle", "data", "deallocate", + "decode", "deferred", "dimension", "do", + "elemental", "else", "encode", "end", + "endif", "entry", "enumerator", "equivalence", + "exit", "external", "extrinsic", "final", + "forall", "format", "function", "generic", + "go", "goto", "if", "implicit", "import", "include", + "inquire", "intent", "interface", "intrinsic", + "module", "namelist", "non_intrinsic", + "non_overridable", "none", "nopass", + "nullify", "open", "optional", "options", + "parameter", "pass", "pause", "pointer", + "print", "private", "program", "protected", + "public", "pure", "read", "recursive", "result", + "return", "rewind", "save", "select", "sequence", + "stop", "subroutine", "target", "then", "to", "type", + "use", "value", "volatile", "where", "while", + "write"]); + var builtins = words(["abort", "abs", "access", "achar", "acos", + "adjustl", "adjustr", "aimag", "aint", "alarm", + "all", "allocated", "alog", "amax", "amin", + "amod", "and", "anint", "any", "asin", + "associated", "atan", "besj", "besjn", "besy", + "besyn", "bit_size", "btest", "cabs", "ccos", + "ceiling", "cexp", "char", "chdir", "chmod", + "clog", "cmplx", "command_argument_count", + "complex", "conjg", "cos", "cosh", "count", + "cpu_time", "cshift", "csin", "csqrt", "ctime", + "c_funloc", "c_loc", "c_associated", "c_null_ptr", + "c_null_funptr", "c_f_pointer", "c_null_char", + "c_alert", "c_backspace", "c_form_feed", + "c_new_line", "c_carriage_return", + "c_horizontal_tab", "c_vertical_tab", "dabs", + "dacos", "dasin", "datan", "date_and_time", + "dbesj", "dbesj", "dbesjn", "dbesy", "dbesy", + "dbesyn", "dble", "dcos", "dcosh", "ddim", "derf", + "derfc", "dexp", "digits", "dim", "dint", "dlog", + "dlog", "dmax", "dmin", "dmod", "dnint", + "dot_product", "dprod", "dsign", "dsinh", + "dsin", "dsqrt", "dtanh", "dtan", "dtime", + "eoshift", "epsilon", "erf", "erfc", "etime", + "exit", "exp", "exponent", "extends_type_of", + "fdate", "fget", "fgetc", "float", "floor", + "flush", "fnum", "fputc", "fput", "fraction", + "fseek", "fstat", "ftell", "gerror", "getarg", + "get_command", "get_command_argument", + "get_environment_variable", "getcwd", + "getenv", "getgid", "getlog", "getpid", + "getuid", "gmtime", "hostnm", "huge", "iabs", + "iachar", "iand", "iargc", "ibclr", "ibits", + "ibset", "ichar", "idate", "idim", "idint", + "idnint", "ieor", "ierrno", "ifix", "imag", + "imagpart", "index", "int", "ior", "irand", + "isatty", "ishft", "ishftc", "isign", + "iso_c_binding", "is_iostat_end", "is_iostat_eor", + "itime", "kill", "kind", "lbound", "len", "len_trim", + "lge", "lgt", "link", "lle", "llt", "lnblnk", "loc", + "log", "logical", "long", "lshift", "lstat", "ltime", + "matmul", "max", "maxexponent", "maxloc", "maxval", + "mclock", "merge", "move_alloc", "min", "minexponent", + "minloc", "minval", "mod", "modulo", "mvbits", + "nearest", "new_line", "nint", "not", "or", "pack", + "perror", "precision", "present", "product", "radix", + "rand", "random_number", "random_seed", "range", + "real", "realpart", "rename", "repeat", "reshape", + "rrspacing", "rshift", "same_type_as", "scale", + "scan", "second", "selected_int_kind", + "selected_real_kind", "set_exponent", "shape", + "short", "sign", "signal", "sinh", "sin", "sleep", + "sngl", "spacing", "spread", "sqrt", "srand", "stat", + "sum", "symlnk", "system", "system_clock", "tan", + "tanh", "time", "tiny", "transfer", "transpose", + "trim", "ttynam", "ubound", "umask", "unlink", + "unpack", "verify", "xor", "zabs", "zcos", "zexp", + "zlog", "zsin", "zsqrt"]); + + var dataTypes = words(["c_bool", "c_char", "c_double", "c_double_complex", + "c_float", "c_float_complex", "c_funptr", "c_int", + "c_int16_t", "c_int32_t", "c_int64_t", "c_int8_t", + "c_int_fast16_t", "c_int_fast32_t", "c_int_fast64_t", + "c_int_fast8_t", "c_int_least16_t", "c_int_least32_t", + "c_int_least64_t", "c_int_least8_t", "c_intmax_t", + "c_intptr_t", "c_long", "c_long_double", + "c_long_double_complex", "c_long_long", "c_ptr", + "c_short", "c_signed_char", "c_size_t", "character", + "complex", "double", "integer", "logical", "real"]); + var isOperatorChar = /[+\-*&=<>\/\:]/; + var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i"); + + function tokenBase(stream, state) { + + if (stream.match(litOperator)){ + return 'operator'; + } + + var ch = stream.next(); + if (ch == "!") { + stream.skipToEnd(); + return "comment"; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]\(\),]/.test(ch)) { + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var word = stream.current().toLowerCase(); + + if (keywords.hasOwnProperty(word)){ + return 'keyword'; + } + if (builtins.hasOwnProperty(word) || dataTypes.hasOwnProperty(word)) { + return 'builtin'; + } + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end || !escaped) state.tokenize = null; + return "string"; + }; + } + + // Interface + + return { + startState: function() { + return {tokenize: null}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + return style; + } + }; +}); + +CodeMirror.defineMIME("text/x-fortran", "fortran"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/mirc/mirc.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMIME("text/mirc", "mirc"); +CodeMirror.defineMode("mirc", function() { + function parseWords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " + + "$activewid $address $addtok $agent $agentname $agentstat $agentver " + + "$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " + + "$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " + + "$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " + + "$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " + + "$com $comcall $comchan $comerr $compact $compress $comval $cos $count " + + "$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " + + "$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " + + "$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " + + "$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " + + "$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " + + "$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " + + "$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " + + "$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " + + "$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " + + "$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " + + "$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " + + "$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " + + "$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " + + "$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " + + "$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " + + "$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " + + "$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " + + "$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " + + "$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " + + "$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " + + "$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " + + "$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " + + "$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " + + "$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " + + "$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " + + "$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " + + "$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " + + "$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " + + "$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor"); + var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " + + "away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " + + "channel clear clearall cline clipboard close cnick color comclose comopen " + + "comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " + + "debug dec describe dialog did didtok disable disconnect dlevel dline dll " + + "dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " + + "drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " + + "events exit fclose filter findtext finger firewall flash flist flood flush " + + "flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " + + "gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " + + "halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " + + "ialmark identd if ignore iline inc invite iuser join kick linesep links list " + + "load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " + + "notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " + + "qme qmsg query queryn quit raw reload remini remote remove rename renwin " + + "reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " + + "say scid scon server set showmirc signam sline sockaccept sockclose socklist " + + "socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " + + "sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " + + "toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " + + "var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " + + "isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " + + "isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " + + "elseif else goto menu nicklist status title icon size option text edit " + + "button check radio box scroll list combo link tab item"); + var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); + var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + function tokenBase(stream, state) { + var beforeParams = state.beforeParams; + state.beforeParams = false; + var ch = stream.next(); + if (/[\[\]{}\(\),\.]/.test(ch)) { + if (ch == "(" && beforeParams) state.inParams = true; + else if (ch == ")") state.inParams = false; + return null; + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + else if (ch == "\\") { + stream.eat("\\"); + stream.eat(/./); + return "number"; + } + else if (ch == "/" && stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else if (ch == ";" && stream.match(/ *\( *\(/)) { + return chain(stream, state, tokenUnparsed); + } + else if (ch == ";" && !state.inParams) { + stream.skipToEnd(); + return "comment"; + } + else if (ch == '"') { + stream.eat(/"/); + return "keyword"; + } + else if (ch == "$") { + stream.eatWhile(/[$_a-z0-9A-Z\.:]/); + if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { + return "keyword"; + } + else { + state.beforeParams = true; + return "builtin"; + } + } + else if (ch == "%") { + stream.eatWhile(/[^,\s()]/); + state.beforeParams = true; + return "string"; + } + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + else { + stream.eatWhile(/[\w\$_{}]/); + var word = stream.current().toLowerCase(); + if (keywords && keywords.propertyIsEnumerable(word)) + return "keyword"; + if (functions && functions.propertyIsEnumerable(word)) { + state.beforeParams = true; + return "keyword"; + } + return null; + } + } + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + function tokenUnparsed(stream, state) { + var maybeEnd = 0, ch; + while (ch = stream.next()) { + if (ch == ";" && maybeEnd == 2) { + state.tokenize = tokenBase; + break; + } + if (ch == ")") + maybeEnd++; + else if (ch != " ") + maybeEnd = 0; + } + return "meta"; + } + return { + startState: function() { + return { + tokenize: tokenBase, + beforeParams: false, + inParams: false + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + } + }; +}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/xquery/xquery.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("xquery", function() { + + // The keywords object is set to the result of this self executing + // function. Each keyword is a property of the keywords object whose + // value is {type: atype, style: astyle} + var keywords = function(){ + // convenience functions used to build keywords object + function kw(type) {return {type: type, style: "keyword"};} + var operator = kw("operator") + , atom = {type: "atom", style: "atom"} + , punctuation = {type: "punctuation", style: null} + , qualifier = {type: "axis_specifier", style: "qualifier"}; + + // kwObj is what is return from this function at the end + var kwObj = { + ',': punctuation + }; + + // a list of 'basic' keywords. For each add a property to kwObj with the value of + // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"} + var basic = ['after', 'all', 'allowing', 'ancestor', 'ancestor-or-self', 'any', 'array', 'as', + 'ascending', 'at', 'attribute', 'base-uri', 'before', 'boundary-space', 'by', 'case', 'cast', + 'castable', 'catch', 'child', 'collation', 'comment', 'construction', 'contains', 'content', + 'context', 'copy', 'copy-namespaces', 'count', 'decimal-format', 'declare', 'default', 'delete', + 'descendant', 'descendant-or-self', 'descending', 'diacritics', 'different', 'distance', + 'document', 'document-node', 'element', 'else', 'empty', 'empty-sequence', 'encoding', 'end', + 'entire', 'every', 'exactly', 'except', 'external', 'first', 'following', 'following-sibling', + 'for', 'from', 'ftand', 'ftnot', 'ft-option', 'ftor', 'function', 'fuzzy', 'greatest', 'group', + 'if', 'import', 'in', 'inherit', 'insensitive', 'insert', 'instance', 'intersect', 'into', + 'invoke', 'is', 'item', 'language', 'last', 'lax', 'least', 'let', 'levels', 'lowercase', 'map', + 'modify', 'module', 'most', 'namespace', 'next', 'no', 'node', 'nodes', 'no-inherit', + 'no-preserve', 'not', 'occurs', 'of', 'only', 'option', 'order', 'ordered', 'ordering', + 'paragraph', 'paragraphs', 'parent', 'phrase', 'preceding', 'preceding-sibling', 'preserve', + 'previous', 'processing-instruction', 'relationship', 'rename', 'replace', 'return', + 'revalidation', 'same', 'satisfies', 'schema', 'schema-attribute', 'schema-element', 'score', + 'self', 'sensitive', 'sentence', 'sentences', 'sequence', 'skip', 'sliding', 'some', 'stable', + 'start', 'stemming', 'stop', 'strict', 'strip', 'switch', 'text', 'then', 'thesaurus', 'times', + 'to', 'transform', 'treat', 'try', 'tumbling', 'type', 'typeswitch', 'union', 'unordered', + 'update', 'updating', 'uppercase', 'using', 'validate', 'value', 'variable', 'version', + 'weight', 'when', 'where', 'wildcards', 'window', 'with', 'without', 'word', 'words', 'xquery']; + for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);}; + + // a list of types. For each add a property to kwObj with the value of + // {type: "atom", style: "atom"} + var types = ['xs:anyAtomicType', 'xs:anySimpleType', 'xs:anyType', 'xs:anyURI', + 'xs:base64Binary', 'xs:boolean', 'xs:byte', 'xs:date', 'xs:dateTime', 'xs:dateTimeStamp', + 'xs:dayTimeDuration', 'xs:decimal', 'xs:double', 'xs:duration', 'xs:ENTITIES', 'xs:ENTITY', + 'xs:float', 'xs:gDay', 'xs:gMonth', 'xs:gMonthDay', 'xs:gYear', 'xs:gYearMonth', 'xs:hexBinary', + 'xs:ID', 'xs:IDREF', 'xs:IDREFS', 'xs:int', 'xs:integer', 'xs:item', 'xs:java', 'xs:language', + 'xs:long', 'xs:Name', 'xs:NCName', 'xs:negativeInteger', 'xs:NMTOKEN', 'xs:NMTOKENS', + 'xs:nonNegativeInteger', 'xs:nonPositiveInteger', 'xs:normalizedString', 'xs:NOTATION', + 'xs:numeric', 'xs:positiveInteger', 'xs:precisionDecimal', 'xs:QName', 'xs:short', 'xs:string', + 'xs:time', 'xs:token', 'xs:unsignedByte', 'xs:unsignedInt', 'xs:unsignedLong', + 'xs:unsignedShort', 'xs:untyped', 'xs:untypedAtomic', 'xs:yearMonthDuration']; + for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;}; + + // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"} + var operators = ['eq', 'ne', 'lt', 'le', 'gt', 'ge', ':=', '=', '>', '>=', '<', '<=', '.', '|', '?', 'and', 'or', 'div', 'idiv', 'mod', '*', '/', '+', '-']; + for(var i=0, l=operators.length; i < l; i++) { kwObj[operators[i]] = operator;}; + + // each axis_specifiers will add a property to kwObj with value of {type: "axis_specifier", style: "qualifier"} + var axis_specifiers = ["self::", "attribute::", "child::", "descendant::", "descendant-or-self::", "parent::", + "ancestor::", "ancestor-or-self::", "following::", "preceding::", "following-sibling::", "preceding-sibling::"]; + for(var i=0, l=axis_specifiers.length; i < l; i++) { kwObj[axis_specifiers[i]] = qualifier; }; + + return kwObj; + }(); + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + // the primary mode tokenizer + function tokenBase(stream, state) { + var ch = stream.next(), + mightBeFunction = false, + isEQName = isEQNameAhead(stream); + + // an XML tag (if not in some sub, chained tokenizer) + if (ch == "<") { + if(stream.match("!--", true)) + return chain(stream, state, tokenXMLComment); + + if(stream.match("![CDATA", false)) { + state.tokenize = tokenCDATA; + return "tag"; + } + + if(stream.match("?", false)) { + return chain(stream, state, tokenPreProcessing); + } + + var isclose = stream.eat("/"); + stream.eatSpace(); + var tagName = "", c; + while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; + + return chain(stream, state, tokenTag(tagName, isclose)); + } + // start code block + else if(ch == "{") { + pushStateStack(state, { type: "codeblock"}); + return null; + } + // end code block + else if(ch == "}") { + popStateStack(state); + return null; + } + // if we're in an XML block + else if(isInXmlBlock(state)) { + if(ch == ">") + return "tag"; + else if(ch == "/" && stream.eat(">")) { + popStateStack(state); + return "tag"; + } + else + return "variable"; + } + // if a number + else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/); + return "atom"; + } + // comment start + else if (ch === "(" && stream.eat(":")) { + pushStateStack(state, { type: "comment"}); + return chain(stream, state, tokenComment); + } + // quoted string + else if (!isEQName && (ch === '"' || ch === "'")) + return chain(stream, state, tokenString(ch)); + // variable + else if(ch === "$") { + return chain(stream, state, tokenVariable); + } + // assignment + else if(ch ===":" && stream.eat("=")) { + return "keyword"; + } + // open paren + else if(ch === "(") { + pushStateStack(state, { type: "paren"}); + return null; + } + // close paren + else if(ch === ")") { + popStateStack(state); + return null; + } + // open paren + else if(ch === "[") { + pushStateStack(state, { type: "bracket"}); + return null; + } + // close paren + else if(ch === "]") { + popStateStack(state); + return null; + } + else { + var known = keywords.propertyIsEnumerable(ch) && keywords[ch]; + + // if there's a EQName ahead, consume the rest of the string portion, it's likely a function + if(isEQName && ch === '\"') while(stream.next() !== '"'){} + if(isEQName && ch === '\'') while(stream.next() !== '\''){} + + // gobble up a word if the character is not known + if(!known) stream.eatWhile(/[\w\$_-]/); + + // gobble a colon in the case that is a lib func type call fn:doc + var foundColon = stream.eat(":"); + + // if there's not a second colon, gobble another word. Otherwise, it's probably an axis specifier + // which should get matched as a keyword + if(!stream.eat(":") && foundColon) { + stream.eatWhile(/[\w\$_-]/); + } + // if the next non whitespace character is an open paren, this is probably a function (if not a keyword of other sort) + if(stream.match(/^[ \t]*\(/, false)) { + mightBeFunction = true; + } + // is the word a keyword? + var word = stream.current(); + known = keywords.propertyIsEnumerable(word) && keywords[word]; + + // if we think it's a function call but not yet known, + // set style to variable for now for lack of something better + if(mightBeFunction && !known) known = {type: "function_call", style: "variable def"}; + + // if the previous word was element, attribute, axis specifier, this word should be the name of that + if(isInXmlConstructor(state)) { + popStateStack(state); + return "variable"; + } + // as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and + // push the stack so we know to look for it on the next word + if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"}); + + // if the word is known, return the details of that else just call this a generic 'word' + return known ? known.style : "variable"; + } + } + + // handle comments, including nested + function tokenComment(stream, state) { + var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; + while (ch = stream.next()) { + if (ch == ")" && maybeEnd) { + if(nestedCount > 0) + nestedCount--; + else { + popStateStack(state); + break; + } + } + else if(ch == ":" && maybeNested) { + nestedCount++; + } + maybeEnd = (ch == ":"); + maybeNested = (ch == "("); + } + + return "comment"; + } + + // tokenizer for string literals + // optionally pass a tokenizer function to set state.tokenize back to when finished + function tokenString(quote, f) { + return function(stream, state) { + var ch; + + if(isInString(state) && stream.current() == quote) { + popStateStack(state); + if(f) state.tokenize = f; + return "string"; + } + + pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) }); + + // if we're in a string and in an XML block, allow an embedded code block + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; + return "string"; + } + + + while (ch = stream.next()) { + if (ch == quote) { + popStateStack(state); + if(f) state.tokenize = f; + break; + } + else { + // if we're in a string and in an XML block, allow an embedded code block in an attribute + if(stream.match("{", false) && isInXmlAttributeBlock(state)) { + state.tokenize = tokenBase; + return "string"; + } + + } + } + + return "string"; + }; + } + + // tokenizer for variables + function tokenVariable(stream, state) { + var isVariableChar = /[\w\$_-]/; + + // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote + if(stream.eat("\"")) { + while(stream.next() !== '\"'){}; + stream.eat(":"); + } else { + stream.eatWhile(isVariableChar); + if(!stream.match(":=", false)) stream.eat(":"); + } + stream.eatWhile(isVariableChar); + state.tokenize = tokenBase; + return "variable"; + } + + // tokenizer for XML tags + function tokenTag(name, isclose) { + return function(stream, state) { + stream.eatSpace(); + if(isclose && stream.eat(">")) { + popStateStack(state); + state.tokenize = tokenBase; + return "tag"; + } + // self closing tag without attributes? + if(!stream.eat("/")) + pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase}); + if(!stream.eat(">")) { + state.tokenize = tokenAttribute; + return "tag"; + } + else { + state.tokenize = tokenBase; + } + return "tag"; + }; + } + + // tokenizer for XML attributes + function tokenAttribute(stream, state) { + var ch = stream.next(); + + if(ch == "/" && stream.eat(">")) { + if(isInXmlAttributeBlock(state)) popStateStack(state); + if(isInXmlBlock(state)) popStateStack(state); + return "tag"; + } + if(ch == ">") { + if(isInXmlAttributeBlock(state)) popStateStack(state); + return "tag"; + } + if(ch == "=") + return null; + // quoted string + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch, tokenAttribute)); + + if(!isInXmlAttributeBlock(state)) + pushStateStack(state, { type: "attribute", tokenize: tokenAttribute}); + + stream.eat(/[a-zA-Z_:]/); + stream.eatWhile(/[-a-zA-Z0-9_:.]/); + stream.eatSpace(); + + // the case where the attribute has not value and the tag was closed + if(stream.match(">", false) || stream.match("/", false)) { + popStateStack(state); + state.tokenize = tokenBase; + } + + return "attribute"; + } + + // handle comments, including nested + function tokenXMLComment(stream, state) { + var ch; + while (ch = stream.next()) { + if (ch == "-" && stream.match("->", true)) { + state.tokenize = tokenBase; + return "comment"; + } + } + } + + + // handle CDATA + function tokenCDATA(stream, state) { + var ch; + while (ch = stream.next()) { + if (ch == "]" && stream.match("]", true)) { + state.tokenize = tokenBase; + return "comment"; + } + } + } + + // handle preprocessing instructions + function tokenPreProcessing(stream, state) { + var ch; + while (ch = stream.next()) { + if (ch == "?" && stream.match(">", true)) { + state.tokenize = tokenBase; + return "comment meta"; + } + } + } + + + // functions to test the current context of the state + function isInXmlBlock(state) { return isIn(state, "tag"); } + function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); } + function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"); } + function isInString(state) { return isIn(state, "string"); } + + function isEQNameAhead(stream) { + // assume we've already eaten a quote (") + if(stream.current() === '"') + return stream.match(/^[^\"]+\"\:/, false); + else if(stream.current() === '\'') + return stream.match(/^[^\"]+\'\:/, false); + else + return false; + } + + function isIn(state, type) { + return (state.stack.length && state.stack[state.stack.length - 1].type == type); + } + + function pushStateStack(state, newState) { + state.stack.push(newState); + } + + function popStateStack(state) { + state.stack.pop(); + var reinstateTokenize = state.stack.length && state.stack[state.stack.length-1].tokenize; + state.tokenize = reinstateTokenize || tokenBase; + } + + // the interface for the mode API + return { + startState: function() { + return { + tokenize: tokenBase, + cc: [], + stack: [] + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + }, + + blockCommentStart: "(:", + blockCommentEnd: ":)" + + }; + +}); + +CodeMirror.defineMIME("application/xquery", "xquery"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/elm/elm.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("elm", function() { + + function switchState(source, setState, f) { + setState(f); + return f(source, setState); + } + + // These should all be Unicode extended, as per the Haskell 2010 report + var smallRE = /[a-z_]/; + var largeRE = /[A-Z]/; + var digitRE = /[0-9]/; + var hexitRE = /[0-9A-Fa-f]/; + var octitRE = /[0-7]/; + var idRE = /[a-z_A-Z0-9\']/; + var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/; + var specialRE = /[(),;[\]`{}]/; + var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer + + function normal() { + return function (source, setState) { + if (source.eatWhile(whiteCharRE)) { + return null; + } + + var ch = source.next(); + if (specialRE.test(ch)) { + if (ch == '{' && source.eat('-')) { + var t = "comment"; + if (source.eat('#')) t = "meta"; + return switchState(source, setState, ncomment(t, 1)); + } + return null; + } + + if (ch == '\'') { + if (source.eat('\\')) + source.next(); // should handle other escapes here + else + source.next(); + + if (source.eat('\'')) + return "string"; + return "error"; + } + + if (ch == '"') { + return switchState(source, setState, stringLiteral); + } + + if (largeRE.test(ch)) { + source.eatWhile(idRE); + if (source.eat('.')) + return "qualifier"; + return "variable-2"; + } + + if (smallRE.test(ch)) { + var isDef = source.pos === 1; + source.eatWhile(idRE); + return isDef ? "type" : "variable"; + } + + if (digitRE.test(ch)) { + if (ch == '0') { + if (source.eat(/[xX]/)) { + source.eatWhile(hexitRE); // should require at least 1 + return "integer"; + } + if (source.eat(/[oO]/)) { + source.eatWhile(octitRE); // should require at least 1 + return "number"; + } + } + source.eatWhile(digitRE); + var t = "number"; + if (source.eat('.')) { + t = "number"; + source.eatWhile(digitRE); // should require at least 1 + } + if (source.eat(/[eE]/)) { + t = "number"; + source.eat(/[-+]/); + source.eatWhile(digitRE); // should require at least 1 + } + return t; + } + + if (symbolRE.test(ch)) { + if (ch == '-' && source.eat(/-/)) { + source.eatWhile(/-/); + if (!source.eat(symbolRE)) { + source.skipToEnd(); + return "comment"; + } + } + source.eatWhile(symbolRE); + return "builtin"; + } + + return "error"; + } + } + + function ncomment(type, nest) { + if (nest == 0) { + return normal(); + } + return function(source, setState) { + var currNest = nest; + while (!source.eol()) { + var ch = source.next(); + if (ch == '{' && source.eat('-')) { + ++currNest; + } else if (ch == '-' && source.eat('}')) { + --currNest; + if (currNest == 0) { + setState(normal()); + return type; + } + } + } + setState(ncomment(type, currNest)); + return type; + } + } + + function stringLiteral(source, setState) { + while (!source.eol()) { + var ch = source.next(); + if (ch == '"') { + setState(normal()); + return "string"; + } + if (ch == '\\') { + if (source.eol() || source.eat(whiteCharRE)) { + setState(stringGap); + return "string"; + } + if (!source.eat('&')) source.next(); // should handle other escapes here + } + } + setState(normal()); + return "error"; + } + + function stringGap(source, setState) { + if (source.eat('\\')) { + return switchState(source, setState, stringLiteral); + } + source.next(); + setState(normal()); + return "error"; + } + + + var wellKnownWords = (function() { + var wkw = {}; + + var keywords = [ + "case", "of", "as", + "if", "then", "else", + "let", "in", + "infix", "infixl", "infixr", + "type", "alias", + "input", "output", "foreign", "loopback", + "module", "where", "import", "exposing", + "_", "..", "|", ":", "=", "\\", "\"", "->", "<-" + ]; + + for (var i = keywords.length; i--;) + wkw[keywords[i]] = "keyword"; + + return wkw; + })(); + + + + return { + startState: function () { return { f: normal() }; }, + copyState: function (s) { return { f: s.f }; }, + + token: function(stream, state) { + var t = state.f(stream, function(s) { state.f = s; }); + var w = stream.current(); + return (wellKnownWords.hasOwnProperty(w)) ? wellKnownWords[w] : t; + } + }; + + }); + + CodeMirror.defineMIME("text/x-elm", "elm"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/vhdl/vhdl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Originally written by Alf Nielsen, re-written by Michael Zhou +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function words(str) { + var obj = {}, words = str.split(","); + for (var i = 0; i < words.length; ++i) { + var allCaps = words[i].toUpperCase(); + var firstCap = words[i].charAt(0).toUpperCase() + words[i].slice(1); + obj[words[i]] = true; + obj[allCaps] = true; + obj[firstCap] = true; + } + return obj; +} + +function metaHook(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; +} + +CodeMirror.defineMode("vhdl", function(config, parserConfig) { + var indentUnit = config.indentUnit, + atoms = parserConfig.atoms || words("null"), + hooks = parserConfig.hooks || {"`": metaHook, "$": metaHook}, + multiLineStrings = parserConfig.multiLineStrings; + + var keywords = words("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block," + + "body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case," + + "end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for," + + "function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage," + + "literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map," + + "postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal," + + "sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"); + + var blockKeywords = words("architecture,entity,begin,case,port,else,elsif,end,for,function,if"); + + var isOperatorChar = /[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"') { + state.tokenize = tokenString2(ch); + return state.tokenize(stream, state); + } + if (ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/[\d']/.test(ch)) { + stream.eatWhile(/[\w\.']/); + return "number"; + } + if (ch == "-") { + if (stream.eat("-")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur.toLowerCase())) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "--"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return "string"; + }; + } + function tokenString2(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "--"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return "string-2"; + }; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-vhdl", "vhdl"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/verilog/verilog.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("verilog", function(config, parserConfig) { + + var indentUnit = config.indentUnit, + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + dontAlignCalls = parserConfig.dontAlignCalls, + noIndentKeywords = parserConfig.noIndentKeywords || [], + multiLineStrings = parserConfig.multiLineStrings, + hooks = parserConfig.hooks || {}; + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + /** + * Keywords from IEEE 1800-2012 + */ + var keywords = words( + "accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind " + + "bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config " + + "const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable " + + "dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup " + + "endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask " + + "enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin " + + "function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import " + + "incdir include initial inout input inside instance int integer interconnect interface intersect join join_any " + + "join_none large let liblist library local localparam logic longint macromodule matches medium modport module " + + "nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed " + + "parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup " + + "pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg " + + "reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime " + + "s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify " + + "specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on " + + "table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior " + + "trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void " + + "wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"); + + /** Operators from IEEE 1800-2012 + unary_operator ::= + + | - | ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ + binary_operator ::= + + | - | * | / | % | == | != | === | !== | ==? | !=? | && | || | ** + | < | <= | > | >= | & | | | ^ | ^~ | ~^ | >> | << | >>> | <<< + | -> | <-> + inc_or_dec_operator ::= ++ | -- + unary_module_path_operator ::= + ! | ~ | & | ~& | | | ~| | ^ | ~^ | ^~ + binary_module_path_operator ::= + == | != | && | || | & | | | ^ | ^~ | ~^ + */ + var isOperatorChar = /[\+\-\*\/!~&|^%=?:]/; + var isBracketChar = /[\[\]{}()]/; + + var unsignedNumber = /\d[0-9_]*/; + var decimalLiteral = /\d*\s*'s?d\s*\d[0-9_]*/i; + var binaryLiteral = /\d*\s*'s?b\s*[xz01][xz01_]*/i; + var octLiteral = /\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i; + var hexLiteral = /\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i; + var realLiteral = /(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i; + + var closingBracketOrWord = /^((\w+)|[)}\]])/; + var closingBracket = /[)}\]]/; + + var curPunc; + var curKeyword; + + // Block openings which are closed by a matching keyword in the form of ("end" + keyword) + // E.g. "task" => "endtask" + var blockKeywords = words( + "case checker class clocking config function generate interface module package " + + "primitive program property specify sequence table task" + ); + + // Opening/closing pairs + var openClose = {}; + for (var keyword in blockKeywords) { + openClose[keyword] = "end" + keyword; + } + openClose["begin"] = "end"; + openClose["casex"] = "endcase"; + openClose["casez"] = "endcase"; + openClose["do" ] = "while"; + openClose["fork" ] = "join;join_any;join_none"; + openClose["covergroup"] = "endgroup"; + + for (var i in noIndentKeywords) { + var keyword = noIndentKeywords[i]; + if (openClose[keyword]) { + openClose[keyword] = undefined; + } + } + + // Keywords which open statements that are ended with a semi-colon + var statementKeywords = words("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while"); + + function tokenBase(stream, state) { + var ch = stream.peek(), style; + if (hooks[ch] && (style = hooks[ch](stream, state)) != false) return style; + if (hooks.tokenBase && (style = hooks.tokenBase(stream, state)) != false) + return style; + + if (/[,;:\.]/.test(ch)) { + curPunc = stream.next(); + return null; + } + if (isBracketChar.test(ch)) { + curPunc = stream.next(); + return "bracket"; + } + // Macros (tick-defines) + if (ch == '`') { + stream.next(); + if (stream.eatWhile(/[\w\$_]/)) { + return "def"; + } else { + return null; + } + } + // System calls + if (ch == '$') { + stream.next(); + if (stream.eatWhile(/[\w\$_]/)) { + return "meta"; + } else { + return null; + } + } + // Time literals + if (ch == '#') { + stream.next(); + stream.eatWhile(/[\d_.]/); + return "def"; + } + // Strings + if (ch == '"') { + stream.next(); + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + // Comments + if (ch == "/") { + stream.next(); + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + stream.backUp(1); + } + + // Numeric literals + if (stream.match(realLiteral) || + stream.match(decimalLiteral) || + stream.match(binaryLiteral) || + stream.match(octLiteral) || + stream.match(hexLiteral) || + stream.match(unsignedNumber) || + stream.match(realLiteral)) { + return "number"; + } + + // Operators + if (stream.eatWhile(isOperatorChar)) { + return "meta"; + } + + // Keywords / plain variables + if (stream.eatWhile(/[\w\$_]/)) { + var cur = stream.current(); + if (keywords[cur]) { + if (openClose[cur]) { + curPunc = "newblock"; + } + if (statementKeywords[cur]) { + curPunc = "newstatement"; + } + curKeyword = cur; + return "keyword"; + } + return "variable"; + } + + stream.next(); + return null; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + var c = new Context(indent, col, type, null, state.context); + return state.context = c; + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") { + state.indented = state.context.indented; + } + return state.context = state.context.prev; + } + + function isClosing(text, contextClosing) { + if (text == contextClosing) { + return true; + } else { + // contextClosing may be multiple keywords separated by ; + var closingKeywords = contextClosing.split(";"); + for (var i in closingKeywords) { + if (text == closingKeywords[i]) { + return true; + } + } + return false; + } + } + + function buildElectricInputRegEx() { + // Reindentation should occur on any bracket char: {}()[] + // or on a match of any of the block closing keywords, at + // the end of a line + var allClosings = []; + for (var i in openClose) { + if (openClose[i]) { + var closings = openClose[i].split(";"); + for (var j in closings) { + allClosings.push(closings[j]); + } + } + } + var re = new RegExp("[{}()\\[\\]]|(" + allClosings.join("|") + ")$"); + return re; + } + + // Interface + return { + + // Regex to force current line to reindent + electricInput: buildElectricInputRegEx(), + + startState: function(basecolumn) { + var state = { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + if (hooks.startState) hooks.startState(state); + return state; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (hooks.token) { + // Call hook, with an optional return value of a style to override verilog styling. + var style = hooks.token(stream, state); + if (style !== undefined) { + return style; + } + } + if (stream.eatSpace()) return null; + curPunc = null; + curKeyword = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta" || style == "variable") return style; + if (ctx.align == null) ctx.align = true; + + if (curPunc == ctx.type) { + popContext(state); + } else if ((curPunc == ";" && ctx.type == "statement") || + (ctx.type && isClosing(curKeyword, ctx.type))) { + ctx = popContext(state); + while (ctx && ctx.type == "statement") ctx = popContext(state); + } else if (curPunc == "{") { + pushContext(state, stream.column(), "}"); + } else if (curPunc == "[") { + pushContext(state, stream.column(), "]"); + } else if (curPunc == "(") { + pushContext(state, stream.column(), ")"); + } else if (ctx && ctx.type == "endcase" && curPunc == ":") { + pushContext(state, stream.column(), "statement"); + } else if (curPunc == "newstatement") { + pushContext(state, stream.column(), "statement"); + } else if (curPunc == "newblock") { + if (curKeyword == "function" && ctx && (ctx.type == "statement" || ctx.type == "endgroup")) { + // The 'function' keyword can appear in some other contexts where it actually does not + // indicate a function (import/export DPI and covergroup definitions). + // Do nothing in this case + } else if (curKeyword == "task" && ctx && ctx.type == "statement") { + // Same thing for task + } else { + var close = openClose[curKeyword]; + pushContext(state, stream.column(), close); + } + } + + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + if (hooks.indent) { + var fromHook = hooks.indent(state); + if (fromHook >= 0) return fromHook; + } + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = false; + var possibleClosing = textAfter.match(closingBracketOrWord); + if (possibleClosing) + closing = isClosing(possibleClosing[0], ctx.type); + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); + else if (closingBracket.test(ctx.type) && ctx.align && !dontAlignCalls) return ctx.column + (closing ? 0 : 1); + else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit; + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + + CodeMirror.defineMIME("text/x-verilog", { + name: "verilog" + }); + + CodeMirror.defineMIME("text/x-systemverilog", { + name: "verilog" + }); + + + + // TL-Verilog mode. + // See tl-x.org for language spec. + // See the mode in action at makerchip.com. + // Contact: steve.hoover@redwoodeda.com + + // TLV Identifier prefixes. + // Note that sign is not treated separately, so "+/-" versions of numeric identifiers + // are included. + var tlvIdentifierStyle = { + "|": "link", + ">": "property", // Should condition this off for > TLV 1c. + "$": "variable", + "$$": "variable", + "?$": "qualifier", + "?*": "qualifier", + "-": "hr", + "/": "property", + "/-": "property", + "@": "variable-3", + "@-": "variable-3", + "@++": "variable-3", + "@+=": "variable-3", + "@+=-": "variable-3", + "@--": "variable-3", + "@-=": "variable-3", + "%+": "tag", + "%-": "tag", + "%": "tag", + ">>": "tag", + "<<": "tag", + "<>": "tag", + "#": "tag", // Need to choose a style for this. + "^": "attribute", + "^^": "attribute", + "^!": "attribute", + "*": "variable-2", + "**": "variable-2", + "\\": "keyword", + "\"": "comment" + }; + + // Lines starting with these characters define scope (result in indentation). + var tlvScopePrefixChars = { + "/": "beh-hier", + ">": "beh-hier", + "-": "phys-hier", + "|": "pipe", + "?": "when", + "@": "stage", + "\\": "keyword" + }; + var tlvIndentUnit = 3; + var tlvTrackStatements = false; + var tlvIdentMatch = /^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/; // Matches an identifiere. + // Note that ':' is excluded, because of it's use in [:]. + var tlvFirstLevelIndentMatch = /^[! ] /; + var tlvLineIndentationMatch = /^[! ] */; + var tlvCommentMatch = /^\/[\/\*]/; + + + // Returns a style specific to the scope at the given indentation column. + // Type is one of: "indent", "scope-ident", "before-scope-ident". + function tlvScopeStyle(state, indentation, type) { + // Begin scope. + var depth = indentation / tlvIndentUnit; // TODO: Pass this in instead. + return "tlv-" + state.tlvIndentationStyle[depth] + "-" + type; + } + + // Return true if the next thing in the stream is an identifier with a mnemonic. + function tlvIdentNext(stream) { + var match; + return (match = stream.match(tlvIdentMatch, false)) && match[2].length > 0; + } + + CodeMirror.defineMIME("text/x-tlv", { + name: "verilog", + + hooks: { + + electricInput: false, + + + // Return undefined for verilog tokenizing, or style for TLV token (null not used). + // Standard CM styles are used for most formatting, but some TL-Verilog-specific highlighting + // can be enabled with the definition of cm-tlv-* styles, including highlighting for: + // - M4 tokens + // - TLV scope indentation + // - Statement delimitation (enabled by tlvTrackStatements) + token: function(stream, state) { + var style = undefined; + var match; // Return value of pattern matches. + + // Set highlighting mode based on code region (TLV or SV). + if (stream.sol() && ! state.tlvInBlockComment) { + // Process region. + if (stream.peek() == '\\') { + style = "def"; + stream.skipToEnd(); + if (stream.string.match(/\\SV/)) { + state.tlvCodeActive = false; + } else if (stream.string.match(/\\TLV/)){ + state.tlvCodeActive = true; + } + } + // Correct indentation in the face of a line prefix char. + if (state.tlvCodeActive && stream.pos == 0 && + (state.indented == 0) && (match = stream.match(tlvLineIndentationMatch, false))) { + state.indented = match[0].length; + } + + // Compute indentation state: + // o Auto indentation on next line + // o Indentation scope styles + var indented = state.indented; + var depth = indented / tlvIndentUnit; + if (depth <= state.tlvIndentationStyle.length) { + // not deeper than current scope + + var blankline = stream.string.length == indented; + var chPos = depth * tlvIndentUnit; + if (chPos < stream.string.length) { + var bodyString = stream.string.slice(chPos); + var ch = bodyString[0]; + if (tlvScopePrefixChars[ch] && ((match = bodyString.match(tlvIdentMatch)) && + tlvIdentifierStyle[match[1]])) { + // This line begins scope. + // Next line gets indented one level. + indented += tlvIndentUnit; + // Style the next level of indentation (except non-region keyword identifiers, + // which are statements themselves) + if (!(ch == "\\" && chPos > 0)) { + state.tlvIndentationStyle[depth] = tlvScopePrefixChars[ch]; + if (tlvTrackStatements) {state.statementComment = false;} + depth++; + } + } + } + // Clear out deeper indentation levels unless line is blank. + if (!blankline) { + while (state.tlvIndentationStyle.length > depth) { + state.tlvIndentationStyle.pop(); + } + } + } + // Set next level of indentation. + state.tlvNextIndent = indented; + } + + if (state.tlvCodeActive) { + // Highlight as TLV. + + var beginStatement = false; + if (tlvTrackStatements) { + // This starts a statement if the position is at the scope level + // and we're not within a statement leading comment. + beginStatement = + (stream.peek() != " ") && // not a space + (style === undefined) && // not a region identifier + !state.tlvInBlockComment && // not in block comment + //!stream.match(tlvCommentMatch, false) && // not comment start + (stream.column() == state.tlvIndentationStyle.length * tlvIndentUnit); // at scope level + if (beginStatement) { + if (state.statementComment) { + // statement already started by comment + beginStatement = false; + } + state.statementComment = + stream.match(tlvCommentMatch, false); // comment start + } + } + + var match; + if (style !== undefined) { + // Region line. + style += " " + tlvScopeStyle(state, 0, "scope-ident") + } else if (((stream.pos / tlvIndentUnit) < state.tlvIndentationStyle.length) && + (match = stream.match(stream.sol() ? tlvFirstLevelIndentMatch : /^ /))) { + // Indentation + style = // make this style distinct from the previous one to prevent + // codemirror from combining spans + "tlv-indent-" + (((stream.pos % 2) == 0) ? "even" : "odd") + + // and style it + " " + tlvScopeStyle(state, stream.pos - tlvIndentUnit, "indent"); + // Style the line prefix character. + if (match[0].charAt(0) == "!") { + style += " tlv-alert-line-prefix"; + } + // Place a class before a scope identifier. + if (tlvIdentNext(stream)) { + style += " " + tlvScopeStyle(state, stream.pos, "before-scope-ident"); + } + } else if (state.tlvInBlockComment) { + // In a block comment. + if (stream.match(/^.*?\*\//)) { + // Exit block comment. + state.tlvInBlockComment = false; + if (tlvTrackStatements && !stream.eol()) { + // Anything after comment is assumed to be real statement content. + state.statementComment = false; + } + } else { + stream.skipToEnd(); + } + style = "comment"; + } else if ((match = stream.match(tlvCommentMatch)) && !state.tlvInBlockComment) { + // Start comment. + if (match[0] == "//") { + // Line comment. + stream.skipToEnd(); + } else { + // Block comment. + state.tlvInBlockComment = true; + } + style = "comment"; + } else if (match = stream.match(tlvIdentMatch)) { + // looks like an identifier (or identifier prefix) + var prefix = match[1]; + var mnemonic = match[2]; + if (// is identifier prefix + tlvIdentifierStyle.hasOwnProperty(prefix) && + // has mnemonic or we're at the end of the line (maybe it hasn't been typed yet) + (mnemonic.length > 0 || stream.eol())) { + style = tlvIdentifierStyle[prefix]; + if (stream.column() == state.indented) { + // Begin scope. + style += " " + tlvScopeStyle(state, stream.column(), "scope-ident") + } + } else { + // Just swallow one character and try again. + // This enables subsequent identifier match with preceding symbol character, which + // is legal within a statement. (Eg, !$reset). It also enables detection of + // comment start with preceding symbols. + stream.backUp(stream.current().length - 1); + style = "tlv-default"; + } + } else if (stream.match(/^\t+/)) { + // Highlight tabs, which are illegal. + style = "tlv-tab"; + } else if (stream.match(/^[\[\]{}\(\);\:]+/)) { + // [:], (), {}, ;. + style = "meta"; + } else if (match = stream.match(/^[mM]4([\+_])?[\w\d_]*/)) { + // m4 pre proc + style = (match[1] == "+") ? "tlv-m4-plus" : "tlv-m4"; + } else if (stream.match(/^ +/)){ + // Skip over spaces. + if (stream.eol()) { + // Trailing spaces. + style = "error"; + } else { + // Non-trailing spaces. + style = "tlv-default"; + } + } else if (stream.match(/^[\w\d_]+/)) { + // alpha-numeric token. + style = "number"; + } else { + // Eat the next char w/ no formatting. + stream.next(); + style = "tlv-default"; + } + if (beginStatement) { + style += " tlv-statement"; + } + } else { + if (stream.match(/^[mM]4([\w\d_]*)/)) { + // m4 pre proc + style = "tlv-m4"; + } + } + return style; + }, + + indent: function(state) { + return (state.tlvCodeActive == true) ? state.tlvNextIndent : -1; + }, + + startState: function(state) { + state.tlvIndentationStyle = []; // Styles to use for each level of indentation. + state.tlvCodeActive = true; // True when we're in a TLV region (and at beginning of file). + state.tlvNextIndent = -1; // The number of spaces to autoindent the next line if tlvCodeActive. + state.tlvInBlockComment = false; // True inside /**/ comment. + if (tlvTrackStatements) { + state.statementComment = false; // True inside a statement's header comment. + } + } + + } + }); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/spreadsheet/spreadsheet.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("spreadsheet", function () { + return { + startState: function () { + return { + stringType: null, + stack: [] + }; + }, + token: function (stream, state) { + if (!stream) return; + + //check for state changes + if (state.stack.length === 0) { + //strings + if ((stream.peek() == '"') || (stream.peek() == "'")) { + state.stringType = stream.peek(); + stream.next(); // Skip quote + state.stack.unshift("string"); + } + } + + //return state + //stack has + switch (state.stack[0]) { + case "string": + while (state.stack[0] === "string" && !stream.eol()) { + if (stream.peek() === state.stringType) { + stream.next(); // Skip quote + state.stack.shift(); // Clear flag + } else if (stream.peek() === "\\") { + stream.next(); + stream.next(); + } else { + stream.match(/^.[^\\\"\']*/); + } + } + return "string"; + + case "characterClass": + while (state.stack[0] === "characterClass" && !stream.eol()) { + if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) + state.stack.shift(); + } + return "operator"; + } + + var peek = stream.peek(); + + //no stack + switch (peek) { + case "[": + stream.next(); + state.stack.unshift("characterClass"); + return "bracket"; + case ":": + stream.next(); + return "operator"; + case "\\": + if (stream.match(/\\[a-z]+/)) return "string-2"; + else { + stream.next(); + return "atom"; + } + case ".": + case ",": + case ";": + case "*": + case "-": + case "+": + case "^": + case "<": + case "/": + case "=": + stream.next(); + return "atom"; + case "$": + stream.next(); + return "builtin"; + } + + if (stream.match(/\d+/)) { + if (stream.match(/^\w+/)) return "error"; + return "number"; + } else if (stream.match(/^[a-zA-Z_]\w*/)) { + if (stream.match(/(?=[\(.])/, false)) return "keyword"; + return "variable-2"; + } else if (["[", "]", "(", ")", "{", "}"].indexOf(peek) != -1) { + stream.next(); + return "bracket"; + } else if (!stream.eatSpace()) { + stream.next(); + } + return null; + } + }; + }); + + CodeMirror.defineMIME("text/x-spreadsheet", "spreadsheet"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/coffeescript/coffeescript.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Link to the project's GitHub page: + * https://github.com/pickhardt/coffeescript-codemirror-mode + */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("coffeescript", function(conf, parserConf) { + var ERRORCLASS = "error"; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/; + var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/; + var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/; + var atProp = /^@[_A-Za-z$][_A-Za-z$0-9]*/; + + var wordOperators = wordRegexp(["and", "or", "not", + "is", "isnt", "in", + "instanceof", "typeof"]); + var indentKeywords = ["for", "while", "loop", "if", "unless", "else", + "switch", "try", "catch", "finally", "class"]; + var commonKeywords = ["break", "by", "continue", "debugger", "delete", + "do", "in", "of", "new", "return", "then", + "this", "@", "throw", "when", "until", "extends"]; + + var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); + + indentKeywords = wordRegexp(indentKeywords); + + + var stringPrefixes = /^('{3}|\"{3}|['\"])/; + var regexPrefixes = /^(\/{3}|\/)/; + var commonConstants = ["Infinity", "NaN", "undefined", "null", "true", "false", "on", "off", "yes", "no"]; + var constants = wordRegexp(commonConstants); + + // Tokenizers + function tokenBase(stream, state) { + // Handle scope changes + if (stream.sol()) { + if (state.scope.align === null) state.scope.align = false; + var scopeOffset = state.scope.offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset && state.scope.type == "coffee") { + return "indent"; + } else if (lineOffset < scopeOffset) { + return "dedent"; + } + return null; + } else { + if (scopeOffset > 0) { + dedent(stream, state); + } + } + } + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle docco title comment (single line) + if (stream.match("####")) { + stream.skipToEnd(); + return "comment"; + } + + // Handle multi line comments + if (stream.match("###")) { + state.tokenize = longComment; + return state.tokenize(stream, state); + } + + // Single line comment + if (ch === "#") { + stream.skipToEnd(); + return "comment"; + } + + // Handle number literals + if (stream.match(/^-?[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { + floatLiteral = true; + } + if (stream.match(/^-?\d+\.\d*/)) { + floatLiteral = true; + } + if (stream.match(/^-?\.\d+/)) { + floatLiteral = true; + } + + if (floatLiteral) { + // prevent from getting extra . on 1.. + if (stream.peek() == "."){ + stream.backUp(1); + } + return "number"; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^-?0x[0-9a-f]+/i)) { + intLiteral = true; + } + // Decimal + if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^-?0(?![\dx])/i)) { + intLiteral = true; + } + if (intLiteral) { + return "number"; + } + } + + // Handle strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenFactory(stream.current(), false, "string"); + return state.tokenize(stream, state); + } + // Handle regex literals + if (stream.match(regexPrefixes)) { + if (stream.current() != "/" || stream.match(/^.*\//, false)) { // prevent highlight of division + state.tokenize = tokenFactory(stream.current(), true, "string-2"); + return state.tokenize(stream, state); + } else { + stream.backUp(1); + } + } + + + + // Handle operators and delimiters + if (stream.match(operators) || stream.match(wordOperators)) { + return "operator"; + } + if (stream.match(delimiters)) { + return "punctuation"; + } + + if (stream.match(constants)) { + return "atom"; + } + + if (stream.match(atProp) || state.prop && stream.match(identifiers)) { + return "property"; + } + + if (stream.match(keywords)) { + return "keyword"; + } + + if (stream.match(identifiers)) { + return "variable"; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenFactory(delimiter, singleline, outclass) { + return function(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\/\\]/); + if (stream.eat("\\")) { + stream.next(); + if (singleline && stream.eol()) { + return outclass; + } + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return outclass; + } else { + stream.eat(/['"\/]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + outclass = ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return outclass; + }; + } + + function longComment(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^#]/); + if (stream.match("###")) { + state.tokenize = tokenBase; + break; + } + stream.eatWhile("#"); + } + return "comment"; + } + + function indent(stream, state, type) { + type = type || "coffee"; + var offset = 0, align = false, alignOffset = null; + for (var scope = state.scope; scope; scope = scope.prev) { + if (scope.type === "coffee" || scope.type == "}") { + offset = scope.offset + conf.indentUnit; + break; + } + } + if (type !== "coffee") { + align = null; + alignOffset = stream.column() + stream.current().length; + } else if (state.scope.align) { + state.scope.align = false; + } + state.scope = { + offset: offset, + type: type, + prev: state.scope, + align: align, + alignOffset: alignOffset + }; + } + + function dedent(stream, state) { + if (!state.scope.prev) return; + if (state.scope.type === "coffee") { + var _indent = stream.indentation(); + var matched = false; + for (var scope = state.scope; scope; scope = scope.prev) { + if (_indent === scope.offset) { + matched = true; + break; + } + } + if (!matched) { + return true; + } + while (state.scope.prev && state.scope.offset !== _indent) { + state.scope = state.scope.prev; + } + return false; + } else { + state.scope = state.scope.prev; + return false; + } + } + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle scope changes. + if (current === "return") { + state.dedent = true; + } + if (((current === "->" || current === "=>") && stream.eol()) + || style === "indent") { + indent(stream, state); + } + var delimiter_index = "[({".indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); + } + if (indentKeywords.exec(current)){ + indent(stream, state); + } + if (current == "then"){ + dedent(stream, state); + } + + + if (style === "dedent") { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = "])}".indexOf(current); + if (delimiter_index !== -1) { + while (state.scope.type == "coffee" && state.scope.prev) + state.scope = state.scope.prev; + if (state.scope.type == current) + state.scope = state.scope.prev; + } + if (state.dedent && stream.eol()) { + if (state.scope.type == "coffee" && state.scope.prev) + state.scope = state.scope.prev; + state.dedent = false; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false}, + prop: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var fillAlign = state.scope.align === null && state.scope; + if (fillAlign && stream.sol()) fillAlign.align = false; + + var style = tokenLexer(stream, state); + if (style && style != "comment") { + if (fillAlign) fillAlign.align = true; + state.prop = style == "punctuation" && stream.current() == "." + } + + return style; + }, + + indent: function(state, text) { + if (state.tokenize != tokenBase) return 0; + var scope = state.scope; + var closer = text && "])}".indexOf(text.charAt(0)) > -1; + if (closer) while (scope.type == "coffee" && scope.prev) scope = scope.prev; + var closes = closer && scope.type === text.charAt(0); + if (scope.align) + return scope.alignOffset - (closes ? 1 : 0); + else + return (closes ? scope.prev : scope).offset; + }, + + lineComment: "#", + fold: "indent" + }; + return external; +}); + +// IANA registered media type +// https://www.iana.org/assignments/media-types/ +CodeMirror.defineMIME("application/vnd.coffeescript", "coffeescript"); + +CodeMirror.defineMIME("text/x-coffeescript", "coffeescript"); +CodeMirror.defineMIME("text/coffeescript", "coffeescript"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/tiddlywiki/tiddlywiki.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/*** + |''Name''|tiddlywiki.js| + |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror| + |''Author''|PMario| + |''Version''|0.1.7| + |''Status''|''stable''| + |''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| + |''Documentation''|http://codemirror.tiddlyspace.com/| + |''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| + |''CoreVersion''|2.5.0| + |''Requires''|codemirror.js| + |''Keywords''|syntax highlighting color code mirror codemirror| + ! Info + CoreVersion parameter is needed for TiddlyWiki only! +***/ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("tiddlywiki", function () { + // Tokenizer + var textwords = {}; + + var keywords = { + "allTags": true, "closeAll": true, "list": true, + "newJournal": true, "newTiddler": true, + "permaview": true, "saveChanges": true, + "search": true, "slider": true, "tabs": true, + "tag": true, "tagging": true, "tags": true, + "tiddler": true, "timeline": true, + "today": true, "version": true, "option": true, + "with": true, "filter": true + }; + + var isSpaceName = /[\w_\-]/i, + reHR = /^\-\-\-\-+$/, // <hr> + reWikiCommentStart = /^\/\*\*\*$/, // /*** + reWikiCommentStop = /^\*\*\*\/$/, // ***/ + reBlockQuote = /^<<<$/, + + reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start + reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop + reXmlCodeStart = /^<!--\{\{\{-->$/, // xml block start + reXmlCodeStop = /^<!--\}\}\}-->$/, // xml stop + + reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start + reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop + + reUntilCodeStop = /.*?\}\}\}/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function tokenBase(stream, state) { + var sol = stream.sol(), ch = stream.peek(); + + state.block = false; // indicates the start of a code block. + + // check start of blocks + if (sol && /[<\/\*{}\-]/.test(ch)) { + if (stream.match(reCodeBlockStart)) { + state.block = true; + return chain(stream, state, twTokenCode); + } + if (stream.match(reBlockQuote)) + return 'quote'; + if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) + return 'comment'; + if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) + return 'comment'; + if (stream.match(reHR)) + return 'hr'; + } + + stream.next(); + if (sol && /[\/\*!#;:>|]/.test(ch)) { + if (ch == "!") { // tw header + stream.skipToEnd(); + return "header"; + } + if (ch == "*") { // tw list + stream.eatWhile('*'); + return "comment"; + } + if (ch == "#") { // tw numbered list + stream.eatWhile('#'); + return "comment"; + } + if (ch == ";") { // definition list, term + stream.eatWhile(';'); + return "comment"; + } + if (ch == ":") { // definition list, description + stream.eatWhile(':'); + return "comment"; + } + if (ch == ">") { // single line quote + stream.eatWhile(">"); + return "quote"; + } + if (ch == '|') + return 'header'; + } + + if (ch == '{' && stream.match(/\{\{/)) + return chain(stream, state, twTokenCode); + + // rudimentary html:// file:// link matching. TW knows much more ... + if (/[hf]/i.test(ch) && + /[ti]/i.test(stream.peek()) && + stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) + return "link"; + + // just a little string indicator, don't want to have the whole string covered + if (ch == '"') + return 'string'; + + if (ch == '~') // _no_ CamelCase indicator should be bold + return 'brace'; + + if (/[\[\]]/.test(ch) && stream.match(ch)) // check for [[..]] + return 'brace'; + + if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting + stream.eatWhile(isSpaceName); + return "link"; + } + + if (/\d/.test(ch)) { // numbers + stream.eatWhile(/\d/); + return "number"; + } + + if (ch == "/") { // tw invisible comment + if (stream.eat("%")) { + return chain(stream, state, twTokenComment); + } else if (stream.eat("/")) { // + return chain(stream, state, twTokenEm); + } + } + + if (ch == "_" && stream.eat("_")) // tw underline + return chain(stream, state, twTokenUnderline); + + // strikethrough and mdash handling + if (ch == "-" && stream.eat("-")) { + // if strikethrough looks ugly, change CSS. + if (stream.peek() != ' ') + return chain(stream, state, twTokenStrike); + // mdash + if (stream.peek() == ' ') + return 'brace'; + } + + if (ch == "'" && stream.eat("'")) // tw bold + return chain(stream, state, twTokenStrong); + + if (ch == "<" && stream.eat("<")) // tw macro + return chain(stream, state, twTokenMacro); + + // core macro handling + stream.eatWhile(/[\w\$_]/); + return textwords.propertyIsEnumerable(stream.current()) ? "keyword" : null + } + + // tw invisible comment + function twTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "%"); + } + return "comment"; + } + + // tw strong / bold + function twTokenStrong(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "'" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "'"); + } + return "strong"; + } + + // tw code + function twTokenCode(stream, state) { + var sb = state.block; + + if (sb && stream.current()) { + return "comment"; + } + + if (!sb && stream.match(reUntilCodeStop)) { + state.tokenize = tokenBase; + return "comment"; + } + + if (sb && stream.sol() && stream.match(reCodeBlockStop)) { + state.tokenize = tokenBase; + return "comment"; + } + + stream.next(); + return "comment"; + } + + // tw em / italic + function twTokenEm(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "/"); + } + return "em"; + } + + // tw underlined text + function twTokenUnderline(stream, state) { + var maybeEnd = false, + ch; + while (ch = stream.next()) { + if (ch == "_" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "_"); + } + return "underlined"; + } + + // tw strike through text looks ugly + // change CSS if needed + function twTokenStrike(stream, state) { + var maybeEnd = false, ch; + + while (ch = stream.next()) { + if (ch == "-" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "-"); + } + return "strikethrough"; + } + + // macro + function twTokenMacro(stream, state) { + if (stream.current() == '<<') { + return 'macro'; + } + + var ch = stream.next(); + if (!ch) { + state.tokenize = tokenBase; + return null; + } + if (ch == ">") { + if (stream.peek() == '>') { + stream.next(); + state.tokenize = tokenBase; + return "macro"; + } + } + + stream.eatWhile(/[\w\$_]/); + return keywords.propertyIsEnumerable(stream.current()) ? "keyword" : null + } + + // Interface + return { + startState: function () { + return {tokenize: tokenBase}; + }, + + token: function (stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + } + }; +}); + +CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/mumps/mumps.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* + This MUMPS Language script was constructed using vbscript.js as a template. +*/ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("mumps", function() { + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"); + var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"); + var singleDelimiters = new RegExp("^[\\.,:]"); + var brackets = new RegExp("[()]"); + var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*"); + var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"]; + // The following list includes instrinsic functions _and_ special variables + var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"]; + var intrinsicFuncs = wordRegexp(intrinsicFuncsWords); + var command = wordRegexp(commandKeywords); + + function tokenBase(stream, state) { + if (stream.sol()) { + state.label = true; + state.commandMode = 0; + } + + // The <space> character has meaning in MUMPS. Ignoring consecutive + // spaces would interfere with interpreting whether the next non-space + // character belongs to the command or argument context. + + // Examine each character and update a mode variable whose interpretation is: + // >0 => command 0 => argument <0 => command post-conditional + var ch = stream.peek(); + + if (ch == " " || ch == "\t") { // Pre-process <space> + state.label = false; + if (state.commandMode == 0) + state.commandMode = 1; + else if ((state.commandMode < 0) || (state.commandMode == 2)) + state.commandMode = 0; + } else if ((ch != ".") && (state.commandMode > 0)) { + if (ch == ":") + state.commandMode = -1; // SIS - Command post-conditional + else + state.commandMode = 2; + } + + // Do not color parameter list as line tag + if ((ch === "(") || (ch === "\u0009")) + state.label = false; + + // MUMPS comment starts with ";" + if (ch === ";") { + stream.skipToEnd(); + return "comment"; + } + + // Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator + if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/)) + return "number"; + + // Handle Strings + if (ch == '"') { + if (stream.skipTo('"')) { + stream.next(); + return "string"; + } else { + stream.skipToEnd(); + return "error"; + } + } + + // Handle operators and Delimiters + if (stream.match(doubleOperators) || stream.match(singleOperators)) + return "operator"; + + // Prevents leading "." in DO block from falling through to error + if (stream.match(singleDelimiters)) + return null; + + if (brackets.test(ch)) { + stream.next(); + return "bracket"; + } + + if (state.commandMode > 0 && stream.match(command)) + return "variable-2"; + + if (stream.match(intrinsicFuncs)) + return "builtin"; + + if (stream.match(identifiers)) + return "variable"; + + // Detect dollar-sign when not a documented intrinsic function + // "^" may introduce a GVN or SSVN - Color same as function + if (ch === "$" || ch === "^") { + stream.next(); + return "builtin"; + } + + // MUMPS Indirection + if (ch === "@") { + stream.next(); + return "string-2"; + } + + if (/[\w%]/.test(ch)) { + stream.eatWhile(/[\w%]/); + return "variable"; + } + + // Handle non-detected items + stream.next(); + return "error"; + } + + return { + startState: function() { + return { + label: false, + commandMode: 0 + }; + }, + + token: function(stream, state) { + var style = tokenBase(stream, state); + if (state.label) return "tag"; + return style; + } + }; + }); + + CodeMirror.defineMIME("text/x-mumps", "mumps"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/eiffel/eiffel.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("eiffel", function() { + function wordObj(words) { + var o = {}; + for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; + return o; + } + var keywords = wordObj([ + 'note', + 'across', + 'when', + 'variant', + 'until', + 'unique', + 'undefine', + 'then', + 'strip', + 'select', + 'retry', + 'rescue', + 'require', + 'rename', + 'reference', + 'redefine', + 'prefix', + 'once', + 'old', + 'obsolete', + 'loop', + 'local', + 'like', + 'is', + 'inspect', + 'infix', + 'include', + 'if', + 'frozen', + 'from', + 'external', + 'export', + 'ensure', + 'end', + 'elseif', + 'else', + 'do', + 'creation', + 'create', + 'check', + 'alias', + 'agent', + 'separate', + 'invariant', + 'inherit', + 'indexing', + 'feature', + 'expanded', + 'deferred', + 'class', + 'Void', + 'True', + 'Result', + 'Precursor', + 'False', + 'Current', + 'create', + 'attached', + 'detachable', + 'as', + 'and', + 'implies', + 'not', + 'or' + ]); + var operators = wordObj([":=", "and then","and", "or","<<",">>"]); + + function chain(newtok, stream, state) { + state.tokenize.push(newtok); + return newtok(stream, state); + } + + function tokenBase(stream, state) { + if (stream.eatSpace()) return null; + var ch = stream.next(); + if (ch == '"'||ch == "'") { + return chain(readQuoted(ch, "string"), stream, state); + } else if (ch == "-"&&stream.eat("-")) { + stream.skipToEnd(); + return "comment"; + } else if (ch == ":"&&stream.eat("=")) { + return "operator"; + } else if (/[0-9]/.test(ch)) { + stream.eatWhile(/[xXbBCc0-9\.]/); + stream.eat(/[\?\!]/); + return "ident"; + } else if (/[a-zA-Z_0-9]/.test(ch)) { + stream.eatWhile(/[a-zA-Z_0-9]/); + stream.eat(/[\?\!]/); + return "ident"; + } else if (/[=+\-\/*^%<>~]/.test(ch)) { + stream.eatWhile(/[=+\-\/*^%<>~]/); + return "operator"; + } else { + return null; + } + } + + function readQuoted(quote, style, unescaped) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && (unescaped || !escaped)) { + state.tokenize.pop(); + break; + } + escaped = !escaped && ch == "%"; + } + return style; + }; + } + + return { + startState: function() { + return {tokenize: [tokenBase]}; + }, + + token: function(stream, state) { + var style = state.tokenize[state.tokenize.length-1](stream, state); + if (style == "ident") { + var word = stream.current(); + style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" + : operators.propertyIsEnumerable(stream.current()) ? "operator" + : /^[A-Z][A-Z_0-9]*$/g.test(word) ? "tag" + : /^0[bB][0-1]+$/g.test(word) ? "number" + : /^0[cC][0-7]+$/g.test(word) ? "number" + : /^0[xX][a-fA-F0-9]+$/g.test(word) ? "number" + : /^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word) ? "number" + : /^[0-9]+$/g.test(word) ? "number" + : "variable"; + } + return style; + }, + lineComment: "--" + }; +}); + +CodeMirror.defineMIME("text/x-eiffel", "eiffel"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/webidl/webidl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); +}; + +var builtinArray = [ + "Clamp", + "Constructor", + "EnforceRange", + "Exposed", + "ImplicitThis", + "Global", "PrimaryGlobal", + "LegacyArrayClass", + "LegacyUnenumerableNamedProperties", + "LenientThis", + "NamedConstructor", + "NewObject", + "NoInterfaceObject", + "OverrideBuiltins", + "PutForwards", + "Replaceable", + "SameObject", + "TreatNonObjectAsNull", + "TreatNullAs", + "EmptyString", + "Unforgeable", + "Unscopeable" +]; +var builtins = wordRegexp(builtinArray); + +var typeArray = [ + "unsigned", "short", "long", // UnsignedIntegerType + "unrestricted", "float", "double", // UnrestrictedFloatType + "boolean", "byte", "octet", // Rest of PrimitiveType + "Promise", // PromiseType + "ArrayBuffer", "DataView", "Int8Array", "Int16Array", "Int32Array", + "Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray", + "Float32Array", "Float64Array", // BufferRelatedType + "ByteString", "DOMString", "USVString", "sequence", "object", "RegExp", + "Error", "DOMException", "FrozenArray", // Rest of NonAnyType + "any", // Rest of SingleType + "void" // Rest of ReturnType +]; +var types = wordRegexp(typeArray); + +var keywordArray = [ + "attribute", "callback", "const", "deleter", "dictionary", "enum", "getter", + "implements", "inherit", "interface", "iterable", "legacycaller", "maplike", + "partial", "required", "serializer", "setlike", "setter", "static", + "stringifier", "typedef", // ArgumentNameKeyword except + // "unrestricted" + "optional", "readonly", "or" +]; +var keywords = wordRegexp(keywordArray); + +var atomArray = [ + "true", "false", // BooleanLiteral + "Infinity", "NaN", // FloatLiteral + "null" // Rest of ConstValue +]; +var atoms = wordRegexp(atomArray); + +CodeMirror.registerHelper("hintWords", "webidl", + builtinArray.concat(typeArray).concat(keywordArray).concat(atomArray)); + +var startDefArray = ["callback", "dictionary", "enum", "interface"]; +var startDefs = wordRegexp(startDefArray); + +var endDefArray = ["typedef"]; +var endDefs = wordRegexp(endDefArray); + +var singleOperators = /^[:<=>?]/; +var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/; +var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/; +var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/; +var identifiersEnd = /^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/; +var strings = /^"[^"]*"/; +var multilineComments = /^\/\*.*?\*\//; +var multilineCommentsStart = /^\/\*.*/; +var multilineCommentsEnd = /^.*?\*\//; + +function readToken(stream, state) { + // whitespace + if (stream.eatSpace()) return null; + + // comment + if (state.inComment) { + if (stream.match(multilineCommentsEnd)) { + state.inComment = false; + return "comment"; + } + stream.skipToEnd(); + return "comment"; + } + if (stream.match("//")) { + stream.skipToEnd(); + return "comment"; + } + if (stream.match(multilineComments)) return "comment"; + if (stream.match(multilineCommentsStart)) { + state.inComment = true; + return "comment"; + } + + // integer and float + if (stream.match(/^-?[0-9\.]/, false)) { + if (stream.match(integers) || stream.match(floats)) return "number"; + } + + // string + if (stream.match(strings)) return "string"; + + // identifier + if (state.startDef && stream.match(identifiers)) return "def"; + + if (state.endDef && stream.match(identifiersEnd)) { + state.endDef = false; + return "def"; + } + + if (stream.match(keywords)) return "keyword"; + + if (stream.match(types)) { + var lastToken = state.lastToken; + var nextToken = (stream.match(/^\s*(.+?)\b/, false) || [])[1]; + + if (lastToken === ":" || lastToken === "implements" || + nextToken === "implements" || nextToken === "=") { + // Used as identifier + return "builtin"; + } else { + // Used as type + return "variable-3"; + } + } + + if (stream.match(builtins)) return "builtin"; + if (stream.match(atoms)) return "atom"; + if (stream.match(identifiers)) return "variable"; + + // other + if (stream.match(singleOperators)) return "operator"; + + // unrecognized + stream.next(); + return null; +}; + +CodeMirror.defineMode("webidl", function() { + return { + startState: function() { + return { + // Is in multiline comment + inComment: false, + // Last non-whitespace, matched token + lastToken: "", + // Next token is a definition + startDef: false, + // Last token of the statement is a definition + endDef: false + }; + }, + token: function(stream, state) { + var style = readToken(stream, state); + + if (style) { + var cur = stream.current(); + state.lastToken = cur; + if (style === "keyword") { + state.startDef = startDefs.test(cur); + state.endDef = state.endDef || endDefs.test(cur); + } else { + state.startDef = false; + } + } + + return style; + } + }; +}); + +CodeMirror.defineMIME("text/x-webidl", "webidl"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/ebnf/ebnf.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("ebnf", function (config) { + var commentType = {slash: 0, parenthesis: 1}; + var stateType = {comment: 0, _string: 1, characterClass: 2}; + var bracesMode = null; + + if (config.bracesMode) + bracesMode = CodeMirror.getMode(config, config.bracesMode); + + return { + startState: function () { + return { + stringType: null, + commentType: null, + braced: 0, + lhs: true, + localState: null, + stack: [], + inDefinition: false + }; + }, + token: function (stream, state) { + if (!stream) return; + + //check for state changes + if (state.stack.length === 0) { + //strings + if ((stream.peek() == '"') || (stream.peek() == "'")) { + state.stringType = stream.peek(); + stream.next(); // Skip quote + state.stack.unshift(stateType._string); + } else if (stream.match(/^\/\*/)) { //comments starting with /* + state.stack.unshift(stateType.comment); + state.commentType = commentType.slash; + } else if (stream.match(/^\(\*/)) { //comments starting with (* + state.stack.unshift(stateType.comment); + state.commentType = commentType.parenthesis; + } + } + + //return state + //stack has + switch (state.stack[0]) { + case stateType._string: + while (state.stack[0] === stateType._string && !stream.eol()) { + if (stream.peek() === state.stringType) { + stream.next(); // Skip quote + state.stack.shift(); // Clear flag + } else if (stream.peek() === "\\") { + stream.next(); + stream.next(); + } else { + stream.match(/^.[^\\\"\']*/); + } + } + return state.lhs ? "property string" : "string"; // Token style + + case stateType.comment: + while (state.stack[0] === stateType.comment && !stream.eol()) { + if (state.commentType === commentType.slash && stream.match(/\*\//)) { + state.stack.shift(); // Clear flag + state.commentType = null; + } else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) { + state.stack.shift(); // Clear flag + state.commentType = null; + } else { + stream.match(/^.[^\*]*/); + } + } + return "comment"; + + case stateType.characterClass: + while (state.stack[0] === stateType.characterClass && !stream.eol()) { + if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { + state.stack.shift(); + } + } + return "operator"; + } + + var peek = stream.peek(); + + if (bracesMode !== null && (state.braced || peek === "{")) { + if (state.localState === null) + state.localState = CodeMirror.startState(bracesMode); + + var token = bracesMode.token(stream, state.localState), + text = stream.current(); + + if (!token) { + for (var i = 0; i < text.length; i++) { + if (text[i] === "{") { + if (state.braced === 0) { + token = "matchingbracket"; + } + state.braced++; + } else if (text[i] === "}") { + state.braced--; + if (state.braced === 0) { + token = "matchingbracket"; + } + } + } + } + return token; + } + + //no stack + switch (peek) { + case "[": + stream.next(); + state.stack.unshift(stateType.characterClass); + return "bracket"; + case ":": + case "|": + case ";": + stream.next(); + return "operator"; + case "%": + if (stream.match("%%")) { + return "header"; + } else if (stream.match(/[%][A-Za-z]+/)) { + return "keyword"; + } else if (stream.match(/[%][}]/)) { + return "matchingbracket"; + } + break; + case "/": + if (stream.match(/[\/][A-Za-z]+/)) { + return "keyword"; + } + case "\\": + if (stream.match(/[\][a-z]+/)) { + return "string-2"; + } + case ".": + if (stream.match(".")) { + return "atom"; + } + case "*": + case "-": + case "+": + case "^": + if (stream.match(peek)) { + return "atom"; + } + case "$": + if (stream.match("$$")) { + return "builtin"; + } else if (stream.match(/[$][0-9]+/)) { + return "variable-3"; + } + case "<": + if (stream.match(/<<[a-zA-Z_]+>>/)) { + return "builtin"; + } + } + + if (stream.match(/^\/\//)) { + stream.skipToEnd(); + return "comment"; + } else if (stream.match(/return/)) { + return "operator"; + } else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) { + if (stream.match(/(?=[\(.])/)) { + return "variable"; + } else if (stream.match(/(?=[\s\n]*[:=])/)) { + return "def"; + } + return "variable-2"; + } else if (["[", "]", "(", ")"].indexOf(stream.peek()) != -1) { + stream.next(); + return "bracket"; + } else if (!stream.eatSpace()) { + stream.next(); + } + return null; + } + }; + }); + + CodeMirror.defineMIME("text/x-ebnf", "ebnf"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/http/http.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("http", function() { + function failFirstLine(stream, state) { + stream.skipToEnd(); + state.cur = header; + return "error"; + } + + function start(stream, state) { + if (stream.match(/^HTTP\/\d\.\d/)) { + state.cur = responseStatusCode; + return "keyword"; + } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) { + state.cur = requestPath; + return "keyword"; + } else { + return failFirstLine(stream, state); + } + } + + function responseStatusCode(stream, state) { + var code = stream.match(/^\d+/); + if (!code) return failFirstLine(stream, state); + + state.cur = responseStatusText; + var status = Number(code[0]); + if (status >= 100 && status < 200) { + return "positive informational"; + } else if (status >= 200 && status < 300) { + return "positive success"; + } else if (status >= 300 && status < 400) { + return "positive redirect"; + } else if (status >= 400 && status < 500) { + return "negative client-error"; + } else if (status >= 500 && status < 600) { + return "negative server-error"; + } else { + return "error"; + } + } + + function responseStatusText(stream, state) { + stream.skipToEnd(); + state.cur = header; + return null; + } + + function requestPath(stream, state) { + stream.eatWhile(/\S/); + state.cur = requestProtocol; + return "string-2"; + } + + function requestProtocol(stream, state) { + if (stream.match(/^HTTP\/\d\.\d$/)) { + state.cur = header; + return "keyword"; + } else { + return failFirstLine(stream, state); + } + } + + function header(stream) { + if (stream.sol() && !stream.eat(/[ \t]/)) { + if (stream.match(/^.*?:/)) { + return "atom"; + } else { + stream.skipToEnd(); + return "error"; + } + } else { + stream.skipToEnd(); + return "string"; + } + } + + function body(stream) { + stream.skipToEnd(); + return null; + } + + return { + token: function(stream, state) { + var cur = state.cur; + if (cur != header && cur != body && stream.eatSpace()) return null; + return cur(stream, state); + }, + + blankLine: function(state) { + state.cur = body; + }, + + startState: function() { + return {cur: start}; + } + }; +}); + +CodeMirror.defineMIME("message/http", "http"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/textile/textile.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") { // CommonJS + mod(require("../../lib/codemirror")); + } else if (typeof define == "function" && define.amd) { // AMD + define(["../../lib/codemirror"], mod); + } else { // Plain browser env + mod(CodeMirror); + } +})(function(CodeMirror) { + "use strict"; + + var TOKEN_STYLES = { + addition: "positive", + attributes: "attribute", + bold: "strong", + cite: "keyword", + code: "atom", + definitionList: "number", + deletion: "negative", + div: "punctuation", + em: "em", + footnote: "variable", + footCite: "qualifier", + header: "header", + html: "comment", + image: "string", + italic: "em", + link: "link", + linkDefinition: "link", + list1: "variable-2", + list2: "variable-3", + list3: "keyword", + notextile: "string-2", + pre: "operator", + p: "property", + quote: "bracket", + span: "quote", + specialChar: "tag", + strong: "strong", + sub: "builtin", + sup: "builtin", + table: "variable-3", + tableHeading: "operator" + }; + + function startNewLine(stream, state) { + state.mode = Modes.newLayout; + state.tableHeading = false; + + if (state.layoutType === "definitionList" && state.spanningLayout && + stream.match(RE("definitionListEnd"), false)) + state.spanningLayout = false; + } + + function handlePhraseModifier(stream, state, ch) { + if (ch === "_") { + if (stream.eat("_")) + return togglePhraseModifier(stream, state, "italic", /__/, 2); + else + return togglePhraseModifier(stream, state, "em", /_/, 1); + } + + if (ch === "*") { + if (stream.eat("*")) { + return togglePhraseModifier(stream, state, "bold", /\*\*/, 2); + } + return togglePhraseModifier(stream, state, "strong", /\*/, 1); + } + + if (ch === "[") { + if (stream.match(/\d+\]/)) state.footCite = true; + return tokenStyles(state); + } + + if (ch === "(") { + var spec = stream.match(/^(r|tm|c)\)/); + if (spec) + return tokenStylesWith(state, TOKEN_STYLES.specialChar); + } + + if (ch === "<" && stream.match(/(\w+)[^>]+>[^<]+<\/\1>/)) + return tokenStylesWith(state, TOKEN_STYLES.html); + + if (ch === "?" && stream.eat("?")) + return togglePhraseModifier(stream, state, "cite", /\?\?/, 2); + + if (ch === "=" && stream.eat("=")) + return togglePhraseModifier(stream, state, "notextile", /==/, 2); + + if (ch === "-" && !stream.eat("-")) + return togglePhraseModifier(stream, state, "deletion", /-/, 1); + + if (ch === "+") + return togglePhraseModifier(stream, state, "addition", /\+/, 1); + + if (ch === "~") + return togglePhraseModifier(stream, state, "sub", /~/, 1); + + if (ch === "^") + return togglePhraseModifier(stream, state, "sup", /\^/, 1); + + if (ch === "%") + return togglePhraseModifier(stream, state, "span", /%/, 1); + + if (ch === "@") + return togglePhraseModifier(stream, state, "code", /@/, 1); + + if (ch === "!") { + var type = togglePhraseModifier(stream, state, "image", /(?:\([^\)]+\))?!/, 1); + stream.match(/^:\S+/); // optional Url portion + return type; + } + return tokenStyles(state); + } + + function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) { + var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null; + var charAfter = stream.peek(); + if (state[phraseModifier]) { + if ((!charAfter || /\W/.test(charAfter)) && charBefore && /\S/.test(charBefore)) { + var type = tokenStyles(state); + state[phraseModifier] = false; + return type; + } + } else if ((!charBefore || /\W/.test(charBefore)) && charAfter && /\S/.test(charAfter) && + stream.match(new RegExp("^.*\\S" + closeRE.source + "(?:\\W|$)"), false)) { + state[phraseModifier] = true; + state.mode = Modes.attributes; + } + return tokenStyles(state); + }; + + function tokenStyles(state) { + var disabled = textileDisabled(state); + if (disabled) return disabled; + + var styles = []; + if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]); + + styles = styles.concat(activeStyles( + state, "addition", "bold", "cite", "code", "deletion", "em", "footCite", + "image", "italic", "link", "span", "strong", "sub", "sup", "table", "tableHeading")); + + if (state.layoutType === "header") + styles.push(TOKEN_STYLES.header + "-" + state.header); + + return styles.length ? styles.join(" ") : null; + } + + function textileDisabled(state) { + var type = state.layoutType; + + switch(type) { + case "notextile": + case "code": + case "pre": + return TOKEN_STYLES[type]; + default: + if (state.notextile) + return TOKEN_STYLES.notextile + (type ? (" " + TOKEN_STYLES[type]) : ""); + return null; + } + } + + function tokenStylesWith(state, extraStyles) { + var disabled = textileDisabled(state); + if (disabled) return disabled; + + var type = tokenStyles(state); + if (extraStyles) + return type ? (type + " " + extraStyles) : extraStyles; + else + return type; + } + + function activeStyles(state) { + var styles = []; + for (var i = 1; i < arguments.length; ++i) { + if (state[arguments[i]]) + styles.push(TOKEN_STYLES[arguments[i]]); + } + return styles; + } + + function blankLine(state) { + var spanningLayout = state.spanningLayout, type = state.layoutType; + + for (var key in state) if (state.hasOwnProperty(key)) + delete state[key]; + + state.mode = Modes.newLayout; + if (spanningLayout) { + state.layoutType = type; + state.spanningLayout = true; + } + } + + var REs = { + cache: {}, + single: { + bc: "bc", + bq: "bq", + definitionList: /- .*?:=+/, + definitionListEnd: /.*=:\s*$/, + div: "div", + drawTable: /\|.*\|/, + foot: /fn\d+/, + header: /h[1-6]/, + html: /\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/, + link: /[^"]+":\S/, + linkDefinition: /\[[^\s\]]+\]\S+/, + list: /(?:#+|\*+)/, + notextile: "notextile", + para: "p", + pre: "pre", + table: "table", + tableCellAttributes: /[\/\\]\d+/, + tableHeading: /\|_\./, + tableText: /[^"_\*\[\(\?\+~\^%@|-]+/, + text: /[^!"_=\*\[\(<\?\+~\^%@-]+/ + }, + attributes: { + align: /(?:<>|<|>|=)/, + selector: /\([^\(][^\)]+\)/, + lang: /\[[^\[\]]+\]/, + pad: /(?:\(+|\)+){1,2}/, + css: /\{[^\}]+\}/ + }, + createRe: function(name) { + switch (name) { + case "drawTable": + return REs.makeRe("^", REs.single.drawTable, "$"); + case "html": + return REs.makeRe("^", REs.single.html, "(?:", REs.single.html, ")*", "$"); + case "linkDefinition": + return REs.makeRe("^", REs.single.linkDefinition, "$"); + case "listLayout": + return REs.makeRe("^", REs.single.list, RE("allAttributes"), "*\\s+"); + case "tableCellAttributes": + return REs.makeRe("^", REs.choiceRe(REs.single.tableCellAttributes, + RE("allAttributes")), "+\\."); + case "type": + return REs.makeRe("^", RE("allTypes")); + case "typeLayout": + return REs.makeRe("^", RE("allTypes"), RE("allAttributes"), + "*\\.\\.?", "(\\s+|$)"); + case "attributes": + return REs.makeRe("^", RE("allAttributes"), "+"); + + case "allTypes": + return REs.choiceRe(REs.single.div, REs.single.foot, + REs.single.header, REs.single.bc, REs.single.bq, + REs.single.notextile, REs.single.pre, REs.single.table, + REs.single.para); + + case "allAttributes": + return REs.choiceRe(REs.attributes.selector, REs.attributes.css, + REs.attributes.lang, REs.attributes.align, REs.attributes.pad); + + default: + return REs.makeRe("^", REs.single[name]); + } + }, + makeRe: function() { + var pattern = ""; + for (var i = 0; i < arguments.length; ++i) { + var arg = arguments[i]; + pattern += (typeof arg === "string") ? arg : arg.source; + } + return new RegExp(pattern); + }, + choiceRe: function() { + var parts = [arguments[0]]; + for (var i = 1; i < arguments.length; ++i) { + parts[i * 2 - 1] = "|"; + parts[i * 2] = arguments[i]; + } + + parts.unshift("(?:"); + parts.push(")"); + return REs.makeRe.apply(null, parts); + } + }; + + function RE(name) { + return (REs.cache[name] || (REs.cache[name] = REs.createRe(name))); + } + + var Modes = { + newLayout: function(stream, state) { + if (stream.match(RE("typeLayout"), false)) { + state.spanningLayout = false; + return (state.mode = Modes.blockType)(stream, state); + } + var newMode; + if (!textileDisabled(state)) { + if (stream.match(RE("listLayout"), false)) + newMode = Modes.list; + else if (stream.match(RE("drawTable"), false)) + newMode = Modes.table; + else if (stream.match(RE("linkDefinition"), false)) + newMode = Modes.linkDefinition; + else if (stream.match(RE("definitionList"))) + newMode = Modes.definitionList; + else if (stream.match(RE("html"), false)) + newMode = Modes.html; + } + return (state.mode = (newMode || Modes.text))(stream, state); + }, + + blockType: function(stream, state) { + var match, type; + state.layoutType = null; + + if (match = stream.match(RE("type"))) + type = match[0]; + else + return (state.mode = Modes.text)(stream, state); + + if (match = type.match(RE("header"))) { + state.layoutType = "header"; + state.header = parseInt(match[0][1]); + } else if (type.match(RE("bq"))) { + state.layoutType = "quote"; + } else if (type.match(RE("bc"))) { + state.layoutType = "code"; + } else if (type.match(RE("foot"))) { + state.layoutType = "footnote"; + } else if (type.match(RE("notextile"))) { + state.layoutType = "notextile"; + } else if (type.match(RE("pre"))) { + state.layoutType = "pre"; + } else if (type.match(RE("div"))) { + state.layoutType = "div"; + } else if (type.match(RE("table"))) { + state.layoutType = "table"; + } + + state.mode = Modes.attributes; + return tokenStyles(state); + }, + + text: function(stream, state) { + if (stream.match(RE("text"))) return tokenStyles(state); + + var ch = stream.next(); + if (ch === '"') + return (state.mode = Modes.link)(stream, state); + return handlePhraseModifier(stream, state, ch); + }, + + attributes: function(stream, state) { + state.mode = Modes.layoutLength; + + if (stream.match(RE("attributes"))) + return tokenStylesWith(state, TOKEN_STYLES.attributes); + else + return tokenStyles(state); + }, + + layoutLength: function(stream, state) { + if (stream.eat(".") && stream.eat(".")) + state.spanningLayout = true; + + state.mode = Modes.text; + return tokenStyles(state); + }, + + list: function(stream, state) { + var match = stream.match(RE("list")); + state.listDepth = match[0].length; + var listMod = (state.listDepth - 1) % 3; + if (!listMod) + state.layoutType = "list1"; + else if (listMod === 1) + state.layoutType = "list2"; + else + state.layoutType = "list3"; + + state.mode = Modes.attributes; + return tokenStyles(state); + }, + + link: function(stream, state) { + state.mode = Modes.text; + if (stream.match(RE("link"))) { + stream.match(/\S+/); + return tokenStylesWith(state, TOKEN_STYLES.link); + } + return tokenStyles(state); + }, + + linkDefinition: function(stream, state) { + stream.skipToEnd(); + return tokenStylesWith(state, TOKEN_STYLES.linkDefinition); + }, + + definitionList: function(stream, state) { + stream.match(RE("definitionList")); + + state.layoutType = "definitionList"; + + if (stream.match(/\s*$/)) + state.spanningLayout = true; + else + state.mode = Modes.attributes; + + return tokenStyles(state); + }, + + html: function(stream, state) { + stream.skipToEnd(); + return tokenStylesWith(state, TOKEN_STYLES.html); + }, + + table: function(stream, state) { + state.layoutType = "table"; + return (state.mode = Modes.tableCell)(stream, state); + }, + + tableCell: function(stream, state) { + if (stream.match(RE("tableHeading"))) + state.tableHeading = true; + else + stream.eat("|"); + + state.mode = Modes.tableCellAttributes; + return tokenStyles(state); + }, + + tableCellAttributes: function(stream, state) { + state.mode = Modes.tableText; + + if (stream.match(RE("tableCellAttributes"))) + return tokenStylesWith(state, TOKEN_STYLES.attributes); + else + return tokenStyles(state); + }, + + tableText: function(stream, state) { + if (stream.match(RE("tableText"))) + return tokenStyles(state); + + if (stream.peek() === "|") { // end of cell + state.mode = Modes.tableCell; + return tokenStyles(state); + } + return handlePhraseModifier(stream, state, stream.next()); + } + }; + + CodeMirror.defineMode("textile", function() { + return { + startState: function() { + return { mode: Modes.newLayout }; + }, + token: function(stream, state) { + if (stream.sol()) startNewLine(stream, state); + return state.mode(stream, state); + }, + blankLine: blankLine + }; + }); + + CodeMirror.defineMIME("text/x-textile", "textile"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/r/r.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.registerHelper("wordChars", "r", /[\w.]/); + +CodeMirror.defineMode("r", function(config) { + function wordObj(str) { + var words = str.split(" "), res = {}; + for (var i = 0; i < words.length; ++i) res[words[i]] = true; + return res; + } + var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); + var builtins = wordObj("list quote bquote eval return call parse deparse"); + var keywords = wordObj("if else repeat while function for in next break"); + var blockkeywords = wordObj("if else repeat while function for"); + var opChars = /[+\-*\/^<>=!&|~$:]/; + var curPunc; + + function tokenBase(stream, state) { + curPunc = null; + var ch = stream.next(); + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } else if (ch == "0" && stream.eat("x")) { + stream.eatWhile(/[\da-f]/i); + return "number"; + } else if (ch == "." && stream.eat(/\d/)) { + stream.match(/\d*(?:e[+\-]?\d+)?/); + return "number"; + } else if (/\d/.test(ch)) { + stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); + return "number"; + } else if (ch == "'" || ch == '"') { + state.tokenize = tokenString(ch); + return "string"; + } else if (ch == "`") { + stream.match(/[^`]+`/); + return "variable-3"; + } else if (ch == "." && stream.match(/.[.\d]+/)) { + return "keyword"; + } else if (/[\w\.]/.test(ch) && ch != "_") { + stream.eatWhile(/[\w\.]/); + var word = stream.current(); + if (atoms.propertyIsEnumerable(word)) return "atom"; + if (keywords.propertyIsEnumerable(word)) { + // Block keywords start new blocks, except 'else if', which only starts + // one new block for the 'if', no block for the 'else'. + if (blockkeywords.propertyIsEnumerable(word) && + !stream.match(/\s*if(\s+|$)/, false)) + curPunc = "block"; + return "keyword"; + } + if (builtins.propertyIsEnumerable(word)) return "builtin"; + return "variable"; + } else if (ch == "%") { + if (stream.skipTo("%")) stream.next(); + return "operator variable-2"; + } else if ( + (ch == "<" && stream.eat("-")) || + (ch == "<" && stream.match("<-")) || + (ch == "-" && stream.match(/>>?/)) + ) { + return "operator arrow"; + } else if (ch == "=" && state.ctx.argList) { + return "arg-is"; + } else if (opChars.test(ch)) { + if (ch == "$") return "operator dollar"; + stream.eatWhile(opChars); + return "operator"; + } else if (/[\(\){}\[\];]/.test(ch)) { + curPunc = ch; + if (ch == ";") return "semi"; + return null; + } else { + return null; + } + } + + function tokenString(quote) { + return function(stream, state) { + if (stream.eat("\\")) { + var ch = stream.next(); + if (ch == "x") stream.match(/^[a-f0-9]{2}/i); + else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); + else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); + else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); + else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); + return "string-2"; + } else { + var next; + while ((next = stream.next()) != null) { + if (next == quote) { state.tokenize = tokenBase; break; } + if (next == "\\") { stream.backUp(1); break; } + } + return "string"; + } + }; + } + + var ALIGN_YES = 1, ALIGN_NO = 2, BRACELESS = 4 + + function push(state, type, stream) { + state.ctx = {type: type, + indent: state.indent, + flags: 0, + column: stream.column(), + prev: state.ctx}; + } + function setFlag(state, flag) { + var ctx = state.ctx + state.ctx = {type: ctx.type, + indent: ctx.indent, + flags: ctx.flags | flag, + column: ctx.column, + prev: ctx.prev} + } + function pop(state) { + state.indent = state.ctx.indent; + state.ctx = state.ctx.prev; + } + + return { + startState: function() { + return {tokenize: tokenBase, + ctx: {type: "top", + indent: -config.indentUnit, + flags: ALIGN_NO}, + indent: 0, + afterIdent: false}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if ((state.ctx.flags & 3) == 0) state.ctx.flags |= ALIGN_NO + if (state.ctx.flags & BRACELESS) pop(state) + state.indent = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (style != "comment" && (state.ctx.flags & ALIGN_NO) == 0) setFlag(state, ALIGN_YES) + + if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && state.ctx.type == "block") pop(state); + if (curPunc == "{") push(state, "}", stream); + else if (curPunc == "(") { + push(state, ")", stream); + if (state.afterIdent) state.ctx.argList = true; + } + else if (curPunc == "[") push(state, "]", stream); + else if (curPunc == "block") push(state, "block", stream); + else if (curPunc == state.ctx.type) pop(state); + else if (state.ctx.type == "block" && style != "comment") setFlag(state, BRACELESS) + state.afterIdent = style == "variable" || style == "keyword"; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, + closing = firstChar == ctx.type; + if (ctx.flags & BRACELESS) ctx = ctx.prev + if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); + else if (ctx.flags & ALIGN_YES) return ctx.column + (closing ? 0 : 1); + else return ctx.indent + (closing ? 0 : config.indentUnit); + }, + + lineComment: "#" + }; +}); + +CodeMirror.defineMIME("text/x-rsrc", "r"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/haml/haml.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + + // full haml mode. This handled embedded ruby and html fragments too + CodeMirror.defineMode("haml", function(config) { + var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); + var rubyMode = CodeMirror.getMode(config, "ruby"); + + function rubyInQuote(endQuote) { + return function(stream, state) { + var ch = stream.peek(); + if (ch == endQuote && state.rubyState.tokenize.length == 1) { + // step out of ruby context as it seems to complete processing all the braces + stream.next(); + state.tokenize = html; + return "closeAttributeTag"; + } else { + return ruby(stream, state); + } + }; + } + + function ruby(stream, state) { + if (stream.match("-#")) { + stream.skipToEnd(); + return "comment"; + } + return rubyMode.token(stream, state.rubyState); + } + + function html(stream, state) { + var ch = stream.peek(); + + // handle haml declarations. All declarations that cant be handled here + // will be passed to html mode + if (state.previousToken.style == "comment" ) { + if (state.indented > state.previousToken.indented) { + stream.skipToEnd(); + return "commentLine"; + } + } + + if (state.startOfLine) { + if (ch == "!" && stream.match("!!")) { + stream.skipToEnd(); + return "tag"; + } else if (stream.match(/^%[\w:#\.]+=/)) { + state.tokenize = ruby; + return "hamlTag"; + } else if (stream.match(/^%[\w:]+/)) { + return "hamlTag"; + } else if (ch == "/" ) { + stream.skipToEnd(); + return "comment"; + } + } + + if (state.startOfLine || state.previousToken.style == "hamlTag") { + if ( ch == "#" || ch == ".") { + stream.match(/[\w-#\.]*/); + return "hamlAttribute"; + } + } + + // donot handle --> as valid ruby, make it HTML close comment instead + if (state.startOfLine && !stream.match("-->", false) && (ch == "=" || ch == "-" )) { + state.tokenize = ruby; + return state.tokenize(stream, state); + } + + if (state.previousToken.style == "hamlTag" || + state.previousToken.style == "closeAttributeTag" || + state.previousToken.style == "hamlAttribute") { + if (ch == "(") { + state.tokenize = rubyInQuote(")"); + return state.tokenize(stream, state); + } else if (ch == "{") { + if (!stream.match(/^\{%.*/)) { + state.tokenize = rubyInQuote("}"); + return state.tokenize(stream, state); + } + } + } + + return htmlMode.token(stream, state.htmlState); + } + + return { + // default to html mode + startState: function() { + var htmlState = CodeMirror.startState(htmlMode); + var rubyState = CodeMirror.startState(rubyMode); + return { + htmlState: htmlState, + rubyState: rubyState, + indented: 0, + previousToken: { style: null, indented: 0}, + tokenize: html + }; + }, + + copyState: function(state) { + return { + htmlState : CodeMirror.copyState(htmlMode, state.htmlState), + rubyState: CodeMirror.copyState(rubyMode, state.rubyState), + indented: state.indented, + previousToken: state.previousToken, + tokenize: state.tokenize + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + state.startOfLine = false; + // dont record comment line as we only want to measure comment line with + // the opening comment block + if (style && style != "commentLine") { + state.previousToken = { style: style, indented: state.indented }; + } + // if current state is ruby and the previous token is not `,` reset the + // tokenize to html + if (stream.eol() && state.tokenize == ruby) { + stream.backUp(1); + var ch = stream.peek(); + stream.next(); + if (ch && ch != ",") { + state.tokenize = html; + } + } + // reprocess some of the specific style tag when finish setting previousToken + if (style == "hamlTag") { + style = "tag"; + } else if (style == "commentLine") { + style = "comment"; + } else if (style == "hamlAttribute") { + style = "attribute"; + } else if (style == "closeAttributeTag") { + style = null; + } + return style; + } + }; + }, "htmlmixed", "ruby"); + + CodeMirror.defineMIME("text/x-haml", "haml"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/ecl/ecl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("ecl", function(config) { + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + function metaHook(stream, state) { + if (!state.startOfLine) return false; + stream.skipToEnd(); + return "meta"; + } + + var indentUnit = config.indentUnit; + var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode"); + var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait"); + var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath"); + var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode"); + var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when"); + var blockKeywords = words("catch class do else finally for if switch try while"); + var atoms = words("true false null"); + var hooks = {"#": metaHook}; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current().toLowerCase(); + if (keyword.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } else if (variable.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable"; + } else if (variable_2.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable-2"; + } else if (variable_3.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "variable-3"; + } else if (builtin.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "builtin"; + } else { //Data types are of from KEYWORD## + var i = cur.length - 1; + while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_')) + --i; + + if (i > 0) { + var cur2 = cur.substr(0, i + 1); + if (variable_3.propertyIsEnumerable(cur2)) { + if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement"; + return "variable-3"; + } + } + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return null; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !escaped) + state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-ecl", "ecl"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/cypher/cypher.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// By the Neo4j Team and contributors. +// https://github.com/neo4j-contrib/CodeMirror + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + var wordRegexp = function(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + }; + + CodeMirror.defineMode("cypher", function(config) { + var tokenBase = function(stream/*, state*/) { + var ch = stream.next(); + if (ch ==='"') { + stream.match(/.*?"/); + return "string"; + } + if (ch === "'") { + stream.match(/.*?'/); + return "string"; + } + if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return "node"; + } else if (ch === "/" && stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } else { + stream.eatWhile(/[_\w\d]/); + if (stream.eat(":")) { + stream.eatWhile(/[\w\d_\-]/); + return "atom"; + } + var word = stream.current(); + if (funcs.test(word)) return "builtin"; + if (preds.test(word)) return "def"; + if (keywords.test(word)) return "keyword"; + return "variable"; + } + }; + var pushContext = function(state, type, col) { + return state.context = { + prev: state.context, + indent: state.indent, + col: col, + type: type + }; + }; + var popContext = function(state) { + state.indent = state.context.indent; + return state.context = state.context.prev; + }; + var indentUnit = config.indentUnit; + var curPunc; + var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]); + var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]); + var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with", "call", "yield"]); + var operatorChars = /[*+\-<>=&|~%^]/; + + return { + startState: function(/*base*/) { + return { + tokenize: tokenBase, + context: null, + indent: 0, + col: 0 + }; + }, + token: function(stream, state) { + if (stream.sol()) { + if (state.context && (state.context.align == null)) { + state.context.align = false; + } + state.indent = stream.indentation(); + } + if (stream.eatSpace()) { + return null; + } + var style = state.tokenize(stream, state); + if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") { + state.context.align = true; + } + if (curPunc === "(") { + pushContext(state, ")", stream.column()); + } else if (curPunc === "[") { + pushContext(state, "]", stream.column()); + } else if (curPunc === "{") { + pushContext(state, "}", stream.column()); + } else if (/[\]\}\)]/.test(curPunc)) { + while (state.context && state.context.type === "pattern") { + popContext(state); + } + if (state.context && curPunc === state.context.type) { + popContext(state); + } + } else if (curPunc === "." && state.context && state.context.type === "pattern") { + popContext(state); + } else if (/atom|string|variable/.test(style) && state.context) { + if (/[\}\]]/.test(state.context.type)) { + pushContext(state, "pattern", stream.column()); + } else if (state.context.type === "pattern" && !state.context.align) { + state.context.align = true; + state.context.col = stream.column(); + } + } + return style; + }, + indent: function(state, textAfter) { + var firstChar = textAfter && textAfter.charAt(0); + var context = state.context; + if (/[\]\}]/.test(firstChar)) { + while (context && context.type === "pattern") { + context = context.prev; + } + } + var closing = context && firstChar === context.type; + if (!context) return 0; + if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent; + if (context.align) return context.col + (closing ? 0 : 1); + return context.indent + (closing ? 0 : indentUnit); + } + }; + }); + + CodeMirror.modeExtensions["cypher"] = { + autoFormatLineBreaks: function(text) { + var i, lines, reProcessedPortion; + var lines = text.split("\n"); + var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g; + for (var i = 0; i < lines.length; i++) + lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim(); + return lines.join("\n"); + } + }; + + CodeMirror.defineMIME("application/x-cypher-query", "cypher"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/sieve/sieve.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("sieve", function(config) { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var keywords = words("if elsif else stop require"); + var atoms = words("true false not"); + var indentUnit = config.indentUnit; + + function tokenBase(stream, state) { + + var ch = stream.next(); + if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + + if (ch === '#') { + stream.skipToEnd(); + return "comment"; + } + + if (ch == "\"") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + + if (ch == "(") { + state._indent.push("("); + // add virtual angel wings so that editor behaves... + // ...more sane incase of broken brackets + state._indent.push("{"); + return null; + } + + if (ch === "{") { + state._indent.push("{"); + return null; + } + + if (ch == ")") { + state._indent.pop(); + state._indent.pop(); + } + + if (ch === "}") { + state._indent.pop(); + return null; + } + + if (ch == ",") + return null; + + if (ch == ";") + return null; + + + if (/[{}\(\),;]/.test(ch)) + return null; + + // 1*DIGIT "K" / "M" / "G" + if (/\d/.test(ch)) { + stream.eatWhile(/[\d]/); + stream.eat(/[KkMmGg]/); + return "number"; + } + + // ":" (ALPHA / "_") *(ALPHA / DIGIT / "_") + if (ch == ":") { + stream.eatWhile(/[a-zA-Z_]/); + stream.eatWhile(/[a-zA-Z0-9_]/); + + return "operator"; + } + + stream.eatWhile(/\w/); + var cur = stream.current(); + + // "text:" *(SP / HTAB) (hash-comment / CRLF) + // *(multiline-literal / multiline-dotstart) + // "." CRLF + if ((cur == "text") && stream.eat(":")) + { + state.tokenize = tokenMultiLineString; + return "string"; + } + + if (keywords.propertyIsEnumerable(cur)) + return "keyword"; + + if (atoms.propertyIsEnumerable(cur)) + return "atom"; + + return null; + } + + function tokenMultiLineString(stream, state) + { + state._multiLineString = true; + // the first line is special it may contain a comment + if (!stream.sol()) { + stream.eatSpace(); + + if (stream.peek() == "#") { + stream.skipToEnd(); + return "comment"; + } + + stream.skipToEnd(); + return "string"; + } + + if ((stream.next() == ".") && (stream.eol())) + { + state._multiLineString = false; + state.tokenize = tokenBase; + } + + return "string"; + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return "string"; + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + _indent: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) + return null; + + return (state.tokenize || tokenBase)(stream, state); + }, + + indent: function(state, _textAfter) { + var length = state._indent.length; + if (_textAfter && (_textAfter[0] == "}")) + length--; + + if (length <0) + length = 0; + + return length * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("application/sieve", "sieve"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/soy/soy.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var indentingTags = ["template", "literal", "msg", "fallbackmsg", "let", "if", "elseif", + "else", "switch", "case", "default", "foreach", "ifempty", "for", + "call", "param", "deltemplate", "delcall", "log"]; + + CodeMirror.defineMode("soy", function(config) { + var textMode = CodeMirror.getMode(config, "text/plain"); + var modes = { + html: CodeMirror.getMode(config, {name: "text/html", multilineTagIndentFactor: 2, multilineTagIndentPastTag: false}), + attributes: textMode, + text: textMode, + uri: textMode, + css: CodeMirror.getMode(config, "text/css"), + js: CodeMirror.getMode(config, {name: "text/javascript", statementIndent: 2 * config.indentUnit}) + }; + + function last(array) { + return array[array.length - 1]; + } + + function tokenUntil(stream, state, untilRegExp) { + if (stream.sol()) { + for (var indent = 0; indent < state.indent; indent++) { + if (!stream.eat(/\s/)) break; + } + if (indent) return null; + } + var oldString = stream.string; + var match = untilRegExp.exec(oldString.substr(stream.pos)); + if (match) { + // We don't use backUp because it backs up just the position, not the state. + // This uses an undocumented API. + stream.string = oldString.substr(0, stream.pos + match.index); + } + var result = stream.hideFirstChars(state.indent, function() { + var localState = last(state.localStates); + return localState.mode.token(stream, localState.state); + }); + stream.string = oldString; + return result; + } + + function contains(list, element) { + while (list) { + if (list.element === element) return true; + list = list.next; + } + return false; + } + + function prepend(list, element) { + return { + element: element, + next: list + }; + } + + // Reference a variable `name` in `list`. + // Let `loose` be truthy to ignore missing identifiers. + function ref(list, name, loose) { + return contains(list, name) ? "variable-2" : (loose ? "variable" : "variable-2 error"); + } + + function popscope(state) { + if (state.scopes) { + state.variables = state.scopes.element; + state.scopes = state.scopes.next; + } + } + + return { + startState: function() { + return { + kind: [], + kindTag: [], + soyState: [], + templates: null, + variables: prepend(null, 'ij'), + scopes: null, + indent: 0, + quoteKind: null, + localStates: [{ + mode: modes.html, + state: CodeMirror.startState(modes.html) + }] + }; + }, + + copyState: function(state) { + return { + tag: state.tag, // Last seen Soy tag. + kind: state.kind.concat([]), // Values of kind="" attributes. + kindTag: state.kindTag.concat([]), // Opened tags with kind="" attributes. + soyState: state.soyState.concat([]), + templates: state.templates, + variables: state.variables, + scopes: state.scopes, + indent: state.indent, // Indentation of the following line. + quoteKind: state.quoteKind, + localStates: state.localStates.map(function(localState) { + return { + mode: localState.mode, + state: CodeMirror.copyState(localState.mode, localState.state) + }; + }) + }; + }, + + token: function(stream, state) { + var match; + + switch (last(state.soyState)) { + case "comment": + if (stream.match(/^.*?\*\//)) { + state.soyState.pop(); + } else { + stream.skipToEnd(); + } + if (!state.scopes) { + var paramRe = /@param\??\s+(\S+)/g; + var current = stream.current(); + for (var match; (match = paramRe.exec(current)); ) { + state.variables = prepend(state.variables, match[1]); + } + } + return "comment"; + + case "string": + var match = stream.match(/^.*?(["']|\\[\s\S])/); + if (!match) { + stream.skipToEnd(); + } else if (match[1] == state.quoteKind) { + state.quoteKind = null; + state.soyState.pop(); + } + return "string"; + } + + if (stream.match(/^\/\*/)) { + state.soyState.push("comment"); + return "comment"; + } else if (stream.match(stream.sol() || (state.soyState.length && last(state.soyState) != "literal") ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) { + return "comment"; + } + + switch (last(state.soyState)) { + case "templ-def": + if (match = stream.match(/^\.?([\w]+(?!\.[\w]+)*)/)) { + state.templates = prepend(state.templates, match[1]); + state.scopes = prepend(state.scopes, state.variables); + state.soyState.pop(); + return "def"; + } + stream.next(); + return null; + + case "templ-ref": + if (match = stream.match(/^\.?([\w]+)/)) { + state.soyState.pop(); + // If the first character is '.', try to match against a local template name. + if (match[0][0] == '.') { + return ref(state.templates, match[1], true); + } + // Otherwise + return "variable"; + } + stream.next(); + return null; + + case "param-def": + if (match = stream.match(/^\w+/)) { + state.variables = prepend(state.variables, match[0]); + state.soyState.pop(); + state.soyState.push("param-type"); + return "def"; + } + stream.next(); + return null; + + case "param-type": + if (stream.peek() == "}") { + state.soyState.pop(); + return null; + } + if (stream.eatWhile(/^[\w]+/)) { + return "variable-3"; + } + stream.next(); + return null; + + case "var-def": + if (match = stream.match(/^\$([\w]+)/)) { + state.variables = prepend(state.variables, match[1]); + state.soyState.pop(); + return "def"; + } + stream.next(); + return null; + + case "tag": + if (stream.match(/^\/?}/)) { + if (state.tag == "/template" || state.tag == "/deltemplate") { + popscope(state); + state.variables = prepend(null, 'ij'); + state.indent = 0; + } else { + if (state.tag == "/for" || state.tag == "/foreach") { + popscope(state); + } + state.indent -= config.indentUnit * + (stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1); + } + state.soyState.pop(); + return "keyword"; + } else if (stream.match(/^([\w?]+)(?==)/)) { + if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) { + var kind = match[1]; + state.kind.push(kind); + state.kindTag.push(state.tag); + var mode = modes[kind] || modes.html; + var localState = last(state.localStates); + if (localState.mode.indent) { + state.indent += localState.mode.indent(localState.state, ""); + } + state.localStates.push({ + mode: mode, + state: CodeMirror.startState(mode) + }); + } + return "attribute"; + } else if (match = stream.match(/^["']/)) { + state.soyState.push("string"); + state.quoteKind = match; + return "string"; + } + if (match = stream.match(/^\$([\w]+)/)) { + return ref(state.variables, match[1]); + } + if (match = stream.match(/^\w+/)) { + return /^(?:as|and|or|not|in)$/.test(match[0]) ? "keyword" : null; + } + stream.next(); + return null; + + case "literal": + if (stream.match(/^(?=\{\/literal})/)) { + state.indent -= config.indentUnit; + state.soyState.pop(); + return this.token(stream, state); + } + return tokenUntil(stream, state, /\{\/literal}/); + } + + if (stream.match(/^\{literal}/)) { + state.indent += config.indentUnit; + state.soyState.push("literal"); + return "keyword"; + + // A tag-keyword must be followed by whitespace, comment or a closing tag. + } else if (match = stream.match(/^\{([\/@\\]?\w+\??)(?=[\s\}]|\/[/*])/)) { + if (match[1] != "/switch") + state.indent += (/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit; + state.tag = match[1]; + if (state.tag == "/" + last(state.kindTag)) { + // We found the tag that opened the current kind="". + state.kind.pop(); + state.kindTag.pop(); + state.localStates.pop(); + var localState = last(state.localStates); + if (localState.mode.indent) { + state.indent -= localState.mode.indent(localState.state, ""); + } + } + state.soyState.push("tag"); + if (state.tag == "template" || state.tag == "deltemplate") { + state.soyState.push("templ-def"); + } else if (state.tag == "call" || state.tag == "delcall") { + state.soyState.push("templ-ref"); + } else if (state.tag == "let") { + state.soyState.push("var-def"); + } else if (state.tag == "for" || state.tag == "foreach") { + state.scopes = prepend(state.scopes, state.variables); + state.soyState.push("var-def"); + } else if (state.tag == "namespace") { + if (!state.scopes) { + state.variables = prepend(null, 'ij'); + } + } else if (state.tag.match(/^@(?:param\??|inject)/)) { + state.soyState.push("param-def"); + } + return "keyword"; + + // Not a tag-keyword; it's an implicit print tag. + } else if (stream.eat('{')) { + state.tag = "print"; + state.indent += 2 * config.indentUnit; + state.soyState.push("tag"); + return "keyword"; + } + + return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/); + }, + + indent: function(state, textAfter) { + var indent = state.indent, top = last(state.soyState); + if (top == "comment") return CodeMirror.Pass; + + if (top == "literal") { + if (/^\{\/literal}/.test(textAfter)) indent -= config.indentUnit; + } else { + if (/^\s*\{\/(template|deltemplate)\b/.test(textAfter)) return 0; + if (/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(textAfter)) indent -= config.indentUnit; + if (state.tag != "switch" && /^\{(case|default)\b/.test(textAfter)) indent -= config.indentUnit; + if (/^\{\/switch\b/.test(textAfter)) indent -= config.indentUnit; + } + var localState = last(state.localStates); + if (indent && localState.mode.indent) { + indent += localState.mode.indent(localState.state, textAfter); + } + return indent; + }, + + innerMode: function(state) { + if (state.soyState.length && last(state.soyState) != "literal") return null; + else return last(state.localStates); + }, + + electricInput: /^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/, + lineComment: "//", + blockCommentStart: "/*", + blockCommentEnd: "*/", + blockCommentContinue: " * ", + useInnerComments: false, + fold: "indent" + }; + }, "htmlmixed"); + + CodeMirror.registerHelper("hintWords", "soy", indentingTags.concat( + ["delpackage", "namespace", "alias", "print", "css", "debugger"])); + + CodeMirror.defineMIME("text/x-soy", "soy"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/pig/pig.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* + * Pig Latin Mode for CodeMirror 2 + * @author Prasanth Jayachandran + * @link https://github.com/prasanthj/pig-codemirror-2 + * This implementation is adapted from PL/SQL mode in CodeMirror 2. + */ +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("pig", function(_config, parserConfig) { + var keywords = parserConfig.keywords, + builtins = parserConfig.builtins, + types = parserConfig.types, + multiLineStrings = parserConfig.multiLineStrings; + + var isOperatorChar = /[*+\-%<>=&?:\/!|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function tokenComment(stream, state) { + var isEnd = false; + var ch; + while(ch = stream.next()) { + if(ch == "/" && isEnd) { + state.tokenize = tokenBase; + break; + } + isEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = tokenBase; + return "error"; + }; + } + + + function tokenBase(stream, state) { + var ch = stream.next(); + + // is a start of string? + if (ch == '"' || ch == "'") + return chain(stream, state, tokenString(ch)); + // is it one of the special chars + else if(/[\[\]{}\(\),;\.]/.test(ch)) + return null; + // is it a number? + else if(/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + // multi line comment or operator + else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, tokenComment); + } + else { + stream.eatWhile(isOperatorChar); + return "operator"; + } + } + // single line comment or operator + else if (ch=="-") { + if(stream.eat("-")){ + stream.skipToEnd(); + return "comment"; + } + else { + stream.eatWhile(isOperatorChar); + return "operator"; + } + } + // is it an operator + else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + else { + // get the while word + stream.eatWhile(/[\w\$_]/); + // is it one of the listed keywords? + if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) { + //keywords can be used as variables like flatten(group), group.$0 etc.. + if (!stream.eat(")") && !stream.eat(".")) + return "keyword"; + } + // is it one of the builtin functions? + if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) + return "variable-2"; + // is it one of the listed types? + if (types && types.propertyIsEnumerable(stream.current().toUpperCase())) + return "variable-3"; + // default is a 'variable' + return "variable"; + } + } + + // Interface + return { + startState: function() { + return { + tokenize: tokenBase, + startOfLine: true + }; + }, + + token: function(stream, state) { + if(stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + return style; + } + }; +}); + +(function() { + function keywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + // builtin funcs taken from trunk revision 1303237 + var pBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL " + + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS " + + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG " + + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN " + + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER " + + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS " + + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA " + + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE " + + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG " + + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER "; + + // taken from QueryLexer.g + var pKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP " + + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL " + + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE " + + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE " + + "NEQ MATCHES TRUE FALSE DUMP"; + + // data types + var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP "; + + CodeMirror.defineMIME("text/x-pig", { + name: "pig", + builtins: keywords(pBuiltins), + keywords: keywords(pKeywords), + types: keywords(pTypes) + }); + + CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" ")); +}()); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/apl/apl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("apl", function() { + var builtInOps = { + ".": "innerProduct", + "\\": "scan", + "/": "reduce", + "⌿": "reduce1Axis", + "⍀": "scan1Axis", + "¨": "each", + "⍣": "power" + }; + var builtInFuncs = { + "+": ["conjugate", "add"], + "−": ["negate", "subtract"], + "×": ["signOf", "multiply"], + "÷": ["reciprocal", "divide"], + "⌈": ["ceiling", "greaterOf"], + "⌊": ["floor", "lesserOf"], + "∣": ["absolute", "residue"], + "⍳": ["indexGenerate", "indexOf"], + "?": ["roll", "deal"], + "⋆": ["exponentiate", "toThePowerOf"], + "⍟": ["naturalLog", "logToTheBase"], + "○": ["piTimes", "circularFuncs"], + "!": ["factorial", "binomial"], + "⌹": ["matrixInverse", "matrixDivide"], + "<": [null, "lessThan"], + "≤": [null, "lessThanOrEqual"], + "=": [null, "equals"], + ">": [null, "greaterThan"], + "≥": [null, "greaterThanOrEqual"], + "≠": [null, "notEqual"], + "≡": ["depth", "match"], + "≢": [null, "notMatch"], + "∈": ["enlist", "membership"], + "⍷": [null, "find"], + "∪": ["unique", "union"], + "∩": [null, "intersection"], + "∼": ["not", "without"], + "∨": [null, "or"], + "∧": [null, "and"], + "⍱": [null, "nor"], + "⍲": [null, "nand"], + "⍴": ["shapeOf", "reshape"], + ",": ["ravel", "catenate"], + "⍪": [null, "firstAxisCatenate"], + "⌽": ["reverse", "rotate"], + "⊖": ["axis1Reverse", "axis1Rotate"], + "⍉": ["transpose", null], + "↑": ["first", "take"], + "↓": [null, "drop"], + "⊂": ["enclose", "partitionWithAxis"], + "⊃": ["diclose", "pick"], + "⌷": [null, "index"], + "⍋": ["gradeUp", null], + "⍒": ["gradeDown", null], + "⊤": ["encode", null], + "⊥": ["decode", null], + "⍕": ["format", "formatByExample"], + "⍎": ["execute", null], + "⊣": ["stop", "left"], + "⊢": ["pass", "right"] + }; + + var isOperator = /[\.\/⌿⍀¨⍣]/; + var isNiladic = /⍬/; + var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/; + var isArrow = /←/; + var isComment = /[⍝#].*$/; + + var stringEater = function(type) { + var prev; + prev = false; + return function(c) { + prev = c; + if (c === type) { + return prev === "\\"; + } + return true; + }; + }; + return { + startState: function() { + return { + prev: false, + func: false, + op: false, + string: false, + escape: false + }; + }, + token: function(stream, state) { + var ch, funcName; + if (stream.eatSpace()) { + return null; + } + ch = stream.next(); + if (ch === '"' || ch === "'") { + stream.eatWhile(stringEater(ch)); + stream.next(); + state.prev = true; + return "string"; + } + if (/[\[{\(]/.test(ch)) { + state.prev = false; + return null; + } + if (/[\]}\)]/.test(ch)) { + state.prev = true; + return null; + } + if (isNiladic.test(ch)) { + state.prev = false; + return "niladic"; + } + if (/[¯\d]/.test(ch)) { + if (state.func) { + state.func = false; + state.prev = false; + } else { + state.prev = true; + } + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (isOperator.test(ch)) { + return "operator apl-" + builtInOps[ch]; + } + if (isArrow.test(ch)) { + return "apl-arrow"; + } + if (isFunction.test(ch)) { + funcName = "apl-"; + if (builtInFuncs[ch] != null) { + if (state.prev) { + funcName += builtInFuncs[ch][1]; + } else { + funcName += builtInFuncs[ch][0]; + } + } + state.func = true; + state.prev = false; + return "function " + funcName; + } + if (isComment.test(ch)) { + stream.skipToEnd(); + return "comment"; + } + if (ch === "∘" && stream.peek() === ".") { + stream.next(); + return "function jot-dot"; + } + stream.eatWhile(/[\w\$_]/); + state.prev = true; + return "keyword"; + } + }; +}); + +CodeMirror.defineMIME("text/apl", "apl"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/crystal/crystal.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("crystal", function(config) { + function wordRegExp(words, end) { + return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b")); + } + + function chain(tokenize, stream, state) { + state.tokenize.push(tokenize); + return tokenize(stream, state); + } + + var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/; + var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/; + var indexingOperators = /^(?:\[\][?=]?)/; + var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/; + var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/; + var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/; + var keywords = wordRegExp([ + "abstract", "alias", "as", "asm", "begin", "break", "case", "class", "def", "do", + "else", "elsif", "end", "ensure", "enum", "extend", "for", "fun", "if", + "include", "instance_sizeof", "lib", "macro", "module", "next", "of", "out", "pointerof", + "private", "protected", "rescue", "return", "require", "select", "sizeof", "struct", + "super", "then", "type", "typeof", "uninitialized", "union", "unless", "until", "when", "while", "with", + "yield", "__DIR__", "__END_LINE__", "__FILE__", "__LINE__" + ]); + var atomWords = wordRegExp(["true", "false", "nil", "self"]); + var indentKeywordsArray = [ + "def", "fun", "macro", + "class", "module", "struct", "lib", "enum", "union", + "do", "for" + ]; + var indentKeywords = wordRegExp(indentKeywordsArray); + var indentExpressionKeywordsArray = ["if", "unless", "case", "while", "until", "begin", "then"]; + var indentExpressionKeywords = wordRegExp(indentExpressionKeywordsArray); + var dedentKeywordsArray = ["end", "else", "elsif", "rescue", "ensure"]; + var dedentKeywords = wordRegExp(dedentKeywordsArray); + var dedentPunctualsArray = ["\\)", "\\}", "\\]"]; + var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$"); + var nextTokenizer = { + "def": tokenFollowIdent, "fun": tokenFollowIdent, "macro": tokenMacroDef, + "class": tokenFollowType, "module": tokenFollowType, "struct": tokenFollowType, + "lib": tokenFollowType, "enum": tokenFollowType, "union": tokenFollowType + }; + var matching = {"[": "]", "{": "}", "(": ")", "<": ">"}; + + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + // Macros + if (state.lastToken != "\\" && stream.match("{%", false)) { + return chain(tokenMacro("%", "%"), stream, state); + } + + if (state.lastToken != "\\" && stream.match("{{", false)) { + return chain(tokenMacro("{", "}"), stream, state); + } + + // Comments + if (stream.peek() == "#") { + stream.skipToEnd(); + return "comment"; + } + + // Variables and keywords + var matched; + if (stream.match(idents)) { + stream.eat(/[?!]/); + + matched = stream.current(); + if (stream.eat(":")) { + return "atom"; + } else if (state.lastToken == ".") { + return "property"; + } else if (keywords.test(matched)) { + if (indentKeywords.test(matched)) { + if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0) && !(matched == "def" && state.lastToken == "abstract")) { + state.blocks.push(matched); + state.currentIndent += 1; + } + } else if ((state.lastStyle == "operator" || !state.lastStyle) && indentExpressionKeywords.test(matched)) { + state.blocks.push(matched); + state.currentIndent += 1; + } else if (matched == "end") { + state.blocks.pop(); + state.currentIndent -= 1; + } + + if (nextTokenizer.hasOwnProperty(matched)) { + state.tokenize.push(nextTokenizer[matched]); + } + + return "keyword"; + } else if (atomWords.test(matched)) { + return "atom"; + } + + return "variable"; + } + + // Class variables and instance variables + // or attributes + if (stream.eat("@")) { + if (stream.peek() == "[") { + return chain(tokenNest("[", "]", "meta"), stream, state); + } + + stream.eat("@"); + stream.match(idents) || stream.match(types); + return "variable-2"; + } + + // Constants and types + if (stream.match(types)) { + return "tag"; + } + + // Symbols or ':' operator + if (stream.eat(":")) { + if (stream.eat("\"")) { + return chain(tokenQuote("\"", "atom", false), stream, state); + } else if (stream.match(idents) || stream.match(types) || + stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) { + return "atom"; + } + stream.eat(":"); + return "operator"; + } + + // Strings + if (stream.eat("\"")) { + return chain(tokenQuote("\"", "string", true), stream, state); + } + + // Strings or regexps or macro variables or '%' operator + if (stream.peek() == "%") { + var style = "string"; + var embed = true; + var delim; + + if (stream.match("%r")) { + // Regexps + style = "string-2"; + delim = stream.next(); + } else if (stream.match("%w")) { + embed = false; + delim = stream.next(); + } else if (stream.match("%q")) { + embed = false; + delim = stream.next(); + } else { + if(delim = stream.match(/^%([^\w\s=])/)) { + delim = delim[1]; + } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) { + // Macro variables + return "meta"; + } else { + // '%' operator + return "operator"; + } + } + + if (matching.hasOwnProperty(delim)) { + delim = matching[delim]; + } + return chain(tokenQuote(delim, style, embed), stream, state); + } + + // Here Docs + if (matched = stream.match(/^<<-('?)([A-Z]\w*)\1/)) { + return chain(tokenHereDoc(matched[2], !matched[1]), stream, state) + } + + // Characters + if (stream.eat("'")) { + stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/); + stream.eat("'"); + return "atom"; + } + + // Numbers + if (stream.eat("0")) { + if (stream.eat("x")) { + stream.match(/^[0-9a-fA-F]+/); + } else if (stream.eat("o")) { + stream.match(/^[0-7]+/); + } else if (stream.eat("b")) { + stream.match(/^[01]+/); + } + return "number"; + } + + if (stream.eat(/^\d/)) { + stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/); + return "number"; + } + + // Operators + if (stream.match(operators)) { + stream.eat("="); // Operators can follow assign symbol. + return "operator"; + } + + if (stream.match(conditionalOperators) || stream.match(anotherOperators)) { + return "operator"; + } + + // Parens and braces + if (matched = stream.match(/[({[]/, false)) { + matched = matched[0]; + return chain(tokenNest(matched, matching[matched], null), stream, state); + } + + // Escapes + if (stream.eat("\\")) { + stream.next(); + return "meta"; + } + + stream.next(); + return null; + } + + function tokenNest(begin, end, style, started) { + return function (stream, state) { + if (!started && stream.match(begin)) { + state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true); + state.currentIndent += 1; + return style; + } + + var nextStyle = tokenBase(stream, state); + if (stream.current() === end) { + state.tokenize.pop(); + state.currentIndent -= 1; + nextStyle = style; + } + + return nextStyle; + }; + } + + function tokenMacro(begin, end, started) { + return function (stream, state) { + if (!started && stream.match("{" + begin)) { + state.currentIndent += 1; + state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true); + return "meta"; + } + + if (stream.match(end + "}")) { + state.currentIndent -= 1; + state.tokenize.pop(); + return "meta"; + } + + return tokenBase(stream, state); + }; + } + + function tokenMacroDef(stream, state) { + if (stream.eatSpace()) { + return null; + } + + var matched; + if (matched = stream.match(idents)) { + if (matched == "def") { + return "keyword"; + } + stream.eat(/[?!]/); + } + + state.tokenize.pop(); + return "def"; + } + + function tokenFollowIdent(stream, state) { + if (stream.eatSpace()) { + return null; + } + + if (stream.match(idents)) { + stream.eat(/[!?]/); + } else { + stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators); + } + state.tokenize.pop(); + return "def"; + } + + function tokenFollowType(stream, state) { + if (stream.eatSpace()) { + return null; + } + + stream.match(types); + state.tokenize.pop(); + return "def"; + } + + function tokenQuote(end, style, embed) { + return function (stream, state) { + var escaped = false; + + while (stream.peek()) { + if (!escaped) { + if (stream.match("{%", false)) { + state.tokenize.push(tokenMacro("%", "%")); + return style; + } + + if (stream.match("{{", false)) { + state.tokenize.push(tokenMacro("{", "}")); + return style; + } + + if (embed && stream.match("#{", false)) { + state.tokenize.push(tokenNest("#{", "}", "meta")); + return style; + } + + var ch = stream.next(); + + if (ch == end) { + state.tokenize.pop(); + return style; + } + + escaped = embed && ch == "\\"; + } else { + stream.next(); + escaped = false; + } + } + + return style; + }; + } + + function tokenHereDoc(phrase, embed) { + return function (stream, state) { + if (stream.sol()) { + stream.eatSpace() + if (stream.match(phrase)) { + state.tokenize.pop(); + return "string"; + } + } + + var escaped = false; + while (stream.peek()) { + if (!escaped) { + if (stream.match("{%", false)) { + state.tokenize.push(tokenMacro("%", "%")); + return "string"; + } + + if (stream.match("{{", false)) { + state.tokenize.push(tokenMacro("{", "}")); + return "string"; + } + + if (embed && stream.match("#{", false)) { + state.tokenize.push(tokenNest("#{", "}", "meta")); + return "string"; + } + + escaped = embed && stream.next() == "\\"; + } else { + stream.next(); + escaped = false; + } + } + + return "string"; + } + } + + return { + startState: function () { + return { + tokenize: [tokenBase], + currentIndent: 0, + lastToken: null, + lastStyle: null, + blocks: [] + }; + }, + + token: function (stream, state) { + var style = state.tokenize[state.tokenize.length - 1](stream, state); + var token = stream.current(); + + if (style && style != "comment") { + state.lastToken = token; + state.lastStyle = style; + } + + return style; + }, + + indent: function (state, textAfter) { + textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, ""); + + if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) { + return config.indentUnit * (state.currentIndent - 1); + } + + return config.indentUnit * state.currentIndent; + }, + + fold: "indent", + electricInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true), + lineComment: '#' + }; + }); + + CodeMirror.defineMIME("text/x-crystal", "crystal"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/clike/clike.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function Context(indented, column, type, info, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.info = info; + this.align = align; + this.prev = prev; +} +function pushContext(state, col, type, info) { + var indent = state.indented; + if (state.context && state.context.type == "statement" && type != "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, info, null, state.context); +} +function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; +} + +function typeBefore(stream, state, pos) { + if (state.prevToken == "variable" || state.prevToken == "type") return true; + if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true; + if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true; +} + +function isTopScope(context) { + for (;;) { + if (!context || context.type == "top") return true; + if (context.type == "}" && context.prev.info != "namespace") return false; + context = context.prev; + } +} + +CodeMirror.defineMode("clike", function(config, parserConfig) { + var indentUnit = config.indentUnit, + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + dontAlignCalls = parserConfig.dontAlignCalls, + keywords = parserConfig.keywords || {}, + types = parserConfig.types || {}, + builtin = parserConfig.builtin || {}, + blockKeywords = parserConfig.blockKeywords || {}, + defKeywords = parserConfig.defKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false, + indentSwitch = parserConfig.indentSwitch !== false, + namespaceSeparator = parserConfig.namespaceSeparator, + isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/, + numberStart = parserConfig.numberStart || /[\d\.]/, + number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i, + isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/, + isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/; + + var curPunc, isDefKeyword; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (isPunctuationChar.test(ch)) { + curPunc = ch; + return null; + } + if (numberStart.test(ch)) { + stream.backUp(1) + if (stream.match(number)) return "number" + stream.next() + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {} + return "operator"; + } + stream.eatWhile(isIdentifierChar); + if (namespaceSeparator) while (stream.match(namespaceSeparator)) + stream.eatWhile(isIdentifierChar); + + var cur = stream.current(); + if (contains(keywords, cur)) { + if (contains(blockKeywords, cur)) curPunc = "newstatement"; + if (contains(defKeywords, cur)) isDefKeyword = true; + return "keyword"; + } + if (contains(types, cur)) return "type"; + if (contains(builtin, cur)) { + if (contains(blockKeywords, cur)) curPunc = "newstatement"; + return "builtin"; + } + if (contains(atoms, cur)) return "atom"; + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function maybeEOL(stream, state) { + if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context)) + state.typeAtEndOfLine = typeBefore(stream, state, stream.pos) + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false), + indented: 0, + startOfLine: true, + prevToken: null + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) { maybeEOL(stream, state); return null; } + curPunc = isDefKeyword = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if (curPunc == ";" || curPunc == ":" || (curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false))) + while (state.context.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && + (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") || + (ctx.type == "statement" && curPunc == "newstatement"))) { + pushContext(state, stream.column(), "statement", stream.current()); + } + + if (style == "variable" && + ((state.prevToken == "def" || + (parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) && + isTopScope(state.context) && stream.match(/^\s*\(/, false))))) + style = "def"; + + if (hooks.token) { + var result = hooks.token(stream, state, style); + if (result !== undefined) style = result; + } + + if (style == "def" && parserConfig.styleDefs === false) style = "variable"; + + state.startOfLine = false; + state.prevToken = isDefKeyword ? "def" : style || curPunc; + maybeEOL(stream, state); + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + if (parserConfig.dontIndentStatements) + while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info)) + ctx = ctx.prev + if (hooks.indent) { + var hook = hooks.indent(state, ctx, textAfter); + if (typeof hook == "number") return hook + } + var closing = firstChar == ctx.type; + var switchBlock = ctx.prev && ctx.prev.info == "switch"; + if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) { + while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev + return ctx.indented + } + if (ctx.type == "statement") + return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); + if (ctx.align && (!dontAlignCalls || ctx.type != ")")) + return ctx.column + (closing ? 0 : 1); + if (ctx.type == ")" && !closing) + return ctx.indented + statementIndentUnit; + + return ctx.indented + (closing ? 0 : indentUnit) + + (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0); + }, + + electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/, + blockCommentStart: "/*", + blockCommentEnd: "*/", + blockCommentContinue: " * ", + lineComment: "//", + fold: "brace" + }; +}); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + function contains(words, word) { + if (typeof words === "function") { + return words(word); + } else { + return words.propertyIsEnumerable(word); + } + } + var cKeywords = "auto if break case register continue return default do sizeof " + + "static else struct switch extern typedef union for goto while enum const volatile"; + var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t"; + + function cppHook(stream, state) { + if (!state.startOfLine) return false + for (var ch, next = null; ch = stream.peek();) { + if (ch == "\\" && stream.match(/^.$/)) { + next = cppHook + break + } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) { + break + } + stream.next() + } + state.tokenize = next + return "meta" + } + + function pointerHook(_stream, state) { + if (state.prevToken == "type") return "type"; + return false; + } + + function cpp14Literal(stream) { + stream.eatWhile(/[\w\.']/); + return "number"; + } + + function cpp11StringHook(stream, state) { + stream.backUp(1); + // Raw strings. + if (stream.match(/(R|u8R|uR|UR|LR)/)) { + var match = stream.match(/"([^\s\\()]{0,16})\(/); + if (!match) { + return false; + } + state.cpp11RawStringDelim = match[1]; + state.tokenize = tokenRawString; + return tokenRawString(stream, state); + } + // Unicode strings/chars. + if (stream.match(/(u8|u|U|L)/)) { + if (stream.match(/["']/, /* eat */ false)) { + return "string"; + } + return false; + } + // Ignore this hook. + stream.next(); + return false; + } + + function cppLooksLikeConstructor(word) { + var lastTwo = /(\w+)::~?(\w+)$/.exec(word); + return lastTwo && lastTwo[1] == lastTwo[2]; + } + + // C#-style strings where "" escapes a quote. + function tokenAtString(stream, state) { + var next; + while ((next = stream.next()) != null) { + if (next == '"' && !stream.eat('"')) { + state.tokenize = null; + break; + } + } + return "string"; + } + + // C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where + // <delim> can be a string up to 16 characters long. + function tokenRawString(stream, state) { + // Escape characters that have special regex meanings. + var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&'); + var match = stream.match(new RegExp(".*?\\)" + delim + '"')); + if (match) + state.tokenize = null; + else + stream.skipToEnd(); + return "string"; + } + + function def(mimes, mode) { + if (typeof mimes == "string") mimes = [mimes]; + var words = []; + function add(obj) { + if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) + words.push(prop); + } + add(mode.keywords); + add(mode.types); + add(mode.builtin); + add(mode.atoms); + if (words.length) { + mode.helperType = mimes[0]; + CodeMirror.registerHelper("hintWords", mimes[0], words); + } + + for (var i = 0; i < mimes.length; ++i) + CodeMirror.defineMIME(mimes[i], mode); + } + + def(["text/x-csrc", "text/x-c", "text/x-chdr"], { + name: "clike", + keywords: words(cKeywords), + types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " + + "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " + + "uint32_t uint64_t"), + blockKeywords: words("case do else for if switch while struct"), + defKeywords: words("struct"), + typeFirstDefinitions: true, + atoms: words("null true false"), + hooks: {"#": cppHook, "*": pointerHook}, + modeProps: {fold: ["brace", "include"]} + }); + + def(["text/x-c++src", "text/x-c++hdr"], { + name: "clike", + keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " + + "static_cast typeid catch operator template typename class friend private " + + "this using const_cast inline public throw virtual delete mutable protected " + + "alignas alignof constexpr decltype nullptr noexcept thread_local final " + + "static_assert override"), + types: words(cTypes + " bool wchar_t"), + blockKeywords: words("catch class do else finally for if struct switch try while"), + defKeywords: words("class namespace struct enum union"), + typeFirstDefinitions: true, + atoms: words("true false null"), + dontIndentStatements: /^template$/, + isIdentifierChar: /[\w\$_~\xa1-\uffff]/, + hooks: { + "#": cppHook, + "*": pointerHook, + "u": cpp11StringHook, + "U": cpp11StringHook, + "L": cpp11StringHook, + "R": cpp11StringHook, + "0": cpp14Literal, + "1": cpp14Literal, + "2": cpp14Literal, + "3": cpp14Literal, + "4": cpp14Literal, + "5": cpp14Literal, + "6": cpp14Literal, + "7": cpp14Literal, + "8": cpp14Literal, + "9": cpp14Literal, + token: function(stream, state, style) { + if (style == "variable" && stream.peek() == "(" && + (state.prevToken == ";" || state.prevToken == null || + state.prevToken == "}") && + cppLooksLikeConstructor(stream.current())) + return "def"; + } + }, + namespaceSeparator: "::", + modeProps: {fold: ["brace", "include"]} + }); + + def("text/x-java", { + name: "clike", + keywords: words("abstract assert break case catch class const continue default " + + "do else enum extends final finally float for goto if implements import " + + "instanceof interface native new package private protected public " + + "return static strictfp super switch synchronized this throw throws transient " + + "try volatile while @interface"), + types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " + + "Integer Long Number Object Short String StringBuffer StringBuilder Void"), + blockKeywords: words("catch class do else finally for if switch try while"), + defKeywords: words("class interface enum @interface"), + typeFirstDefinitions: true, + atoms: words("true false null"), + number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i, + hooks: { + "@": function(stream) { + // Don't match the @interface keyword. + if (stream.match('interface', false)) return false; + + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + }, + modeProps: {fold: ["brace", "import"]} + }); + + def("text/x-csharp", { + name: "clike", + keywords: words("abstract as async await base break case catch checked class const continue" + + " default delegate do else enum event explicit extern finally fixed for" + + " foreach goto if implicit in interface internal is lock namespace new" + + " operator out override params private protected public readonly ref return sealed" + + " sizeof stackalloc static struct switch this throw try typeof unchecked" + + " unsafe using virtual void volatile while add alias ascending descending dynamic from get" + + " global group into join let orderby partial remove select set value var yield"), + types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" + + " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" + + " UInt64 bool byte char decimal double short int long object" + + " sbyte float string ushort uint ulong"), + blockKeywords: words("catch class do else finally for foreach if struct switch try while"), + defKeywords: words("class interface namespace struct var"), + typeFirstDefinitions: true, + atoms: words("true false null"), + hooks: { + "@": function(stream, state) { + if (stream.eat('"')) { + state.tokenize = tokenAtString; + return tokenAtString(stream, state); + } + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); + + function tokenTripleString(stream, state) { + var escaped = false; + while (!stream.eol()) { + if (!escaped && stream.match('"""')) { + state.tokenize = null; + break; + } + escaped = stream.next() == "\\" && !escaped; + } + return "string"; + } + + def("text/x-scala", { + name: "clike", + keywords: words( + + /* scala */ + "abstract case catch class def do else extends final finally for forSome if " + + "implicit import lazy match new null object override package private protected return " + + "sealed super this throw trait try type val var while with yield _ " + + + /* package scala */ + "assert assume require print println printf readLine readBoolean readByte readShort " + + "readChar readInt readLong readFloat readDouble" + ), + types: words( + "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " + + "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " + + "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " + + "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " + + "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " + + + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + + "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" + ), + multiLineStrings: true, + blockKeywords: words("catch class enum do else finally for forSome if match switch try while"), + defKeywords: words("class enum def object package trait type val var"), + atoms: words("true false null"), + indentStatements: false, + indentSwitch: false, + isOperatorChar: /[+\-*&%=<>!?|\/#:@]/, + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + }, + '"': function(stream, state) { + if (!stream.match('""')) return false; + state.tokenize = tokenTripleString; + return state.tokenize(stream, state); + }, + "'": function(stream) { + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + return "atom"; + }, + "=": function(stream, state) { + var cx = state.context + if (cx.type == "}" && cx.align && stream.eat(">")) { + state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev) + return "operator" + } else { + return false + } + } + }, + modeProps: {closeBrackets: {triples: '"'}} + }); + + function tokenKotlinString(tripleString){ + return function (stream, state) { + var escaped = false, next, end = false; + while (!stream.eol()) { + if (!tripleString && !escaped && stream.match('"') ) {end = true; break;} + if (tripleString && stream.match('"""')) {end = true; break;} + next = stream.next(); + if(!escaped && next == "$" && stream.match('{')) + stream.skipTo("}"); + escaped = !escaped && next == "\\" && !tripleString; + } + if (end || !tripleString) + state.tokenize = null; + return "string"; + } + } + + def("text/x-kotlin", { + name: "clike", + keywords: words( + /*keywords*/ + "package as typealias class interface this super val " + + "var fun for is in This throw return " + + "break continue object if else while do try when !in !is as? " + + + /*soft keywords*/ + "file import where by get set abstract enum open inner override private public internal " + + "protected catch finally out final vararg reified dynamic companion constructor init " + + "sealed field property receiver param sparam lateinit data inline noinline tailrec " + + "external annotation crossinline const operator infix suspend" + ), + types: words( + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + + "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" + ), + intendSwitch: false, + indentStatements: false, + multiLineStrings: true, + number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i, + blockKeywords: words("catch class do else finally for if where try while enum"), + defKeywords: words("class val var object interface fun"), + atoms: words("true false null this"), + hooks: { + '"': function(stream, state) { + state.tokenize = tokenKotlinString(stream.match('""')); + return state.tokenize(stream, state); + } + }, + modeProps: {closeBrackets: {triples: '"'}} + }); + + def(["x-shader/x-vertex", "x-shader/x-fragment"], { + name: "clike", + keywords: words("sampler1D sampler2D sampler3D samplerCube " + + "sampler1DShadow sampler2DShadow " + + "const attribute uniform varying " + + "break continue discard return " + + "for while do if else struct " + + "in out inout"), + types: words("float int bool void " + + "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " + + "mat2 mat3 mat4"), + blockKeywords: words("for while do if else struct"), + builtin: words("radians degrees sin cos tan asin acos atan " + + "pow exp log exp2 sqrt inversesqrt " + + "abs sign floor ceil fract mod min max clamp mix step smoothstep " + + "length distance dot cross normalize ftransform faceforward " + + "reflect refract matrixCompMult " + + "lessThan lessThanEqual greaterThan greaterThanEqual " + + "equal notEqual any all not " + + "texture1D texture1DProj texture1DLod texture1DProjLod " + + "texture2D texture2DProj texture2DLod texture2DProjLod " + + "texture3D texture3DProj texture3DLod texture3DProjLod " + + "textureCube textureCubeLod " + + "shadow1D shadow2D shadow1DProj shadow2DProj " + + "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " + + "dFdx dFdy fwidth " + + "noise1 noise2 noise3 noise4"), + atoms: words("true false " + + "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " + + "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " + + "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " + + "gl_FogCoord gl_PointCoord " + + "gl_Position gl_PointSize gl_ClipVertex " + + "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " + + "gl_TexCoord gl_FogFragCoord " + + "gl_FragCoord gl_FrontFacing " + + "gl_FragData gl_FragDepth " + + "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " + + "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " + + "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " + + "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " + + "gl_ProjectionMatrixInverseTranspose " + + "gl_ModelViewProjectionMatrixInverseTranspose " + + "gl_TextureMatrixInverseTranspose " + + "gl_NormalScale gl_DepthRange gl_ClipPlane " + + "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " + + "gl_FrontLightModelProduct gl_BackLightModelProduct " + + "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " + + "gl_FogParameters " + + "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " + + "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " + + "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " + + "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " + + "gl_MaxDrawBuffers"), + indentSwitch: false, + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} + }); + + def("text/x-nesc", { + name: "clike", + keywords: words(cKeywords + "as atomic async call command component components configuration event generic " + + "implementation includes interface module new norace nx_struct nx_union post provides " + + "signal task uses abstract extends"), + types: words(cTypes), + blockKeywords: words("case do else for if switch while struct"), + atoms: words("null true false"), + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} + }); + + def("text/x-objectivec", { + name: "clike", + keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " + + "inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"), + types: words(cTypes), + atoms: words("YES NO NULL NILL ON OFF true false"), + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$]/); + return "keyword"; + }, + "#": cppHook, + indent: function(_state, ctx, textAfter) { + if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented + } + }, + modeProps: {fold: "brace"} + }); + + def("text/x-squirrel", { + name: "clike", + keywords: words("base break clone continue const default delete enum extends function in class" + + " foreach local resume return this throw typeof yield constructor instanceof static"), + types: words(cTypes), + blockKeywords: words("case catch class else for foreach if switch try while"), + defKeywords: words("function local class"), + typeFirstDefinitions: true, + atoms: words("true false null"), + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} + }); + + // Ceylon Strings need to deal with interpolation + var stringTokenizer = null; + function tokenCeylonString(type) { + return function(stream, state) { + var escaped = false, next, end = false; + while (!stream.eol()) { + if (!escaped && stream.match('"') && + (type == "single" || stream.match('""'))) { + end = true; + break; + } + if (!escaped && stream.match('``')) { + stringTokenizer = tokenCeylonString(type); + end = true; + break; + } + next = stream.next(); + escaped = type == "single" && !escaped && next == "\\"; + } + if (end) + state.tokenize = null; + return "string"; + } + } + + def("text/x-ceylon", { + name: "clike", + keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" + + " exists extends finally for function given if import in interface is let module new" + + " nonempty object of out outer package return satisfies super switch then this throw" + + " try value void while"), + types: function(word) { + // In Ceylon all identifiers that start with an uppercase are types + var first = word.charAt(0); + return (first === first.toUpperCase() && first !== first.toLowerCase()); + }, + blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"), + defKeywords: words("class dynamic function interface module object package value"), + builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" + + " native optional sealed see serializable shared suppressWarnings tagged throws variable"), + isPunctuationChar: /[\[\]{}\(\),;\:\.`]/, + isOperatorChar: /[+\-*&%=<>!?|^~:\/]/, + numberStart: /[\d#$]/, + number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i, + multiLineStrings: true, + typeFirstDefinitions: true, + atoms: words("true false null larger smaller equal empty finished"), + indentSwitch: false, + styleDefs: false, + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + }, + '"': function(stream, state) { + state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single"); + return state.tokenize(stream, state); + }, + '`': function(stream, state) { + if (!stringTokenizer || !stream.match('`')) return false; + state.tokenize = stringTokenizer; + stringTokenizer = null; + return state.tokenize(stream, state); + }, + "'": function(stream) { + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + return "atom"; + }, + token: function(_stream, state, style) { + if ((style == "variable" || style == "type") && + state.prevToken == ".") { + return "variable-2"; + } + } + }, + modeProps: { + fold: ["brace", "import"], + closeBrackets: {triples: '"'} + } + }); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/oz/oz.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("oz", function (conf) { + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/; + var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/; + var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/; + + var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch", + "finally", "with", "require", "prepare", "import", "export", "define", "do"]; + var end = ["end"]; + + var atoms = wordRegexp(["true", "false", "nil", "unit"]); + var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex", + "mod", "div", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]); + var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis", + "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]); + var middleKeywords = wordRegexp(middle); + var endKeywords = wordRegexp(end); + + // Tokenizers + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + // Brackets + if(stream.match(/[{}]/)) { + return "bracket"; + } + + // Special [] keyword + if (stream.match(/(\[])/)) { + return "keyword" + } + + // Operators + if (stream.match(tripleOperators) || stream.match(doubleOperators)) { + return "operator"; + } + + // Atoms + if(stream.match(atoms)) { + return 'atom'; + } + + // Opening keywords + var matched = stream.match(openingKeywords); + if (matched) { + if (!state.doInCurrentLine) + state.currentIndent++; + else + state.doInCurrentLine = false; + + // Special matching for signatures + if(matched[0] == "proc" || matched[0] == "fun") + state.tokenize = tokenFunProc; + else if(matched[0] == "class") + state.tokenize = tokenClass; + else if(matched[0] == "meth") + state.tokenize = tokenMeth; + + return 'keyword'; + } + + // Middle and other keywords + if (stream.match(middleKeywords) || stream.match(commonKeywords)) { + return "keyword" + } + + // End keywords + if (stream.match(endKeywords)) { + state.currentIndent--; + return 'keyword'; + } + + // Eat the next char for next comparisons + var ch = stream.next(); + + // Strings + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + + // Numbers + if (/[~\d]/.test(ch)) { + if (ch == "~") { + if(! /^[0-9]/.test(stream.peek())) + return null; + else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) + return "number"; + } + + if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) + return "number"; + + return null; + } + + // Comments + if (ch == "%") { + stream.skipToEnd(); + return 'comment'; + } + else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + } + + // Single operators + if(singleOperators.test(ch)) { + return "operator"; + } + + // If nothing match, we skip the entire alphanumerical block + stream.eatWhile(/\w/); + + return "variable"; + } + + function tokenClass(stream, state) { + if (stream.eatSpace()) { + return null; + } + stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/); + state.tokenize = tokenBase; + return "variable-3" + } + + function tokenMeth(stream, state) { + if (stream.eatSpace()) { + return null; + } + stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/); + state.tokenize = tokenBase; + return "def" + } + + function tokenFunProc(stream, state) { + if (stream.eatSpace()) { + return null; + } + + if(!state.hasPassedFirstStage && stream.eat("{")) { + state.hasPassedFirstStage = true; + return "bracket"; + } + else if(state.hasPassedFirstStage) { + stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/); + state.hasPassedFirstStage = false; + state.tokenize = tokenBase; + return "def" + } + else { + state.tokenize = tokenBase; + return null; + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(quote) { + return function (stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end || !escaped) + state.tokenize = tokenBase; + return "string"; + }; + } + + function buildElectricInputRegEx() { + // Reindentation should occur on [] or on a match of any of + // the block closing keywords, at the end of a line. + var allClosings = middle.concat(end); + return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$"); + } + + return { + + startState: function () { + return { + tokenize: tokenBase, + currentIndent: 0, + doInCurrentLine: false, + hasPassedFirstStage: false + }; + }, + + token: function (stream, state) { + if (stream.sol()) + state.doInCurrentLine = 0; + + return state.tokenize(stream, state); + }, + + indent: function (state, textAfter) { + var trueText = textAfter.replace(/^\s+|\s+$/g, ''); + + if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/)) + return conf.indentUnit * (state.currentIndent - 1); + + if (state.currentIndent < 0) + return 0; + + return state.currentIndent * conf.indentUnit; + }, + fold: "indent", + electricInput: buildElectricInputRegEx(), + lineComment: "%", + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +CodeMirror.defineMIME("text/x-oz", "oz"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/modelica/modelica.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Modelica support for CodeMirror, copyright (c) by Lennart Ochel + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +}) + +(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("modelica", function(config, parserConfig) { + + var indentUnit = config.indentUnit; + var keywords = parserConfig.keywords || {}; + var builtin = parserConfig.builtin || {}; + var atoms = parserConfig.atoms || {}; + + var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/; + var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/; + var isDigit = /[0-9]/; + var isNonDigit = /[_a-zA-Z]/; + + function tokenLineComment(stream, state) { + stream.skipToEnd(); + state.tokenize = null; + return "comment"; + } + + function tokenBlockComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == '"' && !escaped) { + state.tokenize = null; + state.sol = false; + break; + } + escaped = !escaped && ch == "\\"; + } + + return "string"; + } + + function tokenIdent(stream, state) { + stream.eatWhile(isDigit); + while (stream.eat(isDigit) || stream.eat(isNonDigit)) { } + + + var cur = stream.current(); + + if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++; + else if(state.sol && cur == "end" && state.level > 0) state.level--; + + state.tokenize = null; + state.sol = false; + + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + else if (builtin.propertyIsEnumerable(cur)) return "builtin"; + else if (atoms.propertyIsEnumerable(cur)) return "atom"; + else return "variable"; + } + + function tokenQIdent(stream, state) { + while (stream.eat(/[^']/)) { } + + state.tokenize = null; + state.sol = false; + + if(stream.eat("'")) + return "variable"; + else + return "error"; + } + + function tokenUnsignedNuber(stream, state) { + stream.eatWhile(isDigit); + if (stream.eat('.')) { + stream.eatWhile(isDigit); + } + if (stream.eat('e') || stream.eat('E')) { + if (!stream.eat('-')) + stream.eat('+'); + stream.eatWhile(isDigit); + } + + state.tokenize = null; + state.sol = false; + return "number"; + } + + // Interface + return { + startState: function() { + return { + tokenize: null, + level: 0, + sol: true + }; + }, + + token: function(stream, state) { + if(state.tokenize != null) { + return state.tokenize(stream, state); + } + + if(stream.sol()) { + state.sol = true; + } + + // WHITESPACE + if(stream.eatSpace()) { + state.tokenize = null; + return null; + } + + var ch = stream.next(); + + // LINECOMMENT + if(ch == '/' && stream.eat('/')) { + state.tokenize = tokenLineComment; + } + // BLOCKCOMMENT + else if(ch == '/' && stream.eat('*')) { + state.tokenize = tokenBlockComment; + } + // TWO SYMBOL TOKENS + else if(isDoubleOperatorChar.test(ch+stream.peek())) { + stream.next(); + state.tokenize = null; + return "operator"; + } + // SINGLE SYMBOL TOKENS + else if(isSingleOperatorChar.test(ch)) { + state.tokenize = null; + return "operator"; + } + // IDENT + else if(isNonDigit.test(ch)) { + state.tokenize = tokenIdent; + } + // Q-IDENT + else if(ch == "'" && stream.peek() && stream.peek() != "'") { + state.tokenize = tokenQIdent; + } + // STRING + else if(ch == '"') { + state.tokenize = tokenString; + } + // UNSIGNED_NUBER + else if(isDigit.test(ch)) { + state.tokenize = tokenUnsignedNuber; + } + // ERROR + else { + state.tokenize = null; + return "error"; + } + + return state.tokenize(stream, state); + }, + + indent: function(state, textAfter) { + if (state.tokenize != null) return CodeMirror.Pass; + + var level = state.level; + if(/(algorithm)/.test(textAfter)) level--; + if(/(equation)/.test(textAfter)) level--; + if(/(initial algorithm)/.test(textAfter)) level--; + if(/(initial equation)/.test(textAfter)) level--; + if(/(end)/.test(textAfter)) level--; + + if(level > 0) + return indentUnit*level; + else + return 0; + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i=0; i<words.length; ++i) + obj[words[i]] = true; + return obj; + } + + var modelicaKeywords = "algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within"; + var modelicaBuiltin = "abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh"; + var modelicaAtoms = "Real Boolean Integer String"; + + function def(mimes, mode) { + if (typeof mimes == "string") + mimes = [mimes]; + + var words = []; + + function add(obj) { + if (obj) + for (var prop in obj) + if (obj.hasOwnProperty(prop)) + words.push(prop); + } + + add(mode.keywords); + add(mode.builtin); + add(mode.atoms); + + if (words.length) { + mode.helperType = mimes[0]; + CodeMirror.registerHelper("hintWords", mimes[0], words); + } + + for (var i=0; i<mimes.length; ++i) + CodeMirror.defineMIME(mimes[i], mode); + } + + def(["text/x-modelica"], { + name: "modelica", + keywords: words(modelicaKeywords), + builtin: words(modelicaBuiltin), + atoms: words(modelicaAtoms) + }); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/gherkin/gherkin.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* +Gherkin mode - http://www.cukes.info/ +Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues +*/ + +// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js +//var Quotes = { +// SINGLE: 1, +// DOUBLE: 2 +//}; + +//var regex = { +// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/ +//}; + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("gherkin", function () { + return { + startState: function () { + return { + lineNumber: 0, + tableHeaderLine: false, + allowFeature: true, + allowBackground: false, + allowScenario: false, + allowSteps: false, + allowPlaceholders: false, + allowMultilineArgument: false, + inMultilineString: false, + inMultilineTable: false, + inKeywordLine: false + }; + }, + token: function (stream, state) { + if (stream.sol()) { + state.lineNumber++; + state.inKeywordLine = false; + if (state.inMultilineTable) { + state.tableHeaderLine = false; + if (!stream.match(/\s*\|/, false)) { + state.allowMultilineArgument = false; + state.inMultilineTable = false; + } + } + } + + stream.eatSpace(); + + if (state.allowMultilineArgument) { + + // STRING + if (state.inMultilineString) { + if (stream.match('"""')) { + state.inMultilineString = false; + state.allowMultilineArgument = false; + } else { + stream.match(/.*/); + } + return "string"; + } + + // TABLE + if (state.inMultilineTable) { + if (stream.match(/\|\s*/)) { + return "bracket"; + } else { + stream.match(/[^\|]*/); + return state.tableHeaderLine ? "header" : "string"; + } + } + + // DETECT START + if (stream.match('"""')) { + // String + state.inMultilineString = true; + return "string"; + } else if (stream.match("|")) { + // Table + state.inMultilineTable = true; + state.tableHeaderLine = true; + return "bracket"; + } + + } + + // LINE COMMENT + if (stream.match(/#.*/)) { + return "comment"; + + // TAG + } else if (!state.inKeywordLine && stream.match(/@\S+/)) { + return "tag"; + + // FEATURE + } else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) { + state.allowScenario = true; + state.allowBackground = true; + state.allowPlaceholders = false; + state.allowSteps = false; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // BACKGROUND + } else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // SCENARIO OUTLINE + } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) { + state.allowPlaceholders = true; + state.allowSteps = true; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // EXAMPLES + } else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = true; + return "keyword"; + + // SCENARIO + } else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) { + state.allowPlaceholders = false; + state.allowSteps = true; + state.allowBackground = false; + state.allowMultilineArgument = false; + state.inKeywordLine = true; + return "keyword"; + + // STEPS + } else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) { + state.inStep = true; + state.allowPlaceholders = true; + state.allowMultilineArgument = true; + state.inKeywordLine = true; + return "keyword"; + + // INLINE STRING + } else if (stream.match(/"[^"]*"?/)) { + return "string"; + + // PLACEHOLDER + } else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) { + return "variable"; + + // Fall through + } else { + stream.next(); + stream.eatWhile(/[^@"<#]/); + return null; + } + } + }; +}); + +CodeMirror.defineMIME("text/x-feature", "gherkin"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/swift/swift.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Swift mode created by Michael Kaminsky https://github.com/mkaminsky11 + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") + mod(require("../../lib/codemirror")) + else if (typeof define == "function" && define.amd) + define(["../../lib/codemirror"], mod) + else + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + + function wordSet(words) { + var set = {} + for (var i = 0; i < words.length; i++) set[words[i]] = true + return set + } + + var keywords = wordSet(["_","var","let","class","enum","extension","import","protocol","struct","func","typealias","associatedtype", + "open","public","internal","fileprivate","private","deinit","init","new","override","self","subscript","super", + "convenience","dynamic","final","indirect","lazy","required","static","unowned","unowned(safe)","unowned(unsafe)","weak","as","is", + "break","case","continue","default","else","fallthrough","for","guard","if","in","repeat","switch","where","while", + "defer","return","inout","mutating","nonmutating","catch","do","rethrows","throw","throws","try","didSet","get","set","willSet", + "assignment","associativity","infix","left","none","operator","postfix","precedence","precedencegroup","prefix","right", + "Any","AnyObject","Type","dynamicType","Self","Protocol","__COLUMN__","__FILE__","__FUNCTION__","__LINE__"]) + var definingKeywords = wordSet(["var","let","class","enum","extension","import","protocol","struct","func","typealias","associatedtype","for"]) + var atoms = wordSet(["true","false","nil","self","super","_"]) + var types = wordSet(["Array","Bool","Character","Dictionary","Double","Float","Int","Int8","Int16","Int32","Int64","Never","Optional","Set","String", + "UInt8","UInt16","UInt32","UInt64","Void"]) + var operators = "+-/*%=|&<>~^?!" + var punc = ":;,.(){}[]" + var binary = /^\-?0b[01][01_]*/ + var octal = /^\-?0o[0-7][0-7_]*/ + var hexadecimal = /^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/ + var decimal = /^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/ + var identifier = /^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/ + var property = /^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/ + var instruction = /^\#[A-Za-z]+/ + var attribute = /^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/ + //var regexp = /^\/(?!\s)(?:\/\/)?(?:\\.|[^\/])+\// + + function tokenBase(stream, state, prev) { + if (stream.sol()) state.indented = stream.indentation() + if (stream.eatSpace()) return null + + var ch = stream.peek() + if (ch == "/") { + if (stream.match("//")) { + stream.skipToEnd() + return "comment" + } + if (stream.match("/*")) { + state.tokenize.push(tokenComment) + return tokenComment(stream, state) + } + } + if (stream.match(instruction)) return "builtin" + if (stream.match(attribute)) return "attribute" + if (stream.match(binary)) return "number" + if (stream.match(octal)) return "number" + if (stream.match(hexadecimal)) return "number" + if (stream.match(decimal)) return "number" + if (stream.match(property)) return "property" + if (operators.indexOf(ch) > -1) { + stream.next() + return "operator" + } + if (punc.indexOf(ch) > -1) { + stream.next() + stream.match("..") + return "punctuation" + } + if (ch == '"' || ch == "'") { + stream.next() + var tokenize = tokenString(ch) + state.tokenize.push(tokenize) + return tokenize(stream, state) + } + + if (stream.match(identifier)) { + var ident = stream.current() + if (types.hasOwnProperty(ident)) return "variable-2" + if (atoms.hasOwnProperty(ident)) return "atom" + if (keywords.hasOwnProperty(ident)) { + if (definingKeywords.hasOwnProperty(ident)) + state.prev = "define" + return "keyword" + } + if (prev == "define") return "def" + return "variable" + } + + stream.next() + return null + } + + function tokenUntilClosingParen() { + var depth = 0 + return function(stream, state, prev) { + var inner = tokenBase(stream, state, prev) + if (inner == "punctuation") { + if (stream.current() == "(") ++depth + else if (stream.current() == ")") { + if (depth == 0) { + stream.backUp(1) + state.tokenize.pop() + return state.tokenize[state.tokenize.length - 1](stream, state) + } + else --depth + } + } + return inner + } + } + + function tokenString(quote) { + return function(stream, state) { + var ch, escaped = false + while (ch = stream.next()) { + if (escaped) { + if (ch == "(") { + state.tokenize.push(tokenUntilClosingParen()) + return "string" + } + escaped = false + } else if (ch == quote) { + break + } else { + escaped = ch == "\\" + } + } + state.tokenize.pop() + return "string" + } + } + + function tokenComment(stream, state) { + stream.match(/^(?:[^*]|\*(?!\/))*/) + if (stream.match("*/")) state.tokenize.pop() + return "comment" + } + + function Context(prev, align, indented) { + this.prev = prev + this.align = align + this.indented = indented + } + + function pushContext(state, stream) { + var align = stream.match(/^\s*($|\/[\/\*])/, false) ? null : stream.column() + 1 + state.context = new Context(state.context, align, state.indented) + } + + function popContext(state) { + if (state.context) { + state.indented = state.context.indented + state.context = state.context.prev + } + } + + CodeMirror.defineMode("swift", function(config) { + return { + startState: function() { + return { + prev: null, + context: null, + indented: 0, + tokenize: [] + } + }, + + token: function(stream, state) { + var prev = state.prev + state.prev = null + var tokenize = state.tokenize[state.tokenize.length - 1] || tokenBase + var style = tokenize(stream, state, prev) + if (!style || style == "comment") state.prev = prev + else if (!state.prev) state.prev = style + + if (style == "punctuation") { + var bracket = /[\(\[\{]|([\]\)\}])/.exec(stream.current()) + if (bracket) (bracket[1] ? popContext : pushContext)(state, stream) + } + + return style + }, + + indent: function(state, textAfter) { + var cx = state.context + if (!cx) return 0 + var closing = /^[\]\}\)]/.test(textAfter) + if (cx.align != null) return cx.align - (closing ? 1 : 0) + return cx.indented + (closing ? 0 : config.indentUnit) + }, + + electricInput: /^\s*[\)\}\]]$/, + + lineComment: "//", + blockCommentStart: "/*", + blockCommentEnd: "*/", + fold: "brace", + closeBrackets: "()[]{}''\"\"``" + } + }) + + CodeMirror.defineMIME("text/x-swift","swift") +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/scheme/scheme.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Author: Koh Zi Han, based on implementation by Koh Zi Chun + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("scheme", function () { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket"; + var INDENT_WORD_SKIP = 2; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); + var indentKeys = makeKeywords("define let letrec let* lambda"); + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i); + var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i); + var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i); + var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i); + + function isBinaryNumber (stream) { + return stream.match(binaryMatcher); + } + + function isOctalNumber (stream) { + return stream.match(octalMatcher); + } + + function isDecimalNumber (stream, backup) { + if (backup === true) { + stream.backUp(1); + } + return stream.match(decimalMatcher); + } + + function isHexNumber (stream) { + return stream.match(hexMatcher); + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false, + sExprComment: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in scheme-string mode + break; + case "comment": // comment parsing mode + var next, maybeEnd = false; + while ((next = stream.next()) != null) { + if (next == "#" && maybeEnd) { + + state.mode = false; + break; + } + maybeEnd = (next == "|"); + } + returnType = COMMENT; + break; + case "s-expr-comment": // s-expr commenting mode + state.mode = false; + if(stream.peek() == "(" || stream.peek() == "["){ + // actually start scheme s-expr commenting mode + state.sExprComment = 0; + }else{ + // if not we just comment the entire of the next token + stream.eatWhile(/[^/s]/); // eat non spaces + returnType = COMMENT; + break; + } + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + + } else if (ch == "'") { + returnType = ATOM; + } else if (ch == '#') { + if (stream.eat("|")) { // Multi-line comment + state.mode = "comment"; // toggle to comment mode + returnType = COMMENT; + } else if (stream.eat(/[tf]/i)) { // #t/#f (atom) + returnType = ATOM; + } else if (stream.eat(';')) { // S-Expr comment + state.mode = "s-expr-comment"; + returnType = COMMENT; + } else { + var numTest = null, hasExactness = false, hasRadix = true; + if (stream.eat(/[ei]/i)) { + hasExactness = true; + } else { + stream.backUp(1); // must be radix specifier + } + if (stream.match(/^#b/i)) { + numTest = isBinaryNumber; + } else if (stream.match(/^#o/i)) { + numTest = isOctalNumber; + } else if (stream.match(/^#x/i)) { + numTest = isHexNumber; + } else if (stream.match(/^#d/i)) { + numTest = isDecimalNumber; + } else if (stream.match(/^[-+0-9.]/, false)) { + hasRadix = false; + numTest = isDecimalNumber; + // re-consume the intial # if all matches failed + } else if (!hasExactness) { + stream.eat('#'); + } + if (numTest != null) { + if (hasRadix && !hasExactness) { + // consume optional exactness after radix + stream.match(/^#[ei]/i); + } + if (numTest(stream)) + returnType = NUMBER; + } + } + } else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal + returnType = NUMBER; + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (ch == "(" || ch == "[") { + var keyWord = ''; var indentTemp = stream.column(), letter; + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word + + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation 1 space after + pushStack(state, indentTemp + 1, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + if(typeof state.sExprComment == "number") state.sExprComment++; + + returnType = BRACKET; + } else if (ch == ")" || ch == "]") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { + popStack(state); + + if(typeof state.sExprComment == "number"){ + if(--state.sExprComment == 0){ + returnType = COMMENT; // final closing bracket + state.sExprComment = false; // turn off s-expr commenting mode + } + } + } + } else { + stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + } else returnType = "variable"; + } + } + return (typeof state.sExprComment == "number") ? COMMENT : returnType; + }, + + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + }, + + closeBrackets: {pairs: "()[]{}\"\""}, + lineComment: ";;" + }; +}); + +CodeMirror.defineMIME("text/x-scheme", "scheme"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/idl/idl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function wordRegexp(words) { + return new RegExp('^((' + words.join(')|(') + '))\\b', 'i'); + }; + + var builtinArray = [ + 'a_correlate', 'abs', 'acos', 'adapt_hist_equal', 'alog', + 'alog2', 'alog10', 'amoeba', 'annotate', 'app_user_dir', + 'app_user_dir_query', 'arg_present', 'array_equal', 'array_indices', + 'arrow', 'ascii_template', 'asin', 'assoc', 'atan', + 'axis', 'axis', 'bandpass_filter', 'bandreject_filter', 'barplot', + 'bar_plot', 'beseli', 'beselj', 'beselk', 'besely', + 'beta', 'biginteger', 'bilinear', 'bin_date', 'binary_template', + 'bindgen', 'binomial', 'bit_ffs', 'bit_population', 'blas_axpy', + 'blk_con', 'boolarr', 'boolean', 'boxplot', 'box_cursor', + 'breakpoint', 'broyden', 'bubbleplot', 'butterworth', 'bytarr', + 'byte', 'byteorder', 'bytscl', 'c_correlate', 'calendar', + 'caldat', 'call_external', 'call_function', 'call_method', + 'call_procedure', 'canny', 'catch', 'cd', 'cdf', 'ceil', + 'chebyshev', 'check_math', 'chisqr_cvf', 'chisqr_pdf', 'choldc', + 'cholsol', 'cindgen', 'cir_3pnt', 'clipboard', 'close', + 'clust_wts', 'cluster', 'cluster_tree', 'cmyk_convert', 'code_coverage', + 'color_convert', 'color_exchange', 'color_quan', 'color_range_map', + 'colorbar', 'colorize_sample', 'colormap_applicable', + 'colormap_gradient', 'colormap_rotation', 'colortable', + 'comfit', 'command_line_args', 'common', 'compile_opt', 'complex', + 'complexarr', 'complexround', 'compute_mesh_normals', 'cond', 'congrid', + 'conj', 'constrained_min', 'contour', 'contour', 'convert_coord', + 'convol', 'convol_fft', 'coord2to3', 'copy_lun', 'correlate', + 'cos', 'cosh', 'cpu', 'cramer', 'createboxplotdata', + 'create_cursor', 'create_struct', 'create_view', 'crossp', 'crvlength', + 'ct_luminance', 'cti_test', 'cursor', 'curvefit', 'cv_coord', + 'cvttobm', 'cw_animate', 'cw_animate_getp', 'cw_animate_load', + 'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index', + 'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel', 'cw_form', + 'cw_fslider', 'cw_light_editor', 'cw_light_editor_get', + 'cw_light_editor_set', 'cw_orient', 'cw_palette_editor', + 'cw_palette_editor_get', 'cw_palette_editor_set', 'cw_pdmenu', + 'cw_rgbslider', 'cw_tmpl', 'cw_zoom', 'db_exists', + 'dblarr', 'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key', + 'define_msgblk', 'define_msgblk_from_file', 'defroi', 'defsysv', + 'delvar', 'dendro_plot', 'dendrogram', 'deriv', 'derivsig', + 'determ', 'device', 'dfpmin', 'diag_matrix', 'dialog_dbconnect', + 'dialog_message', 'dialog_pickfile', 'dialog_printersetup', + 'dialog_printjob', 'dialog_read_image', + 'dialog_write_image', 'dictionary', 'digital_filter', 'dilate', 'dindgen', + 'dissolve', 'dist', 'distance_measure', 'dlm_load', 'dlm_register', + 'doc_library', 'double', 'draw_roi', 'edge_dog', 'efont', + 'eigenql', 'eigenvec', 'ellipse', 'elmhes', 'emboss', + 'empty', 'enable_sysrtn', 'eof', 'eos', 'erase', + 'erf', 'erfc', 'erfcx', 'erode', 'errorplot', + 'errplot', 'estimator_filter', 'execute', 'exit', 'exp', + 'expand', 'expand_path', 'expint', 'extrac', 'extract_slice', + 'f_cvf', 'f_pdf', 'factorial', 'fft', 'file_basename', + 'file_chmod', 'file_copy', 'file_delete', 'file_dirname', + 'file_expand_path', 'file_gunzip', 'file_gzip', 'file_info', + 'file_lines', 'file_link', 'file_mkdir', 'file_move', + 'file_poll_input', 'file_readlink', 'file_same', + 'file_search', 'file_tar', 'file_test', 'file_untar', 'file_unzip', + 'file_which', 'file_zip', 'filepath', 'findgen', 'finite', + 'fix', 'flick', 'float', 'floor', 'flow3', + 'fltarr', 'flush', 'format_axis_values', 'forward_function', 'free_lun', + 'fstat', 'fulstr', 'funct', 'function', 'fv_test', + 'fx_root', 'fz_roots', 'gamma', 'gamma_ct', 'gauss_cvf', + 'gauss_pdf', 'gauss_smooth', 'gauss2dfit', 'gaussfit', + 'gaussian_function', 'gaussint', 'get_drive_list', 'get_dxf_objects', + 'get_kbrd', 'get_login_info', + 'get_lun', 'get_screen_size', 'getenv', 'getwindows', 'greg2jul', + 'grib', 'grid_input', 'grid_tps', 'grid3', 'griddata', + 'gs_iter', 'h_eq_ct', 'h_eq_int', 'hanning', 'hash', + 'hdf', 'hdf5', 'heap_free', 'heap_gc', 'heap_nosave', + 'heap_refcount', 'heap_save', 'help', 'hilbert', 'hist_2d', + 'hist_equal', 'histogram', 'hls', 'hough', 'hqr', + 'hsv', 'i18n_multibytetoutf8', + 'i18n_multibytetowidechar', 'i18n_utf8tomultibyte', + 'i18n_widechartomultibyte', + 'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity', + 'idl_base64', 'idl_container', 'idl_validname', + 'idlexbr_assistant', 'idlitsys_createtool', + 'idlunit', 'iellipse', 'igamma', 'igetcurrent', 'igetdata', + 'igetid', 'igetproperty', 'iimage', 'image', 'image_cont', + 'image_statistics', 'image_threshold', 'imaginary', 'imap', 'indgen', + 'int_2d', 'int_3d', 'int_tabulated', 'intarr', 'interpol', + 'interpolate', 'interval_volume', 'invert', 'ioctl', 'iopen', + 'ir_filter', 'iplot', 'ipolygon', 'ipolyline', 'iputdata', + 'iregister', 'ireset', 'iresolve', 'irotate', 'isa', + 'isave', 'iscale', 'isetcurrent', 'isetproperty', 'ishft', + 'isocontour', 'isosurface', 'isurface', 'itext', 'itranslate', + 'ivector', 'ivolume', 'izoom', 'journal', 'json_parse', + 'json_serialize', 'jul2greg', 'julday', 'keyword_set', 'krig2d', + 'kurtosis', 'kw_test', 'l64indgen', 'la_choldc', 'la_cholmprove', + 'la_cholsol', 'la_determ', 'la_eigenproblem', 'la_eigenql', 'la_eigenvec', + 'la_elmhes', 'la_gm_linear_model', 'la_hqr', 'la_invert', + 'la_least_square_equality', 'la_least_squares', 'la_linear_equation', + 'la_ludc', 'la_lumprove', 'la_lusol', + 'la_svd', 'la_tridc', 'la_trimprove', 'la_triql', 'la_trired', + 'la_trisol', 'label_date', 'label_region', 'ladfit', 'laguerre', + 'lambda', 'lambdap', 'lambertw', 'laplacian', 'least_squares_filter', + 'leefilt', 'legend', 'legendre', 'linbcg', 'lindgen', + 'linfit', 'linkimage', 'list', 'll_arc_distance', 'lmfit', + 'lmgr', 'lngamma', 'lnp_test', 'loadct', 'locale_get', + 'logical_and', 'logical_or', 'logical_true', 'lon64arr', 'lonarr', + 'long', 'long64', 'lsode', 'lu_complex', 'ludc', + 'lumprove', 'lusol', 'm_correlate', 'machar', 'make_array', + 'make_dll', 'make_rt', 'map', 'mapcontinents', 'mapgrid', + 'map_2points', 'map_continents', 'map_grid', 'map_image', 'map_patch', + 'map_proj_forward', 'map_proj_image', 'map_proj_info', + 'map_proj_init', 'map_proj_inverse', + 'map_set', 'matrix_multiply', 'matrix_power', 'max', 'md_test', + 'mean', 'meanabsdev', 'mean_filter', 'median', 'memory', + 'mesh_clip', 'mesh_decimate', 'mesh_issolid', + 'mesh_merge', 'mesh_numtriangles', + 'mesh_obj', 'mesh_smooth', 'mesh_surfacearea', + 'mesh_validate', 'mesh_volume', + 'message', 'min', 'min_curve_surf', 'mk_html_help', 'modifyct', + 'moment', 'morph_close', 'morph_distance', + 'morph_gradient', 'morph_hitormiss', + 'morph_open', 'morph_thin', 'morph_tophat', 'multi', 'n_elements', + 'n_params', 'n_tags', 'ncdf', 'newton', 'noise_hurl', + 'noise_pick', 'noise_scatter', 'noise_slur', 'norm', 'obj_class', + 'obj_destroy', 'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid', + 'objarr', 'on_error', 'on_ioerror', 'online_help', 'openr', + 'openu', 'openw', 'oplot', 'oploterr', 'orderedhash', + 'p_correlate', 'parse_url', 'particle_trace', 'path_cache', 'path_sep', + 'pcomp', 'plot', 'plot3d', 'plot', 'plot_3dbox', + 'plot_field', 'ploterr', 'plots', 'polar_contour', 'polar_surface', + 'polyfill', 'polyshade', 'pnt_line', 'point_lun', 'polarplot', + 'poly', 'poly_2d', 'poly_area', 'poly_fit', 'polyfillv', + 'polygon', 'polyline', 'polywarp', 'popd', 'powell', + 'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes', + 'print', 'printf', 'printd', 'pro', 'product', + 'profile', 'profiler', 'profiles', 'project_vol', 'ps_show_fonts', + 'psafm', 'pseudo', 'ptr_free', 'ptr_new', 'ptr_valid', + 'ptrarr', 'pushd', 'qgrid3', 'qhull', 'qromb', + 'qromo', 'qsimp', 'query_*', 'query_ascii', 'query_bmp', + 'query_csv', 'query_dicom', 'query_gif', 'query_image', 'query_jpeg', + 'query_jpeg2000', 'query_mrsid', 'query_pict', 'query_png', 'query_ppm', + 'query_srf', 'query_tiff', 'query_video', 'query_wav', 'r_correlate', + 'r_test', 'radon', 'randomn', 'randomu', 'ranks', + 'rdpix', 'read', 'readf', 'read_ascii', 'read_binary', + 'read_bmp', 'read_csv', 'read_dicom', 'read_gif', 'read_image', + 'read_interfile', 'read_jpeg', 'read_jpeg2000', 'read_mrsid', 'read_pict', + 'read_png', 'read_ppm', 'read_spr', 'read_srf', 'read_sylk', + 'read_tiff', 'read_video', 'read_wav', 'read_wave', 'read_x11_bitmap', + 'read_xwd', 'reads', 'readu', 'real_part', 'rebin', + 'recall_commands', 'recon3', 'reduce_colors', 'reform', 'region_grow', + 'register_cursor', 'regress', 'replicate', + 'replicate_inplace', 'resolve_all', + 'resolve_routine', 'restore', 'retall', 'return', 'reverse', + 'rk4', 'roberts', 'rot', 'rotate', 'round', + 'routine_filepath', 'routine_info', 'rs_test', 's_test', 'save', + 'savgol', 'scale3', 'scale3d', 'scatterplot', 'scatterplot3d', + 'scope_level', 'scope_traceback', 'scope_varfetch', + 'scope_varname', 'search2d', + 'search3d', 'sem_create', 'sem_delete', 'sem_lock', 'sem_release', + 'set_plot', 'set_shading', 'setenv', 'sfit', 'shade_surf', + 'shade_surf_irr', 'shade_volume', 'shift', 'shift_diff', 'shmdebug', + 'shmmap', 'shmunmap', 'shmvar', 'show3', 'showfont', + 'signum', 'simplex', 'sin', 'sindgen', 'sinh', + 'size', 'skewness', 'skip_lun', 'slicer3', 'slide_image', + 'smooth', 'sobel', 'socket', 'sort', 'spawn', + 'sph_4pnt', 'sph_scat', 'spher_harm', 'spl_init', 'spl_interp', + 'spline', 'spline_p', 'sprsab', 'sprsax', 'sprsin', + 'sprstp', 'sqrt', 'standardize', 'stddev', 'stop', + 'strarr', 'strcmp', 'strcompress', 'streamline', 'streamline', + 'stregex', 'stretch', 'string', 'strjoin', 'strlen', + 'strlowcase', 'strmatch', 'strmessage', 'strmid', 'strpos', + 'strput', 'strsplit', 'strtrim', 'struct_assign', 'struct_hide', + 'strupcase', 'surface', 'surface', 'surfr', 'svdc', + 'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace', 'symbol', + 'systime', 't_cvf', 't_pdf', 't3d', 'tag_names', + 'tan', 'tanh', 'tek_color', 'temporary', 'terminal_size', + 'tetra_clip', 'tetra_surface', 'tetra_volume', 'text', 'thin', + 'thread', 'threed', 'tic', 'time_test2', 'timegen', + 'timer', 'timestamp', 'timestamptovalues', 'tm_test', 'toc', + 'total', 'trace', 'transpose', 'tri_surf', 'triangulate', + 'trigrid', 'triql', 'trired', 'trisol', 'truncate_lun', + 'ts_coef', 'ts_diff', 'ts_fcast', 'ts_smooth', 'tv', + 'tvcrs', 'tvlct', 'tvrd', 'tvscl', 'typename', + 'uindgen', 'uint', 'uintarr', 'ul64indgen', 'ulindgen', + 'ulon64arr', 'ulonarr', 'ulong', 'ulong64', 'uniq', + 'unsharp_mask', 'usersym', 'value_locate', 'variance', 'vector', + 'vector_field', 'vel', 'velovect', 'vert_t3d', 'voigt', + 'volume', 'voronoi', 'voxel_proj', 'wait', 'warp_tri', + 'watershed', 'wdelete', 'wf_draw', 'where', 'widget_base', + 'widget_button', 'widget_combobox', 'widget_control', + 'widget_displaycontextmenu', 'widget_draw', + 'widget_droplist', 'widget_event', 'widget_info', + 'widget_label', 'widget_list', + 'widget_propertysheet', 'widget_slider', 'widget_tab', + 'widget_table', 'widget_text', + 'widget_tree', 'widget_tree_move', 'widget_window', + 'wiener_filter', 'window', + 'window', 'write_bmp', 'write_csv', 'write_gif', 'write_image', + 'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict', 'write_png', + 'write_ppm', 'write_spr', 'write_srf', 'write_sylk', 'write_tiff', + 'write_video', 'write_wav', 'write_wave', 'writeu', 'wset', + 'wshow', 'wtn', 'wv_applet', 'wv_cwt', 'wv_cw_wavelet', + 'wv_denoise', 'wv_dwt', 'wv_fn_coiflet', + 'wv_fn_daubechies', 'wv_fn_gaussian', + 'wv_fn_haar', 'wv_fn_morlet', 'wv_fn_paul', + 'wv_fn_symlet', 'wv_import_data', + 'wv_import_wavelet', 'wv_plot3d_wps', 'wv_plot_multires', + 'wv_pwt', 'wv_tool_denoise', + 'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont', 'xinteranimate', + 'xloadct', 'xmanager', 'xmng_tmpl', 'xmtool', 'xobjview', + 'xobjview_rotate', 'xobjview_write_image', + 'xpalette', 'xpcolor', 'xplot3d', + 'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit', + 'xvolume', 'xvolume_rotate', 'xvolume_write_image', + 'xyouts', 'zlib_compress', 'zlib_uncompress', 'zoom', 'zoom_24' + ]; + var builtins = wordRegexp(builtinArray); + + var keywordArray = [ + 'begin', 'end', 'endcase', 'endfor', + 'endwhile', 'endif', 'endrep', 'endforeach', + 'break', 'case', 'continue', 'for', + 'foreach', 'goto', 'if', 'then', 'else', + 'repeat', 'until', 'switch', 'while', + 'do', 'pro', 'function' + ]; + var keywords = wordRegexp(keywordArray); + + CodeMirror.registerHelper("hintWords", "idl", builtinArray.concat(keywordArray)); + + var identifiers = new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*', 'i'); + + var singleOperators = /[+\-*&=<>\/@#~$]/; + var boolOperators = new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)', 'i'); + + function tokenBase(stream) { + // whitespaces + if (stream.eatSpace()) return null; + + // Handle one line Comments + if (stream.match(';')) { + stream.skipToEnd(); + return 'comment'; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.+-]/, false)) { + if (stream.match(/^[+-]?0x[0-9a-fA-F]+/)) + return 'number'; + if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)) + return 'number'; + if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/)) + return 'number'; + } + + // Handle Strings + if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } + if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } + + // Handle words + if (stream.match(keywords)) { return 'keyword'; } + if (stream.match(builtins)) { return 'builtin'; } + if (stream.match(identifiers)) { return 'variable'; } + + if (stream.match(singleOperators) || stream.match(boolOperators)) { + return 'operator'; } + + // Handle non-detected items + stream.next(); + return null; + }; + + CodeMirror.defineMode('idl', function() { + return { + token: function(stream) { + return tokenBase(stream); + } + }; + }); + + CodeMirror.defineMIME('text/x-idl', 'idl'); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/yaml/yaml.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("yaml", function() { + + var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; + var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); + + return { + token: function(stream, state) { + var ch = stream.peek(); + var esc = state.escaped; + state.escaped = false; + /* comments */ + if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) { + stream.skipToEnd(); + return "comment"; + } + + if (stream.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/)) + return "string"; + + if (state.literal && stream.indentation() > state.keyCol) { + stream.skipToEnd(); return "string"; + } else if (state.literal) { state.literal = false; } + if (stream.sol()) { + state.keyCol = 0; + state.pair = false; + state.pairStart = false; + /* document start */ + if(stream.match(/---/)) { return "def"; } + /* document end */ + if (stream.match(/\.\.\./)) { return "def"; } + /* array list item */ + if (stream.match(/\s*-\s+/)) { return 'meta'; } + } + /* inline pairs/lists */ + if (stream.match(/^(\{|\}|\[|\])/)) { + if (ch == '{') + state.inlinePairs++; + else if (ch == '}') + state.inlinePairs--; + else if (ch == '[') + state.inlineList++; + else + state.inlineList--; + return 'meta'; + } + + /* list seperator */ + if (state.inlineList > 0 && !esc && ch == ',') { + stream.next(); + return 'meta'; + } + /* pairs seperator */ + if (state.inlinePairs > 0 && !esc && ch == ',') { + state.keyCol = 0; + state.pair = false; + state.pairStart = false; + stream.next(); + return 'meta'; + } + + /* start of value of a pair */ + if (state.pairStart) { + /* block literals */ + if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; + /* references */ + if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } + /* numbers */ + if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } + if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } + /* keywords */ + if (stream.match(keywordRegex)) { return 'keyword'; } + } + + /* pairs (associative arrays) -> key */ + if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) { + state.pair = true; + state.keyCol = stream.indentation(); + return "atom"; + } + if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } + + /* nothing found, continue */ + state.pairStart = false; + state.escaped = (ch == '\\'); + stream.next(); + return null; + }, + startState: function() { + return { + pair: false, + pairStart: false, + keyCol: 0, + inlinePairs: 0, + inlineList: 0, + literal: false, + escaped: false + }; + } + }; +}); + +CodeMirror.defineMIME("text/x-yaml", "yaml"); +CodeMirror.defineMIME("text/yaml", "yaml"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/vue/vue.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + "use strict"; + if (typeof exports === "object" && typeof module === "object") {// CommonJS + mod(require("../../lib/codemirror"), + require("../../addon/mode/overlay"), + require("../xml/xml"), + require("../javascript/javascript"), + require("../coffeescript/coffeescript"), + require("../css/css"), + require("../sass/sass"), + require("../stylus/stylus"), + require("../pug/pug"), + require("../handlebars/handlebars")); + } else if (typeof define === "function" && define.amd) { // AMD + define(["../../lib/codemirror", + "../../addon/mode/overlay", + "../xml/xml", + "../javascript/javascript", + "../coffeescript/coffeescript", + "../css/css", + "../sass/sass", + "../stylus/stylus", + "../pug/pug", + "../handlebars/handlebars"], mod); + } else { // Plain browser env + mod(CodeMirror); + } +})(function (CodeMirror) { + var tagLanguages = { + script: [ + ["lang", /coffee(script)?/, "coffeescript"], + ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"], + ["lang", /^babel$/, "javascript"], + ["type", /^text\/babel$/, "javascript"], + ["type", /^text\/ecmascript-\d+$/, "javascript"] + ], + style: [ + ["lang", /^stylus$/i, "stylus"], + ["lang", /^sass$/i, "sass"], + ["lang", /^less$/i, "text/x-less"], + ["lang", /^scss$/i, "text/x-scss"], + ["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"], + ["type", /^text\/sass/i, "sass"], + ["type", /^(text\/)?(x-)?scss$/i, "text/x-scss"], + ["type", /^(text\/)?(x-)?less$/i, "text/x-less"] + ], + template: [ + ["lang", /^vue-template$/i, "vue"], + ["lang", /^pug$/i, "pug"], + ["lang", /^handlebars$/i, "handlebars"], + ["type", /^(text\/)?(x-)?pug$/i, "pug"], + ["type", /^text\/x-handlebars-template$/i, "handlebars"], + [null, null, "vue-template"] + ] + }; + + CodeMirror.defineMode("vue-template", function (config, parserConfig) { + var mustacheOverlay = { + token: function (stream) { + if (stream.match(/^\{\{.*?\}\}/)) return "meta mustache"; + while (stream.next() && !stream.match("{{", false)) {} + return null; + } + }; + return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay); + }); + + CodeMirror.defineMode("vue", function (config) { + return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages}); + }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "pug", "handlebars"); + + CodeMirror.defineMIME("script/x-vue", "vue"); + CodeMirror.defineMIME("text/x-vue", "vue"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/twig/twig.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../../addon/mode/multiplex")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../../addon/mode/multiplex"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("twig:inner", function() { + var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"], + operator = /^[+\-*&%=<>!?|~^]/, + sign = /^[:\[\(\{]/, + atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"], + number = /^(\d[+\-\*\/])?\d+(\.\d+)?/; + + keywords = new RegExp("((" + keywords.join(")|(") + "))\\b"); + atom = new RegExp("((" + atom.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + var ch = stream.peek(); + + //Comment + if (state.incomment) { + if (!stream.skipTo("#}")) { + stream.skipToEnd(); + } else { + stream.eatWhile(/\#|}/); + state.incomment = false; + } + return "comment"; + //Tag + } else if (state.intag) { + //After operator + if (state.operator) { + state.operator = false; + if (stream.match(atom)) { + return "atom"; + } + if (stream.match(number)) { + return "number"; + } + } + //After sign + if (state.sign) { + state.sign = false; + if (stream.match(atom)) { + return "atom"; + } + if (stream.match(number)) { + return "number"; + } + } + + if (state.instring) { + if (ch == state.instring) { + state.instring = false; + } + stream.next(); + return "string"; + } else if (ch == "'" || ch == '"') { + state.instring = ch; + stream.next(); + return "string"; + } else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) { + state.intag = false; + return "tag"; + } else if (stream.match(operator)) { + state.operator = true; + return "operator"; + } else if (stream.match(sign)) { + state.sign = true; + } else { + if (stream.eat(" ") || stream.sol()) { + if (stream.match(keywords)) { + return "keyword"; + } + if (stream.match(atom)) { + return "atom"; + } + if (stream.match(number)) { + return "number"; + } + if (stream.sol()) { + stream.next(); + } + } else { + stream.next(); + } + + } + return "variable"; + } else if (stream.eat("{")) { + if (stream.eat("#")) { + state.incomment = true; + if (!stream.skipTo("#}")) { + stream.skipToEnd(); + } else { + stream.eatWhile(/\#|}/); + state.incomment = false; + } + return "comment"; + //Open tag + } else if (ch = stream.eat(/\{|%/)) { + //Cache close tag + state.intag = ch; + if (ch == "{") { + state.intag = "}"; + } + stream.eat("-"); + return "tag"; + } + } + stream.next(); + }; + + return { + startState: function () { + return {}; + }, + token: function (stream, state) { + return tokenBase(stream, state); + } + }; + }); + + CodeMirror.defineMode("twig", function(config, parserConfig) { + var twigInner = CodeMirror.getMode(config, "twig:inner"); + if (!parserConfig || !parserConfig.base) return twigInner; + return CodeMirror.multiplexingMode( + CodeMirror.getMode(config, parserConfig.base), { + open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true + } + ); + }); + CodeMirror.defineMIME("text/x-twig", "twig"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/cmake/cmake.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) + define(["../../lib/codemirror"], mod); + else + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("cmake", function () { + var variable_regex = /({)?[a-zA-Z0-9_]+(})?/; + + function tokenString(stream, state) { + var current, prev, found_var = false; + while (!stream.eol() && (current = stream.next()) != state.pending) { + if (current === '$' && prev != '\\' && state.pending == '"') { + found_var = true; + break; + } + prev = current; + } + if (found_var) { + stream.backUp(1); + } + if (current == state.pending) { + state.continueString = false; + } else { + state.continueString = true; + } + return "string"; + } + + function tokenize(stream, state) { + var ch = stream.next(); + + // Have we found a variable? + if (ch === '$') { + if (stream.match(variable_regex)) { + return 'variable-2'; + } + return 'variable'; + } + // Should we still be looking for the end of a string? + if (state.continueString) { + // If so, go through the loop again + stream.backUp(1); + return tokenString(stream, state); + } + // Do we just have a function on our hands? + // In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched + if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) { + stream.backUp(1); + return 'def'; + } + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + // Have we found a string? + if (ch == "'" || ch == '"') { + // Store the type (single or double) + state.pending = ch; + // Perform the looping function to find the end + return tokenString(stream, state); + } + if (ch == '(' || ch == ')') { + return 'bracket'; + } + if (ch.match(/[0-9]/)) { + return 'number'; + } + stream.eatWhile(/[\w-]/); + return null; + } + return { + startState: function () { + var state = {}; + state.inDefinition = false; + state.inInclude = false; + state.continueString = false; + state.pending = false; + return state; + }, + token: function (stream, state) { + if (stream.eatSpace()) return null; + return tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/x-cmake", "cmake"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/asciiarmor/asciiarmor.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function errorIfNotEmpty(stream) { + var nonWS = stream.match(/^\s*\S/); + stream.skipToEnd(); + return nonWS ? "error" : null; + } + + CodeMirror.defineMode("asciiarmor", function() { + return { + token: function(stream, state) { + var m; + if (state.state == "top") { + if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) { + state.state = "headers"; + state.type = m[1]; + return "tag"; + } + return errorIfNotEmpty(stream); + } else if (state.state == "headers") { + if (stream.sol() && stream.match(/^\w+:/)) { + state.state = "header"; + return "atom"; + } else { + var result = errorIfNotEmpty(stream); + if (result) state.state = "body"; + return result; + } + } else if (state.state == "header") { + stream.skipToEnd(); + state.state = "headers"; + return "string"; + } else if (state.state == "body") { + if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) { + if (m[1] != state.type) return "error"; + state.state = "end"; + return "tag"; + } else { + if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) { + return null; + } else { + stream.next(); + return "error"; + } + } + } else if (state.state == "end") { + return errorIfNotEmpty(stream); + } + }, + blankLine: function(state) { + if (state.state == "headers") state.state = "body"; + }, + startState: function() { + return {state: "top", type: null}; + } + }; + }); + + CodeMirror.defineMIME("application/pgp", "asciiarmor"); + CodeMirror.defineMIME("application/pgp-encrypted", "asciiarmor"); + CodeMirror.defineMIME("application/pgp-keys", "asciiarmor"); + CodeMirror.defineMIME("application/pgp-signature", "asciiarmor"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/pegjs/pegjs.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../javascript/javascript")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../javascript/javascript"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("pegjs", function (config) { + var jsMode = CodeMirror.getMode(config, "javascript"); + + function identifier(stream) { + return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/); + } + + return { + startState: function () { + return { + inString: false, + stringType: null, + inComment: false, + inCharacterClass: false, + braced: 0, + lhs: true, + localState: null + }; + }, + token: function (stream, state) { + if (stream) + + //check for state changes + if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) { + state.stringType = stream.peek(); + stream.next(); // Skip quote + state.inString = true; // Update state + } + if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { + state.inComment = true; + } + + //return state + if (state.inString) { + while (state.inString && !stream.eol()) { + if (stream.peek() === state.stringType) { + stream.next(); // Skip quote + state.inString = false; // Clear flag + } else if (stream.peek() === '\\') { + stream.next(); + stream.next(); + } else { + stream.match(/^.[^\\\"\']*/); + } + } + return state.lhs ? "property string" : "string"; // Token style + } else if (state.inComment) { + while (state.inComment && !stream.eol()) { + if (stream.match(/\*\//)) { + state.inComment = false; // Clear flag + } else { + stream.match(/^.[^\*]*/); + } + } + return "comment"; + } else if (state.inCharacterClass) { + while (state.inCharacterClass && !stream.eol()) { + if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { + state.inCharacterClass = false; + } + } + } else if (stream.peek() === '[') { + stream.next(); + state.inCharacterClass = true; + return 'bracket'; + } else if (stream.match(/^\/\//)) { + stream.skipToEnd(); + return "comment"; + } else if (state.braced || stream.peek() === '{') { + if (state.localState === null) { + state.localState = CodeMirror.startState(jsMode); + } + var token = jsMode.token(stream, state.localState); + var text = stream.current(); + if (!token) { + for (var i = 0; i < text.length; i++) { + if (text[i] === '{') { + state.braced++; + } else if (text[i] === '}') { + state.braced--; + } + }; + } + return token; + } else if (identifier(stream)) { + if (stream.peek() === ':') { + return 'variable'; + } + return 'variable-2'; + } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) { + stream.next(); + return 'bracket'; + } else if (!stream.eatSpace()) { + stream.next(); + } + return null; + } + }; +}, "javascript"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/solr/solr.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("solr", function() { + "use strict"; + + var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\"\\]/; + var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/; + var isOperatorString = /^(OR|AND|NOT|TO)$/i; + + function isNumber(word) { + return parseFloat(word).toString() === word; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + + if (!escaped) state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenOperator(operator) { + return function(stream, state) { + var style = "operator"; + if (operator == "+") + style += " positive"; + else if (operator == "-") + style += " negative"; + else if (operator == "|") + stream.eat(/\|/); + else if (operator == "&") + stream.eat(/\&/); + else if (operator == "^") + style += " boost"; + + state.tokenize = tokenBase; + return style; + }; + } + + function tokenWord(ch) { + return function(stream, state) { + var word = ch; + while ((ch = stream.peek()) && ch.match(isStringChar) != null) { + word += stream.next(); + } + + state.tokenize = tokenBase; + if (isOperatorString.test(word)) + return "operator"; + else if (isNumber(word)) + return "number"; + else if (stream.peek() == ":") + return "field"; + else + return "string"; + }; + } + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"') + state.tokenize = tokenString(ch); + else if (isOperatorChar.test(ch)) + state.tokenize = tokenOperator(ch); + else if (isStringChar.test(ch)) + state.tokenize = tokenWord(ch); + + return (state.tokenize != tokenBase) ? state.tokenize(stream, state) : null; + } + + return { + startState: function() { + return { + tokenize: tokenBase + }; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/x-solr", "solr"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/tiki/tiki.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('tiki', function(config) { + function inBlock(style, terminator, returnTokenizer) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + + if (returnTokenizer) state.tokenize = returnTokenizer; + + return style; + }; + } + + function inLine(style) { + return function(stream, state) { + while(!stream.eol()) { + stream.next(); + } + state.tokenize = inText; + return style; + }; + } + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var sol = stream.sol(); + var ch = stream.next(); + + //non start of line + switch (ch) { //switch is generally much faster than if, so it is used here + case "{": //plugin + stream.eat("/"); + stream.eatSpace(); + stream.eatWhile(/[^\s\u00a0=\"\'\/?(}]/); + state.tokenize = inPlugin; + return "tag"; + case "_": //bold + if (stream.eat("_")) + return chain(inBlock("strong", "__", inText)); + break; + case "'": //italics + if (stream.eat("'")) + return chain(inBlock("em", "''", inText)); + break; + case "(":// Wiki Link + if (stream.eat("(")) + return chain(inBlock("variable-2", "))", inText)); + break; + case "[":// Weblink + return chain(inBlock("variable-3", "]", inText)); + break; + case "|": //table + if (stream.eat("|")) + return chain(inBlock("comment", "||")); + break; + case "-": + if (stream.eat("=")) {//titleBar + return chain(inBlock("header string", "=-", inText)); + } else if (stream.eat("-")) {//deleted + return chain(inBlock("error tw-deleted", "--", inText)); + } + break; + case "=": //underline + if (stream.match("==")) + return chain(inBlock("tw-underline", "===", inText)); + break; + case ":": + if (stream.eat(":")) + return chain(inBlock("comment", "::")); + break; + case "^": //box + return chain(inBlock("tw-box", "^")); + break; + case "~": //np + if (stream.match("np~")) + return chain(inBlock("meta", "~/np~")); + break; + } + + //start of line types + if (sol) { + switch (ch) { + case "!": //header at start of line + if (stream.match('!!!!!')) { + return chain(inLine("header string")); + } else if (stream.match('!!!!')) { + return chain(inLine("header string")); + } else if (stream.match('!!!')) { + return chain(inLine("header string")); + } else if (stream.match('!!')) { + return chain(inLine("header string")); + } else { + return chain(inLine("header string")); + } + break; + case "*": //unordered list line item, or <li /> at start of line + case "#": //ordered list line item, or <li /> at start of line + case "+": //ordered list line item, or <li /> at start of line + return chain(inLine("tw-listitem bracket")); + break; + } + } + + //stream.eatWhile(/[&{]/); was eating up plugins, turned off to act less like html and more like tiki + return null; + } + + var indentUnit = config.indentUnit; + + // Return variables for tokenizers + var pluginName, type; + function inPlugin(stream, state) { + var ch = stream.next(); + var peek = stream.peek(); + + if (ch == "}") { + state.tokenize = inText; + //type = ch == ")" ? "endPlugin" : "selfclosePlugin"; inPlugin + return "tag"; + } else if (ch == "(" || ch == ")") { + return "bracket"; + } else if (ch == "=") { + type = "equals"; + + if (peek == ">") { + stream.next(); + peek = stream.peek(); + } + + //here we detect values directly after equal character with no quotes + if (!/[\'\"]/.test(peek)) { + state.tokenize = inAttributeNoQuote(); + } + //end detect values + + return "operator"; + } else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + return state.tokenize(stream, state); + } else { + stream.eatWhile(/[^\s\u00a0=\"\'\/?]/); + return "keyword"; + } + } + + function inAttribute(quote) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inPlugin; + break; + } + } + return "string"; + }; + } + + function inAttributeNoQuote() { + return function(stream, state) { + while (!stream.eol()) { + var ch = stream.next(); + var peek = stream.peek(); + if (ch == " " || ch == "," || /[ )}]/.test(peek)) { + state.tokenize = inPlugin; + break; + } + } + return "string"; +}; + } + +var curState, setStyle; +function pass() { + for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); +} + +function cont() { + pass.apply(null, arguments); + return true; +} + +function pushContext(pluginName, startOfLine) { + var noIndent = curState.context && curState.context.noIndent; + curState.context = { + prev: curState.context, + pluginName: pluginName, + indent: curState.indented, + startOfLine: startOfLine, + noIndent: noIndent + }; +} + +function popContext() { + if (curState.context) curState.context = curState.context.prev; +} + +function element(type) { + if (type == "openPlugin") {curState.pluginName = pluginName; return cont(attributes, endplugin(curState.startOfLine));} + else if (type == "closePlugin") { + var err = false; + if (curState.context) { + err = curState.context.pluginName != pluginName; + popContext(); + } else { + err = true; + } + if (err) setStyle = "error"; + return cont(endcloseplugin(err)); + } + else if (type == "string") { + if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); + if (curState.tokenize == inText) popContext(); + return cont(); + } + else return cont(); +} + +function endplugin(startOfLine) { + return function(type) { + if ( + type == "selfclosePlugin" || + type == "endPlugin" + ) + return cont(); + if (type == "endPlugin") {pushContext(curState.pluginName, startOfLine); return cont();} + return cont(); + }; +} + +function endcloseplugin(err) { + return function(type) { + if (err) setStyle = "error"; + if (type == "endPlugin") return cont(); + return pass(); + }; +} + +function attributes(type) { + if (type == "keyword") {setStyle = "attribute"; return cont(attributes);} + if (type == "equals") return cont(attvalue, attributes); + return pass(); +} +function attvalue(type) { + if (type == "keyword") {setStyle = "string"; return cont();} + if (type == "string") return cont(attvaluemaybe); + return pass(); +} +function attvaluemaybe(type) { + if (type == "string") return cont(attvaluemaybe); + else return pass(); +} +return { + startState: function() { + return {tokenize: inText, cc: [], indented: 0, startOfLine: true, pluginName: null, context: null}; + }, + token: function(stream, state) { + if (stream.sol()) { + state.startOfLine = true; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + + setStyle = type = pluginName = null; + var style = state.tokenize(stream, state); + if ((style || type) && style != "comment") { + curState = state; + while (true) { + var comb = state.cc.pop() || element; + if (comb(type || style)) break; + } + } + state.startOfLine = false; + return setStyle || style; + }, + indent: function(state, textAfter) { + var context = state.context; + if (context && context.noIndent) return 0; + if (context && /^{\//.test(textAfter)) + context = context.prev; + while (context && !context.startOfLine) + context = context.prev; + if (context) return context.indent + indentUnit; + else return 0; + }, + electricChars: "/" +}; +}); + +CodeMirror.defineMIME("text/tiki", "tiki"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/slim/slim.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Slim Highlighting for CodeMirror copyright (c) HicknHack Software Gmbh + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), require("../ruby/ruby")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../ruby/ruby"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + + CodeMirror.defineMode("slim", function(config) { + var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"}); + var rubyMode = CodeMirror.getMode(config, "ruby"); + var modes = { html: htmlMode, ruby: rubyMode }; + var embedded = { + ruby: "ruby", + javascript: "javascript", + css: "text/css", + sass: "text/x-sass", + scss: "text/x-scss", + less: "text/x-less", + styl: "text/x-styl", // no highlighting so far + coffee: "coffeescript", + asciidoc: "text/x-asciidoc", + markdown: "text/x-markdown", + textile: "text/x-textile", // no highlighting so far + creole: "text/x-creole", // no highlighting so far + wiki: "text/x-wiki", // no highlighting so far + mediawiki: "text/x-mediawiki", // no highlighting so far + rdoc: "text/x-rdoc", // no highlighting so far + builder: "text/x-builder", // no highlighting so far + nokogiri: "text/x-nokogiri", // no highlighting so far + erb: "application/x-erb" + }; + var embeddedRegexp = function(map){ + var arr = []; + for(var key in map) arr.push(key); + return new RegExp("^("+arr.join('|')+"):"); + }(embedded); + + var styleMap = { + "commentLine": "comment", + "slimSwitch": "operator special", + "slimTag": "tag", + "slimId": "attribute def", + "slimClass": "attribute qualifier", + "slimAttribute": "attribute", + "slimSubmode": "keyword special", + "closeAttributeTag": null, + "slimDoctype": null, + "lineContinuation": null + }; + var closing = { + "{": "}", + "[": "]", + "(": ")" + }; + + var nameStartChar = "_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; + var nameChar = nameStartChar + "\\-0-9\xB7\u0300-\u036F\u203F-\u2040"; + var nameRegexp = new RegExp("^[:"+nameStartChar+"](?::["+nameChar+"]|["+nameChar+"]*)"); + var attributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*(?=\\s*=)"); + var wrappedAttributeNameRegexp = new RegExp("^[:"+nameStartChar+"][:\\."+nameChar+"]*"); + var classNameRegexp = /^\.-?[_a-zA-Z]+[\w\-]*/; + var classIdRegexp = /^#[_a-zA-Z]+[\w\-]*/; + + function backup(pos, tokenize, style) { + var restore = function(stream, state) { + state.tokenize = tokenize; + if (stream.pos < pos) { + stream.pos = pos; + return style; + } + return state.tokenize(stream, state); + }; + return function(stream, state) { + state.tokenize = restore; + return tokenize(stream, state); + }; + } + + function maybeBackup(stream, state, pat, offset, style) { + var cur = stream.current(); + var idx = cur.search(pat); + if (idx > -1) { + state.tokenize = backup(stream.pos, state.tokenize, style); + stream.backUp(cur.length - idx - offset); + } + return style; + } + + function continueLine(state, column) { + state.stack = { + parent: state.stack, + style: "continuation", + indented: column, + tokenize: state.line + }; + state.line = state.tokenize; + } + function finishContinue(state) { + if (state.line == state.tokenize) { + state.line = state.stack.tokenize; + state.stack = state.stack.parent; + } + } + + function lineContinuable(column, tokenize) { + return function(stream, state) { + finishContinue(state); + if (stream.match(/^\\$/)) { + continueLine(state, column); + return "lineContinuation"; + } + var style = tokenize(stream, state); + if (stream.eol() && stream.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)) { + stream.backUp(1); + } + return style; + }; + } + function commaContinuable(column, tokenize) { + return function(stream, state) { + finishContinue(state); + var style = tokenize(stream, state); + if (stream.eol() && stream.current().match(/,$/)) { + continueLine(state, column); + } + return style; + }; + } + + function rubyInQuote(endQuote, tokenize) { + // TODO: add multi line support + return function(stream, state) { + var ch = stream.peek(); + if (ch == endQuote && state.rubyState.tokenize.length == 1) { + // step out of ruby context as it seems to complete processing all the braces + stream.next(); + state.tokenize = tokenize; + return "closeAttributeTag"; + } else { + return ruby(stream, state); + } + }; + } + function startRubySplat(tokenize) { + var rubyState; + var runSplat = function(stream, state) { + if (state.rubyState.tokenize.length == 1 && !state.rubyState.context.prev) { + stream.backUp(1); + if (stream.eatSpace()) { + state.rubyState = rubyState; + state.tokenize = tokenize; + return tokenize(stream, state); + } + stream.next(); + } + return ruby(stream, state); + }; + return function(stream, state) { + rubyState = state.rubyState; + state.rubyState = CodeMirror.startState(rubyMode); + state.tokenize = runSplat; + return ruby(stream, state); + }; + } + + function ruby(stream, state) { + return rubyMode.token(stream, state.rubyState); + } + + function htmlLine(stream, state) { + if (stream.match(/^\\$/)) { + return "lineContinuation"; + } + return html(stream, state); + } + function html(stream, state) { + if (stream.match(/^#\{/)) { + state.tokenize = rubyInQuote("}", state.tokenize); + return null; + } + return maybeBackup(stream, state, /[^\\]#\{/, 1, htmlMode.token(stream, state.htmlState)); + } + + function startHtmlLine(lastTokenize) { + return function(stream, state) { + var style = htmlLine(stream, state); + if (stream.eol()) state.tokenize = lastTokenize; + return style; + }; + } + + function startHtmlMode(stream, state, offset) { + state.stack = { + parent: state.stack, + style: "html", + indented: stream.column() + offset, // pipe + space + tokenize: state.line + }; + state.line = state.tokenize = html; + return null; + } + + function comment(stream, state) { + stream.skipToEnd(); + return state.stack.style; + } + + function commentMode(stream, state) { + state.stack = { + parent: state.stack, + style: "comment", + indented: state.indented + 1, + tokenize: state.line + }; + state.line = comment; + return comment(stream, state); + } + + function attributeWrapper(stream, state) { + if (stream.eat(state.stack.endQuote)) { + state.line = state.stack.line; + state.tokenize = state.stack.tokenize; + state.stack = state.stack.parent; + return null; + } + if (stream.match(wrappedAttributeNameRegexp)) { + state.tokenize = attributeWrapperAssign; + return "slimAttribute"; + } + stream.next(); + return null; + } + function attributeWrapperAssign(stream, state) { + if (stream.match(/^==?/)) { + state.tokenize = attributeWrapperValue; + return null; + } + return attributeWrapper(stream, state); + } + function attributeWrapperValue(stream, state) { + var ch = stream.peek(); + if (ch == '"' || ch == "\'") { + state.tokenize = readQuoted(ch, "string", true, false, attributeWrapper); + stream.next(); + return state.tokenize(stream, state); + } + if (ch == '[') { + return startRubySplat(attributeWrapper)(stream, state); + } + if (stream.match(/^(true|false|nil)\b/)) { + state.tokenize = attributeWrapper; + return "keyword"; + } + return startRubySplat(attributeWrapper)(stream, state); + } + + function startAttributeWrapperMode(state, endQuote, tokenize) { + state.stack = { + parent: state.stack, + style: "wrapper", + indented: state.indented + 1, + tokenize: tokenize, + line: state.line, + endQuote: endQuote + }; + state.line = state.tokenize = attributeWrapper; + return null; + } + + function sub(stream, state) { + if (stream.match(/^#\{/)) { + state.tokenize = rubyInQuote("}", state.tokenize); + return null; + } + var subStream = new CodeMirror.StringStream(stream.string.slice(state.stack.indented), stream.tabSize); + subStream.pos = stream.pos - state.stack.indented; + subStream.start = stream.start - state.stack.indented; + subStream.lastColumnPos = stream.lastColumnPos - state.stack.indented; + subStream.lastColumnValue = stream.lastColumnValue - state.stack.indented; + var style = state.subMode.token(subStream, state.subState); + stream.pos = subStream.pos + state.stack.indented; + return style; + } + function firstSub(stream, state) { + state.stack.indented = stream.column(); + state.line = state.tokenize = sub; + return state.tokenize(stream, state); + } + + function createMode(mode) { + var query = embedded[mode]; + var spec = CodeMirror.mimeModes[query]; + if (spec) { + return CodeMirror.getMode(config, spec); + } + var factory = CodeMirror.modes[query]; + if (factory) { + return factory(config, {name: query}); + } + return CodeMirror.getMode(config, "null"); + } + + function getMode(mode) { + if (!modes.hasOwnProperty(mode)) { + return modes[mode] = createMode(mode); + } + return modes[mode]; + } + + function startSubMode(mode, state) { + var subMode = getMode(mode); + var subState = CodeMirror.startState(subMode); + + state.subMode = subMode; + state.subState = subState; + + state.stack = { + parent: state.stack, + style: "sub", + indented: state.indented + 1, + tokenize: state.line + }; + state.line = state.tokenize = firstSub; + return "slimSubmode"; + } + + function doctypeLine(stream, _state) { + stream.skipToEnd(); + return "slimDoctype"; + } + + function startLine(stream, state) { + var ch = stream.peek(); + if (ch == '<') { + return (state.tokenize = startHtmlLine(state.tokenize))(stream, state); + } + if (stream.match(/^[|']/)) { + return startHtmlMode(stream, state, 1); + } + if (stream.match(/^\/(!|\[\w+])?/)) { + return commentMode(stream, state); + } + if (stream.match(/^(-|==?[<>]?)/)) { + state.tokenize = lineContinuable(stream.column(), commaContinuable(stream.column(), ruby)); + return "slimSwitch"; + } + if (stream.match(/^doctype\b/)) { + state.tokenize = doctypeLine; + return "keyword"; + } + + var m = stream.match(embeddedRegexp); + if (m) { + return startSubMode(m[1], state); + } + + return slimTag(stream, state); + } + + function slim(stream, state) { + if (state.startOfLine) { + return startLine(stream, state); + } + return slimTag(stream, state); + } + + function slimTag(stream, state) { + if (stream.eat('*')) { + state.tokenize = startRubySplat(slimTagExtras); + return null; + } + if (stream.match(nameRegexp)) { + state.tokenize = slimTagExtras; + return "slimTag"; + } + return slimClass(stream, state); + } + function slimTagExtras(stream, state) { + if (stream.match(/^(<>?|><?)/)) { + state.tokenize = slimClass; + return null; + } + return slimClass(stream, state); + } + function slimClass(stream, state) { + if (stream.match(classIdRegexp)) { + state.tokenize = slimClass; + return "slimId"; + } + if (stream.match(classNameRegexp)) { + state.tokenize = slimClass; + return "slimClass"; + } + return slimAttribute(stream, state); + } + function slimAttribute(stream, state) { + if (stream.match(/^([\[\{\(])/)) { + return startAttributeWrapperMode(state, closing[RegExp.$1], slimAttribute); + } + if (stream.match(attributeNameRegexp)) { + state.tokenize = slimAttributeAssign; + return "slimAttribute"; + } + if (stream.peek() == '*') { + stream.next(); + state.tokenize = startRubySplat(slimContent); + return null; + } + return slimContent(stream, state); + } + function slimAttributeAssign(stream, state) { + if (stream.match(/^==?/)) { + state.tokenize = slimAttributeValue; + return null; + } + // should never happen, because of forward lookup + return slimAttribute(stream, state); + } + + function slimAttributeValue(stream, state) { + var ch = stream.peek(); + if (ch == '"' || ch == "\'") { + state.tokenize = readQuoted(ch, "string", true, false, slimAttribute); + stream.next(); + return state.tokenize(stream, state); + } + if (ch == '[') { + return startRubySplat(slimAttribute)(stream, state); + } + if (ch == ':') { + return startRubySplat(slimAttributeSymbols)(stream, state); + } + if (stream.match(/^(true|false|nil)\b/)) { + state.tokenize = slimAttribute; + return "keyword"; + } + return startRubySplat(slimAttribute)(stream, state); + } + function slimAttributeSymbols(stream, state) { + stream.backUp(1); + if (stream.match(/^[^\s],(?=:)/)) { + state.tokenize = startRubySplat(slimAttributeSymbols); + return null; + } + stream.next(); + return slimAttribute(stream, state); + } + function readQuoted(quote, style, embed, unescaped, nextTokenize) { + return function(stream, state) { + finishContinue(state); + var fresh = stream.current().length == 0; + if (stream.match(/^\\$/, fresh)) { + if (!fresh) return style; + continueLine(state, state.indented); + return "lineContinuation"; + } + if (stream.match(/^#\{/, fresh)) { + if (!fresh) return style; + state.tokenize = rubyInQuote("}", state.tokenize); + return null; + } + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && (unescaped || !escaped)) { + state.tokenize = nextTokenize; + break; + } + if (embed && ch == "#" && !escaped) { + if (stream.eat("{")) { + stream.backUp(2); + break; + } + } + escaped = !escaped && ch == "\\"; + } + if (stream.eol() && escaped) { + stream.backUp(1); + } + return style; + }; + } + function slimContent(stream, state) { + if (stream.match(/^==?/)) { + state.tokenize = ruby; + return "slimSwitch"; + } + if (stream.match(/^\/$/)) { // tag close hint + state.tokenize = slim; + return null; + } + if (stream.match(/^:/)) { // inline tag + state.tokenize = slimTag; + return "slimSwitch"; + } + startHtmlMode(stream, state, 0); + return state.tokenize(stream, state); + } + + var mode = { + // default to html mode + startState: function() { + var htmlState = CodeMirror.startState(htmlMode); + var rubyState = CodeMirror.startState(rubyMode); + return { + htmlState: htmlState, + rubyState: rubyState, + stack: null, + last: null, + tokenize: slim, + line: slim, + indented: 0 + }; + }, + + copyState: function(state) { + return { + htmlState : CodeMirror.copyState(htmlMode, state.htmlState), + rubyState: CodeMirror.copyState(rubyMode, state.rubyState), + subMode: state.subMode, + subState: state.subMode && CodeMirror.copyState(state.subMode, state.subState), + stack: state.stack, + last: state.last, + tokenize: state.tokenize, + line: state.line + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.indented = stream.indentation(); + state.startOfLine = true; + state.tokenize = state.line; + while (state.stack && state.stack.indented > state.indented && state.last != "slimSubmode") { + state.line = state.tokenize = state.stack.tokenize; + state.stack = state.stack.parent; + state.subMode = null; + state.subState = null; + } + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + state.startOfLine = false; + if (style) state.last = style; + return styleMap.hasOwnProperty(style) ? styleMap[style] : style; + }, + + blankLine: function(state) { + if (state.subMode && state.subMode.blankLine) { + return state.subMode.blankLine(state.subState); + } + }, + + innerMode: function(state) { + if (state.subMode) return {state: state.subState, mode: state.subMode}; + return {state: state, mode: mode}; + } + + //indent: function(state) { + // return state.indented; + //} + }; + return mode; + }, "htmlmixed", "ruby"); + + CodeMirror.defineMIME("text/x-slim", "slim"); + CodeMirror.defineMIME("application/x-slim", "slim"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/puppet/puppet.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("puppet", function () { + // Stores the words from the define method + var words = {}; + // Taken, mostly, from the Puppet official variable standards regex + var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/; + + // Takes a string of words separated by spaces and adds them as + // keys with the value of the first argument 'style' + function define(style, string) { + var split = string.split(' '); + for (var i = 0; i < split.length; i++) { + words[split[i]] = style; + } + } + + // Takes commonly known puppet types/words and classifies them to a style + define('keyword', 'class define site node include import inherits'); + define('keyword', 'case if else in and elsif default or'); + define('atom', 'false true running present absent file directory undef'); + define('builtin', 'action augeas burst chain computer cron destination dport exec ' + + 'file filebucket group host icmp iniface interface jump k5login limit log_level ' + + 'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' + + 'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' + + 'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' + + 'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' + + 'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' + + 'resources router schedule scheduled_task selboolean selmodule service source ' + + 'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' + + 'user vlan yumrepo zfs zone zpool'); + + // After finding a start of a string ('|") this function attempts to find the end; + // If a variable is encountered along the way, we display it differently when it + // is encapsulated in a double-quoted string. + function tokenString(stream, state) { + var current, prev, found_var = false; + while (!stream.eol() && (current = stream.next()) != state.pending) { + if (current === '$' && prev != '\\' && state.pending == '"') { + found_var = true; + break; + } + prev = current; + } + if (found_var) { + stream.backUp(1); + } + if (current == state.pending) { + state.continueString = false; + } else { + state.continueString = true; + } + return "string"; + } + + // Main function + function tokenize(stream, state) { + // Matches one whole word + var word = stream.match(/[\w]+/, false); + // Matches attributes (i.e. ensure => present ; 'ensure' would be matched) + var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false); + // Matches non-builtin resource declarations + // (i.e. "apache::vhost {" or "mycustomclasss {" would be matched) + var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false); + // Matches virtual and exported resources (i.e. @@user { ; and the like) + var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false); + + // Finally advance the stream + var ch = stream.next(); + + // Have we found a variable? + if (ch === '$') { + if (stream.match(variable_regex)) { + // If so, and its in a string, assign it a different color + return state.continueString ? 'variable-2' : 'variable'; + } + // Otherwise return an invalid variable + return "error"; + } + // Should we still be looking for the end of a string? + if (state.continueString) { + // If so, go through the loop again + stream.backUp(1); + return tokenString(stream, state); + } + // Are we in a definition (class, node, define)? + if (state.inDefinition) { + // If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched) + if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) { + return 'def'; + } + // Match the rest it the next time around + stream.match(/\s+{/); + state.inDefinition = false; + } + // Are we in an 'include' statement? + if (state.inInclude) { + // Match and return the included class + stream.match(/(\s+)?\S+(\s+)?/); + state.inInclude = false; + return 'def'; + } + // Do we just have a function on our hands? + // In 'ensure_resource("myclass")', 'ensure_resource' is matched + if (stream.match(/(\s+)?\w+\(/)) { + stream.backUp(1); + return 'def'; + } + // Have we matched the prior attribute regex? + if (attribute) { + stream.match(/(\s+)?\w+/); + return 'tag'; + } + // Do we have Puppet specific words? + if (word && words.hasOwnProperty(word)) { + // Negates the initial next() + stream.backUp(1); + // rs move the stream + stream.match(/[\w]+/); + // We want to process these words differently + // do to the importance they have in Puppet + if (stream.match(/\s+\S+\s+{/, false)) { + state.inDefinition = true; + } + if (word == 'include') { + state.inInclude = true; + } + // Returns their value as state in the prior define methods + return words[word]; + } + // Is there a match on a reference? + if (/(^|\s+)[A-Z][\w:_]+/.test(word)) { + // Negate the next() + stream.backUp(1); + // Match the full reference + stream.match(/(^|\s+)[A-Z][\w:_]+/); + return 'def'; + } + // Have we matched the prior resource regex? + if (resource) { + stream.match(/(\s+)?[\w:_]+/); + return 'def'; + } + // Have we matched the prior special_resource regex? + if (special_resource) { + stream.match(/(\s+)?[@]{1,2}/); + return 'special'; + } + // Match all the comments. All of them. + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + // Have we found a string? + if (ch == "'" || ch == '"') { + // Store the type (single or double) + state.pending = ch; + // Perform the looping function to find the end + return tokenString(stream, state); + } + // Match all the brackets + if (ch == '{' || ch == '}') { + return 'bracket'; + } + // Match characters that we are going to assume + // are trying to be regex + if (ch == '/') { + stream.match(/.*?\//); + return 'variable-3'; + } + // Match all the numbers + if (ch.match(/[0-9]/)) { + stream.eatWhile(/[0-9]+/); + return 'number'; + } + // Match the '=' and '=>' operators + if (ch == '=') { + if (stream.peek() == '>') { + stream.next(); + } + return "operator"; + } + // Keep advancing through all the rest + stream.eatWhile(/[\w-]/); + // Return a blank line for everything else + return null; + } + // Start it all + return { + startState: function () { + var state = {}; + state.inDefinition = false; + state.inInclude = false; + state.continueString = false; + state.pending = false; + return state; + }, + token: function (stream, state) { + // Strip the spaces, but regex will account for them eitherway + if (stream.eatSpace()) return null; + // Go through the main process + return tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME("text/x-puppet", "puppet"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/meta.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.modeInfo = [ + {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, + {name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"]}, + {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]}, + {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, + {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]}, + {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, + {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, + {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, + {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, + {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]}, + {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]}, + {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]}, + {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, + {name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, + {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, + {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, + {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, + {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]}, + {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, + {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, + {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, + {name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]}, + {name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]}, + {name: "Django", mime: "text/x-django", mode: "django"}, + {name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile", file: /^Dockerfile$/}, + {name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]}, + {name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]}, + {name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"}, + {name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]}, + {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]}, + {name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]}, + {name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]}, + {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]}, + {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]}, + {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]}, + {name: "Esper", mime: "text/x-esper", mode: "sql"}, + {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]}, + {name: "FCL", mime: "text/x-fcl", mode: "fcl"}, + {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]}, + {name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]}, + {name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]}, + {name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]}, + {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, + {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i}, + {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, + {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/}, + {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, + {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, + {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]}, + {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, + {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, + {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]}, + {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, + {name: "HTTP", mime: "message/http", mode: "http"}, + {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, + {name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]}, + {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, + {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, + {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], + mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]}, + {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]}, + {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]}, + {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]}, + {name: "Jinja2", mime: "null", mode: "jinja2"}, + {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, + {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]}, + {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, + {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]}, + {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, + {name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]}, + {name: "mIRC", mime: "text/mirc", mode: "mirc"}, + {name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"}, + {name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]}, + {name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]}, + {name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]}, + {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, + {name: "mbox", mime: "application/mbox", mode: "mbox", ext: ["mbox"]}, + {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, + {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, + {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]}, + {name: "NTriples", mimes: ["application/n-triples", "application/n-quads", "text/n-triples"], + mode: "ntriples", ext: ["nt", "nq"]}, + {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]}, + {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, + {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, + {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]}, + {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, + {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]}, + {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, + {name: "PHP", mime: ["application/x-httpd-php", "text/x-php"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"]}, + {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]}, + {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]}, + {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]}, + {name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]}, + {name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]}, + {name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]}, + {name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/}, + {name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]}, + {name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]}, + {name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r", "R"], alias: ["rscript"]}, + {name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]}, + {name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"}, + {name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]}, + {name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]}, + {name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]}, + {name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]}, + {name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]}, + {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, + {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, + {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, + {name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/}, + {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]}, + {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, + {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, + {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]}, + {name: "Solr", mime: "text/x-solr", mode: "solr"}, + {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]}, + {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, + {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]}, + {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, + {name: "SQLite", mime: "text/x-sqlite", mode: "sql"}, + {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]}, + {name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"]}, + {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]}, + {name: "sTeX", mime: "text/x-stex", mode: "stex"}, + {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]}, + {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]}, + {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]}, + {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]}, + {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"}, + {name: "Tiki wiki", mime: "text/tiki", mode: "tiki"}, + {name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]}, + {name: "Tornado", mime: "text/x-tornado", mode: "tornado"}, + {name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]}, + {name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]}, + {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]}, + {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]}, + {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]}, + {name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"]}, + {name: "Twig", mime: "text/x-twig", mode: "twig"}, + {name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]}, + {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]}, + {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]}, + {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, + {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, + {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]}, + {name: "Vue.js Component", mimes: ["script/x-vue", "text/x-vue"], mode: "vue", ext: ["vue"]}, + {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd", "svg"], alias: ["rss", "wsdl", "xsd"]}, + {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, + {name: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]}, + {name: "YAML", mimes: ["text/x-yaml", "text/yaml"], mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, + {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}, + {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]}, + {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]}, + {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]} + ]; + // Ensure all modes have a mime property for backwards compatibility + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.mimes) info.mime = info.mimes[0]; + } + + CodeMirror.findModeByMIME = function(mime) { + mime = mime.toLowerCase(); + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.mime == mime) return info; + if (info.mimes) for (var j = 0; j < info.mimes.length; j++) + if (info.mimes[j] == mime) return info; + } + if (/\+xml$/.test(mime)) return CodeMirror.findModeByMIME("application/xml") + if (/\+json$/.test(mime)) return CodeMirror.findModeByMIME("application/json") + }; + + CodeMirror.findModeByExtension = function(ext) { + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.ext) for (var j = 0; j < info.ext.length; j++) + if (info.ext[j] == ext) return info; + } + }; + + CodeMirror.findModeByFileName = function(filename) { + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.file && info.file.test(filename)) return info; + } + var dot = filename.lastIndexOf("."); + var ext = dot > -1 && filename.substring(dot + 1, filename.length); + if (ext) return CodeMirror.findModeByExtension(ext); + }; + + CodeMirror.findModeByName = function(name) { + name = name.toLowerCase(); + for (var i = 0; i < CodeMirror.modeInfo.length; i++) { + var info = CodeMirror.modeInfo[i]; + if (info.name.toLowerCase() == name) return info; + if (info.alias) for (var j = 0; j < info.alias.length; j++) + if (info.alias[j].toLowerCase() == name) return info; + } + }; +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/go/go.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("go", function(config) { + var indentUnit = config.indentUnit; + + var keywords = { + "break":true, "case":true, "chan":true, "const":true, "continue":true, + "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, + "func":true, "go":true, "goto":true, "if":true, "import":true, + "interface":true, "map":true, "package":true, "range":true, "return":true, + "select":true, "struct":true, "switch":true, "type":true, "var":true, + "bool":true, "byte":true, "complex64":true, "complex128":true, + "float32":true, "float64":true, "int8":true, "int16":true, "int32":true, + "int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true, + "uint64":true, "int":true, "uint":true, "uintptr":true, "error": true, + "rune":true + }; + + var atoms = { + "true":true, "false":true, "iota":true, "nil":true, "append":true, + "cap":true, "close":true, "complex":true, "copy":true, "delete":true, "imag":true, + "len":true, "make":true, "new":true, "panic":true, "print":true, + "println":true, "real":true, "recover":true + }; + + var isOperatorChar = /[+\-*&^%:=<>!|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'" || ch == "`") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\d\.]/.test(ch)) { + if (ch == ".") { + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + } else if (ch == "0") { + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + } else { + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + } + return "number"; + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) { + if (cur == "case" || cur == "default") curPunc = "case"; + return "keyword"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && quote != "`" && next == "\\"; + } + if (end || !(escaped || quote == "`")) + state.tokenize = tokenBase; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + if (!state.context.prev) return; + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + if (ctx.type == "case") ctx.type = "}"; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "case") ctx.type = "case"; + else if (curPunc == "}" && ctx.type == "}") popContext(state); + else if (curPunc == ctx.type) popContext(state); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) { + state.context.type = "}"; + return ctx.indented; + } + var closing = firstChar == ctx.type; + if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}):", + closeBrackets: "()[]{}''\"\"``", + fold: "brace", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-go", "go"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/commonlisp/commonlisp.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("commonlisp", function (config) { + var specialForm = /^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/; + var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/; + var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/; + var symbol = /[^\s'`,@()\[\]";]/; + var type; + + function readSym(stream) { + var ch; + while (ch = stream.next()) { + if (ch == "\\") stream.next(); + else if (!symbol.test(ch)) { stream.backUp(1); break; } + } + return stream.current(); + } + + function base(stream, state) { + if (stream.eatSpace()) {type = "ws"; return null;} + if (stream.match(numLiteral)) return "number"; + var ch = stream.next(); + if (ch == "\\") ch = stream.next(); + + if (ch == '"') return (state.tokenize = inString)(stream, state); + else if (ch == "(") { type = "open"; return "bracket"; } + else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; } + else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; } + else if (/['`,@]/.test(ch)) return null; + else if (ch == "|") { + if (stream.skipTo("|")) { stream.next(); return "symbol"; } + else { stream.skipToEnd(); return "error"; } + } else if (ch == "#") { + var ch = stream.next(); + if (ch == "(") { type = "open"; return "bracket"; } + else if (/[+\-=\.']/.test(ch)) return null; + else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null; + else if (ch == "|") return (state.tokenize = inComment)(stream, state); + else if (ch == ":") { readSym(stream); return "meta"; } + else if (ch == "\\") { stream.next(); readSym(stream); return "string-2" } + else return "error"; + } else { + var name = readSym(stream); + if (name == ".") return null; + type = "symbol"; + if (name == "nil" || name == "t" || name.charAt(0) == ":") return "atom"; + if (state.lastType == "open" && (specialForm.test(name) || assumeBody.test(name))) return "keyword"; + if (name.charAt(0) == "&") return "variable-2"; + return "variable"; + } + } + + function inString(stream, state) { + var escaped = false, next; + while (next = stream.next()) { + if (next == '"' && !escaped) { state.tokenize = base; break; } + escaped = !escaped && next == "\\"; + } + return "string"; + } + + function inComment(stream, state) { + var next, last; + while (next = stream.next()) { + if (next == "#" && last == "|") { state.tokenize = base; break; } + last = next; + } + type = "ws"; + return "comment"; + } + + return { + startState: function () { + return {ctx: {prev: null, start: 0, indentTo: 0}, lastType: null, tokenize: base}; + }, + + token: function (stream, state) { + if (stream.sol() && typeof state.ctx.indentTo != "number") + state.ctx.indentTo = state.ctx.start + 1; + + type = null; + var style = state.tokenize(stream, state); + if (type != "ws") { + if (state.ctx.indentTo == null) { + if (type == "symbol" && assumeBody.test(stream.current())) + state.ctx.indentTo = state.ctx.start + config.indentUnit; + else + state.ctx.indentTo = "next"; + } else if (state.ctx.indentTo == "next") { + state.ctx.indentTo = stream.column(); + } + state.lastType = type; + } + if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null}; + else if (type == "close") state.ctx = state.ctx.prev || state.ctx; + return style; + }, + + indent: function (state, _textAfter) { + var i = state.ctx.indentTo; + return typeof i == "number" ? i : state.ctx.start + 1; + }, + + closeBrackets: {pairs: "()[]{}\"\""}, + lineComment: ";;", + blockCommentStart: "#|", + blockCommentEnd: "|#" + }; +}); + +CodeMirror.defineMIME("text/x-common-lisp", "commonlisp"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/rust/rust.min.js */ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/powershell/powershell.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + 'use strict'; + if (typeof exports == 'object' && typeof module == 'object') // CommonJS + mod(require('../../lib/codemirror')); + else if (typeof define == 'function' && define.amd) // AMD + define(['../../lib/codemirror'], mod); + else // Plain browser env + mod(window.CodeMirror); +})(function(CodeMirror) { +'use strict'; + +CodeMirror.defineMode('powershell', function() { + function buildRegexp(patterns, options) { + options = options || {}; + var prefix = options.prefix !== undefined ? options.prefix : '^'; + var suffix = options.suffix !== undefined ? options.suffix : '\\b'; + + for (var i = 0; i < patterns.length; i++) { + if (patterns[i] instanceof RegExp) { + patterns[i] = patterns[i].source; + } + else { + patterns[i] = patterns[i].replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + } + + return new RegExp(prefix + '(' + patterns.join('|') + ')' + suffix, 'i'); + } + + var notCharacterOrDash = '(?=[^A-Za-z\\d\\-_]|$)'; + var varNames = /[\w\-:]/ + var keywords = buildRegexp([ + /begin|break|catch|continue|data|default|do|dynamicparam/, + /else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/, + /param|process|return|switch|throw|trap|try|until|where|while/ + ], { suffix: notCharacterOrDash }); + + var punctuation = /[\[\]{},;`\.]|@[({]/; + var wordOperators = buildRegexp([ + 'f', + /b?not/, + /[ic]?split/, 'join', + /is(not)?/, 'as', + /[ic]?(eq|ne|[gl][te])/, + /[ic]?(not)?(like|match|contains)/, + /[ic]?replace/, + /b?(and|or|xor)/ + ], { prefix: '-' }); + var symbolOperators = /[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/; + var operators = buildRegexp([wordOperators, symbolOperators], { suffix: '' }); + + var numbers = /^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i; + + var identifiers = /^[A-Za-z\_][A-Za-z\-\_\d]*\b/; + + var symbolBuiltins = /[A-Z]:|%|\?/i; + var namedBuiltins = buildRegexp([ + /Add-(Computer|Content|History|Member|PSSnapin|Type)/, + /Checkpoint-Computer/, + /Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/, + /Compare-Object/, + /Complete-Transaction/, + /Connect-PSSession/, + /ConvertFrom-(Csv|Json|SecureString|StringData)/, + /Convert-Path/, + /ConvertTo-(Csv|Html|Json|SecureString|Xml)/, + /Copy-Item(Property)?/, + /Debug-Process/, + /Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/, + /Disconnect-PSSession/, + /Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/, + /(Enter|Exit)-PSSession/, + /Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/, + /ForEach-Object/, + /Format-(Custom|List|Table|Wide)/, + new RegExp('Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential' + + '|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job' + + '|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration' + + '|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)'), + /Group-Object/, + /Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/, + /ImportSystemModules/, + /Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/, + /Join-Path/, + /Limit-EventLog/, + /Measure-(Command|Object)/, + /Move-Item(Property)?/, + new RegExp('New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile' + + '|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)'), + /Out-(Default|File|GridView|Host|Null|Printer|String)/, + /Pause/, + /(Pop|Push)-Location/, + /Read-Host/, + /Receive-(Job|PSSession)/, + /Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/, + /Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/, + /Rename-(Computer|Item(Property)?)/, + /Reset-ComputerMachinePassword/, + /Resolve-Path/, + /Restart-(Computer|Service)/, + /Restore-Computer/, + /Resume-(Job|Service)/, + /Save-Help/, + /Select-(Object|String|Xml)/, + /Send-MailMessage/, + new RegExp('Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug' + + '|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)'), + /Show-(Command|ControlPanelItem|EventLog)/, + /Sort-Object/, + /Split-Path/, + /Start-(Job|Process|Service|Sleep|Transaction|Transcript)/, + /Stop-(Computer|Job|Process|Service|Transcript)/, + /Suspend-(Job|Service)/, + /TabExpansion2/, + /Tee-Object/, + /Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/, + /Trace-Command/, + /Unblock-File/, + /Undo-Transaction/, + /Unregister-(Event|PSSessionConfiguration)/, + /Update-(FormatData|Help|List|TypeData)/, + /Use-Transaction/, + /Wait-(Event|Job|Process)/, + /Where-Object/, + /Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/, + /cd|help|mkdir|more|oss|prompt/, + /ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/, + /echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/, + /group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/, + /measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/, + /rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/, + /sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/ + ], { prefix: '', suffix: '' }); + var variableBuiltins = buildRegexp([ + /[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/, + /FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/, + /MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/, + /PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/, + /PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/, + /WarningPreference|WhatIfPreference/, + + /Event|EventArgs|EventSubscriber|Sender/, + /Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/, + /true|false|null/ + ], { prefix: '\\$', suffix: '' }); + + var builtins = buildRegexp([symbolBuiltins, namedBuiltins, variableBuiltins], { suffix: notCharacterOrDash }); + + var grammar = { + keyword: keywords, + number: numbers, + operator: operators, + builtin: builtins, + punctuation: punctuation, + identifier: identifiers + }; + + // tokenizers + function tokenBase(stream, state) { + // Handle Comments + //var ch = stream.peek(); + + var parent = state.returnStack[state.returnStack.length - 1]; + if (parent && parent.shouldReturnFrom(state)) { + state.tokenize = parent.tokenize; + state.returnStack.pop(); + return state.tokenize(stream, state); + } + + if (stream.eatSpace()) { + return null; + } + + if (stream.eat('(')) { + state.bracketNesting += 1; + return 'punctuation'; + } + + if (stream.eat(')')) { + state.bracketNesting -= 1; + return 'punctuation'; + } + + for (var key in grammar) { + if (stream.match(grammar[key])) { + return key; + } + } + + var ch = stream.next(); + + // single-quote string + if (ch === "'") { + return tokenSingleQuoteString(stream, state); + } + + if (ch === '$') { + return tokenVariable(stream, state); + } + + // double-quote string + if (ch === '"') { + return tokenDoubleQuoteString(stream, state); + } + + if (ch === '<' && stream.eat('#')) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + + if (ch === '#') { + stream.skipToEnd(); + return 'comment'; + } + + if (ch === '@') { + var quoteMatch = stream.eat(/["']/); + if (quoteMatch && stream.eol()) { + state.tokenize = tokenMultiString; + state.startQuote = quoteMatch[0]; + return tokenMultiString(stream, state); + } else if (stream.eol()) { + return 'error'; + } else if (stream.peek().match(/[({]/)) { + return 'punctuation'; + } else if (stream.peek().match(varNames)) { + // splatted variable + return tokenVariable(stream, state); + } + } + return 'error'; + } + + function tokenSingleQuoteString(stream, state) { + var ch; + while ((ch = stream.peek()) != null) { + stream.next(); + + if (ch === "'" && !stream.eat("'")) { + state.tokenize = tokenBase; + return 'string'; + } + } + + return 'error'; + } + + function tokenDoubleQuoteString(stream, state) { + var ch; + while ((ch = stream.peek()) != null) { + if (ch === '$') { + state.tokenize = tokenStringInterpolation; + return 'string'; + } + + stream.next(); + if (ch === '`') { + stream.next(); + continue; + } + + if (ch === '"' && !stream.eat('"')) { + state.tokenize = tokenBase; + return 'string'; + } + } + + return 'error'; + } + + function tokenStringInterpolation(stream, state) { + return tokenInterpolation(stream, state, tokenDoubleQuoteString); + } + + function tokenMultiStringReturn(stream, state) { + state.tokenize = tokenMultiString; + state.startQuote = '"' + return tokenMultiString(stream, state); + } + + function tokenHereStringInterpolation(stream, state) { + return tokenInterpolation(stream, state, tokenMultiStringReturn); + } + + function tokenInterpolation(stream, state, parentTokenize) { + if (stream.match('$(')) { + var savedBracketNesting = state.bracketNesting; + state.returnStack.push({ + /*jshint loopfunc:true */ + shouldReturnFrom: function(state) { + return state.bracketNesting === savedBracketNesting; + }, + tokenize: parentTokenize + }); + state.tokenize = tokenBase; + state.bracketNesting += 1; + return 'punctuation'; + } else { + stream.next(); + state.returnStack.push({ + shouldReturnFrom: function() { return true; }, + tokenize: parentTokenize + }); + state.tokenize = tokenVariable; + return state.tokenize(stream, state); + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == '>') { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch === '#'); + } + return 'comment'; + } + + function tokenVariable(stream, state) { + var ch = stream.peek(); + if (stream.eat('{')) { + state.tokenize = tokenVariableWithBraces; + return tokenVariableWithBraces(stream, state); + } else if (ch != undefined && ch.match(varNames)) { + stream.eatWhile(varNames); + state.tokenize = tokenBase; + return 'variable-2'; + } else { + state.tokenize = tokenBase; + return 'error'; + } + } + + function tokenVariableWithBraces(stream, state) { + var ch; + while ((ch = stream.next()) != null) { + if (ch === '}') { + state.tokenize = tokenBase; + break; + } + } + return 'variable-2'; + } + + function tokenMultiString(stream, state) { + var quote = state.startQuote; + if (stream.sol() && stream.match(new RegExp(quote + '@'))) { + state.tokenize = tokenBase; + } + else if (quote === '"') { + while (!stream.eol()) { + var ch = stream.peek(); + if (ch === '$') { + state.tokenize = tokenHereStringInterpolation; + return 'string'; + } + + stream.next(); + if (ch === '`') { + stream.next(); + } + } + } + else { + stream.skipToEnd(); + } + + return 'string'; + } + + var external = { + startState: function() { + return { + returnStack: [], + bracketNesting: 0, + tokenize: tokenBase + }; + }, + + token: function(stream, state) { + return state.tokenize(stream, state); + }, + + blockCommentStart: '<#', + blockCommentEnd: '#>', + lineComment: '#', + fold: 'brace' + }; + return external; +}); + +CodeMirror.defineMIME('application/x-powershell', 'powershell'); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/stex/stex.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* + * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) + * Licence: MIT + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("stex", function() { + "use strict"; + + function pushCommand(state, command) { + state.cmdState.push(command); + } + + function peekCommand(state) { + if (state.cmdState.length > 0) { + return state.cmdState[state.cmdState.length - 1]; + } else { + return null; + } + } + + function popCommand(state) { + var plug = state.cmdState.pop(); + if (plug) { + plug.closeBracket(); + } + } + + // returns the non-default plugin closest to the end of the list + function getMostPowerful(state) { + var context = state.cmdState; + for (var i = context.length - 1; i >= 0; i--) { + var plug = context[i]; + if (plug.name == "DEFAULT") { + continue; + } + return plug; + } + return { styleIdentifier: function() { return null; } }; + } + + function addPluginPattern(pluginName, cmdStyle, styles) { + return function () { + this.name = pluginName; + this.bracketNo = 0; + this.style = cmdStyle; + this.styles = styles; + this.argument = null; // \begin and \end have arguments that follow. These are stored in the plugin + + this.styleIdentifier = function() { + return this.styles[this.bracketNo - 1] || null; + }; + this.openBracket = function() { + this.bracketNo++; + return "bracket"; + }; + this.closeBracket = function() {}; + }; + } + + var plugins = {}; + + plugins["importmodule"] = addPluginPattern("importmodule", "tag", ["string", "builtin"]); + plugins["documentclass"] = addPluginPattern("documentclass", "tag", ["", "atom"]); + plugins["usepackage"] = addPluginPattern("usepackage", "tag", ["atom"]); + plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]); + plugins["end"] = addPluginPattern("end", "tag", ["atom"]); + + plugins["DEFAULT"] = function () { + this.name = "DEFAULT"; + this.style = "tag"; + + this.styleIdentifier = this.openBracket = this.closeBracket = function() {}; + }; + + function setState(state, f) { + state.f = f; + } + + // called when in a normal (no environment) context + function normal(source, state) { + var plug; + // Do we look like '\command' ? If so, attempt to apply the plugin 'command' + if (source.match(/^\\[a-zA-Z@]+/)) { + var cmdName = source.current().slice(1); + plug = plugins[cmdName] || plugins["DEFAULT"]; + plug = new plug(); + pushCommand(state, plug); + setState(state, beginParams); + return plug.style; + } + + // escape characters + if (source.match(/^\\[$&%#{}_]/)) { + return "tag"; + } + + // white space control characters + if (source.match(/^\\[,;!\/\\]/)) { + return "tag"; + } + + // find if we're starting various math modes + if (source.match("\\[")) { + setState(state, function(source, state){ return inMathMode(source, state, "\\]"); }); + return "keyword"; + } + if (source.match("$$")) { + setState(state, function(source, state){ return inMathMode(source, state, "$$"); }); + return "keyword"; + } + if (source.match("$")) { + setState(state, function(source, state){ return inMathMode(source, state, "$"); }); + return "keyword"; + } + + var ch = source.next(); + if (ch == "%") { + source.skipToEnd(); + return "comment"; + } else if (ch == '}' || ch == ']') { + plug = peekCommand(state); + if (plug) { + plug.closeBracket(ch); + setState(state, beginParams); + } else { + return "error"; + } + return "bracket"; + } else if (ch == '{' || ch == '[') { + plug = plugins["DEFAULT"]; + plug = new plug(); + pushCommand(state, plug); + return "bracket"; + } else if (/\d/.test(ch)) { + source.eatWhile(/[\w.%]/); + return "atom"; + } else { + source.eatWhile(/[\w\-_]/); + plug = getMostPowerful(state); + if (plug.name == 'begin') { + plug.argument = source.current(); + } + return plug.styleIdentifier(); + } + } + + function inMathMode(source, state, endModeSeq) { + if (source.eatSpace()) { + return null; + } + if (source.match(endModeSeq)) { + setState(state, normal); + return "keyword"; + } + if (source.match(/^\\[a-zA-Z@]+/)) { + return "tag"; + } + if (source.match(/^[a-zA-Z]+/)) { + return "variable-2"; + } + // escape characters + if (source.match(/^\\[$&%#{}_]/)) { + return "tag"; + } + // white space control characters + if (source.match(/^\\[,;!\/]/)) { + return "tag"; + } + // special math-mode characters + if (source.match(/^[\^_&]/)) { + return "tag"; + } + // non-special characters + if (source.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)) { + return null; + } + if (source.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)) { + return "number"; + } + var ch = source.next(); + if (ch == "{" || ch == "}" || ch == "[" || ch == "]" || ch == "(" || ch == ")") { + return "bracket"; + } + + if (ch == "%") { + source.skipToEnd(); + return "comment"; + } + return "error"; + } + + function beginParams(source, state) { + var ch = source.peek(), lastPlug; + if (ch == '{' || ch == '[') { + lastPlug = peekCommand(state); + lastPlug.openBracket(ch); + source.eat(ch); + setState(state, normal); + return "bracket"; + } + if (/[ \t\r]/.test(ch)) { + source.eat(ch); + return null; + } + setState(state, normal); + popCommand(state); + + return normal(source, state); + } + + return { + startState: function() { + return { + cmdState: [], + f: normal + }; + }, + copyState: function(s) { + return { + cmdState: s.cmdState.slice(), + f: s.f + }; + }, + token: function(stream, state) { + return state.f(stream, state); + }, + blankLine: function(state) { + state.f = normal; + state.cmdState.length = 0; + }, + lineComment: "%" + }; + }); + + CodeMirror.defineMIME("text/x-stex", "stex"); + CodeMirror.defineMIME("text/x-latex", "stex"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/q/q.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("q",function(config){ + var indentUnit=config.indentUnit, + curPunc, + keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]), + E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/; + function buildRE(w){return new RegExp("^("+w.join("|")+")$");} + function tokenBase(stream,state){ + var sol=stream.sol(),c=stream.next(); + curPunc=null; + if(sol) + if(c=="/") + return(state.tokenize=tokenLineComment)(stream,state); + else if(c=="\\"){ + if(stream.eol()||/\s/.test(stream.peek())) + return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream):state.tokenize=tokenBase,"comment"; + else + return state.tokenize=tokenBase,"builtin"; + } + if(/\s/.test(c)) + return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace"; + if(c=='"') + return(state.tokenize=tokenString)(stream,state); + if(c=='`') + return stream.eatWhile(/[A-Za-z\d_:\/.]/),"symbol"; + if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){ + var t=null; + stream.backUp(1); + if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([DT](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/) + || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/) + || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/) + || stream.match(/^\d+[ptuv]{1}/)) + t="temporal"; + else if(stream.match(/^0[NwW]{1}/) + || stream.match(/^0x[\da-fA-F]*/) + || stream.match(/^[01]+[b]{1}/) + || stream.match(/^\d+[chijn]{1}/) + || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/)) + t="number"; + return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error"); + } + if(/[A-Za-z]|\./.test(c)) + return stream.eatWhile(/[A-Za-z._\d]/),keywords.test(stream.current())?"keyword":"variable"; + if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c)) + return null; + if(/[{}\(\[\]\)]/.test(c)) + return null; + return"error"; + } + function tokenLineComment(stream,state){ + return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment"; + } + function tokenBlockComment(stream,state){ + var f=stream.sol()&&stream.peek()=="\\"; + stream.skipToEnd(); + if(f&&/^\\\s*$/.test(stream.current())) + state.tokenize=tokenBase; + return"comment"; + } + function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";} + function tokenString(stream,state){ + var escaped=false,next,end=false; + while((next=stream.next())){ + if(next=="\""&&!escaped){end=true;break;} + escaped=!escaped&&next=="\\"; + } + if(end)state.tokenize=tokenBase; + return"string"; + } + function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};} + function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;} + return{ + startState:function(){ + return{tokenize:tokenBase, + context:null, + indent:0, + col:0}; + }, + token:function(stream,state){ + if(stream.sol()){ + if(state.context&&state.context.align==null) + state.context.align=false; + state.indent=stream.indentation(); + } + //if (stream.eatSpace()) return null; + var style=state.tokenize(stream,state); + if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){ + state.context.align=true; + } + if(curPunc=="(")pushContext(state,")",stream.column()); + else if(curPunc=="[")pushContext(state,"]",stream.column()); + else if(curPunc=="{")pushContext(state,"}",stream.column()); + else if(/[\]\}\)]/.test(curPunc)){ + while(state.context&&state.context.type=="pattern")popContext(state); + if(state.context&&curPunc==state.context.type)popContext(state); + } + else if(curPunc=="."&&state.context&&state.context.type=="pattern")popContext(state); + else if(/atom|string|variable/.test(style)&&state.context){ + if(/[\}\]]/.test(state.context.type)) + pushContext(state,"pattern",stream.column()); + else if(state.context.type=="pattern"&&!state.context.align){ + state.context.align=true; + state.context.col=stream.column(); + } + } + return style; + }, + indent:function(state,textAfter){ + var firstChar=textAfter&&textAfter.charAt(0); + var context=state.context; + if(/[\]\}]/.test(firstChar)) + while (context&&context.type=="pattern")context=context.prev; + var closing=context&&firstChar==context.type; + if(!context) + return 0; + else if(context.type=="pattern") + return context.col; + else if(context.align) + return context.col+(closing?0:1); + else + return context.indent+(closing?0:indentUnit); + } + }; +}); +CodeMirror.defineMIME("text/x-q","q"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/htmlembedded/htmlembedded.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), + require("../../addon/mode/multiplex")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", + "../../addon/mode/multiplex"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { + return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { + open: parserConfig.open || parserConfig.scriptStartRegex || "<%", + close: parserConfig.close || parserConfig.scriptEndRegex || "%>", + mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) + }); + }, "htmlmixed"); + + CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); + CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); + CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); + CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/d/d.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("d", function(config, parserConfig) { + var indentUnit = config.indentUnit, + statementIndentUnit = parserConfig.statementIndentUnit || indentUnit, + keywords = parserConfig.keywords || {}, + builtin = parserConfig.builtin || {}, + blockKeywords = parserConfig.blockKeywords || {}, + atoms = parserConfig.atoms || {}, + hooks = parserConfig.hooks || {}, + multiLineStrings = parserConfig.multiLineStrings; + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == '"' || ch == "'" || ch == "`") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("+")) { + state.tokenize = tokenNestedComment; + return tokenNestedComment(stream, state); + } + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "keyword"; + } + if (builtin.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + return "builtin"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenNestedComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "+"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state); + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; + var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); + if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}" + }; +}); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " + + "out scope struct switch try union unittest version while with"; + + CodeMirror.defineMIME("text/x-d", { + name: "d", + keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " + + "debug default delegate delete deprecated export extern final finally function goto immutable " + + "import inout invariant is lazy macro module new nothrow override package pragma private " + + "protected public pure ref return shared short static super synchronized template this " + + "throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " + + blockKeywords), + blockKeywords: words(blockKeywords), + builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " + + "ucent uint ulong ushort wchar wstring void size_t sizediff_t"), + atoms: words("exit failure success true false null"), + hooks: { + "@": function(stream, _state) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + } + } + }); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/protobuf/protobuf.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + }; + + var keywordArray = [ + "package", "message", "import", "syntax", + "required", "optional", "repeated", "reserved", "default", "extensions", "packed", + "bool", "bytes", "double", "enum", "float", "string", + "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64", + "option", "service", "rpc", "returns" + ]; + var keywords = wordRegexp(keywordArray); + + CodeMirror.registerHelper("hintWords", "protobuf", keywordArray); + + var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); + + function tokenBase(stream) { + // whitespaces + if (stream.eatSpace()) return null; + + // Handle one line Comments + if (stream.match("//")) { + stream.skipToEnd(); + return "comment"; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.+-]/, false)) { + if (stream.match(/^[+-]?0x[0-9a-fA-F]+/)) + return "number"; + if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)) + return "number"; + if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/)) + return "number"; + } + + // Handle Strings + if (stream.match(/^"([^"]|(""))*"/)) { return "string"; } + if (stream.match(/^'([^']|(''))*'/)) { return "string"; } + + // Handle words + if (stream.match(keywords)) { return "keyword"; } + if (stream.match(identifiers)) { return "variable"; } ; + + // Handle non-detected items + stream.next(); + return null; + }; + + CodeMirror.defineMode("protobuf", function() { + return {token: tokenBase}; + }); + + CodeMirror.defineMIME("text/x-protobuf", "protobuf"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/mscgen/mscgen.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// mode(s) for the sequence chart dsl's mscgen, xù and msgenny +// For more information on mscgen, see the site of the original author: +// http://www.mcternan.me.uk/mscgen +// +// This mode for mscgen and the two derivative languages were +// originally made for use in the mscgen_js interpreter +// (https://sverweij.github.io/mscgen_js) + +(function(mod) { + if ( typeof exports == "object" && typeof module == "object")// CommonJS + mod(require("../../lib/codemirror")); + else if ( typeof define == "function" && define.amd)// AMD + define(["../../lib/codemirror"], mod); + else// Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var languages = { + mscgen: { + "keywords" : ["msc"], + "options" : ["hscale", "width", "arcgradient", "wordwraparcs"], + "constants" : ["true", "false", "on", "off"], + "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], + "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists + "arcsWords" : ["note", "abox", "rbox", "box"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + }, + xu: { + "keywords" : ["msc", "xu"], + "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], + "constants" : ["true", "false", "on", "off", "auto"], + "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], + "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists + "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + }, + msgenny: { + "keywords" : null, + "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], + "constants" : ["true", "false", "on", "off", "auto"], + "attributes" : null, + "brackets" : ["\\{", "\\}"], + "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + } + } + + CodeMirror.defineMode("mscgen", function(_, modeConfig) { + var language = languages[modeConfig && modeConfig.language || "mscgen"] + return { + startState: startStateFn, + copyState: copyStateFn, + token: produceTokenFunction(language), + lineComment : "#", + blockCommentStart : "/*", + blockCommentEnd : "*/" + }; + }); + + CodeMirror.defineMIME("text/x-mscgen", "mscgen"); + CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"}); + CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"}); + + function wordRegexpBoundary(pWords) { + return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i"); + } + + function wordRegexp(pWords) { + return new RegExp("(" + pWords.join("|") + ")", "i"); + } + + function startStateFn() { + return { + inComment : false, + inString : false, + inAttributeList : false, + inScript : false + }; + } + + function copyStateFn(pState) { + return { + inComment : pState.inComment, + inString : pState.inString, + inAttributeList : pState.inAttributeList, + inScript : pState.inScript + }; + } + + function produceTokenFunction(pConfig) { + + return function(pStream, pState) { + if (pStream.match(wordRegexp(pConfig.brackets), true, true)) { + return "bracket"; + } + /* comments */ + if (!pState.inComment) { + if (pStream.match(/\/\*[^\*\/]*/, true, true)) { + pState.inComment = true; + return "comment"; + } + if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) { + pStream.skipToEnd(); + return "comment"; + } + } + if (pState.inComment) { + if (pStream.match(/[^\*\/]*\*\//, true, true)) + pState.inComment = false; + else + pStream.skipToEnd(); + return "comment"; + } + /* strings */ + if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) { + pState.inString = true; + return "string"; + } + if (pState.inString) { + if (pStream.match(/[^\"]*\"/, true, true)) + pState.inString = false; + else + pStream.skipToEnd(); + return "string"; + } + /* keywords & operators */ + if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true)) + return "keyword"; + + if (pStream.match(wordRegexpBoundary(pConfig.options), true, true)) + return "keyword"; + + if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true)) + return "keyword"; + + if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true)) + return "keyword"; + + if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true)) + return "operator"; + + if (!!pConfig.constants && pStream.match(wordRegexp(pConfig.constants), true, true)) + return "variable"; + + /* attribute lists */ + if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) { + pConfig.inAttributeList = true; + return "bracket"; + } + if (pConfig.inAttributeList) { + if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) { + return "attribute"; + } + if (pStream.match(/]/, true, true)) { + pConfig.inAttributeList = false; + return "bracket"; + } + } + + pStream.next(); + return "base"; + }; + } + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/django/django.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), + require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", + "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("django:inner", function() { + var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter", + "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import", + "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal", + "endifnotequal", "extends", "include", "load", "comment", "endcomment", + "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now", + "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", + "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless", + "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"], + filters = ["add", "addslashes", "capfirst", "center", "cut", "date", + "default", "default_if_none", "dictsort", + "dictsortreversed", "divisibleby", "escape", "escapejs", + "filesizeformat", "first", "floatformat", "force_escape", + "get_digit", "iriencode", "join", "last", "length", + "length_is", "linebreaks", "linebreaksbr", "linenumbers", + "ljust", "lower", "make_list", "phone2numeric", "pluralize", + "pprint", "random", "removetags", "rjust", "safe", + "safeseq", "slice", "slugify", "stringformat", "striptags", + "time", "timesince", "timeuntil", "title", "truncatechars", + "truncatechars_html", "truncatewords", "truncatewords_html", + "unordered_list", "upper", "urlencode", "urlize", + "urlizetrunc", "wordcount", "wordwrap", "yesno"], + operators = ["==", "!=", "<", ">", "<=", ">="], + wordOperators = ["in", "not", "or", "and"]; + + keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); + filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); + operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); + wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b"); + + // We have to return "null" instead of null, in order to avoid string + // styling as the default, when using Django templates inside HTML + // element attributes + function tokenBase (stream, state) { + // Attempt to identify a variable, template or comment tag respectively + if (stream.match("{{")) { + state.tokenize = inVariable; + return "tag"; + } else if (stream.match("{%")) { + state.tokenize = inTag; + return "tag"; + } else if (stream.match("{#")) { + state.tokenize = inComment; + return "comment"; + } + + // Ignore completely any stream series that do not match the + // Django template opening tags. + while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {} + return null; + } + + // A string can be included in either single or double quotes (this is + // the delimiter). Mark everything as a string until the start delimiter + // occurs again. + function inString (delimiter, previousTokenizer) { + return function (stream, state) { + if (!state.escapeNext && stream.eat(delimiter)) { + state.tokenize = previousTokenizer; + } else { + if (state.escapeNext) { + state.escapeNext = false; + } + + var ch = stream.next(); + + // Take into account the backslash for escaping characters, such as + // the string delimiter. + if (ch == "\\") { + state.escapeNext = true; + } + } + + return "string"; + }; + } + + // Apply Django template variable syntax highlighting + function inVariable (stream, state) { + // Attempt to match a dot that precedes a property + if (state.waitDot) { + state.waitDot = false; + + if (stream.peek() != ".") { + return "null"; + } + + // Dot followed by a non-word character should be considered an error. + if (stream.match(/\.\W+/)) { + return "error"; + } else if (stream.eat(".")) { + state.waitProperty = true; + return "null"; + } else { + throw Error ("Unexpected error while waiting for property."); + } + } + + // Attempt to match a pipe that precedes a filter + if (state.waitPipe) { + state.waitPipe = false; + + if (stream.peek() != "|") { + return "null"; + } + + // Pipe followed by a non-word character should be considered an error. + if (stream.match(/\.\W+/)) { + return "error"; + } else if (stream.eat("|")) { + state.waitFilter = true; + return "null"; + } else { + throw Error ("Unexpected error while waiting for filter."); + } + } + + // Highlight properties + if (state.waitProperty) { + state.waitProperty = false; + if (stream.match(/\b(\w+)\b/)) { + state.waitDot = true; // A property can be followed by another property + state.waitPipe = true; // A property can be followed by a filter + return "property"; + } + } + + // Highlight filters + if (state.waitFilter) { + state.waitFilter = false; + if (stream.match(filters)) { + return "variable-2"; + } + } + + // Ignore all white spaces + if (stream.eatSpace()) { + state.waitProperty = false; + return "null"; + } + + // Identify numbers + if (stream.match(/\b\d+(\.\d+)?\b/)) { + return "number"; + } + + // Identify strings + if (stream.match("'")) { + state.tokenize = inString("'", state.tokenize); + return "string"; + } else if (stream.match('"')) { + state.tokenize = inString('"', state.tokenize); + return "string"; + } + + // Attempt to find the variable + if (stream.match(/\b(\w+)\b/) && !state.foundVariable) { + state.waitDot = true; + state.waitPipe = true; // A property can be followed by a filter + return "variable"; + } + + // If found closing tag reset + if (stream.match("}}")) { + state.waitProperty = null; + state.waitFilter = null; + state.waitDot = null; + state.waitPipe = null; + state.tokenize = tokenBase; + return "tag"; + } + + // If nothing was found, advance to the next character + stream.next(); + return "null"; + } + + function inTag (stream, state) { + // Attempt to match a dot that precedes a property + if (state.waitDot) { + state.waitDot = false; + + if (stream.peek() != ".") { + return "null"; + } + + // Dot followed by a non-word character should be considered an error. + if (stream.match(/\.\W+/)) { + return "error"; + } else if (stream.eat(".")) { + state.waitProperty = true; + return "null"; + } else { + throw Error ("Unexpected error while waiting for property."); + } + } + + // Attempt to match a pipe that precedes a filter + if (state.waitPipe) { + state.waitPipe = false; + + if (stream.peek() != "|") { + return "null"; + } + + // Pipe followed by a non-word character should be considered an error. + if (stream.match(/\.\W+/)) { + return "error"; + } else if (stream.eat("|")) { + state.waitFilter = true; + return "null"; + } else { + throw Error ("Unexpected error while waiting for filter."); + } + } + + // Highlight properties + if (state.waitProperty) { + state.waitProperty = false; + if (stream.match(/\b(\w+)\b/)) { + state.waitDot = true; // A property can be followed by another property + state.waitPipe = true; // A property can be followed by a filter + return "property"; + } + } + + // Highlight filters + if (state.waitFilter) { + state.waitFilter = false; + if (stream.match(filters)) { + return "variable-2"; + } + } + + // Ignore all white spaces + if (stream.eatSpace()) { + state.waitProperty = false; + return "null"; + } + + // Identify numbers + if (stream.match(/\b\d+(\.\d+)?\b/)) { + return "number"; + } + + // Identify strings + if (stream.match("'")) { + state.tokenize = inString("'", state.tokenize); + return "string"; + } else if (stream.match('"')) { + state.tokenize = inString('"', state.tokenize); + return "string"; + } + + // Attempt to match an operator + if (stream.match(operators)) { + return "operator"; + } + + // Attempt to match a word operator + if (stream.match(wordOperators)) { + return "keyword"; + } + + // Attempt to match a keyword + var keywordMatch = stream.match(keywords); + if (keywordMatch) { + if (keywordMatch[0] == "comment") { + state.blockCommentTag = true; + } + return "keyword"; + } + + // Attempt to match a variable + if (stream.match(/\b(\w+)\b/)) { + state.waitDot = true; + state.waitPipe = true; // A property can be followed by a filter + return "variable"; + } + + // If found closing tag reset + if (stream.match("%}")) { + state.waitProperty = null; + state.waitFilter = null; + state.waitDot = null; + state.waitPipe = null; + // If the tag that closes is a block comment tag, we want to mark the + // following code as comment, until the tag closes. + if (state.blockCommentTag) { + state.blockCommentTag = false; // Release the "lock" + state.tokenize = inBlockComment; + } else { + state.tokenize = tokenBase; + } + return "tag"; + } + + // If nothing was found, advance to the next character + stream.next(); + return "null"; + } + + // Mark everything as comment inside the tag and the tag itself. + function inComment (stream, state) { + if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase + else stream.skipToEnd() + return "comment"; + } + + // Mark everything as a comment until the `blockcomment` tag closes. + function inBlockComment (stream, state) { + if (stream.match(/\{%\s*endcomment\s*%\}/, false)) { + state.tokenize = inTag; + stream.match("{%"); + return "tag"; + } else { + stream.next(); + return "comment"; + } + } + + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + }, + blockCommentStart: "{% comment %}", + blockCommentEnd: "{% endcomment %}" + }; + }); + + CodeMirror.defineMode("django", function(config) { + var htmlBase = CodeMirror.getMode(config, "text/html"); + var djangoInner = CodeMirror.getMode(config, "django:inner"); + return CodeMirror.overlayMode(htmlBase, djangoInner); + }); + + CodeMirror.defineMIME("text/x-django", "django"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/toml/toml.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("toml", function () { + return { + startState: function () { + return { + inString: false, + stringType: "", + lhs: true, + inArray: 0 + }; + }, + token: function (stream, state) { + //check for state changes + if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { + state.stringType = stream.peek(); + stream.next(); // Skip quote + state.inString = true; // Update state + } + if (stream.sol() && state.inArray === 0) { + state.lhs = true; + } + //return state + if (state.inString) { + while (state.inString && !stream.eol()) { + if (stream.peek() === state.stringType) { + stream.next(); // Skip quote + state.inString = false; // Clear flag + } else if (stream.peek() === '\\') { + stream.next(); + stream.next(); + } else { + stream.match(/^.[^\\\"\']*/); + } + } + return state.lhs ? "property string" : "string"; // Token style + } else if (state.inArray && stream.peek() === ']') { + stream.next(); + state.inArray--; + return 'bracket'; + } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) { + stream.next();//skip closing ] + // array of objects has an extra open & close [] + if (stream.peek() === ']') stream.next(); + return "atom"; + } else if (stream.peek() === "#") { + stream.skipToEnd(); + return "comment"; + } else if (stream.eatSpace()) { + return null; + } else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) { + return "property"; + } else if (state.lhs && stream.peek() === "=") { + stream.next(); + state.lhs = false; + return null; + } else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) { + return 'atom'; //date + } else if (!state.lhs && (stream.match('true') || stream.match('false'))) { + return 'atom'; + } else if (!state.lhs && stream.peek() === '[') { + state.inArray++; + stream.next(); + return 'bracket'; + } else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) { + return 'number'; + } else if (!stream.eatSpace()) { + stream.next(); + } + return null; + } + }; +}); + +CodeMirror.defineMIME('text/x-toml', 'toml'); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/yacas/yacas.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Yacas mode copyright (c) 2015 by Grzegorz Mazur +// Loosely based on mathematica mode by Calin Barbat + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('yacas', function(_config, _parserConfig) { + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var bodiedOps = words("Assert BackQuote D Defun Deriv For ForEach FromFile " + + "FromString Function Integrate InverseTaylor Limit " + + "LocalSymbols Macro MacroRule MacroRulePattern " + + "NIntegrate Rule RulePattern Subst TD TExplicitSum " + + "TSum Taylor Taylor1 Taylor2 Taylor3 ToFile " + + "ToStdout ToString TraceRule Until While"); + + // patterns + var pFloatForm = "(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)"; + var pIdentifier = "(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)"; + + // regular expressions + var reFloatForm = new RegExp(pFloatForm); + var reIdentifier = new RegExp(pIdentifier); + var rePattern = new RegExp(pIdentifier + "?_" + pIdentifier); + var reFunctionLike = new RegExp(pIdentifier + "\\s*\\("); + + function tokenBase(stream, state) { + var ch; + + // get next character + ch = stream.next(); + + // string + if (ch === '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + + // comment + if (ch === '/') { + if (stream.eat('*')) { + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + + // go back one character + stream.backUp(1); + + // update scope info + var m = stream.match(/^(\w+)\s*\(/, false); + if (m !== null && bodiedOps.hasOwnProperty(m[1])) + state.scopes.push('bodied'); + + var scope = currentScope(state); + + if (scope === 'bodied' && ch === '[') + state.scopes.pop(); + + if (ch === '[' || ch === '{' || ch === '(') + state.scopes.push(ch); + + scope = currentScope(state); + + if (scope === '[' && ch === ']' || + scope === '{' && ch === '}' || + scope === '(' && ch === ')') + state.scopes.pop(); + + if (ch === ';') { + while (scope === 'bodied') { + state.scopes.pop(); + scope = currentScope(state); + } + } + + // look for ordered rules + if (stream.match(/\d+ *#/, true, false)) { + return 'qualifier'; + } + + // look for numbers + if (stream.match(reFloatForm, true, false)) { + return 'number'; + } + + // look for placeholders + if (stream.match(rePattern, true, false)) { + return 'variable-3'; + } + + // match all braces separately + if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) { + return 'bracket'; + } + + // literals looking like function calls + if (stream.match(reFunctionLike, true, false)) { + stream.backUp(1); + return 'variable'; + } + + // all other identifiers + if (stream.match(reIdentifier, true, false)) { + return 'variable-2'; + } + + // operators; note that operators like @@ or /; are matched separately for each symbol. + if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%|#)/, true, false)) { + return 'operator'; + } + + // everything else is an error + return 'error'; + } + + function tokenString(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === '"' && !escaped) { + end = true; + break; + } + escaped = !escaped && next === '\\'; + } + if (end && !escaped) { + state.tokenize = tokenBase; + } + return 'string'; + }; + + function tokenComment(stream, state) { + var prev, next; + while((next = stream.next()) != null) { + if (prev === '*' && next === '/') { + state.tokenize = tokenBase; + break; + } + prev = next; + } + return 'comment'; + } + + function currentScope(state) { + var scope = null; + if (state.scopes.length > 0) + scope = state.scopes[state.scopes.length - 1]; + return scope; + } + + return { + startState: function() { + return { + tokenize: tokenBase, + scopes: [] + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + }, + indent: function(state, textAfter) { + if (state.tokenize !== tokenBase && state.tokenize !== null) + return CodeMirror.Pass; + + var delta = 0; + if (textAfter === ']' || textAfter === '];' || + textAfter === '}' || textAfter === '};' || + textAfter === ');') + delta = -1; + + return (state.scopes.length + delta) * _config.indentUnit; + }, + electricChars: "{}[]();", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME('text/x-yacas', { + name: 'yacas' +}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/dockerfile/dockerfile.min.js */ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/python/python.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var wordOperators = wordRegexp(["and", "or", "not", "is"]); + var commonKeywords = ["as", "assert", "break", "class", "continue", + "def", "del", "elif", "else", "except", "finally", + "for", "from", "global", "if", "import", + "lambda", "pass", "raise", "return", + "try", "while", "with", "yield", "in"]; + var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr", + "classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod", + "enumerate", "eval", "filter", "float", "format", "frozenset", + "getattr", "globals", "hasattr", "hash", "help", "hex", "id", + "input", "int", "isinstance", "issubclass", "iter", "len", + "list", "locals", "map", "max", "memoryview", "min", "next", + "object", "oct", "open", "ord", "pow", "property", "range", + "repr", "reversed", "round", "set", "setattr", "slice", + "sorted", "staticmethod", "str", "sum", "super", "tuple", + "type", "vars", "zip", "__import__", "NotImplemented", + "Ellipsis", "__debug__"]; + CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins)); + + function top(state) { + return state.scopes[state.scopes.length - 1]; + } + + CodeMirror.defineMode("python", function(conf, parserConf) { + var ERRORCLASS = "error"; + + var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/; + // (Backwards-compatiblity with old, cumbersome config system) + var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters, + parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/] + for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1) + + var hangingIndent = parserConf.hangingIndent || conf.indentUnit; + + var myKeywords = commonKeywords, myBuiltins = commonBuiltins; + if (parserConf.extra_keywords != undefined) + myKeywords = myKeywords.concat(parserConf.extra_keywords); + + if (parserConf.extra_builtins != undefined) + myBuiltins = myBuiltins.concat(parserConf.extra_builtins); + + var py3 = !(parserConf.version && Number(parserConf.version) < 3) + if (py3) { + // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator + var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/; + myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]); + myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]); + var stringPrefixes = new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))", "i"); + } else { + var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/; + myKeywords = myKeywords.concat(["exec", "print"]); + myBuiltins = myBuiltins.concat(["apply", "basestring", "buffer", "cmp", "coerce", "execfile", + "file", "intern", "long", "raw_input", "reduce", "reload", + "unichr", "unicode", "xrange", "False", "True", "None"]); + var stringPrefixes = new RegExp("^(([rubf]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); + } + var keywords = wordRegexp(myKeywords); + var builtins = wordRegexp(myBuiltins); + + // tokenizers + function tokenBase(stream, state) { + if (stream.sol()) state.indent = stream.indentation() + // Handle scope changes + if (stream.sol() && top(state).type == "py") { + var scopeOffset = top(state).offset; + if (stream.eatSpace()) { + var lineOffset = stream.indentation(); + if (lineOffset > scopeOffset) + pushPyScope(state); + else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != "#") + state.errorToken = true; + return null; + } else { + var style = tokenBaseInner(stream, state); + if (scopeOffset > 0 && dedent(stream, state)) + style += " " + ERRORCLASS; + return style; + } + } + return tokenBaseInner(stream, state); + } + + function tokenBaseInner(stream, state) { + if (stream.eatSpace()) return null; + + var ch = stream.peek(); + + // Handle Comments + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.]/, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } + if (stream.match(/^[\d_]+\.\d*/)) { floatLiteral = true; } + if (stream.match(/^\.\d+/)) { floatLiteral = true; } + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return "number"; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true; + // Binary + if (stream.match(/^0b[01_]+/i)) intLiteral = true; + // Octal + if (stream.match(/^0o[0-7_]+/i)) intLiteral = true; + // Decimal + if (stream.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + if (stream.match(/^0(?![\dx])/i)) intLiteral = true; + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return "number"; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + for (var i = 0; i < operators.length; i++) + if (stream.match(operators[i])) return "operator" + + if (stream.match(delimiters)) return "punctuation"; + + if (state.lastToken == "." && stream.match(identifiers)) + return "property"; + + if (stream.match(keywords) || stream.match(wordOperators)) + return "keyword"; + + if (stream.match(builtins)) + return "builtin"; + + if (stream.match(/^(self|cls)\b/)) + return "variable-2"; + + if (stream.match(identifiers)) { + if (state.lastToken == "def" || state.lastToken == "class") + return "def"; + return "variable"; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) + delimiter = delimiter.substr(1); + + var singleline = delimiter.length == 1; + var OUTCLASS = "string"; + + function tokenString(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"\\]/); + if (stream.eat("\\")) { + stream.next(); + if (singleline && stream.eol()) + return OUTCLASS; + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) + return ERRORCLASS; + else + state.tokenize = tokenBase; + } + return OUTCLASS; + } + tokenString.isString = true; + return tokenString; + } + + function pushPyScope(state) { + while (top(state).type != "py") state.scopes.pop() + state.scopes.push({offset: top(state).offset + conf.indentUnit, + type: "py", + align: null}) + } + + function pushBracketScope(stream, state, type) { + var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1 + state.scopes.push({offset: state.indent + hangingIndent, + type: type, + align: align}) + } + + function dedent(stream, state) { + var indented = stream.indentation(); + while (state.scopes.length > 1 && top(state).offset > indented) { + if (top(state).type != "py") return true; + state.scopes.pop(); + } + return top(state).offset != indented; + } + + function tokenLexer(stream, state) { + if (stream.sol()) state.beginningOfLine = true; + + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle decorators + if (state.beginningOfLine && current == "@") + return stream.match(identifiers, false) ? "meta" : py3 ? "operator" : ERRORCLASS; + + if (/\S/.test(current)) state.beginningOfLine = false; + + if ((style == "variable" || style == "builtin") + && state.lastToken == "meta") + style = "meta"; + + // Handle scope changes. + if (current == "pass" || current == "return") + state.dedent += 1; + + if (current == "lambda") state.lambda = true; + if (current == ":" && !state.lambda && top(state).type == "py") + pushPyScope(state); + + var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1; + if (delimiter_index != -1) + pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1)); + + delimiter_index = "])}".indexOf(current); + if (delimiter_index != -1) { + if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent + else return ERRORCLASS; + } + if (state.dedent > 0 && stream.eol() && top(state).type == "py") { + if (state.scopes.length > 1) state.scopes.pop(); + state.dedent -= 1; + } + + return style; + } + + var external = { + startState: function(basecolumn) { + return { + tokenize: tokenBase, + scopes: [{offset: basecolumn || 0, type: "py", align: null}], + indent: basecolumn || 0, + lastToken: null, + lambda: false, + dedent: 0 + }; + }, + + token: function(stream, state) { + var addErr = state.errorToken; + if (addErr) state.errorToken = false; + var style = tokenLexer(stream, state); + + if (style && style != "comment") + state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style; + if (style == "punctuation") style = null; + + if (stream.eol() && state.lambda) + state.lambda = false; + return addErr ? style + " " + ERRORCLASS : style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase) + return state.tokenize.isString ? CodeMirror.Pass : 0; + + var scope = top(state), closing = scope.type == textAfter.charAt(0) + if (scope.align != null) + return scope.align - (closing ? 1 : 0) + else + return scope.offset - (closing ? hangingIndent : 0) + }, + + electricInput: /^\s*[\}\]\)]$/, + closeBrackets: {triples: "'\""}, + lineComment: "#", + fold: "indent" + }; + return external; + }); + + CodeMirror.defineMIME("text/x-python", "python"); + + var words = function(str) { return str.split(" "); }; + + CodeMirror.defineMIME("text/x-cython", { + name: "python", + extra_keywords: words("by cdef cimport cpdef ctypedef enum except "+ + "extern gil include nogil property public "+ + "readonly struct union DEF IF ELIF ELSE") + }); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/vb/vb.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("vb", function(conf, parserConf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"); + var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); + var doubleOperators = new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); + var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); + var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + + var openingKeywords = ['class','module', 'sub','enum','select','while','if','function', 'get','set','property', 'try']; + var middleKeywords = ['else','elseif','case', 'catch']; + var endKeywords = ['next','loop']; + + var operatorKeywords = ['and', 'or', 'not', 'xor', 'in']; + var wordOperators = wordRegexp(operatorKeywords); + var commonKeywords = ['as', 'dim', 'break', 'continue','optional', 'then', 'until', + 'goto', 'byval','byref','new','handles','property', 'return', + 'const','private', 'protected', 'friend', 'public', 'shared', 'static', 'true','false']; + var commontypes = ['integer','string','double','decimal','boolean','short','char', 'float','single']; + + var keywords = wordRegexp(commonKeywords); + var types = wordRegexp(commontypes); + var stringPrefixes = '"'; + + var opening = wordRegexp(openingKeywords); + var middle = wordRegexp(middleKeywords); + var closing = wordRegexp(endKeywords); + var doubleClosing = wordRegexp(['end']); + var doOpening = wordRegexp(['do']); + + var indentInfo = null; + + CodeMirror.registerHelper("hintWords", "vb", openingKeywords.concat(middleKeywords).concat(endKeywords) + .concat(operatorKeywords).concat(commonKeywords).concat(commontypes)); + + function indent(_stream, state) { + state.currentIndent++; + } + + function dedent(_stream, state) { + state.currentIndent--; + } + // tokenizers + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle Comments + if (ch === "'") { + stream.skipToEnd(); + return 'comment'; + } + + + // Handle Number Literals + if (stream.match(/^((&H)|(&O))?[0-9\.a-f]/i, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^\d*\.\d+F?/i)) { floatLiteral = true; } + else if (stream.match(/^\d+\.\d*F?/)) { floatLiteral = true; } + else if (stream.match(/^\.\d+F?/)) { floatLiteral = true; } + + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } + // Octal + else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } + // Decimal + else if (stream.match(/^[1-9]\d*F?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return 'number'; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + // Handle operators and Delimiters + if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { + return null; + } + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return null; + } + if (stream.match(doOpening)) { + indent(stream,state); + state.doInCurrentLine = true; + return 'keyword'; + } + if (stream.match(opening)) { + if (! state.doInCurrentLine) + indent(stream,state); + else + state.doInCurrentLine = false; + return 'keyword'; + } + if (stream.match(middle)) { + return 'keyword'; + } + + if (stream.match(doubleClosing)) { + dedent(stream,state); + dedent(stream,state); + return 'keyword'; + } + if (stream.match(closing)) { + dedent(stream,state); + return 'keyword'; + } + + if (stream.match(types)) { + return 'keyword'; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + var singleline = delimiter.length == 1; + var OUTCLASS = 'string'; + + return function(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"]/); + if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + return ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return OUTCLASS; + }; + } + + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = state.tokenize(stream, state); + if (style === 'variable') { + return 'variable'; + } else { + return ERRORCLASS; + } + } + + + var delimiter_index = '[({'.indexOf(current); + if (delimiter_index !== -1) { + indent(stream, state ); + } + if (indentInfo === 'dedent') { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + delimiter_index = '])}'.indexOf(current); + if (delimiter_index !== -1) { + if (dedent(stream, state)) { + return ERRORCLASS; + } + } + + return style; + } + + var external = { + electricChars:"dDpPtTfFeE ", + startState: function() { + return { + tokenize: tokenBase, + lastToken: null, + currentIndent: 0, + nextLineIndent: 0, + doInCurrentLine: false + + + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.currentIndent += state.nextLineIndent; + state.nextLineIndent = 0; + state.doInCurrentLine = 0; + } + var style = tokenLexer(stream, state); + + state.lastToken = {style:style, content: stream.current()}; + + + + return style; + }, + + indent: function(state, textAfter) { + var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; + if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); + if(state.currentIndent < 0) return 0; + return state.currentIndent * conf.indentUnit; + }, + + lineComment: "'" + }; + return external; +}); + +CodeMirror.defineMIME("text/x-vb", "vb"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/octave/octave.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("octave", function() { + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"); + var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]'); + var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"); + var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"); + var tripleDelimiters = new RegExp("^((>>=)|(<<=))"); + var expressionEnd = new RegExp("^[\\]\\)]"); + var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"); + + var builtins = wordRegexp([ + 'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos', + 'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh', + 'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones', + 'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov', + 'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot', + 'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str', + 'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember' + ]); + + var keywords = wordRegexp([ + 'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction', + 'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events', + 'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until', + 'continue', 'pkg' + ]); + + + // tokenizers + function tokenTranspose(stream, state) { + if (!stream.sol() && stream.peek() === '\'') { + stream.next(); + state.tokenize = tokenBase; + return 'operator'; + } + state.tokenize = tokenBase; + return tokenBase(stream, state); + } + + + function tokenComment(stream, state) { + if (stream.match(/^.*%}/)) { + state.tokenize = tokenBase; + return 'comment'; + }; + stream.skipToEnd(); + return 'comment'; + } + + function tokenBase(stream, state) { + // whitespaces + if (stream.eatSpace()) return null; + + // Handle one line Comments + if (stream.match('%{')){ + state.tokenize = tokenComment; + stream.skipToEnd(); + return 'comment'; + } + + if (stream.match(/^[%#]/)){ + stream.skipToEnd(); + return 'comment'; + } + + // Handle Number Literals + if (stream.match(/^[0-9\.+-]/, false)) { + if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) { + stream.tokenize = tokenBase; + return 'number'; }; + if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; }; + if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; }; + } + if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; }; + + // Handle Strings + var m = stream.match(/^"(?:[^"]|"")*("|$)/) || stream.match(/^'(?:[^']|'')*('|$)/) + if (m) { return m[1] ? 'string' : "string error"; } + + // Handle words + if (stream.match(keywords)) { return 'keyword'; } ; + if (stream.match(builtins)) { return 'builtin'; } ; + if (stream.match(identifiers)) { return 'variable'; } ; + + if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; }; + if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; }; + + if (stream.match(expressionEnd)) { + state.tokenize = tokenTranspose; + return null; + }; + + + // Handle non-detected items + stream.next(); + return 'error'; + }; + + + return { + startState: function() { + return { + tokenize: tokenBase + }; + }, + + token: function(stream, state) { + var style = state.tokenize(stream, state); + if (style === 'number' || style === 'variable'){ + state.tokenize = tokenTranspose; + } + return style; + }, + + lineComment: '%', + + fold: 'indent' + }; +}); + +CodeMirror.defineMIME("text/x-octave", "octave"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/tcl/tcl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +//tcl mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("tcl", function() { + function parseWords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var keywords = parseWords("Tcl safe after append array auto_execok auto_import auto_load " + + "auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror " + + "binary break catch cd close concat continue dde eof encoding error " + + "eval exec exit expr fblocked fconfigure fcopy file fileevent filename " + + "filename flush for foreach format gets glob global history http if " + + "incr info interp join lappend lindex linsert list llength load lrange " + + "lreplace lsearch lset lsort memory msgcat namespace open package parray " + + "pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp " + + "registry regsub rename resource return scan seek set socket source split " + + "string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord " + + "tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest " + + "tclvars tell time trace unknown unset update uplevel upvar variable " + + "vwait"); + var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch"); + var isOperatorChar = /[+\-*&%=<>!?^\/\|]/; + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + function tokenBase(stream, state) { + var beforeParams = state.beforeParams; + state.beforeParams = false; + var ch = stream.next(); + if ((ch == '"' || ch == "'") && state.inParams) { + return chain(stream, state, tokenString(ch)); + } else if (/[\[\]{}\(\),;\.]/.test(ch)) { + if (ch == "(" && beforeParams) state.inParams = true; + else if (ch == ")") state.inParams = false; + return null; + } else if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } else if (ch == "#") { + if (stream.eat("*")) + return chain(stream, state, tokenComment); + if (ch == "#" && stream.match(/ *\[ *\[/)) + return chain(stream, state, tokenUnparsed); + stream.skipToEnd(); + return "comment"; + } else if (ch == '"') { + stream.skipTo(/"/); + return "comment"; + } else if (ch == "$") { + stream.eatWhile(/[$_a-z0-9A-Z\.{:]/); + stream.eatWhile(/}/); + state.beforeParams = true; + return "builtin"; + } else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "comment"; + } else { + stream.eatWhile(/[\w\$_{}\xa1-\uffff]/); + var word = stream.current().toLowerCase(); + if (keywords && keywords.propertyIsEnumerable(word)) + return "keyword"; + if (functions && functions.propertyIsEnumerable(word)) { + state.beforeParams = true; + return "keyword"; + } + return null; + } + } + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end) state.tokenize = tokenBase; + return "string"; + }; + } + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "#" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + function tokenUnparsed(stream, state) { + var maybeEnd = 0, ch; + while (ch = stream.next()) { + if (ch == "#" && maybeEnd == 2) { + state.tokenize = tokenBase; + break; + } + if (ch == "]") + maybeEnd++; + else if (ch != " ") + maybeEnd = 0; + } + return "meta"; + } + return { + startState: function() { + return { + tokenize: tokenBase, + beforeParams: false, + inParams: false + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + } + }; +}); +CodeMirror.defineMIME("text/x-tcl", "tcl"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/clojure/clojure.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Author: Hans Engel + * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("clojure", function (options) { + var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2", + ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword", VAR = "variable"; + var INDENT_WORD_SKIP = options.indentUnit || 2; + var NORMAL_INDENT_UNIT = options.indentUnit || 2; + + function makeKeywords(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var atoms = makeKeywords("true false nil"); + + var keywords = makeKeywords( + "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest " + + "slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn " + + "do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync " + + "doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars " + + "binding gen-class gen-and-load-class gen-and-save-class handler-case handle"); + + var builtins = makeKeywords( + "* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* " + + "*compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* " + + "*math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* " + + "*source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> " + + "->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor " + + "aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! " + + "alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double " + + "aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 " + + "bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set " + + "bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast " + + "byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append " + + "chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors " + + "clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp " + + "conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? " + + "declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol " + + "defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc " + + "dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last " + + "drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info " + + "extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword " + + "find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? " + + "fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? " + + "gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash " + + "hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? " + + "int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep " + + "keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file " + + "load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array " + + "make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods " + + "min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty " + + "not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias " + + "ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all " + + "partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers " + + "primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str " + + "prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues " + + "quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern " + + "re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history " + + "ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods " + + "remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest " + + "restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? " + + "seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts " + + "shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? " + + "special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol " + + "symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce " + + "transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec " + + "unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int " + + "unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int "+ + "unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote " + + "unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of " + + "vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context " + + "with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap " + + "*default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! " + + "set-agent-send-off-executor! some-> some->>"); + + var indentKeys = makeKeywords( + // Built-ins + "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto " + + "locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type " + + "try catch " + + + // Binding forms + "let letfn binding loop for doseq dotimes when-let if-let " + + + // Data structures + "defstruct struct-map assoc " + + + // clojure.test + "testing deftest " + + + // contrib + "handler-case handle dotrace deftrace"); + + var tests = { + digit: /\d/, + digit_or_colon: /[\d:]/, + hex: /[0-9a-f]/i, + sign: /[+-]/, + exponent: /e/i, + keyword_char: /[^\s\(\[\;\)\]]/, + symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/, + block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/ + }; + + function stateStack(indent, type, prev) { // represents a state stack object + this.indent = indent; + this.type = type; + this.prev = prev; + } + + function pushStack(state, indent, type) { + state.indentStack = new stateStack(indent, type, state.indentStack); + } + + function popStack(state) { + state.indentStack = state.indentStack.prev; + } + + function isNumber(ch, stream){ + // hex + if ( ch === '0' && stream.eat(/x/i) ) { + stream.eatWhile(tests.hex); + return true; + } + + // leading sign + if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) { + stream.eat(tests.sign); + ch = stream.next(); + } + + if ( tests.digit.test(ch) ) { + stream.eat(ch); + stream.eatWhile(tests.digit); + + if ( '.' == stream.peek() ) { + stream.eat('.'); + stream.eatWhile(tests.digit); + } else if ('/' == stream.peek() ) { + stream.eat('/'); + stream.eatWhile(tests.digit); + } + + if ( stream.eat(tests.exponent) ) { + stream.eat(tests.sign); + stream.eatWhile(tests.digit); + } + + return true; + } + + return false; + } + + // Eat character that starts after backslash \ + function eatCharacter(stream) { + var first = stream.next(); + // Read special literals: backspace, newline, space, return. + // Just read all lowercase letters. + if (first && first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) { + return; + } + // Read unicode character: \u1000 \uA0a1 + if (first === "u") { + stream.match(/[0-9a-z]{4}/i, true); + } + } + + return { + startState: function () { + return { + indentStack: null, + indentation: 0, + mode: false + }; + }, + + token: function (stream, state) { + if (state.indentStack == null && stream.sol()) { + // update indentation, but only if indentStack is empty + state.indentation = stream.indentation(); + } + + // skip spaces + if (state.mode != "string" && stream.eatSpace()) { + return null; + } + var returnType = null; + + switch(state.mode){ + case "string": // multi-line string parsing mode + var next, escaped = false; + while ((next = stream.next()) != null) { + if (next == "\"" && !escaped) { + + state.mode = false; + break; + } + escaped = !escaped && next == "\\"; + } + returnType = STRING; // continue on in string mode + break; + default: // default parsing mode + var ch = stream.next(); + + if (ch == "\"") { + state.mode = "string"; + returnType = STRING; + } else if (ch == "\\") { + eatCharacter(stream); + returnType = CHARACTER; + } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { + returnType = ATOM; + } else if (ch == ";") { // comment + stream.skipToEnd(); // rest of the line is a comment + returnType = COMMENT; + } else if (isNumber(ch,stream)){ + returnType = NUMBER; + } else if (ch == "(" || ch == "[" || ch == "{" ) { + var keyWord = '', indentTemp = stream.column(), letter; + /** + Either + (indent-word .. + (non-indent-word .. + (;something else, bracket, etc. + */ + + if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) { + keyWord += letter; + } + + if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) || + tests.block_indent.test(keyWord))) { // indent-word + pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); + } else { // non-indent word + // we continue eating the spaces + stream.eatSpace(); + if (stream.eol() || stream.peek() == ";") { + // nothing significant after + // we restart indentation the user defined spaces after + pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch); + } else { + pushStack(state, indentTemp + stream.current().length, ch); // else we match + } + } + stream.backUp(stream.current().length - 1); // undo all the eating + + returnType = BRACKET; + } else if (ch == ")" || ch == "]" || ch == "}") { + returnType = BRACKET; + if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) { + popStack(state); + } + } else if ( ch == ":" ) { + stream.eatWhile(tests.symbol); + return ATOM; + } else { + stream.eatWhile(tests.symbol); + + if (keywords && keywords.propertyIsEnumerable(stream.current())) { + returnType = KEYWORD; + } else if (builtins && builtins.propertyIsEnumerable(stream.current())) { + returnType = BUILTIN; + } else if (atoms && atoms.propertyIsEnumerable(stream.current())) { + returnType = ATOM; + } else { + returnType = VAR; + } + } + } + + return returnType; + }, + + indent: function (state) { + if (state.indentStack == null) return state.indentation; + return state.indentStack.indent; + }, + + closeBrackets: {pairs: "()[]{}\"\""}, + lineComment: ";;" + }; +}); + +CodeMirror.defineMIME("text/x-clojure", "clojure"); +CodeMirror.defineMIME("text/x-clojurescript", "clojure"); +CodeMirror.defineMIME("application/edn", "clojure"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/sass/sass.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../css/css")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../css/css"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("sass", function(config) { + var cssMode = CodeMirror.mimeModes["text/css"]; + var propertyKeywords = cssMode.propertyKeywords || {}, + colorKeywords = cssMode.colorKeywords || {}, + valueKeywords = cssMode.valueKeywords || {}, + fontProperties = cssMode.fontProperties || {}; + + function tokenRegexp(words) { + return new RegExp("^" + words.join("|")); + } + + var keywords = ["true", "false", "null", "auto"]; + var keywordsRegexp = new RegExp("^" + keywords.join("|")); + + var operators = ["\\(", "\\)", "=", ">", "<", "==", ">=", "<=", "\\+", "-", + "\\!=", "/", "\\*", "%", "and", "or", "not", ";","\\{","\\}",":"]; + var opRegexp = tokenRegexp(operators); + + var pseudoElementsRegexp = /^::?[a-zA-Z_][\w\-]*/; + + var word; + + function isEndLine(stream) { + return !stream.peek() || stream.match(/\s+$/, false); + } + + function urlTokens(stream, state) { + var ch = stream.peek(); + + if (ch === ")") { + stream.next(); + state.tokenizer = tokenBase; + return "operator"; + } else if (ch === "(") { + stream.next(); + stream.eatSpace(); + + return "operator"; + } else if (ch === "'" || ch === '"') { + state.tokenizer = buildStringTokenizer(stream.next()); + return "string"; + } else { + state.tokenizer = buildStringTokenizer(")", false); + return "string"; + } + } + function comment(indentation, multiLine) { + return function(stream, state) { + if (stream.sol() && stream.indentation() <= indentation) { + state.tokenizer = tokenBase; + return tokenBase(stream, state); + } + + if (multiLine && stream.skipTo("*/")) { + stream.next(); + stream.next(); + state.tokenizer = tokenBase; + } else { + stream.skipToEnd(); + } + + return "comment"; + }; + } + + function buildStringTokenizer(quote, greedy) { + if (greedy == null) { greedy = true; } + + function stringTokenizer(stream, state) { + var nextChar = stream.next(); + var peekChar = stream.peek(); + var previousChar = stream.string.charAt(stream.pos-2); + + var endingString = ((nextChar !== "\\" && peekChar === quote) || (nextChar === quote && previousChar !== "\\")); + + if (endingString) { + if (nextChar !== quote && greedy) { stream.next(); } + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + state.tokenizer = tokenBase; + return "string"; + } else if (nextChar === "#" && peekChar === "{") { + state.tokenizer = buildInterpolationTokenizer(stringTokenizer); + stream.next(); + return "operator"; + } else { + return "string"; + } + } + + return stringTokenizer; + } + + function buildInterpolationTokenizer(currentTokenizer) { + return function(stream, state) { + if (stream.peek() === "}") { + stream.next(); + state.tokenizer = currentTokenizer; + return "operator"; + } else { + return tokenBase(stream, state); + } + }; + } + + function indent(state) { + if (state.indentCount == 0) { + state.indentCount++; + var lastScopeOffset = state.scopes[0].offset; + var currentOffset = lastScopeOffset + config.indentUnit; + state.scopes.unshift({ offset:currentOffset }); + } + } + + function dedent(state) { + if (state.scopes.length == 1) return; + + state.scopes.shift(); + } + + function tokenBase(stream, state) { + var ch = stream.peek(); + + // Comment + if (stream.match("/*")) { + state.tokenizer = comment(stream.indentation(), true); + return state.tokenizer(stream, state); + } + if (stream.match("//")) { + state.tokenizer = comment(stream.indentation(), false); + return state.tokenizer(stream, state); + } + + // Interpolation + if (stream.match("#{")) { + state.tokenizer = buildInterpolationTokenizer(tokenBase); + return "operator"; + } + + // Strings + if (ch === '"' || ch === "'") { + stream.next(); + state.tokenizer = buildStringTokenizer(ch); + return "string"; + } + + if(!state.cursorHalf){// state.cursorHalf === 0 + // first half i.e. before : for key-value pairs + // including selectors + + if (ch === "-") { + if (stream.match(/^-\w+-/)) { + return "meta"; + } + } + + if (ch === ".") { + stream.next(); + if (stream.match(/^[\w-]+/)) { + indent(state); + return "qualifier"; + } else if (stream.peek() === "#") { + indent(state); + return "tag"; + } + } + + if (ch === "#") { + stream.next(); + // ID selectors + if (stream.match(/^[\w-]+/)) { + indent(state); + return "builtin"; + } + if (stream.peek() === "#") { + indent(state); + return "tag"; + } + } + + // Variables + if (ch === "$") { + stream.next(); + stream.eatWhile(/[\w-]/); + return "variable-2"; + } + + // Numbers + if (stream.match(/^-?[0-9\.]+/)) + return "number"; + + // Units + if (stream.match(/^(px|em|in)\b/)) + return "unit"; + + if (stream.match(keywordsRegexp)) + return "keyword"; + + if (stream.match(/^url/) && stream.peek() === "(") { + state.tokenizer = urlTokens; + return "atom"; + } + + if (ch === "=") { + // Match shortcut mixin definition + if (stream.match(/^=[\w-]+/)) { + indent(state); + return "meta"; + } + } + + if (ch === "+") { + // Match shortcut mixin definition + if (stream.match(/^\+[\w-]+/)){ + return "variable-3"; + } + } + + if(ch === "@"){ + if(stream.match(/@extend/)){ + if(!stream.match(/\s*[\w]/)) + dedent(state); + } + } + + + // Indent Directives + if (stream.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)) { + indent(state); + return "def"; + } + + // Other Directives + if (ch === "@") { + stream.next(); + stream.eatWhile(/[\w-]/); + return "def"; + } + + if (stream.eatWhile(/[\w-]/)){ + if(stream.match(/ *: *[\w-\+\$#!\("']/,false)){ + word = stream.current().toLowerCase(); + var prop = state.prevProp + "-" + word; + if (propertyKeywords.hasOwnProperty(prop)) { + return "property"; + } else if (propertyKeywords.hasOwnProperty(word)) { + state.prevProp = word; + return "property"; + } else if (fontProperties.hasOwnProperty(word)) { + return "property"; + } + return "tag"; + } + else if(stream.match(/ *:/,false)){ + indent(state); + state.cursorHalf = 1; + state.prevProp = stream.current().toLowerCase(); + return "property"; + } + else if(stream.match(/ *,/,false)){ + return "tag"; + } + else{ + indent(state); + return "tag"; + } + } + + if(ch === ":"){ + if (stream.match(pseudoElementsRegexp)){ // could be a pseudo-element + return "variable-3"; + } + stream.next(); + state.cursorHalf=1; + return "operator"; + } + + } // cursorHalf===0 ends here + else{ + + if (ch === "#") { + stream.next(); + // Hex numbers + if (stream.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){ + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "number"; + } + } + + // Numbers + if (stream.match(/^-?[0-9\.]+/)){ + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "number"; + } + + // Units + if (stream.match(/^(px|em|in)\b/)){ + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "unit"; + } + + if (stream.match(keywordsRegexp)){ + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "keyword"; + } + + if (stream.match(/^url/) && stream.peek() === "(") { + state.tokenizer = urlTokens; + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "atom"; + } + + // Variables + if (ch === "$") { + stream.next(); + stream.eatWhile(/[\w-]/); + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "variable-2"; + } + + // bang character for !important, !default, etc. + if (ch === "!") { + stream.next(); + state.cursorHalf = 0; + return stream.match(/^[\w]+/) ? "keyword": "operator"; + } + + if (stream.match(opRegexp)){ + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + return "operator"; + } + + // attributes + if (stream.eatWhile(/[\w-]/)) { + if (isEndLine(stream)) { + state.cursorHalf = 0; + } + word = stream.current().toLowerCase(); + if (valueKeywords.hasOwnProperty(word)) { + return "atom"; + } else if (colorKeywords.hasOwnProperty(word)) { + return "keyword"; + } else if (propertyKeywords.hasOwnProperty(word)) { + state.prevProp = stream.current().toLowerCase(); + return "property"; + } else { + return "tag"; + } + } + + //stream.eatSpace(); + if (isEndLine(stream)) { + state.cursorHalf = 0; + return null; + } + + } // else ends here + + if (stream.match(opRegexp)) + return "operator"; + + // If we haven't returned by now, we move 1 character + // and return an error + stream.next(); + return null; + } + + function tokenLexer(stream, state) { + if (stream.sol()) state.indentCount = 0; + var style = state.tokenizer(stream, state); + var current = stream.current(); + + if (current === "@return" || current === "}"){ + dedent(state); + } + + if (style !== null) { + var startOfToken = stream.pos - current.length; + + var withCurrentIndent = startOfToken + (config.indentUnit * state.indentCount); + + var newScopes = []; + + for (var i = 0; i < state.scopes.length; i++) { + var scope = state.scopes[i]; + + if (scope.offset <= withCurrentIndent) + newScopes.push(scope); + } + + state.scopes = newScopes; + } + + + return style; + } + + return { + startState: function() { + return { + tokenizer: tokenBase, + scopes: [{offset: 0, type: "sass"}], + indentCount: 0, + cursorHalf: 0, // cursor half tells us if cursor lies after (1) + // or before (0) colon (well... more or less) + definedVars: [], + definedMixins: [] + }; + }, + token: function(stream, state) { + var style = tokenLexer(stream, state); + + state.lastToken = { style: style, content: stream.current() }; + + return style; + }, + + indent: function(state) { + return state.scopes[0].offset; + } + }; +}, "css"); + +CodeMirror.defineMIME("text/x-sass", "sass"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/gas/gas.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("gas", function(_config, parserConfig) { + 'use strict'; + + // If an architecture is specified, its initialization function may + // populate this array with custom parsing functions which will be + // tried in the event that the standard functions do not find a match. + var custom = []; + + // The symbol used to start a line comment changes based on the target + // architecture. + // If no architecture is pased in "parserConfig" then only multiline + // comments will have syntax support. + var lineCommentStartSymbol = ""; + + // These directives are architecture independent. + // Machine specific directives should go in their respective + // architecture initialization function. + // Reference: + // http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops + var directives = { + ".abort" : "builtin", + ".align" : "builtin", + ".altmacro" : "builtin", + ".ascii" : "builtin", + ".asciz" : "builtin", + ".balign" : "builtin", + ".balignw" : "builtin", + ".balignl" : "builtin", + ".bundle_align_mode" : "builtin", + ".bundle_lock" : "builtin", + ".bundle_unlock" : "builtin", + ".byte" : "builtin", + ".cfi_startproc" : "builtin", + ".comm" : "builtin", + ".data" : "builtin", + ".def" : "builtin", + ".desc" : "builtin", + ".dim" : "builtin", + ".double" : "builtin", + ".eject" : "builtin", + ".else" : "builtin", + ".elseif" : "builtin", + ".end" : "builtin", + ".endef" : "builtin", + ".endfunc" : "builtin", + ".endif" : "builtin", + ".equ" : "builtin", + ".equiv" : "builtin", + ".eqv" : "builtin", + ".err" : "builtin", + ".error" : "builtin", + ".exitm" : "builtin", + ".extern" : "builtin", + ".fail" : "builtin", + ".file" : "builtin", + ".fill" : "builtin", + ".float" : "builtin", + ".func" : "builtin", + ".global" : "builtin", + ".gnu_attribute" : "builtin", + ".hidden" : "builtin", + ".hword" : "builtin", + ".ident" : "builtin", + ".if" : "builtin", + ".incbin" : "builtin", + ".include" : "builtin", + ".int" : "builtin", + ".internal" : "builtin", + ".irp" : "builtin", + ".irpc" : "builtin", + ".lcomm" : "builtin", + ".lflags" : "builtin", + ".line" : "builtin", + ".linkonce" : "builtin", + ".list" : "builtin", + ".ln" : "builtin", + ".loc" : "builtin", + ".loc_mark_labels" : "builtin", + ".local" : "builtin", + ".long" : "builtin", + ".macro" : "builtin", + ".mri" : "builtin", + ".noaltmacro" : "builtin", + ".nolist" : "builtin", + ".octa" : "builtin", + ".offset" : "builtin", + ".org" : "builtin", + ".p2align" : "builtin", + ".popsection" : "builtin", + ".previous" : "builtin", + ".print" : "builtin", + ".protected" : "builtin", + ".psize" : "builtin", + ".purgem" : "builtin", + ".pushsection" : "builtin", + ".quad" : "builtin", + ".reloc" : "builtin", + ".rept" : "builtin", + ".sbttl" : "builtin", + ".scl" : "builtin", + ".section" : "builtin", + ".set" : "builtin", + ".short" : "builtin", + ".single" : "builtin", + ".size" : "builtin", + ".skip" : "builtin", + ".sleb128" : "builtin", + ".space" : "builtin", + ".stab" : "builtin", + ".string" : "builtin", + ".struct" : "builtin", + ".subsection" : "builtin", + ".symver" : "builtin", + ".tag" : "builtin", + ".text" : "builtin", + ".title" : "builtin", + ".type" : "builtin", + ".uleb128" : "builtin", + ".val" : "builtin", + ".version" : "builtin", + ".vtable_entry" : "builtin", + ".vtable_inherit" : "builtin", + ".warning" : "builtin", + ".weak" : "builtin", + ".weakref" : "builtin", + ".word" : "builtin" + }; + + var registers = {}; + + function x86(_parserConfig) { + lineCommentStartSymbol = "#"; + + registers.ax = "variable"; + registers.eax = "variable-2"; + registers.rax = "variable-3"; + + registers.bx = "variable"; + registers.ebx = "variable-2"; + registers.rbx = "variable-3"; + + registers.cx = "variable"; + registers.ecx = "variable-2"; + registers.rcx = "variable-3"; + + registers.dx = "variable"; + registers.edx = "variable-2"; + registers.rdx = "variable-3"; + + registers.si = "variable"; + registers.esi = "variable-2"; + registers.rsi = "variable-3"; + + registers.di = "variable"; + registers.edi = "variable-2"; + registers.rdi = "variable-3"; + + registers.sp = "variable"; + registers.esp = "variable-2"; + registers.rsp = "variable-3"; + + registers.bp = "variable"; + registers.ebp = "variable-2"; + registers.rbp = "variable-3"; + + registers.ip = "variable"; + registers.eip = "variable-2"; + registers.rip = "variable-3"; + + registers.cs = "keyword"; + registers.ds = "keyword"; + registers.ss = "keyword"; + registers.es = "keyword"; + registers.fs = "keyword"; + registers.gs = "keyword"; + } + + function armv6(_parserConfig) { + // Reference: + // http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf + // http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf + lineCommentStartSymbol = "@"; + directives.syntax = "builtin"; + + registers.r0 = "variable"; + registers.r1 = "variable"; + registers.r2 = "variable"; + registers.r3 = "variable"; + registers.r4 = "variable"; + registers.r5 = "variable"; + registers.r6 = "variable"; + registers.r7 = "variable"; + registers.r8 = "variable"; + registers.r9 = "variable"; + registers.r10 = "variable"; + registers.r11 = "variable"; + registers.r12 = "variable"; + + registers.sp = "variable-2"; + registers.lr = "variable-2"; + registers.pc = "variable-2"; + registers.r13 = registers.sp; + registers.r14 = registers.lr; + registers.r15 = registers.pc; + + custom.push(function(ch, stream) { + if (ch === '#') { + stream.eatWhile(/\w/); + return "number"; + } + }); + } + + var arch = (parserConfig.architecture || "x86").toLowerCase(); + if (arch === "x86") { + x86(parserConfig); + } else if (arch === "arm" || arch === "armv6") { + armv6(parserConfig); + } + + function nextUntilUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next === end && !escaped) { + return false; + } + escaped = !escaped && next === "\\"; + } + return escaped; + } + + function clikeComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (ch === "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch === "*"); + } + return "comment"; + } + + return { + startState: function() { + return { + tokenize: null + }; + }, + + token: function(stream, state) { + if (state.tokenize) { + return state.tokenize(stream, state); + } + + if (stream.eatSpace()) { + return null; + } + + var style, cur, ch = stream.next(); + + if (ch === "/") { + if (stream.eat("*")) { + state.tokenize = clikeComment; + return clikeComment(stream, state); + } + } + + if (ch === lineCommentStartSymbol) { + stream.skipToEnd(); + return "comment"; + } + + if (ch === '"') { + nextUntilUnescaped(stream, '"'); + return "string"; + } + + if (ch === '.') { + stream.eatWhile(/\w/); + cur = stream.current().toLowerCase(); + style = directives[cur]; + return style || null; + } + + if (ch === '=') { + stream.eatWhile(/\w/); + return "tag"; + } + + if (ch === '{') { + return "braket"; + } + + if (ch === '}') { + return "braket"; + } + + if (/\d/.test(ch)) { + if (ch === "0" && stream.eat("x")) { + stream.eatWhile(/[0-9a-fA-F]/); + return "number"; + } + stream.eatWhile(/\d/); + return "number"; + } + + if (/\w/.test(ch)) { + stream.eatWhile(/\w/); + if (stream.eat(":")) { + return 'tag'; + } + cur = stream.current().toLowerCase(); + style = registers[cur]; + return style || null; + } + + for (var i = 0; i < custom.length; i++) { + style = custom[i](ch, stream, state); + if (style) { + return style; + } + } + }, + + lineComment: lineCommentStartSymbol, + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/sas/sas.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + + +// SAS mode copyright (c) 2016 Jared Dean, SAS Institute +// Created by Jared Dean + +// TODO +// indent and de-indent +// identify macro variables + + +//Definitions +// comment -- text within * ; or /* */ +// keyword -- SAS language variable +// variable -- macro variables starts with '&' or variable formats +// variable-2 -- DATA Step, proc, or macro names +// string -- text within ' ' or " " +// operator -- numeric operator + / - * ** le eq ge ... and so on +// builtin -- proc %macro data run mend +// atom +// def + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("sas", function () { + var words = {}; + var isDoubleOperatorSym = { + eq: 'operator', + lt: 'operator', + le: 'operator', + gt: 'operator', + ge: 'operator', + "in": 'operator', + ne: 'operator', + or: 'operator' + }; + var isDoubleOperatorChar = /(<=|>=|!=|<>)/; + var isSingleOperatorChar = /[=\(:\),{}.*<>+\-\/^\[\]]/; + + // Takes a string of words separated by spaces and adds them as + // keys with the value of the first argument 'style' + function define(style, string, context) { + if (context) { + var split = string.split(' '); + for (var i = 0; i < split.length; i++) { + words[split[i]] = {style: style, state: context}; + } + } + } + //datastep + define('def', 'stack pgm view source debug nesting nolist', ['inDataStep']); + define('def', 'if while until for do do; end end; then else cancel', ['inDataStep']); + define('def', 'label format _n_ _error_', ['inDataStep']); + define('def', 'ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME', ['inDataStep']); + define('def', 'filevar finfo finv fipname fipnamel fipstate first firstobs floor', ['inDataStep']); + define('def', 'varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday', ['inDataStep']); + define('def', 'zipfips zipname zipnamel zipstate', ['inDataStep']); + define('def', 'put putc putn', ['inDataStep']); + define('builtin', 'data run', ['inDataStep']); + + + //proc + define('def', 'data', ['inProc']); + + // flow control for macros + define('def', '%if %end %end; %else %else; %do %do; %then', ['inMacro']); + + //everywhere + define('builtin', 'proc run; quit; libname filename %macro %mend option options', ['ALL']); + + define('def', 'footnote title libname ods', ['ALL']); + define('def', '%let %put %global %sysfunc %eval ', ['ALL']); + // automatic macro variables http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003167023.htm + define('variable', '&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext', ['ALL']); + + //footnote[1-9]? title[1-9]? + + //options statement + define('def', 'source2 nosource2 page pageno pagesize', ['ALL']); + + //proc and datastep + define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']); + define('operator', 'and not ', ['inDataStep', 'inProc']); + + // Main function + function tokenize(stream, state) { + // Finally advance the stream + var ch = stream.next(); + + // BLOCKCOMMENT + if (ch === '/' && stream.eat('*')) { + state.continueComment = true; + return "comment"; + } else if (state.continueComment === true) { // in comment block + //comment ends at the beginning of the line + if (ch === '*' && stream.peek() === '/') { + stream.next(); + state.continueComment = false; + } else if (stream.skipTo('*')) { //comment is potentially later in line + stream.skipTo('*'); + stream.next(); + if (stream.eat('/')) + state.continueComment = false; + } else { + stream.skipToEnd(); + } + return "comment"; + } + + if (ch == "*" && stream.column() == stream.indentation()) { + stream.skipToEnd() + return "comment" + } + + // DoubleOperator match + var doubleOperator = ch + stream.peek(); + + if ((ch === '"' || ch === "'") && !state.continueString) { + state.continueString = ch + return "string" + } else if (state.continueString) { + if (state.continueString == ch) { + state.continueString = null; + } else if (stream.skipTo(state.continueString)) { + // quote found on this line + stream.next(); + state.continueString = null; + } else { + stream.skipToEnd(); + } + return "string"; + } else if (state.continueString !== null && stream.eol()) { + stream.skipTo(state.continueString) || stream.skipToEnd(); + return "string"; + } else if (/[\d\.]/.test(ch)) { //find numbers + if (ch === ".") + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + else if (ch === "0") + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + else + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + return "number"; + } else if (isDoubleOperatorChar.test(ch + stream.peek())) { // TWO SYMBOL TOKENS + stream.next(); + return "operator"; + } else if (isDoubleOperatorSym.hasOwnProperty(doubleOperator)) { + stream.next(); + if (stream.peek() === ' ') + return isDoubleOperatorSym[doubleOperator.toLowerCase()]; + } else if (isSingleOperatorChar.test(ch)) { // SINGLE SYMBOL TOKENS + return "operator"; + } + + // Matches one whole word -- even if the word is a character + var word; + if (stream.match(/[%&;\w]+/, false) != null) { + word = ch + stream.match(/[%&;\w]+/, true); + if (/&/.test(word)) return 'variable' + } else { + word = ch; + } + // the word after DATA PROC or MACRO + if (state.nextword) { + stream.match(/[\w]+/); + // match memname.libname + if (stream.peek() === '.') stream.skipTo(' '); + state.nextword = false; + return 'variable-2'; + } + + word = word.toLowerCase() + // Are we in a DATA Step? + if (state.inDataStep) { + if (word === 'run;' || stream.match(/run\s;/)) { + state.inDataStep = false; + return 'builtin'; + } + // variable formats + if ((word) && stream.next() === '.') { + //either a format or libname.memname + if (/\w/.test(stream.peek())) return 'variable-2'; + else return 'variable'; + } + // do we have a DATA Step keyword + if (word && words.hasOwnProperty(word) && + (words[word].state.indexOf("inDataStep") !== -1 || + words[word].state.indexOf("ALL") !== -1)) { + //backup to the start of the word + if (stream.start < stream.pos) + stream.backUp(stream.pos - stream.start); + //advance the length of the word and return + for (var i = 0; i < word.length; ++i) stream.next(); + return words[word].style; + } + } + // Are we in an Proc statement? + if (state.inProc) { + if (word === 'run;' || word === 'quit;') { + state.inProc = false; + return 'builtin'; + } + // do we have a proc keyword + if (word && words.hasOwnProperty(word) && + (words[word].state.indexOf("inProc") !== -1 || + words[word].state.indexOf("ALL") !== -1)) { + stream.match(/[\w]+/); + return words[word].style; + } + } + // Are we in a Macro statement? + if (state.inMacro) { + if (word === '%mend') { + if (stream.peek() === ';') stream.next(); + state.inMacro = false; + return 'builtin'; + } + if (word && words.hasOwnProperty(word) && + (words[word].state.indexOf("inMacro") !== -1 || + words[word].state.indexOf("ALL") !== -1)) { + stream.match(/[\w]+/); + return words[word].style; + } + + return 'atom'; + } + // Do we have Keywords specific words? + if (word && words.hasOwnProperty(word)) { + // Negates the initial next() + stream.backUp(1); + // Actually move the stream + stream.match(/[\w]+/); + if (word === 'data' && /=/.test(stream.peek()) === false) { + state.inDataStep = true; + state.nextword = true; + return 'builtin'; + } + if (word === 'proc') { + state.inProc = true; + state.nextword = true; + return 'builtin'; + } + if (word === '%macro') { + state.inMacro = true; + state.nextword = true; + return 'builtin'; + } + if (/title[1-9]/.test(word)) return 'def'; + + if (word === 'footnote') { + stream.eat(/[1-9]/); + return 'def'; + } + + // Returns their value as state in the prior define methods + if (state.inDataStep === true && words[word].state.indexOf("inDataStep") !== -1) + return words[word].style; + if (state.inProc === true && words[word].state.indexOf("inProc") !== -1) + return words[word].style; + if (state.inMacro === true && words[word].state.indexOf("inMacro") !== -1) + return words[word].style; + if (words[word].state.indexOf("ALL") !== -1) + return words[word].style; + return null; + } + // Unrecognized syntax + return null; + } + + return { + startState: function () { + return { + inDataStep: false, + inProc: false, + inMacro: false, + nextword: false, + continueString: null, + continueComment: false + }; + }, + token: function (stream, state) { + // Strip the spaces, but regex will account for them either way + if (stream.eatSpace()) return null; + // Go through the main process + return tokenize(stream, state); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; + + }); + + CodeMirror.defineMIME("text/x-sas", "sas"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/julia/julia.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("julia", function(config, parserConf) { + function wordRegexp(words, end) { + if (typeof end === "undefined") { end = "\\b"; } + return new RegExp("^((" + words.join(")|(") + "))" + end); + } + + var octChar = "\\\\[0-7]{1,3}"; + var hexChar = "\\\\x[A-Fa-f0-9]{1,2}"; + var sChar = "\\\\[abefnrtv0%?'\"\\\\]"; + var uChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])"; + + var operators = parserConf.operators || wordRegexp([ + "[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "->", "\\/\\/", + "[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":", + "\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218", + "\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264", + "\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5", + "\\b(in|isa)\\b(?!\.?\\()"], ""); + var delimiters = parserConf.delimiters || /^[;,()[\]{}]/; + var identifiers = parserConf.identifiers || + /^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/; + + var chars = wordRegexp([octChar, hexChar, sChar, uChar], "'"); + var openers = wordRegexp(["begin", "function", "type", "struct", "immutable", + "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", + "finally", "catch", "do"]); + var closers = wordRegexp(["end", "else", "elseif", "catch", "finally"]); + var keywords = wordRegexp(["if", "else", "elseif", "while", "for", "begin", + "let", "end", "do", "try", "catch", "finally", "return", "break", + "continue", "global", "local", "const", "export", "import", "importall", + "using", "function", "where", "macro", "module", "baremodule", "struct", + "type", "mutable", "immutable", "quote", "typealias", "abstract", + "primitive", "bitstype"]); + var builtins = wordRegexp(["true", "false", "nothing", "NaN", "Inf"]); + + var macro = /^@[_A-Za-z][\w]*/; + var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/; + var stringPrefixes = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/; + + function inArray(state) { + return inGenerator(state, '[') + } + + function inGenerator(state, bracket) { + var curr = currentScope(state), + prev = currentScope(state, 1); + if (typeof(bracket) === "undefined") { bracket = '('; } + if (curr === bracket || (prev === bracket && curr === "for")) { + return true; + } + return false; + } + + function currentScope(state, n) { + if (typeof(n) === "undefined") { n = 0; } + if (state.scopes.length <= n) { + return null; + } + return state.scopes[state.scopes.length - (n + 1)]; + } + + // tokenizers + function tokenBase(stream, state) { + // Handle multiline comments + if (stream.match(/^#=/, false)) { + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + + // Handle scope changes + var leavingExpr = state.leavingExpr; + if (stream.sol()) { + leavingExpr = false; + } + state.leavingExpr = false; + + if (leavingExpr) { + if (stream.match(/^'+/)) { + return "operator"; + } + } + + if (stream.match(/\.{4,}/)) { + return "error"; + } else if (stream.match(/\.{1,3}/)) { + return "operator"; + } + + if (stream.eatSpace()) { + return null; + } + + var ch = stream.peek(); + + // Handle single line comments + if (ch === '#') { + stream.skipToEnd(); + return "comment"; + } + + if (ch === '[') { + state.scopes.push('['); + } + + if (ch === '(') { + state.scopes.push('('); + } + + var scope = currentScope(state); + + if (inArray(state) && ch === ']') { + if (scope === "for") { state.scopes.pop(); } + state.scopes.pop(); + state.leavingExpr = true; + } + + if (inGenerator(state) && ch === ')') { + if (scope === "for") { state.scopes.pop(); } + state.scopes.pop(); + state.leavingExpr = true; + } + + if (inArray(state)) { + if (state.lastToken == "end" && stream.match(/^:/)) { + return "operator"; + } + if (stream.match(/^end/)) { + return "number"; + } + } + + var match; + if (match = stream.match(openers, false)) { + state.scopes.push(match[0]); + } + + if (stream.match(closers, false)) { + state.scopes.pop(); + } + + // Handle type annotations + if (stream.match(/^::(?![:\$])/)) { + state.tokenize = tokenAnnotation; + return state.tokenize(stream, state); + } + + // Handle symbols + if (!leavingExpr && stream.match(symbol) || + stream.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)) { + return "builtin"; + } + + // Handle parametric types + //if (stream.match(/^{[^}]*}(?=\()/)) { + // return "builtin"; + //} + + // Handle operators and Delimiters + if (stream.match(operators)) { + return "operator"; + } + + // Handle Number Literals + if (stream.match(/^\.?\d/, false)) { + var imMatcher = RegExp(/^im\b/); + var numberLiteral = false; + // Floats + if (stream.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)) { numberLiteral = true; } + if (stream.match(/^\d+\.(?!\.)\d*/)) { numberLiteral = true; } + if (stream.match(/^\.\d+/)) { numberLiteral = true; } + if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { numberLiteral = true; } + // Integers + if (stream.match(/^0x[0-9a-f]+/i)) { numberLiteral = true; } // Hex + if (stream.match(/^0b[01]+/i)) { numberLiteral = true; } // Binary + if (stream.match(/^0o[0-7]+/i)) { numberLiteral = true; } // Octal + if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { numberLiteral = true; } // Decimal + // Zero by itself with no other piece of number. + if (stream.match(/^0(?![\dx])/i)) { numberLiteral = true; } + if (numberLiteral) { + // Integer literals may be "long" + stream.match(imMatcher); + state.leavingExpr = true; + return "number"; + } + } + + // Handle Chars + if (stream.match(/^'/)) { + state.tokenize = tokenChar; + return state.tokenize(stream, state); + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + if (stream.match(macro)) { + return "meta"; + } + + if (stream.match(delimiters)) { + return null; + } + + if (stream.match(keywords)) { + return "keyword"; + } + + if (stream.match(builtins)) { + return "builtin"; + } + + var isDefinition = state.isDefinition || state.lastToken == "function" || + state.lastToken == "macro" || state.lastToken == "type" || + state.lastToken == "struct" || state.lastToken == "immutable"; + + if (stream.match(identifiers)) { + if (isDefinition) { + if (stream.peek() === '.') { + state.isDefinition = true; + return "variable"; + } + state.isDefinition = false; + return "def"; + } + if (stream.match(/^({[^}]*})*\(/, false)) { + state.tokenize = tokenCallOrDef; + return state.tokenize(stream, state); + } + state.leavingExpr = true; + return "variable"; + } + + // Handle non-detected items + stream.next(); + return "error"; + } + + function tokenCallOrDef(stream, state) { + var match = stream.match(/^(\(\s*)/); + if (match) { + if (state.firstParenPos < 0) + state.firstParenPos = state.scopes.length; + state.scopes.push('('); + state.charsAdvanced += match[1].length; + } + if (currentScope(state) == '(' && stream.match(/^\)/)) { + state.scopes.pop(); + state.charsAdvanced += 1; + if (state.scopes.length <= state.firstParenPos) { + var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false); + stream.backUp(state.charsAdvanced); + state.firstParenPos = -1; + state.charsAdvanced = 0; + state.tokenize = tokenBase; + if (isDefinition) + return "def"; + return "builtin"; + } + } + // Unfortunately javascript does not support multiline strings, so we have + // to undo anything done upto here if a function call or definition splits + // over two or more lines. + if (stream.match(/^$/g, false)) { + stream.backUp(state.charsAdvanced); + while (state.scopes.length > state.firstParenPos) + state.scopes.pop(); + state.firstParenPos = -1; + state.charsAdvanced = 0; + state.tokenize = tokenBase; + return "builtin"; + } + state.charsAdvanced += stream.match(/^([^()]*)/)[1].length; + return state.tokenize(stream, state); + } + + function tokenAnnotation(stream, state) { + stream.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/); + if (stream.match(/^{/)) { + state.nestedLevels++; + } else if (stream.match(/^}/)) { + state.nestedLevels--; + } + if (state.nestedLevels > 0) { + stream.match(/.*?(?={|})/) || stream.next(); + } else if (state.nestedLevels == 0) { + state.tokenize = tokenBase; + } + return "builtin"; + } + + function tokenComment(stream, state) { + if (stream.match(/^#=/)) { + state.nestedLevels++; + } + if (!stream.match(/.*?(?=(#=|=#))/)) { + stream.skipToEnd(); + } + if (stream.match(/^=#/)) { + state.nestedLevels--; + if (state.nestedLevels == 0) + state.tokenize = tokenBase; + } + return "comment"; + } + + function tokenChar(stream, state) { + var isChar = false, match; + if (stream.match(chars)) { + isChar = true; + } else if (match = stream.match(/\\u([a-f0-9]{1,4})(?=')/i)) { + var value = parseInt(match[1], 16); + if (value <= 55295 || value >= 57344) { // (U+0,U+D7FF), (U+E000,U+FFFF) + isChar = true; + stream.next(); + } + } else if (match = stream.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) { + var value = parseInt(match[1], 16); + if (value <= 1114111) { // U+10FFFF + isChar = true; + stream.next(); + } + } + if (isChar) { + state.leavingExpr = true; + state.tokenize = tokenBase; + return "string"; + } + if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); } + if (stream.match(/^'/)) { state.tokenize = tokenBase; } + return "error"; + } + + function tokenStringFactory(delimiter) { + if (delimiter.substr(-3) === '"""') { + delimiter = '"""'; + } else if (delimiter.substr(-1) === '"') { + delimiter = '"'; + } + function tokenString(stream, state) { + if (stream.eat('\\')) { + stream.next(); + } else if (stream.match(delimiter)) { + state.tokenize = tokenBase; + state.leavingExpr = true; + return "string"; + } else { + stream.eat(/[`"]/); + } + stream.eatWhile(/[^\\`"]/); + return "string"; + } + return tokenString; + } + + var external = { + startState: function() { + return { + tokenize: tokenBase, + scopes: [], + lastToken: null, + leavingExpr: false, + isDefinition: false, + nestedLevels: 0, + charsAdvanced: 0, + firstParenPos: -1 + }; + }, + + token: function(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + if (current && style) { + state.lastToken = current; + } + + return style; + }, + + indent: function(state, textAfter) { + var delta = 0; + if ( textAfter === ']' || textAfter === ')' || textAfter === "end" || + textAfter === "else" || textAfter === "catch" || textAfter === "elseif" || + textAfter === "finally" ) { + delta = -1; + } + return (state.scopes.length + delta) * config.indentUnit; + }, + + electricInput: /\b(end|else|catch|finally)\b/, + blockCommentStart: "#=", + blockCommentEnd: "=#", + lineComment: "#", + fold: "indent" + }; + return external; +}); + + +CodeMirror.defineMIME("text/x-julia", "julia"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/fcl/fcl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("fcl", function(config) { + var indentUnit = config.indentUnit; + + var keywords = { + "term": true, + "method": true, "accu": true, + "rule": true, "then": true, "is": true, "and": true, "or": true, + "if": true, "default": true + }; + + var start_blocks = { + "var_input": true, + "var_output": true, + "fuzzify": true, + "defuzzify": true, + "function_block": true, + "ruleblock": true + }; + + var end_blocks = { + "end_ruleblock": true, + "end_defuzzify": true, + "end_function_block": true, + "end_fuzzify": true, + "end_var": true + }; + + var atoms = { + "true": true, "false": true, "nan": true, + "real": true, "min": true, "max": true, "cog": true, "cogs": true + }; + + var isOperatorChar = /[+\-*&^%:=<>!|\/]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (/[\d\.]/.test(ch)) { + if (ch == ".") { + stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); + } else if (ch == "0") { + stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); + } else { + stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); + } + return "number"; + } + + if (ch == "/" || ch == "(") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + + var cur = stream.current().toLowerCase(); + if (keywords.propertyIsEnumerable(cur) || + start_blocks.propertyIsEnumerable(cur) || + end_blocks.propertyIsEnumerable(cur)) { + return "keyword"; + } + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if ((ch == "/" || ch == ")") && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + + function popContext(state) { + if (!state.context.prev) return; + var t = state.context.type; + if (t == "end_block") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + var cur = stream.current().toLowerCase(); + + if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), "end_block"); + else if (end_blocks.propertyIsEnumerable(cur)) popContext(state); + + state.startOfLine = false; + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize != tokenBase && state.tokenize != null) return 0; + var ctx = state.context; + + var closing = end_blocks.propertyIsEnumerable(textAfter); + if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "ryk", + fold: "brace", + blockCommentStart: "(*", + blockCommentEnd: "*)", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-fcl", "fcl"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/tornado/tornado.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"), + require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../htmlmixed/htmlmixed", + "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("tornado:inner", function() { + var keywords = ["and","as","assert","autoescape","block","break","class","comment","context", + "continue","datetime","def","del","elif","else","end","escape","except", + "exec","extends","false","finally","for","from","global","if","import","in", + "include","is","json_encode","lambda","length","linkify","load","module", + "none","not","or","pass","print","put","raise","raw","return","self","set", + "squeeze","super","true","try","url_escape","while","with","without","xhtml_escape","yield"]; + keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + stream.eatWhile(/[^\{]/); + var ch = stream.next(); + if (ch == "{") { + if (ch = stream.eat(/\{|%|#/)) { + state.tokenize = inTag(ch); + return "tag"; + } + } + } + function inTag (close) { + if (close == "{") { + close = "}"; + } + return function (stream, state) { + var ch = stream.next(); + if ((ch == close) && stream.eat("}")) { + state.tokenize = tokenBase; + return "tag"; + } + if (stream.match(keywords)) { + return "keyword"; + } + return close == "#" ? "comment" : "string"; + }; + } + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; + }); + + CodeMirror.defineMode("tornado", function(config) { + var htmlBase = CodeMirror.getMode(config, "text/html"); + var tornadoInner = CodeMirror.getMode(config, "tornado:inner"); + return CodeMirror.overlayMode(htmlBase, tornadoInner); + }); + + CodeMirror.defineMIME("text/x-tornado", "tornado"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/asterisk/asterisk.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* + * ===================================================================================== + * + * Filename: mode/asterisk/asterisk.js + * + * Description: CodeMirror mode for Asterisk dialplan + * + * Created: 05/17/2012 09:20:25 PM + * Revision: none + * + * Author: Stas Kobzar (stas@modulis.ca), + * Company: Modulis.ca Inc. + * + * ===================================================================================== + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("asterisk", function() { + var atoms = ["exten", "same", "include","ignorepat","switch"], + dpcmd = ["#include","#exec"], + apps = [ + "addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi", + "alarmreceiver","amd","answer","authenticate","background","backgrounddetect", + "bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent", + "changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge", + "congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge", + "dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility", + "datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa", + "dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy", + "externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif", + "goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete", + "ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus", + "jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme", + "meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete", + "minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode", + "mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish", + "originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce", + "parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones", + "privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten", + "readfile","receivefax","receivefax","receivefax","record","removequeuemember", + "resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun", + "saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax", + "sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags", + "setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel", + "slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground", + "speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound", + "speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor", + "stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec", + "trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate", + "vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring", + "waitforsilence","waitmusiconhold","waituntil","while","zapateller" + ]; + + function basicToken(stream,state){ + var cur = ''; + var ch = stream.next(); + // comment + if(ch == ";") { + stream.skipToEnd(); + return "comment"; + } + // context + if(ch == '[') { + stream.skipTo(']'); + stream.eat(']'); + return "header"; + } + // string + if(ch == '"') { + stream.skipTo('"'); + return "string"; + } + if(ch == "'") { + stream.skipTo("'"); + return "string-2"; + } + // dialplan commands + if(ch == '#') { + stream.eatWhile(/\w/); + cur = stream.current(); + if(dpcmd.indexOf(cur) !== -1) { + stream.skipToEnd(); + return "strong"; + } + } + // application args + if(ch == '$'){ + var ch1 = stream.peek(); + if(ch1 == '{'){ + stream.skipTo('}'); + stream.eat('}'); + return "variable-3"; + } + } + // extension + stream.eatWhile(/\w/); + cur = stream.current(); + if(atoms.indexOf(cur) !== -1) { + state.extenStart = true; + switch(cur) { + case 'same': state.extenSame = true; break; + case 'include': + case 'switch': + case 'ignorepat': + state.extenInclude = true;break; + default:break; + } + return "atom"; + } + } + + return { + startState: function() { + return { + extenStart: false, + extenSame: false, + extenInclude: false, + extenExten: false, + extenPriority: false, + extenApplication: false + }; + }, + token: function(stream, state) { + + var cur = ''; + if(stream.eatSpace()) return null; + // extension started + if(state.extenStart){ + stream.eatWhile(/[^\s]/); + cur = stream.current(); + if(/^=>?$/.test(cur)){ + state.extenExten = true; + state.extenStart = false; + return "strong"; + } else { + state.extenStart = false; + stream.skipToEnd(); + return "error"; + } + } else if(state.extenExten) { + // set exten and priority + state.extenExten = false; + state.extenPriority = true; + stream.eatWhile(/[^,]/); + if(state.extenInclude) { + stream.skipToEnd(); + state.extenPriority = false; + state.extenInclude = false; + } + if(state.extenSame) { + state.extenPriority = false; + state.extenSame = false; + state.extenApplication = true; + } + return "tag"; + } else if(state.extenPriority) { + state.extenPriority = false; + state.extenApplication = true; + stream.next(); // get comma + if(state.extenSame) return null; + stream.eatWhile(/[^,]/); + return "number"; + } else if(state.extenApplication) { + stream.eatWhile(/,/); + cur = stream.current(); + if(cur === ',') return null; + stream.eatWhile(/\w/); + cur = stream.current().toLowerCase(); + state.extenApplication = false; + if(apps.indexOf(cur) !== -1){ + return "def strong"; + } + } else{ + return basicToken(stream,state); + } + + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-asterisk", "asterisk"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/sql/sql.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("sql", function(config, parserConfig) { + "use strict"; + + var client = parserConfig.client || {}, + atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, + builtin = parserConfig.builtin || {}, + keywords = parserConfig.keywords || {}, + operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/, + support = parserConfig.support || {}, + hooks = parserConfig.hooks || {}, + dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; + + function tokenBase(stream, state) { + var ch = stream.next(); + + // call hooks from the mime type + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + + if (support.hexNumber && + ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) + || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { + // hex + // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html + return "number"; + } else if (support.binaryNumber && + (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) + || (ch == "0" && stream.match(/^b[01]+/)))) { + // bitstring + // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html + return "number"; + } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { + // numbers + // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html + stream.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/); + support.decimallessFloat && stream.match(/^\.(?!\.)/); + return "number"; + } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { + // placeholders + return "variable-3"; + } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { + // strings + // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } else if ((((support.nCharCast && (ch == "n" || ch == "N")) + || (support.charsetCast && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) + && (stream.peek() == "'" || stream.peek() == '"'))) { + // charset casting: _utf8'str', N'str', n'str' + // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html + return "keyword"; + } else if (/^[\(\),\;\[\]]/.test(ch)) { + // no highlighting + return null; + } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { + // 1-line comment + stream.skipToEnd(); + return "comment"; + } else if ((support.commentHash && ch == "#") + || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { + // 1-line comments + // ref: https://kb.askmonty.org/en/comment-syntax/ + stream.skipToEnd(); + return "comment"; + } else if (ch == "/" && stream.eat("*")) { + // multi-line comments + // ref: https://kb.askmonty.org/en/comment-syntax/ + state.tokenize = tokenComment(1); + return state.tokenize(stream, state); + } else if (ch == ".") { + // .1 for 0.1 + if (support.zerolessFloat && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) + return "number"; + if (stream.match(/^\.+/)) + return null + // .table_name (ODBC) + // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html + if (support.ODBCdotTable && stream.match(/^[\w\d_]+/)) + return "variable-2"; + } else if (operatorChars.test(ch)) { + // operators + stream.eatWhile(operatorChars); + return null; + } else if (ch == '{' && + (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { + // dates (weird ODBC syntax) + // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html + return "number"; + } else { + stream.eatWhile(/^[_\w\d]/); + var word = stream.current().toLowerCase(); + // dates (standard SQL syntax) + // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html + if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) + return "number"; + if (atoms.hasOwnProperty(word)) return "atom"; + if (builtin.hasOwnProperty(word)) return "builtin"; + if (keywords.hasOwnProperty(word)) return "keyword"; + if (client.hasOwnProperty(word)) return "string-2"; + return null; + } + } + + // 'string', with char specified in quote escaped by '\' + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "string"; + }; + } + function tokenComment(depth) { + return function(stream, state) { + var m = stream.match(/^.*?(\/\*|\*\/)/) + if (!m) stream.skipToEnd() + else if (m[1] == "/*") state.tokenize = tokenComment(depth + 1) + else if (depth > 1) state.tokenize = tokenComment(depth - 1) + else state.tokenize = tokenBase + return "comment" + } + } + + function pushContext(stream, state, type) { + state.context = { + prev: state.context, + indent: stream.indentation(), + col: stream.column(), + type: type + }; + } + + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function() { + return {tokenize: tokenBase, context: null}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) + state.context.align = false; + } + if (state.tokenize == tokenBase && stream.eatSpace()) return null; + + var style = state.tokenize(stream, state); + if (style == "comment") return style; + + if (state.context && state.context.align == null) + state.context.align = true; + + var tok = stream.current(); + if (tok == "(") + pushContext(stream, state, ")"); + else if (tok == "[") + pushContext(stream, state, "]"); + else if (state.context && state.context.type == tok) + popContext(state); + return style; + }, + + indent: function(state, textAfter) { + var cx = state.context; + if (!cx) return CodeMirror.Pass; + var closing = textAfter.charAt(0) == cx.type; + if (cx.align) return cx.col + (closing ? 0 : 1); + else return cx.indent + (closing ? 0 : config.indentUnit); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : "--" + }; +}); + +(function() { + "use strict"; + + // `identifier` + function hookIdentifier(stream) { + // MySQL/MariaDB identifiers + // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html + var ch; + while ((ch = stream.next()) != null) { + if (ch == "`" && !stream.eat("`")) return "variable-2"; + } + stream.backUp(stream.current().length - 1); + return stream.eatWhile(/\w/) ? "variable-2" : null; + } + + // "identifier" + function hookIdentifierDoublequote(stream) { + // Standard SQL /SQLite identifiers + // ref: http://web.archive.org/web/20160813185132/http://savage.net.au/SQL/sql-99.bnf.html#delimited%20identifier + // ref: http://sqlite.org/lang_keywords.html + var ch; + while ((ch = stream.next()) != null) { + if (ch == "\"" && !stream.eat("\"")) return "variable-2"; + } + stream.backUp(stream.current().length - 1); + return stream.eatWhile(/\w/) ? "variable-2" : null; + } + + // variable token + function hookVar(stream) { + // variables + // @@prefix.varName @varName + // varName can be quoted with ` or ' or " + // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html + if (stream.eat("@")) { + stream.match(/^session\./); + stream.match(/^local\./); + stream.match(/^global\./); + } + + if (stream.eat("'")) { + stream.match(/^.*'/); + return "variable-2"; + } else if (stream.eat('"')) { + stream.match(/^.*"/); + return "variable-2"; + } else if (stream.eat("`")) { + stream.match(/^.*`/); + return "variable-2"; + } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { + return "variable-2"; + } + return null; + }; + + // short client keyword token + function hookClient(stream) { + // \N means NULL + // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html + if (stream.eat("N")) { + return "atom"; + } + // \g, etc + // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html + return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; + } + + // these keywords are used by all SQL dialects (however, a mode can still overwrite it) + var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit "; + + // turn a space-separated list into an array + function set(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + // A generic SQL Mode. It's not a standard, it just try to support what is generally supported + CodeMirror.defineMIME("text/x-sql", { + name: "sql", + keywords: set(sqlKeywords + "begin"), + builtin: set("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") + }); + + CodeMirror.defineMIME("text/x-mssql", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec"), + builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, + dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), + hooks: { + "@": hookVar + } + }); + + CodeMirror.defineMIME("text/x-mysql", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), + builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), + hooks: { + "@": hookVar, + "`": hookIdentifier, + "\\": hookClient + } + }); + + CodeMirror.defineMIME("text/x-mariadb", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), + builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), + hooks: { + "@": hookVar, + "`": hookIdentifier, + "\\": hookClient + } + }); + + // provided by the phpLiteAdmin project - phpliteadmin.org + CodeMirror.defineMIME("text/x-sqlite", { + name: "sql", + // commands of the official SQLite client, ref: https://www.sqlite.org/cli.html#dotcmd + client: set("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"), + // ref: http://sqlite.org/lang_keywords.html + keywords: set(sqlKeywords + "abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"), + // SQLite is weakly typed, ref: http://sqlite.org/datatype3.html. This is just a list of some common types. + builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"), + // ref: http://sqlite.org/syntax/literal-value.html + atoms: set("null current_date current_time current_timestamp"), + // ref: http://sqlite.org/lang_expr.html#binaryops + operatorChars: /^[*+\-%<>!=&|/~]/, + // SQLite is weakly typed, ref: http://sqlite.org/datatype3.html. This is just a list of some common types. + dateSQL: set("date time timestamp datetime"), + support: set("decimallessFloat zerolessFloat"), + identifierQuote: "\"", //ref: http://sqlite.org/lang_keywords.html + hooks: { + // bind-parameters ref:http://sqlite.org/lang_expr.html#varparam + "@": hookVar, + ":": hookVar, + "?": hookVar, + "$": hookVar, + // The preferred way to escape Identifiers is using double quotes, ref: http://sqlite.org/lang_keywords.html + "\"": hookIdentifierDoublequote, + // there is also support for backtics, ref: http://sqlite.org/lang_keywords.html + "`": hookIdentifier + } + }); + + // the query language used by Apache Cassandra is called CQL, but this mime type + // is called Cassandra to avoid confusion with Contextual Query Language + CodeMirror.defineMIME("text/x-cassandra", { + name: "sql", + client: { }, + keywords: set("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"), + builtin: set("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"), + atoms: set("false true infinity NaN"), + operatorChars: /^[<>=]/, + dateSQL: { }, + support: set("commentSlashSlash decimallessFloat"), + hooks: { } + }); + + // this is based on Peter Raganitsch's 'plsql' mode + CodeMirror.defineMIME("text/x-plsql", { + name: "sql", + client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), + keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), + builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), + operatorChars: /^[*+\-%<>!=~]/, + dateSQL: set("date time timestamp"), + support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") + }); + + // Created to support specific hive keywords + CodeMirror.defineMIME("text/x-hive", { + name: "sql", + keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"), + builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, + dateSQL: set("date timestamp"), + support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") + }); + + CodeMirror.defineMIME("text/x-pgsql", { + name: "sql", + client: set("source"), + // https://www.postgresql.org/docs/10/static/sql-keywords-appendix.html + keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone"), + // https://www.postgresql.org/docs/10/static/datatype.html + builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast") + }); + + // Google's SQL-like query language, GQL + CodeMirror.defineMIME("text/x-gql", { + name: "sql", + keywords: set("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"), + atoms: set("false true"), + builtin: set("blob datetime first key __key__ string integer double boolean null"), + operatorChars: /^[*+\-%<>!=]/ + }); + + // Greenplum + CodeMirror.defineMIME("text/x-gpsql", { + name: "sql", + client: set("source"), + //https://github.com/greenplum-db/gpdb/blob/master/src/include/parser/kwlist.h + keywords: set("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"), + builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast") + }); + + // Spark SQL + CodeMirror.defineMIME("text/x-sparksql", { + name: "sql", + keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), + builtin: set("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"), + atoms: set("false true null"), + operatorChars: /^[*+\-%<>!=~&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable doubleQuote zerolessFloat") + }); + + // Esper + CodeMirror.defineMIME("text/x-esper", { + name: "sql", + client: set("source"), + // http://www.espertech.com/esper/release-5.5.0/esper-reference/html/appendix_keywords.html + keywords: set("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"), + builtin: {}, + atoms: set("false true null"), + operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, + dateSQL: set("time"), + support: set("decimallessFloat zerolessFloat binaryNumber hexNumber") + }); +}()); + +}); + +/* + How Properties of Mime Types are used by SQL Mode + ================================================= + + keywords: + A list of keywords you want to be highlighted. + builtin: + A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). + operatorChars: + All characters that must be handled as operators. + client: + Commands parsed and executed by the client (not the server). + support: + A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. + * ODBCdotTable: .tableName + * zerolessFloat: .1 + * doubleQuote + * nCharCast: N'string' + * charsetCast: _utf8'string' + * commentHash: use # char for comments + * commentSlashSlash: use // for comments + * commentSpaceRequired: require a space after -- for comments + atoms: + Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: + UNKNOWN, INFINITY, UNDERFLOW, NaN... + dateSQL: + Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. +*/ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/gfm/gfm.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../markdown/markdown"), require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i + +CodeMirror.defineMode("gfm", function(config, modeConfig) { + var codeDepth = 0; + function blankLine(state) { + state.code = false; + return null; + } + var gfmOverlay = { + startState: function() { + return { + code: false, + codeBlock: false, + ateSpace: false + }; + }, + copyState: function(s) { + return { + code: s.code, + codeBlock: s.codeBlock, + ateSpace: s.ateSpace + }; + }, + token: function(stream, state) { + state.combineTokens = null; + + // Hack to prevent formatting override inside code blocks (block and inline) + if (state.codeBlock) { + if (stream.match(/^```+/)) { + state.codeBlock = false; + return null; + } + stream.skipToEnd(); + return null; + } + if (stream.sol()) { + state.code = false; + } + if (stream.sol() && stream.match(/^```+/)) { + stream.skipToEnd(); + state.codeBlock = true; + return null; + } + // If this block is changed, it may need to be updated in Markdown mode + if (stream.peek() === '`') { + stream.next(); + var before = stream.pos; + stream.eatWhile('`'); + var difference = 1 + stream.pos - before; + if (!state.code) { + codeDepth = difference; + state.code = true; + } else { + if (difference === codeDepth) { // Must be exact + state.code = false; + } + } + return null; + } else if (state.code) { + stream.next(); + return null; + } + // Check if space. If so, links can be formatted later on + if (stream.eatSpace()) { + state.ateSpace = true; + return null; + } + if (stream.sol() || state.ateSpace) { + state.ateSpace = false; + if (modeConfig.gitHubSpice !== false) { + if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)) { + // User/Project@SHA + // User@SHA + // SHA + state.combineTokens = true; + return "link"; + } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { + // User/Project#Num + // User#Num + // #Num + state.combineTokens = true; + return "link"; + } + } + } + if (stream.match(urlRE) && + stream.string.slice(stream.start - 2, stream.start) != "](" && + (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) { + // URLs + // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls + // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine + // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL + state.combineTokens = true; + return "link"; + } + stream.next(); + return null; + }, + blankLine: blankLine + }; + + var markdownConfig = { + taskLists: true, + strikethrough: true, + emoji: true + }; + for (var attr in modeConfig) { + markdownConfig[attr] = modeConfig[attr]; + } + markdownConfig.name = "markdown"; + return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay); + +}, "markdown"); + + CodeMirror.defineMIME("text/x-gfm", "gfm"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/mllike/mllike.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('mllike', function(_config, parserConfig) { + var words = { + 'let': 'keyword', + 'rec': 'keyword', + 'in': 'keyword', + 'of': 'keyword', + 'and': 'keyword', + 'if': 'keyword', + 'then': 'keyword', + 'else': 'keyword', + 'for': 'keyword', + 'to': 'keyword', + 'while': 'keyword', + 'do': 'keyword', + 'done': 'keyword', + 'fun': 'keyword', + 'function': 'keyword', + 'val': 'keyword', + 'type': 'keyword', + 'mutable': 'keyword', + 'match': 'keyword', + 'with': 'keyword', + 'try': 'keyword', + 'open': 'builtin', + 'ignore': 'builtin', + 'begin': 'keyword', + 'end': 'keyword' + }; + + var extraWords = parserConfig.extraWords || {}; + for (var prop in extraWords) { + if (extraWords.hasOwnProperty(prop)) { + words[prop] = parserConfig.extraWords[prop]; + } + } + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (ch === '"') { + state.tokenize = tokenString; + return state.tokenize(stream, state); + } + if (ch === '(') { + if (stream.eat('*')) { + state.commentLevel++; + state.tokenize = tokenComment; + return state.tokenize(stream, state); + } + } + if (ch === '~') { + stream.eatWhile(/\w/); + return 'variable-2'; + } + if (ch === '`') { + stream.eatWhile(/\w/); + return 'quote'; + } + if (ch === '/' && parserConfig.slashComments && stream.eat('/')) { + stream.skipToEnd(); + return 'comment'; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\d]/); + if (stream.eat('.')) { + stream.eatWhile(/[\d]/); + } + return 'number'; + } + if ( /[+\-*&%=<>!?|]/.test(ch)) { + return 'operator'; + } + if (/[\w\xa1-\uffff]/.test(ch)) { + stream.eatWhile(/[\w\xa1-\uffff]/); + var cur = stream.current(); + return words.hasOwnProperty(cur) ? words[cur] : 'variable'; + } + return null + } + + function tokenString(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === '"' && !escaped) { + end = true; + break; + } + escaped = !escaped && next === '\\'; + } + if (end && !escaped) { + state.tokenize = tokenBase; + } + return 'string'; + }; + + function tokenComment(stream, state) { + var prev, next; + while(state.commentLevel > 0 && (next = stream.next()) != null) { + if (prev === '(' && next === '*') state.commentLevel++; + if (prev === '*' && next === ')') state.commentLevel--; + prev = next; + } + if (state.commentLevel <= 0) { + state.tokenize = tokenBase; + } + return 'comment'; + } + + return { + startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, + token: function(stream, state) { + if (stream.eatSpace()) return null; + return state.tokenize(stream, state); + }, + + blockCommentStart: "(*", + blockCommentEnd: "*)", + lineComment: parserConfig.slashComments ? "//" : null + }; +}); + +CodeMirror.defineMIME('text/x-ocaml', { + name: 'mllike', + extraWords: { + 'succ': 'keyword', + 'trace': 'builtin', + 'exit': 'builtin', + 'print_string': 'builtin', + 'print_endline': 'builtin', + 'true': 'atom', + 'false': 'atom', + 'raise': 'keyword' + } +}); + +CodeMirror.defineMIME('text/x-fsharp', { + name: 'mllike', + extraWords: { + 'abstract': 'keyword', + 'as': 'keyword', + 'assert': 'keyword', + 'base': 'keyword', + 'class': 'keyword', + 'default': 'keyword', + 'delegate': 'keyword', + 'downcast': 'keyword', + 'downto': 'keyword', + 'elif': 'keyword', + 'exception': 'keyword', + 'extern': 'keyword', + 'finally': 'keyword', + 'global': 'keyword', + 'inherit': 'keyword', + 'inline': 'keyword', + 'interface': 'keyword', + 'internal': 'keyword', + 'lazy': 'keyword', + 'let!': 'keyword', + 'member' : 'keyword', + 'module': 'keyword', + 'namespace': 'keyword', + 'new': 'keyword', + 'null': 'keyword', + 'override': 'keyword', + 'private': 'keyword', + 'public': 'keyword', + 'return': 'keyword', + 'return!': 'keyword', + 'select': 'keyword', + 'static': 'keyword', + 'struct': 'keyword', + 'upcast': 'keyword', + 'use': 'keyword', + 'use!': 'keyword', + 'val': 'keyword', + 'when': 'keyword', + 'yield': 'keyword', + 'yield!': 'keyword', + + 'List': 'builtin', + 'Seq': 'builtin', + 'Map': 'builtin', + 'Set': 'builtin', + 'int': 'builtin', + 'string': 'builtin', + 'raise': 'builtin', + 'failwith': 'builtin', + 'not': 'builtin', + 'true': 'builtin', + 'false': 'builtin' + }, + slashComments: true +}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/rst/rst.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('rst', function (config, options) { + + var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/; + var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/; + var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/; + + var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/; + var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/; + var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/; + + var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://"; + var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})"; + var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*"; + var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path); + + var overlay = { + token: function (stream) { + + if (stream.match(rx_strong) && stream.match (/\W+|$/, false)) + return 'strong'; + if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false)) + return 'em'; + if (stream.match(rx_literal) && stream.match (/\W+|$/, false)) + return 'string-2'; + if (stream.match(rx_number)) + return 'number'; + if (stream.match(rx_positive)) + return 'positive'; + if (stream.match(rx_negative)) + return 'negative'; + if (stream.match(rx_uri)) + return 'link'; + + while (stream.next() != null) { + if (stream.match(rx_strong, false)) break; + if (stream.match(rx_emphasis, false)) break; + if (stream.match(rx_literal, false)) break; + if (stream.match(rx_number, false)) break; + if (stream.match(rx_positive, false)) break; + if (stream.match(rx_negative, false)) break; + if (stream.match(rx_uri, false)) break; + } + + return null; + } + }; + + var mode = CodeMirror.getMode( + config, options.backdrop || 'rst-base' + ); + + return CodeMirror.overlayMode(mode, overlay, true); // combine +}, 'python', 'stex'); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +CodeMirror.defineMode('rst-base', function (config) { + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function format(string) { + var args = Array.prototype.slice.call(arguments, 1); + return string.replace(/{(\d+)}/g, function (match, n) { + return typeof args[n] != 'undefined' ? args[n] : match; + }); + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + var mode_python = CodeMirror.getMode(config, 'python'); + var mode_stex = CodeMirror.getMode(config, 'stex'); + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + var SEPA = "\\s+"; + var TAIL = "(?:\\s*|\\W|$)", + rx_TAIL = new RegExp(format('^{0}', TAIL)); + + var NAME = + "(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)", + rx_NAME = new RegExp(format('^{0}', NAME)); + var NAME_WWS = + "(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)"; + var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS); + + var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)"; + var TEXT2 = "(?:[^\\`]+)", + rx_TEXT2 = new RegExp(format('^{0}', TEXT2)); + + var rx_section = new RegExp( + "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"); + var rx_explicit = new RegExp( + format('^\\.\\.{0}', SEPA)); + var rx_link = new RegExp( + format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL)); + var rx_directive = new RegExp( + format('^{0}::{1}', REF_NAME, TAIL)); + var rx_substitution = new RegExp( + format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL)); + var rx_footnote = new RegExp( + format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL)); + var rx_citation = new RegExp( + format('^\\[{0}\\]{1}', REF_NAME, TAIL)); + + var rx_substitution_ref = new RegExp( + format('^\\|{0}\\|', TEXT1)); + var rx_footnote_ref = new RegExp( + format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME)); + var rx_citation_ref = new RegExp( + format('^\\[{0}\\]_', REF_NAME)); + var rx_link_ref1 = new RegExp( + format('^{0}__?', REF_NAME)); + var rx_link_ref2 = new RegExp( + format('^`{0}`_', TEXT2)); + + var rx_role_pre = new RegExp( + format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL)); + var rx_role_suf = new RegExp( + format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL)); + var rx_role = new RegExp( + format('^:{0}:{1}', NAME, TAIL)); + + var rx_directive_name = new RegExp(format('^{0}', REF_NAME)); + var rx_directive_tail = new RegExp(format('^::{0}', TAIL)); + var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1)); + var rx_substitution_sepa = new RegExp(format('^{0}', SEPA)); + var rx_substitution_name = new RegExp(format('^{0}', REF_NAME)); + var rx_substitution_tail = new RegExp(format('^::{0}', TAIL)); + var rx_link_head = new RegExp("^_"); + var rx_link_name = new RegExp(format('^{0}|_', REF_NAME)); + var rx_link_tail = new RegExp(format('^:{0}', TAIL)); + + var rx_verbatim = new RegExp('^::\\s*$'); + var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s'); + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_normal(stream, state) { + var token = null; + + if (stream.sol() && stream.match(rx_examples, false)) { + change(state, to_mode, { + mode: mode_python, local: CodeMirror.startState(mode_python) + }); + } else if (stream.sol() && stream.match(rx_explicit)) { + change(state, to_explicit); + token = 'meta'; + } else if (stream.sol() && stream.match(rx_section)) { + change(state, to_normal); + token = 'header'; + } else if (phase(state) == rx_role_pre || + stream.match(rx_role_pre, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_role_pre, 1)); + stream.match(/^:/); + token = 'meta'; + break; + case 1: + change(state, to_normal, context(rx_role_pre, 2)); + stream.match(rx_NAME); + token = 'keyword'; + + if (stream.current().match(/^(?:math|latex)/)) { + state.tmp_stex = true; + } + break; + case 2: + change(state, to_normal, context(rx_role_pre, 3)); + stream.match(/^:`/); + token = 'meta'; + break; + case 3: + if (state.tmp_stex) { + state.tmp_stex = undefined; state.tmp = { + mode: mode_stex, local: CodeMirror.startState(mode_stex) + }; + } + + if (state.tmp) { + if (stream.peek() == '`') { + change(state, to_normal, context(rx_role_pre, 4)); + state.tmp = undefined; + break; + } + + token = state.tmp.mode.token(stream, state.tmp.local); + break; + } + + change(state, to_normal, context(rx_role_pre, 4)); + stream.match(rx_TEXT2); + token = 'string'; + break; + case 4: + change(state, to_normal, context(rx_role_pre, 5)); + stream.match(/^`/); + token = 'meta'; + break; + case 5: + change(state, to_normal, context(rx_role_pre, 6)); + stream.match(rx_TAIL); + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_role_suf || + stream.match(rx_role_suf, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_role_suf, 1)); + stream.match(/^`/); + token = 'meta'; + break; + case 1: + change(state, to_normal, context(rx_role_suf, 2)); + stream.match(rx_TEXT2); + token = 'string'; + break; + case 2: + change(state, to_normal, context(rx_role_suf, 3)); + stream.match(/^`:/); + token = 'meta'; + break; + case 3: + change(state, to_normal, context(rx_role_suf, 4)); + stream.match(rx_NAME); + token = 'keyword'; + break; + case 4: + change(state, to_normal, context(rx_role_suf, 5)); + stream.match(/^:/); + token = 'meta'; + break; + case 5: + change(state, to_normal, context(rx_role_suf, 6)); + stream.match(rx_TAIL); + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_role || stream.match(rx_role, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_role, 1)); + stream.match(/^:/); + token = 'meta'; + break; + case 1: + change(state, to_normal, context(rx_role, 2)); + stream.match(rx_NAME); + token = 'keyword'; + break; + case 2: + change(state, to_normal, context(rx_role, 3)); + stream.match(/^:/); + token = 'meta'; + break; + case 3: + change(state, to_normal, context(rx_role, 4)); + stream.match(rx_TAIL); + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_substitution_ref || + stream.match(rx_substitution_ref, false)) { + + switch (stage(state)) { + case 0: + change(state, to_normal, context(rx_substitution_ref, 1)); + stream.match(rx_substitution_text); + token = 'variable-2'; + break; + case 1: + change(state, to_normal, context(rx_substitution_ref, 2)); + if (stream.match(/^_?_?/)) token = 'link'; + break; + default: + change(state, to_normal); + } + } else if (stream.match(rx_footnote_ref)) { + change(state, to_normal); + token = 'quote'; + } else if (stream.match(rx_citation_ref)) { + change(state, to_normal); + token = 'quote'; + } else if (stream.match(rx_link_ref1)) { + change(state, to_normal); + if (!stream.peek() || stream.peek().match(/^\W$/)) { + token = 'link'; + } + } else if (phase(state) == rx_link_ref2 || + stream.match(rx_link_ref2, false)) { + + switch (stage(state)) { + case 0: + if (!stream.peek() || stream.peek().match(/^\W$/)) { + change(state, to_normal, context(rx_link_ref2, 1)); + } else { + stream.match(rx_link_ref2); + } + break; + case 1: + change(state, to_normal, context(rx_link_ref2, 2)); + stream.match(/^`/); + token = 'link'; + break; + case 2: + change(state, to_normal, context(rx_link_ref2, 3)); + stream.match(rx_TEXT2); + break; + case 3: + change(state, to_normal, context(rx_link_ref2, 4)); + stream.match(/^`_/); + token = 'link'; + break; + default: + change(state, to_normal); + } + } else if (stream.match(rx_verbatim)) { + change(state, to_verbatim); + } + + else { + if (stream.next()) change(state, to_normal); + } + + return token; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_explicit(stream, state) { + var token = null; + + if (phase(state) == rx_substitution || + stream.match(rx_substitution, false)) { + + switch (stage(state)) { + case 0: + change(state, to_explicit, context(rx_substitution, 1)); + stream.match(rx_substitution_text); + token = 'variable-2'; + break; + case 1: + change(state, to_explicit, context(rx_substitution, 2)); + stream.match(rx_substitution_sepa); + break; + case 2: + change(state, to_explicit, context(rx_substitution, 3)); + stream.match(rx_substitution_name); + token = 'keyword'; + break; + case 3: + change(state, to_explicit, context(rx_substitution, 4)); + stream.match(rx_substitution_tail); + token = 'meta'; + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_directive || + stream.match(rx_directive, false)) { + + switch (stage(state)) { + case 0: + change(state, to_explicit, context(rx_directive, 1)); + stream.match(rx_directive_name); + token = 'keyword'; + + if (stream.current().match(/^(?:math|latex)/)) + state.tmp_stex = true; + else if (stream.current().match(/^python/)) + state.tmp_py = true; + break; + case 1: + change(state, to_explicit, context(rx_directive, 2)); + stream.match(rx_directive_tail); + token = 'meta'; + + if (stream.match(/^latex\s*$/) || state.tmp_stex) { + state.tmp_stex = undefined; change(state, to_mode, { + mode: mode_stex, local: CodeMirror.startState(mode_stex) + }); + } + break; + case 2: + change(state, to_explicit, context(rx_directive, 3)); + if (stream.match(/^python\s*$/) || state.tmp_py) { + state.tmp_py = undefined; change(state, to_mode, { + mode: mode_python, local: CodeMirror.startState(mode_python) + }); + } + break; + default: + change(state, to_normal); + } + } else if (phase(state) == rx_link || stream.match(rx_link, false)) { + + switch (stage(state)) { + case 0: + change(state, to_explicit, context(rx_link, 1)); + stream.match(rx_link_head); + stream.match(rx_link_name); + token = 'link'; + break; + case 1: + change(state, to_explicit, context(rx_link, 2)); + stream.match(rx_link_tail); + token = 'meta'; + break; + default: + change(state, to_normal); + } + } else if (stream.match(rx_footnote)) { + change(state, to_normal); + token = 'quote'; + } else if (stream.match(rx_citation)) { + change(state, to_normal); + token = 'quote'; + } + + else { + stream.eatSpace(); + if (stream.eol()) { + change(state, to_normal); + } else { + stream.skipToEnd(); + change(state, to_comment); + token = 'comment'; + } + } + + return token; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_comment(stream, state) { + return as_block(stream, state, 'comment'); + } + + function to_verbatim(stream, state) { + return as_block(stream, state, 'meta'); + } + + function as_block(stream, state, token) { + if (stream.eol() || stream.eatSpace()) { + stream.skipToEnd(); + return token; + } else { + change(state, to_normal); + return null; + } + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function to_mode(stream, state) { + + if (state.ctx.mode && state.ctx.local) { + + if (stream.sol()) { + if (!stream.eatSpace()) change(state, to_normal); + return null; + } + + return state.ctx.mode.token(stream, state.ctx.local); + } + + change(state, to_normal); + return null; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + function context(phase, stage, mode, local) { + return {phase: phase, stage: stage, mode: mode, local: local}; + } + + function change(state, tok, ctx) { + state.tok = tok; + state.ctx = ctx || {}; + } + + function stage(state) { + return state.ctx.stage || 0; + } + + function phase(state) { + return state.ctx.phase; + } + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + return { + startState: function () { + return {tok: to_normal, ctx: context(undefined, 0)}; + }, + + copyState: function (state) { + var ctx = state.ctx, tmp = state.tmp; + if (ctx.local) + ctx = {mode: ctx.mode, local: CodeMirror.copyState(ctx.mode, ctx.local)}; + if (tmp) + tmp = {mode: tmp.mode, local: CodeMirror.copyState(tmp.mode, tmp.local)}; + return {tok: state.tok, ctx: ctx, tmp: tmp}; + }, + + innerMode: function (state) { + return state.tmp ? {state: state.tmp.local, mode: state.tmp.mode} + : state.ctx.mode ? {state: state.ctx.local, mode: state.ctx.mode} + : null; + }, + + token: function (stream, state) { + return state.tok(stream, state); + } + }; +}, 'python', 'stex'); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +CodeMirror.defineMIME('text/x-rst', 'rst'); + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/ntriples/ntriples.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/********************************************************** +* This script provides syntax highlighting support for +* the N-Triples format. +* N-Triples format specification: +* https://www.w3.org/TR/n-triples/ +***********************************************************/ + +/* + The following expression defines the defined ASF grammar transitions. + + pre_subject -> + { + ( writing_subject_uri | writing_bnode_uri ) + -> pre_predicate + -> writing_predicate_uri + -> pre_object + -> writing_object_uri | writing_object_bnode | + ( + writing_object_literal + -> writing_literal_lang | writing_literal_type + ) + -> post_object + -> BEGIN + } otherwise { + -> ERROR + } +*/ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("ntriples", function() { + + var Location = { + PRE_SUBJECT : 0, + WRITING_SUB_URI : 1, + WRITING_BNODE_URI : 2, + PRE_PRED : 3, + WRITING_PRED_URI : 4, + PRE_OBJ : 5, + WRITING_OBJ_URI : 6, + WRITING_OBJ_BNODE : 7, + WRITING_OBJ_LITERAL : 8, + WRITING_LIT_LANG : 9, + WRITING_LIT_TYPE : 10, + POST_OBJ : 11, + ERROR : 12 + }; + function transitState(currState, c) { + var currLocation = currState.location; + var ret; + + // Opening. + if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; + else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; + else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; + else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; + else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; + else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; + + // Closing. + else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; + else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; + else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; + else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; + else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; + + // Closing typed and language literal. + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; + else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; + + // Spaces. + else if( c == ' ' && + ( + currLocation == Location.PRE_SUBJECT || + currLocation == Location.PRE_PRED || + currLocation == Location.PRE_OBJ || + currLocation == Location.POST_OBJ + ) + ) ret = currLocation; + + // Reset. + else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; + + // Error + else ret = Location.ERROR; + + currState.location=ret; + } + + return { + startState: function() { + return { + location : Location.PRE_SUBJECT, + uris : [], + anchors : [], + bnodes : [], + langs : [], + types : [] + }; + }, + token: function(stream, state) { + var ch = stream.next(); + if(ch == '<') { + transitState(state, ch); + var parsedURI = ''; + stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); + state.uris.push(parsedURI); + if( stream.match('#', false) ) return 'variable'; + stream.next(); + transitState(state, '>'); + return 'variable'; + } + if(ch == '#') { + var parsedAnchor = ''; + stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;}); + state.anchors.push(parsedAnchor); + return 'variable-2'; + } + if(ch == '>') { + transitState(state, '>'); + return 'variable'; + } + if(ch == '_') { + transitState(state, ch); + var parsedBNode = ''; + stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); + state.bnodes.push(parsedBNode); + stream.next(); + transitState(state, ' '); + return 'builtin'; + } + if(ch == '"') { + transitState(state, ch); + stream.eatWhile( function(c) { return c != '"'; } ); + stream.next(); + if( stream.peek() != '@' && stream.peek() != '^' ) { + transitState(state, '"'); + } + return 'string'; + } + if( ch == '@' ) { + transitState(state, '@'); + var parsedLang = ''; + stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); + state.langs.push(parsedLang); + stream.next(); + transitState(state, ' '); + return 'string-2'; + } + if( ch == '^' ) { + stream.next(); + transitState(state, '^'); + var parsedType = ''; + stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); + state.types.push(parsedType); + stream.next(); + transitState(state, '>'); + return 'variable'; + } + if( ch == ' ' ) { + transitState(state, ch); + } + if( ch == '.' ) { + transitState(state, ch); + } + } + }; +}); + +// define the registered Media Type for n-triples: +// https://www.w3.org/TR/n-triples/#n-triples-mediatype +CodeMirror.defineMIME("application/n-triples", "ntriples"); + +// N-Quads is based on the N-Triples format (so same highlighting works) +// https://www.w3.org/TR/n-quads/ +CodeMirror.defineMIME("application/n-quads", "ntriples"); + +// previously used, though technically incorrect media type for n-triples +CodeMirror.defineMIME("text/n-triples", "ntriples"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/sparql/sparql.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("sparql", function(config) { + var indentUnit = config.indentUnit; + var curPunc; + + function wordRegexp(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", + "iri", "uri", "bnode", "count", "sum", "min", "max", "avg", "sample", + "group_concat", "rand", "abs", "ceil", "floor", "round", "concat", "substr", "strlen", + "replace", "ucase", "lcase", "encode_for_uri", "contains", "strstarts", "strends", + "strbefore", "strafter", "year", "month", "day", "hours", "minutes", "seconds", + "timezone", "tz", "now", "uuid", "struuid", "md5", "sha1", "sha256", "sha384", + "sha512", "coalesce", "if", "strlang", "strdt", "isnumeric", "regex", "exists", + "isblank", "isliteral", "a", "bind"]); + var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", + "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", + "graph", "by", "asc", "desc", "as", "having", "undef", "values", "group", + "minus", "in", "not", "service", "silent", "using", "insert", "delete", "union", + "true", "false", "with", + "data", "copy", "to", "move", "add", "create", "drop", "clear", "load"]); + var operatorChars = /[*+\-<>=&|\^\/!\?]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + curPunc = null; + if (ch == "$" || ch == "?") { + if(ch == "?" && stream.match(/\s/, false)){ + return "operator"; + } + stream.match(/^[\w\d]*/); + return "variable-2"; + } + else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { + stream.match(/^[^\s\u00a0>]*>?/); + return "atom"; + } + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } + else if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return "bracket"; + } + else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return "operator"; + } + else if (ch == ":") { + stream.eatWhile(/[\w\d\._\-]/); + return "atom"; + } + else if (ch == "@") { + stream.eatWhile(/[a-z\d\-]/i); + return "meta"; + } + else { + stream.eatWhile(/[_\w\d]/); + if (stream.eat(":")) { + stream.eatWhile(/[\w\d_\-]/); + return "atom"; + } + var word = stream.current(); + if (ops.test(word)) + return "builtin"; + else if (keywords.test(word)) + return "keyword"; + else + return "variable"; + } + } + + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "string"; + }; + } + + function pushContext(state, type, col) { + state.context = {prev: state.context, indent: state.indent, col: col, type: type}; + } + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function() { + return {tokenize: tokenBase, + context: null, + indent: 0, + col: 0}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) state.context.align = false; + state.indent = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { + state.context.align = true; + } + + if (curPunc == "(") pushContext(state, ")", stream.column()); + else if (curPunc == "[") pushContext(state, "]", stream.column()); + else if (curPunc == "{") pushContext(state, "}", stream.column()); + else if (/[\]\}\)]/.test(curPunc)) { + while (state.context && state.context.type == "pattern") popContext(state); + if (state.context && curPunc == state.context.type) { + popContext(state); + if (curPunc == "}" && state.context && state.context.type == "pattern") + popContext(state); + } + } + else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); + else if (/atom|string|variable/.test(style) && state.context) { + if (/[\}\]]/.test(state.context.type)) + pushContext(state, "pattern", stream.column()); + else if (state.context.type == "pattern" && !state.context.align) { + state.context.align = true; + state.context.col = stream.column(); + } + } + + return style; + }, + + indent: function(state, textAfter) { + var firstChar = textAfter && textAfter.charAt(0); + var context = state.context; + if (/[\]\}]/.test(firstChar)) + while (context && context.type == "pattern") context = context.prev; + + var closing = context && firstChar == context.type; + if (!context) + return 0; + else if (context.type == "pattern") + return context.col; + else if (context.align) + return context.col + (closing ? 0 : 1); + else + return context.indent + (closing ? 0 : indentUnit); + }, + + lineComment: "#" + }; +}); + +CodeMirror.defineMIME("application/sparql-query", "sparql"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/properties/properties.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("properties", function() { + return { + token: function(stream, state) { + var sol = stream.sol() || state.afterSection; + var eol = stream.eol(); + + state.afterSection = false; + + if (sol) { + if (state.nextMultiline) { + state.inMultiline = true; + state.nextMultiline = false; + } else { + state.position = "def"; + } + } + + if (eol && ! state.nextMultiline) { + state.inMultiline = false; + state.position = "def"; + } + + if (sol) { + while(stream.eatSpace()) {} + } + + var ch = stream.next(); + + if (sol && (ch === "#" || ch === "!" || ch === ";")) { + state.position = "comment"; + stream.skipToEnd(); + return "comment"; + } else if (sol && ch === "[") { + state.afterSection = true; + stream.skipTo("]"); stream.eat("]"); + return "header"; + } else if (ch === "=" || ch === ":") { + state.position = "quote"; + return null; + } else if (ch === "\\" && state.position === "quote") { + if (stream.eol()) { // end of line? + // Multiline value + state.nextMultiline = true; + } + } + + return state.position; + }, + + startState: function() { + return { + position : "def", // Current position, "def", "quote" or "comment" + nextMultiline : false, // Is the next line multiline value + inMultiline : false, // Is the current line a multiline value + afterSection : false // Did we just open a section + }; + } + + }; +}); + +CodeMirror.defineMIME("text/x-properties", "properties"); +CodeMirror.defineMIME("text/x-ini", "properties"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/rpm/rpm.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("rpm-changes", function() { + var headerSeperator = /^-+$/; + var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; + var simpleEmail = /^[\w+.-]+@[\w.-]+/; + + return { + token: function(stream) { + if (stream.sol()) { + if (stream.match(headerSeperator)) { return 'tag'; } + if (stream.match(headerLine)) { return 'tag'; } + } + if (stream.match(simpleEmail)) { return 'string'; } + stream.next(); + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); + +// Quick and dirty spec file highlighting + +CodeMirror.defineMode("rpm-spec", function() { + var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; + + var preamble = /^[a-zA-Z0-9()]+:/; + var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/; + var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros + var control_flow_simple = /^%(else|endif)/; // rpm control flow macros + var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros + + return { + startState: function () { + return { + controlFlow: false, + macroParameters: false, + section: false + }; + }, + token: function (stream, state) { + var ch = stream.peek(); + if (ch == "#") { stream.skipToEnd(); return "comment"; } + + if (stream.sol()) { + if (stream.match(preamble)) { return "header"; } + if (stream.match(section)) { return "atom"; } + } + + if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' + if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' + + if (stream.match(control_flow_simple)) { return "keyword"; } + if (stream.match(control_flow_complex)) { + state.controlFlow = true; + return "keyword"; + } + if (state.controlFlow) { + if (stream.match(operators)) { return "operator"; } + if (stream.match(/^(\d+)/)) { return "number"; } + if (stream.eol()) { state.controlFlow = false; } + } + + if (stream.match(arch)) { + if (stream.eol()) { state.controlFlow = false; } + return "number"; + } + + // Macros like '%make_install' or '%attr(0775,root,root)' + if (stream.match(/^%[\w]+/)) { + if (stream.match(/^\(/)) { state.macroParameters = true; } + return "keyword"; + } + if (state.macroParameters) { + if (stream.match(/^\d+/)) { return "number";} + if (stream.match(/^\)/)) { + state.macroParameters = false; + return "keyword"; + } + } + + // Macros like '%{defined fedora}' + if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) { + if (stream.eol()) { state.controlFlow = false; } + return "def"; + } + + //TODO: Include bash script sub-parser (CodeMirror supports that) + stream.next(); + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/htmlmixed/htmlmixed.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var defaultTags = { + script: [ + ["lang", /(javascript|babel)/i, "javascript"], + ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"], + ["type", /./, "text/plain"], + [null, null, "javascript"] + ], + style: [ + ["lang", /^css$/i, "css"], + ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"], + ["type", /./, "text/plain"], + [null, null, "css"] + ] + }; + + function maybeBackup(stream, pat, style) { + var cur = stream.current(), close = cur.search(pat); + if (close > -1) { + stream.backUp(cur.length - close); + } else if (cur.match(/<\/?$/)) { + stream.backUp(cur.length); + if (!stream.match(pat, false)) stream.match(cur); + } + return style; + } + + var attrRegexpCache = {}; + function getAttrRegexp(attr) { + var regexp = attrRegexpCache[attr]; + if (regexp) return regexp; + return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"); + } + + function getAttrValue(text, attr) { + var match = text.match(getAttrRegexp(attr)) + return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : "" + } + + function getTagRegexp(tagName, anchored) { + return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); + } + + function addTags(from, to) { + for (var tag in from) { + var dest = to[tag] || (to[tag] = []); + var source = from[tag]; + for (var i = source.length - 1; i >= 0; i--) + dest.unshift(source[i]) + } + } + + function findMatchingMode(tagInfo, tagText) { + for (var i = 0; i < tagInfo.length; i++) { + var spec = tagInfo[i]; + if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2]; + } + } + + CodeMirror.defineMode("htmlmixed", function (config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, { + name: "xml", + htmlMode: true, + multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, + multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag + }); + + var tags = {}; + var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes; + addTags(defaultTags, tags); + if (configTags) addTags(configTags, tags); + if (configScript) for (var i = configScript.length - 1; i >= 0; i--) + tags.script.unshift(["type", configScript[i].matches, configScript[i].mode]) + + function html(stream, state) { + var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName + if (tag && !/[<>\s\/]/.test(stream.current()) && + (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) && + tags.hasOwnProperty(tagName)) { + state.inTag = tagName + " " + } else if (state.inTag && tag && />$/.test(stream.current())) { + var inTag = /^([\S]+) (.*)/.exec(state.inTag) + state.inTag = null + var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2]) + var mode = CodeMirror.getMode(config, modeSpec) + var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false); + state.token = function (stream, state) { + if (stream.match(endTagA, false)) { + state.token = html; + state.localState = state.localMode = null; + return null; + } + return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState)); + }; + state.localMode = mode; + state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "")); + } else if (state.inTag) { + state.inTag += stream.current() + if (stream.eol()) state.inTag += " " + } + return style; + }; + + return { + startState: function () { + var state = CodeMirror.startState(htmlMode); + return {token: html, inTag: null, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function (state) { + var local; + if (state.localState) { + local = CodeMirror.copyState(state.localMode, state.localState); + } + return {token: state.token, inTag: state.inTag, + localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function (stream, state) { + return state.token(stream, state); + }, + + indent: function (state, textAfter, line) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter, line); + else + return CodeMirror.Pass; + }, + + innerMode: function (state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; + }, "xml", "javascript", "css"); + + CodeMirror.defineMIME("text/html", "htmlmixed"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/xml/xml.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var htmlConfig = { + autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, + 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, + 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, + 'track': true, 'wbr': true, 'menuitem': true}, + implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, + 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, + 'th': true, 'tr': true}, + contextGrabbers: { + 'dd': {'dd': true, 'dt': true}, + 'dt': {'dd': true, 'dt': true}, + 'li': {'li': true}, + 'option': {'option': true, 'optgroup': true}, + 'optgroup': {'optgroup': true}, + 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, + 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, + 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, + 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, + 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, + 'rp': {'rp': true, 'rt': true}, + 'rt': {'rp': true, 'rt': true}, + 'tbody': {'tbody': true, 'tfoot': true}, + 'td': {'td': true, 'th': true}, + 'tfoot': {'tbody': true}, + 'th': {'td': true, 'th': true}, + 'thead': {'tbody': true, 'tfoot': true}, + 'tr': {'tr': true} + }, + doNotIndent: {"pre": true}, + allowUnquoted: true, + allowMissing: true, + caseFold: true +} + +var xmlConfig = { + autoSelfClosers: {}, + implicitlyClosed: {}, + contextGrabbers: {}, + doNotIndent: {}, + allowUnquoted: false, + allowMissing: false, + caseFold: false +} + +CodeMirror.defineMode("xml", function(editorConf, config_) { + var indentUnit = editorConf.indentUnit + var config = {} + var defaults = config_.htmlMode ? htmlConfig : xmlConfig + for (var prop in defaults) config[prop] = defaults[prop] + for (var prop in config_) config[prop] = config_[prop] + + // Return variables for tokenizers + var type, setStyle; + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var ch = stream.next(); + if (ch == "<") { + if (stream.eat("!")) { + if (stream.eat("[")) { + if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); + else return null; + } else if (stream.match("--")) { + return chain(inBlock("comment", "-->")); + } else if (stream.match("DOCTYPE", true, true)) { + stream.eatWhile(/[\w\._\-]/); + return chain(doctype(1)); + } else { + return null; + } + } else if (stream.eat("?")) { + stream.eatWhile(/[\w\._\-]/); + state.tokenize = inBlock("meta", "?>"); + return "meta"; + } else { + type = stream.eat("/") ? "closeTag" : "openTag"; + state.tokenize = inTag; + return "tag bracket"; + } + } else if (ch == "&") { + var ok; + if (stream.eat("#")) { + if (stream.eat("x")) { + ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); + } else { + ok = stream.eatWhile(/[\d]/) && stream.eat(";"); + } + } else { + ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); + } + return ok ? "atom" : "error"; + } else { + stream.eatWhile(/[^&<]/); + return null; + } + } + inText.isInText = true; + + function inTag(stream, state) { + var ch = stream.next(); + if (ch == ">" || (ch == "/" && stream.eat(">"))) { + state.tokenize = inText; + type = ch == ">" ? "endTag" : "selfcloseTag"; + return "tag bracket"; + } else if (ch == "=") { + type = "equals"; + return null; + } else if (ch == "<") { + state.tokenize = inText; + state.state = baseState; + state.tagName = state.tagStart = null; + var next = state.tokenize(stream, state); + return next ? next + " tag error" : "tag error"; + } else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + state.stringStartCol = stream.column(); + return state.tokenize(stream, state); + } else { + stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); + return "word"; + } + } + + function inAttribute(quote) { + var closure = function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inTag; + break; + } + } + return "string"; + }; + closure.isInAttribute = true; + return closure; + } + + function inBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + return style; + }; + } + function doctype(depth) { + return function(stream, state) { + var ch; + while ((ch = stream.next()) != null) { + if (ch == "<") { + state.tokenize = doctype(depth + 1); + return state.tokenize(stream, state); + } else if (ch == ">") { + if (depth == 1) { + state.tokenize = inText; + break; + } else { + state.tokenize = doctype(depth - 1); + return state.tokenize(stream, state); + } + } + } + return "meta"; + }; + } + + function Context(state, tagName, startOfLine) { + this.prev = state.context; + this.tagName = tagName; + this.indent = state.indented; + this.startOfLine = startOfLine; + if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) + this.noIndent = true; + } + function popContext(state) { + if (state.context) state.context = state.context.prev; + } + function maybePopContext(state, nextTagName) { + var parentTagName; + while (true) { + if (!state.context) { + return; + } + parentTagName = state.context.tagName; + if (!config.contextGrabbers.hasOwnProperty(parentTagName) || + !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { + return; + } + popContext(state); + } + } + + function baseState(type, stream, state) { + if (type == "openTag") { + state.tagStart = stream.column(); + return tagNameState; + } else if (type == "closeTag") { + return closeTagNameState; + } else { + return baseState; + } + } + function tagNameState(type, stream, state) { + if (type == "word") { + state.tagName = stream.current(); + setStyle = "tag"; + return attrState; + } else { + setStyle = "error"; + return tagNameState; + } + } + function closeTagNameState(type, stream, state) { + if (type == "word") { + var tagName = stream.current(); + if (state.context && state.context.tagName != tagName && + config.implicitlyClosed.hasOwnProperty(state.context.tagName)) + popContext(state); + if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { + setStyle = "tag"; + return closeState; + } else { + setStyle = "tag error"; + return closeStateErr; + } + } else { + setStyle = "error"; + return closeStateErr; + } + } + + function closeState(type, _stream, state) { + if (type != "endTag") { + setStyle = "error"; + return closeState; + } + popContext(state); + return baseState; + } + function closeStateErr(type, stream, state) { + setStyle = "error"; + return closeState(type, stream, state); + } + + function attrState(type, _stream, state) { + if (type == "word") { + setStyle = "attribute"; + return attrEqState; + } else if (type == "endTag" || type == "selfcloseTag") { + var tagName = state.tagName, tagStart = state.tagStart; + state.tagName = state.tagStart = null; + if (type == "selfcloseTag" || + config.autoSelfClosers.hasOwnProperty(tagName)) { + maybePopContext(state, tagName); + } else { + maybePopContext(state, tagName); + state.context = new Context(state, tagName, tagStart == state.indented); + } + return baseState; + } + setStyle = "error"; + return attrState; + } + function attrEqState(type, stream, state) { + if (type == "equals") return attrValueState; + if (!config.allowMissing) setStyle = "error"; + return attrState(type, stream, state); + } + function attrValueState(type, stream, state) { + if (type == "string") return attrContinuedState; + if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} + setStyle = "error"; + return attrState(type, stream, state); + } + function attrContinuedState(type, stream, state) { + if (type == "string") return attrContinuedState; + return attrState(type, stream, state); + } + + return { + startState: function(baseIndent) { + var state = {tokenize: inText, + state: baseState, + indented: baseIndent || 0, + tagName: null, tagStart: null, + context: null} + if (baseIndent != null) state.baseIndent = baseIndent + return state + }, + + token: function(stream, state) { + if (!state.tagName && stream.sol()) + state.indented = stream.indentation(); + + if (stream.eatSpace()) return null; + type = null; + var style = state.tokenize(stream, state); + if ((style || type) && style != "comment") { + setStyle = null; + state.state = state.state(type || style, stream, state); + if (setStyle) + style = setStyle == "error" ? style + " error" : setStyle; + } + return style; + }, + + indent: function(state, textAfter, fullLine) { + var context = state.context; + // Indent multi-line strings (e.g. css). + if (state.tokenize.isInAttribute) { + if (state.tagStart == state.indented) + return state.stringStartCol + 1; + else + return state.indented + indentUnit; + } + if (context && context.noIndent) return CodeMirror.Pass; + if (state.tokenize != inTag && state.tokenize != inText) + return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; + // Indent the starts of attribute names. + if (state.tagName) { + if (config.multilineTagIndentPastTag !== false) + return state.tagStart + state.tagName.length + 2; + else + return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); + } + if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0; + var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter); + if (tagAfter && tagAfter[1]) { // Closing tag spotted + while (context) { + if (context.tagName == tagAfter[2]) { + context = context.prev; + break; + } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) { + context = context.prev; + } else { + break; + } + } + } else if (tagAfter) { // Opening tag spotted + while (context) { + var grabbers = config.contextGrabbers[context.tagName]; + if (grabbers && grabbers.hasOwnProperty(tagAfter[2])) + context = context.prev; + else + break; + } + } + while (context && context.prev && !context.startOfLine) + context = context.prev; + if (context) return context.indent + indentUnit; + else return state.baseIndent || 0; + }, + + electricInput: /<\/[\s\w:]+>$/, + blockCommentStart: "<!--", + blockCommentEnd: "-->", + + configuration: config.htmlMode ? "html" : "xml", + helperType: config.htmlMode ? "html" : "xml", + + skipAttribute: function(state) { + if (state.state == attrValueState) + state.state = attrState + } + }; +}); + +CodeMirror.defineMIME("text/xml", "xml"); +CodeMirror.defineMIME("application/xml", "xml"); +if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) + CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/ttcn-cfg/ttcn-cfg.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("ttcn-cfg", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {}, + externalCommands = parserConfig.externalCommands || {}, + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false; + var isOperatorChar = /[\|]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[:=]/.test(ch)) { + curPunc = ch; + return "punctuation"; + } + if (ch == "#"){ + stream.skipToEnd(); + return "comment"; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + if (ch == "["){ + stream.eatWhile(/[\w_\]]/); + return "number sectionTitle"; + } + + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (fileNCtrlMaskOptions.propertyIsEnumerable(cur)) + return "negative fileNCtrlMaskOptions"; + if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands"; + + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped){ + var afterNext = stream.peek(); + //look if the character if the quote is like the B in '10100010'B + if (afterNext){ + afterNext = afterNext.toLowerCase(); + if(afterNext == "b" || afterNext == "h" || afterNext == "o") + stream.next(); + } + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + //Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") + && ctx.type == "statement"){ + popContext(state); + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") + && curPunc != ';') || (ctx.type == "statement" + && curPunc == "newstatement"))) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + return style; + }, + + electricChars: "{}", + lineComment: "#", + fold: "brace" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) + obj[words[i]] = true; + return obj; + } + + CodeMirror.defineMIME("text/x-ttcn-cfg", { + name: "ttcn-cfg", + keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" + + " TimeStampFormat LogEventTypes SourceInfoFormat" + + " LogEntityName LogSourceInfo DiskFullAction" + + " LogFileNumber LogFileSize MatchingHints Detailed" + + " Compact SubCategories Stack Single None Seconds" + + " DateTime Time Stop Error Retry Delete TCPPort KillTimer" + + " NumHCs UnixSocketsEnabled LocalAddress"), + fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" + + " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" + + " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" + + " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" + + " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" + + " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" + + " VERDICTOP DEFAULTOP TESTCASE ACTION USER" + + " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" + + " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" + + " DEBUG_ENCDEC DEBUG_TESTPORT" + + " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" + + " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" + + " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" + + " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" + + " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" + + " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" + + " FUNCTION_RND FUNCTION_UNQUALIFIED" + + " MATCHING_DONE MATCHING_MCSUCCESS" + + " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" + + " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" + + " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" + + " MATCHING_PMUNSUCC MATCHING_PROBLEM" + + " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" + + " PARALLEL_PORTCONN PARALLEL_PORTMAP" + + " PARALLEL_PTC PARALLEL_UNQUALIFIED" + + " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" + + " PORTEVENT_MCRECV PORTEVENT_MCSEND" + + " PORTEVENT_MMRECV PORTEVENT_MMSEND" + + " PORTEVENT_MQUEUE PORTEVENT_PCIN" + + " PORTEVENT_PCOUT PORTEVENT_PMIN" + + " PORTEVENT_PMOUT PORTEVENT_PQUEUE" + + " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" + + " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" + + " TESTCASE_FINISH TESTCASE_START" + + " TESTCASE_UNQUALIFIED TIMEROP_GUARD" + + " TIMEROP_READ TIMEROP_START TIMEROP_STOP" + + " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" + + " USER_UNQUALIFIED VERDICTOP_FINAL" + + " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" + + " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"), + externalCommands: words("BeginControlPart EndControlPart BeginTestCase" + + " EndTestCase"), + multiLineStrings: true + }); +});/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/ttcn/ttcn.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("ttcn", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + builtin = parserConfig.builtin || {}, + timerOps = parserConfig.timerOps || {}, + portOps = parserConfig.portOps || {}, + configOps = parserConfig.configOps || {}, + verdictOps = parserConfig.verdictOps || {}, + sutOps = parserConfig.sutOps || {}, + functionOps = parserConfig.functionOps || {}, + + verdictConsts = parserConfig.verdictConsts || {}, + booleanConsts = parserConfig.booleanConsts || {}, + otherConsts = parserConfig.otherConsts || {}, + + types = parserConfig.types || {}, + visibilityModifiers = parserConfig.visibilityModifiers || {}, + templateMatch = parserConfig.templateMatch || {}, + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false; + var isOperatorChar = /[+\-*&@=<>!\/]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) { + curPunc = ch; + return "punctuation"; + } + if (ch == "#"){ + stream.skipToEnd(); + return "atom preprocessor"; + } + if (ch == "%"){ + stream.eatWhile(/\b/); + return "atom ttcn3Macros"; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + if(ch == "@"){ + if(stream.match("try") || stream.match("catch") + || stream.match("lazy")){ + return "keyword"; + } + } + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + var cur = stream.current(); + + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (builtin.propertyIsEnumerable(cur)) return "builtin"; + + if (timerOps.propertyIsEnumerable(cur)) return "def timerOps"; + if (configOps.propertyIsEnumerable(cur)) return "def configOps"; + if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps"; + if (portOps.propertyIsEnumerable(cur)) return "def portOps"; + if (sutOps.propertyIsEnumerable(cur)) return "def sutOps"; + if (functionOps.propertyIsEnumerable(cur)) return "def functionOps"; + + if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts"; + if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts"; + if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts"; + + if (types.propertyIsEnumerable(cur)) return "builtin types"; + if (visibilityModifiers.propertyIsEnumerable(cur)) + return "builtin visibilityModifiers"; + if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch"; + + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped){ + var afterQuote = stream.peek(); + //look if the character after the quote is like the B in '10100010'B + if (afterQuote){ + afterQuote = afterQuote.toLowerCase(); + if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o") + stream.next(); + } + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + //Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") + && ctx.type == "statement"){ + popContext(state); + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && + (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || + (ctx.type == "statement" && curPunc == "newstatement"))) + pushContext(state, stream.column(), "statement"); + + state.startOfLine = false; + + return style; + }, + + electricChars: "{}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//", + fold: "brace" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + function def(mimes, mode) { + if (typeof mimes == "string") mimes = [mimes]; + var words = []; + function add(obj) { + if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop)) + words.push(prop); + } + + add(mode.keywords); + add(mode.builtin); + add(mode.timerOps); + add(mode.portOps); + + if (words.length) { + mode.helperType = mimes[0]; + CodeMirror.registerHelper("hintWords", mimes[0], words); + } + + for (var i = 0; i < mimes.length; ++i) + CodeMirror.defineMIME(mimes[i], mode); + } + + def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], { + name: "ttcn", + keywords: words("activate address alive all alt altstep and and4b any" + + " break case component const continue control deactivate" + + " display do else encode enumerated except exception" + + " execute extends extension external for from function" + + " goto group if import in infinity inout interleave" + + " label language length log match message mixed mod" + + " modifies module modulepar mtc noblock not not4b nowait" + + " of on optional or or4b out override param pattern port" + + " procedure record recursive rem repeat return runs select" + + " self sender set signature system template testcase to" + + " type union value valueof var variant while with xor xor4b"), + builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" + + " decomp decvalue float2int float2str hex2bit hex2int" + + " hex2oct hex2str int2bit int2char int2float int2hex" + + " int2oct int2str int2unichar isbound ischosen ispresent" + + " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" + + " oct2str regexp replace rnd sizeof str2bit str2float" + + " str2hex str2int str2oct substr unichar2int unichar2char" + + " enum2int"), + types: words("anytype bitstring boolean char charstring default float" + + " hexstring integer objid octetstring universal verdicttype timer"), + timerOps: words("read running start stop timeout"), + portOps: words("call catch check clear getcall getreply halt raise receive" + + " reply send trigger"), + configOps: words("create connect disconnect done kill killed map unmap"), + verdictOps: words("getverdict setverdict"), + sutOps: words("action"), + functionOps: words("apply derefers refers"), + + verdictConsts: words("error fail inconc none pass"), + booleanConsts: words("true false"), + otherConsts: words("null NULL omit"), + + visibilityModifiers: words("private public friend"), + templateMatch: words("complement ifpresent subset superset permutation"), + multiLineStrings: true + }); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/z80/z80.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('z80', function(_config, parserConfig) { + var ez80 = parserConfig.ez80; + var keywords1, keywords2; + if (ez80) { + keywords1 = /^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i; + keywords2 = /^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i; + } else { + keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; + keywords2 = /^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i; + } + + var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; + var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; + var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; + var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i; + + return { + startState: function() { + return { + context: 0 + }; + }, + token: function(stream, state) { + if (!stream.column()) + state.context = 0; + + if (stream.eatSpace()) + return null; + + var w; + + if (stream.eatWhile(/\w/)) { + if (ez80 && stream.eat('.')) { + stream.eatWhile(/\w/); + } + w = stream.current(); + + if (stream.indentation()) { + if ((state.context == 1 || state.context == 4) && variables1.test(w)) { + state.context = 4; + return 'var2'; + } + + if (state.context == 2 && variables2.test(w)) { + state.context = 4; + return 'var3'; + } + + if (keywords1.test(w)) { + state.context = 1; + return 'keyword'; + } else if (keywords2.test(w)) { + state.context = 2; + return 'keyword'; + } else if (state.context == 4 && numbers.test(w)) { + return 'number'; + } + + if (errors.test(w)) + return 'error'; + } else if (stream.match(numbers)) { + return 'number'; + } else { + return null; + } + } else if (stream.eat(';')) { + stream.skipToEnd(); + return 'comment'; + } else if (stream.eat('"')) { + while (w = stream.next()) { + if (w == '"') + break; + + if (w == '\\') + stream.next(); + } + return 'string'; + } else if (stream.eat('\'')) { + if (stream.match(/\\?.'/)) + return 'number'; + } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { + state.context = 5; + + if (stream.eatWhile(/\w/)) + return 'def'; + } else if (stream.eat('$')) { + if (stream.eatWhile(/[\da-f]/i)) + return 'number'; + } else if (stream.eat('%')) { + if (stream.eatWhile(/[01]/)) + return 'number'; + } else { + stream.next(); + } + return null; + } + }; +}); + +CodeMirror.defineMIME("text/x-z80", "z80"); +CodeMirror.defineMIME("text/x-ez80", { name: "z80", ez80: true }); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/brainfuck/brainfuck.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11 + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") + mod(require("../../lib/codemirror")) + else if (typeof define == "function" && define.amd) + define(["../../lib/codemirror"], mod) + else + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + var reserve = "><+-.,[]".split(""); + /* + comments can be either: + placed behind lines + + +++ this is a comment + + where reserved characters cannot be used + or in a loop + [ + this is ok to use [ ] and stuff + ] + or preceded by # + */ + CodeMirror.defineMode("brainfuck", function() { + return { + startState: function() { + return { + commentLine: false, + left: 0, + right: 0, + commentLoop: false + } + }, + token: function(stream, state) { + if (stream.eatSpace()) return null + if(stream.sol()){ + state.commentLine = false; + } + var ch = stream.next().toString(); + if(reserve.indexOf(ch) !== -1){ + if(state.commentLine === true){ + if(stream.eol()){ + state.commentLine = false; + } + return "comment"; + } + if(ch === "]" || ch === "["){ + if(ch === "["){ + state.left++; + } + else{ + state.right++; + } + return "bracket"; + } + else if(ch === "+" || ch === "-"){ + return "keyword"; + } + else if(ch === "<" || ch === ">"){ + return "atom"; + } + else if(ch === "." || ch === ","){ + return "def"; + } + } + else{ + state.commentLine = true; + if(stream.eol()){ + state.commentLine = false; + } + return "comment"; + } + if(stream.eol()){ + state.commentLine = false; + } + } + }; + }); +CodeMirror.defineMIME("text/x-brainfuck","brainfuck") +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/forth/forth.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Author: Aliaksei Chapyzhenka + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + function toWordList(words) { + var ret = []; + words.split(' ').forEach(function(e){ + ret.push({name: e}); + }); + return ret; + } + + var coreWordList = toWordList( +'INVERT AND OR XOR\ + 2* 2/ LSHIFT RSHIFT\ + 0= = 0< < > U< MIN MAX\ + 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\ + >R R> R@\ + + - 1+ 1- ABS NEGATE\ + S>D * M* UM*\ + FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\ + HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\ + ALIGN ALIGNED +! ALLOT\ + CHAR [CHAR] [ ] BL\ + FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\ + ; DOES> >BODY\ + EVALUATE\ + SOURCE >IN\ + <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\ + FILL MOVE\ + . CR EMIT SPACE SPACES TYPE U. .R U.R\ + ACCEPT\ + TRUE FALSE\ + <> U> 0<> 0>\ + NIP TUCK ROLL PICK\ + 2>R 2R@ 2R>\ + WITHIN UNUSED MARKER\ + I J\ + TO\ + COMPILE, [COMPILE]\ + SAVE-INPUT RESTORE-INPUT\ + PAD ERASE\ + 2LITERAL DNEGATE\ + D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\ + M+ M*/ D. D.R 2ROT DU<\ + CATCH THROW\ + FREE RESIZE ALLOCATE\ + CS-PICK CS-ROLL\ + GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\ + PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\ + -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL'); + + var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE'); + + CodeMirror.defineMode('forth', function() { + function searchWordList (wordList, word) { + var i; + for (i = wordList.length - 1; i >= 0; i--) { + if (wordList[i].name === word.toUpperCase()) { + return wordList[i]; + } + } + return undefined; + } + return { + startState: function() { + return { + state: '', + base: 10, + coreWordList: coreWordList, + immediateWordList: immediateWordList, + wordList: [] + }; + }, + token: function (stream, stt) { + var mat; + if (stream.eatSpace()) { + return null; + } + if (stt.state === '') { // interpretation + if (stream.match(/^(\]|:NONAME)(\s|$)/i)) { + stt.state = ' compilation'; + return 'builtin compilation'; + } + mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/); + if (mat) { + stt.wordList.push({name: mat[2].toUpperCase()}); + stt.state = ' compilation'; + return 'def' + stt.state; + } + mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i); + if (mat) { + stt.wordList.push({name: mat[2].toUpperCase()}); + return 'def' + stt.state; + } + mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/); + if (mat) { + return 'builtin' + stt.state; + } + } else { // compilation + // ; [ + if (stream.match(/^(\;|\[)(\s)/)) { + stt.state = ''; + stream.backUp(1); + return 'builtin compilation'; + } + if (stream.match(/^(\;|\[)($)/)) { + stt.state = ''; + return 'builtin compilation'; + } + if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) { + return 'builtin'; + } + } + + // dynamic wordlist + mat = stream.match(/^(\S+)(\s+|$)/); + if (mat) { + if (searchWordList(stt.wordList, mat[1]) !== undefined) { + return 'variable' + stt.state; + } + + // comments + if (mat[1] === '\\') { + stream.skipToEnd(); + return 'comment' + stt.state; + } + + // core words + if (searchWordList(stt.coreWordList, mat[1]) !== undefined) { + return 'builtin' + stt.state; + } + if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) { + return 'keyword' + stt.state; + } + + if (mat[1] === '(') { + stream.eatWhile(function (s) { return s !== ')'; }); + stream.eat(')'); + return 'comment' + stt.state; + } + + // // strings + if (mat[1] === '.(') { + stream.eatWhile(function (s) { return s !== ')'; }); + stream.eat(')'); + return 'string' + stt.state; + } + if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') { + stream.eatWhile(function (s) { return s !== '"'; }); + stream.eat('"'); + return 'string' + stt.state; + } + + // numbers + if (mat[1] - 0xfffffffff) { + return 'number' + stt.state; + } + // if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) { + // return 'number' + stt.state; + // } + + return 'atom' + stt.state; + } + } + }; + }); + CodeMirror.defineMIME("text/x-forth", "forth"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/nginx/nginx.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("nginx", function(config) { + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var keywords = words( + /* ngxDirectiveControl */ "break return rewrite set" + + /* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23" + ); + + var keywords_block = words( + /* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map" + ); + + var keywords_important = words( + /* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files" + ); + + var indentUnit = config.indentUnit, type; + function ret(style, tp) {type = tp; return style;} + + function tokenBase(stream, state) { + + + stream.eatWhile(/[\w\$_]/); + + var cur = stream.current(); + + + if (keywords.propertyIsEnumerable(cur)) { + return "keyword"; + } + else if (keywords_block.propertyIsEnumerable(cur)) { + return "variable-2"; + } + else if (keywords_important.propertyIsEnumerable(cur)) { + return "string-2"; + } + /**/ + + var ch = stream.next(); + if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} + else if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + else if (ch == "<" && stream.eat("!")) { + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + } + else if (ch == "=") ret(null, "compare"); + else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + else if (ch == "#") { + stream.skipToEnd(); + return ret("comment", "comment"); + } + else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } + else if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } + else if (/[,.+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } + else if (/[;{}:\[\]]/.test(ch)) { + return ret(null, ch); + } + else { + stream.eatWhile(/[\w\\\-]/); + return ret("variable", "variable"); + } + } + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = tokenBase; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ret("comment", "comment"); + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) + break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + type = null; + var style = state.tokenize(stream, state); + + var context = state.stack[state.stack.length-1]; + if (type == "hash" && context == "rule") style = "atom"; + else if (style == "variable") { + if (context == "rule") style = "number"; + else if (!context || context == "@media{") style = "tag"; + } + + if (context == "rule" && /^[\{\};]$/.test(type)) + state.stack.pop(); + if (type == "{") { + if (context == "@media") state.stack[state.stack.length-1] = "@media{"; + else state.stack.push("{"); + } + else if (type == "}") state.stack.pop(); + else if (type == "@media") state.stack.push("@media"); + else if (context == "{" && type != "comment") state.stack.push("rule"); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + if (/^\}/.test(textAfter)) + n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; + return state.baseIndent + n * indentUnit; + }, + + electricChars: "}" + }; +}); + +CodeMirror.defineMIME("text/x-nginx-conf", "nginx"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/javascript/javascript.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonldMode = parserConfig.jsonld; + var jsonMode = parserConfig.json || jsonldMode; + var isTS = parserConfig.typescript; + var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + var jsKeywords = { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C, + "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this"), "class": kw("class"), "super": kw("atom"), + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, + "await": C + }; + + // Extend the 'normal' keywords with the TypeScript language extensions + if (isTS) { + var type = {type: "variable", style: "type"}; + var tsKeywords = { + // object-like things + "interface": kw("class"), + "implements": C, + "namespace": C, + + // scope modifiers + "public": kw("modifier"), + "private": kw("modifier"), + "protected": kw("modifier"), + "abstract": kw("modifier"), + "readonly": kw("modifier"), + + // types + "string": type, "number": type, "boolean": type, "any": type + }; + + for (var attr in tsKeywords) { + jsKeywords[attr] = tsKeywords[attr]; + } + } + + return jsKeywords; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^@]/; + var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; + + function readRegexp(stream) { + var escaped = false, next, inSet = false; + while ((next = stream.next()) != null) { + if (!escaped) { + if (next == "/" && !inSet) return; + if (next == "[") inSet = true; + else if (inSet && next == "]") inSet = false; + } + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { + return ret("number", "number"); + } else if (ch == "." && stream.match("..")) { + return ret("spread", "meta"); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "=" && stream.eat(">")) { + return ret("=>", "operator"); + } else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/o/i)) { + stream.eatWhile(/[0-7]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/b/i)) { + stream.eatWhile(/[01]/i); + return ret("number", "number"); + } else if (/\d/.test(ch)) { + stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else if (expressionAllowed(stream, state, 1)) { + readRegexp(stream); + stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); + return ret("regexp", "string-2"); + } else { + stream.eat("="); + return ret("operator", "operator", stream.current()); + } + } else if (ch == "`") { + state.tokenize = tokenQuasi; + return tokenQuasi(stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } else if (isOperatorChar.test(ch)) { + if (ch != ">" || !state.lexical || state.lexical.type != ">") { + if (stream.eat("=")) { + if (ch == "!" || ch == "=") stream.eat("=") + } else if (/[<>*+\-]/.test(ch)) { + stream.eat(ch) + if (ch == ">") stream.eat(ch) + } + } + return ret("operator", "operator", stream.current()); + } else if (wordRE.test(ch)) { + stream.eatWhile(wordRE); + var word = stream.current() + if (state.lastType != ".") { + if (keywords.propertyIsEnumerable(word)) { + var kw = keywords[word] + return ret(kw.type, kw.style, word) + } + if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\(\w]/, false)) + return ret("async", "keyword", word) + } + return ret("variable", "variable", word) + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ + state.tokenize = tokenBase; + return ret("jsonld-keyword", "meta"); + } + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenQuasi(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && next == "\\"; + } + return ret("quasi", "string-2", stream.current()); + } + + var brackets = "([{}])"; + // This is a crude lookahead trick to try and notice that we're + // parsing the argument patterns for a fat-arrow function before we + // actually hit the arrow token. It only works if the arrow is on + // the same line as the arguments and there's no strange noise + // (comments) in between. Fallback is to only notice when we hit the + // arrow, and not declare the arguments as locals for the arrow + // body. + function findFatArrow(stream, state) { + if (state.fatArrowAt) state.fatArrowAt = null; + var arrow = stream.string.indexOf("=>", stream.start); + if (arrow < 0) return; + + if (isTS) { // Try to skip TypeScript return type declarations after the arguments + var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)) + if (m) arrow = m.index + } + + var depth = 0, sawSomething = false; + for (var pos = arrow - 1; pos >= 0; --pos) { + var ch = stream.string.charAt(pos); + var bracket = brackets.indexOf(ch); + if (bracket >= 0 && bracket < 3) { + if (!depth) { ++pos; break; } + if (--depth == 0) { if (ch == "(") sawSomething = true; break; } + } else if (bracket >= 3 && bracket < 6) { + ++depth; + } else if (wordRE.test(ch)) { + sawSomething = true; + } else if (/["'\/]/.test(ch)) { + return; + } else if (sawSomething && !depth) { + ++pos; + break; + } + } + if (sawSomething && !depth) state.fatArrowAt = pos; + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + for (var cx = state.context; cx; cx = cx.prev) { + for (var v = cx.vars; v; v = v.next) + if (v.name == varname) return true; + } + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function register(varname) { + function inList(list) { + for (var v = list; v; v = v.next) + if (v.name == varname) return true; + return false; + } + var state = cx.state; + cx.marked = "def"; + if (state.context) { + if (inList(state.localVars)) return; + state.localVars = {name: varname, next: state.localVars}; + } else { + if (inList(state.globalVars)) return; + if (parserConfig.globalVars) + state.globalVars = {name: varname, next: state.globalVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: {name: "arguments"}}; + function pushcontext() { + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + cx.state.localVars = defaultVars; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) + indent = outer.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function exp(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(exp); + }; + return exp; + } + + function statement(type, value) { + if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); + if (type == "debugger") return cont(expect(";")); + if (type == "{") return cont(pushlex("}"), block, poplex); + if (type == ";") return cont(); + if (type == "if") { + if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) + cx.state.cc.pop()(); + return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); + } + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); + if (type == "variable") { + if (isTS && value == "type") { + cx.marked = "keyword" + return cont(typeexpr, expect("operator"), typeexpr, expect(";")); + } else if (isTS && value == "declare") { + cx.marked = "keyword" + return cont(statement) + } else if (isTS && (value == "module" || value == "enum") && cx.stream.match(/^\s*\w/, false)) { + cx.marked = "keyword" + return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) + } else { + return cont(pushlex("stat"), maybelabel); + } + } + if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + if (type == "class") return cont(pushlex("form"), className, poplex); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "async") return cont(statement) + if (value == "@") return cont(expression, statement) + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + return expressionInner(type, false); + } + function expressionNoComma(type) { + return expressionInner(type, true); + } + function parenExpr(type) { + if (type != "(") return pass() + return cont(pushlex(")"), expression, expect(")"), poplex) + } + function expressionInner(type, noComma) { + if (cx.state.fatArrowAt == cx.stream.start) { + var body = noComma ? arrowBodyNoComma : arrowBody; + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext); + else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); + } + + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef, maybeop); + if (type == "class") return cont(pushlex("form"), classExpression, poplex); + if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); + if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); + if (type == "{") return contCommasep(objprop, "}", null, maybeop); + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, false); + } + function maybeoperatorNoComma(type, value, noComma) { + var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; + var expr = noComma == false ? expression : expressionNoComma; + if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); + if (type == "operator") { + if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); + if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false)) + return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); + if (value == "?") return cont(expression, expect(":"), expr); + return cont(expr); + } + if (type == "quasi") { return pass(quasi, me); } + if (type == ";") return; + if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) } + if (type == "regexp") { + cx.state.lastType = cx.marked = "operator" + cx.stream.backUp(cx.stream.pos - cx.stream.start - 1) + return cont(expr) + } + } + function quasi(type, value) { + if (type != "quasi") return pass(); + if (value.slice(value.length - 2) != "${") return cont(quasi); + return cont(expression, continueQuasi); + } + function continueQuasi(type) { + if (type == "}") { + cx.marked = "string-2"; + cx.state.tokenize = tokenQuasi; + return cont(quasi); + } + } + function arrowBody(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expression); + } + function arrowBodyNoComma(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expressionNoComma); + } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma) + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "async") { + cx.marked = "property"; + return cont(objprop); + } else if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params + if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) + cx.state.fatArrowAt = cx.stream.pos + m[0].length + return cont(afterprop); + } else if (type == "number" || type == "string") { + cx.marked = jsonldMode ? "property" : (cx.style + " property"); + return cont(afterprop); + } else if (type == "jsonld-keyword") { + return cont(afterprop); + } else if (type == "modifier") { + return cont(objprop) + } else if (type == "[") { + return cont(expression, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expressionNoComma, afterprop); + } else if (value == "*") { + cx.marked = "keyword"; + return cont(objprop); + } else if (type == ":") { + return pass(afterprop) + } + } + function getterSetter(type) { + if (type != "variable") return pass(afterprop); + cx.marked = "property"; + return cont(functiondef); + } + function afterprop(type) { + if (type == ":") return cont(expressionNoComma); + if (type == "(") return pass(functiondef); + } + function commasep(what, end, sep) { + function proceed(type, value) { + if (sep ? sep.indexOf(type) > -1 : type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(function(type, value) { + if (type == end || value == end) return pass() + return pass(what) + }, proceed); + } + if (type == end || value == end) return cont(); + return cont(expect(end)); + } + return function(type, value) { + if (type == end || value == end) return cont(); + return pass(what, proceed); + }; + } + function contCommasep(what, end, info) { + for (var i = 3; i < arguments.length; i++) + cx.cc.push(arguments[i]); + return cont(pushlex(end, info), commasep(what, end), poplex); + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type, value) { + if (isTS) { + if (type == ":") return cont(typeexpr); + if (value == "?") return cont(maybetype); + } + } + function mayberettype(type) { + if (isTS && type == ":") { + if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) + else return cont(typeexpr) + } + } + function isKW(_, value) { + if (value == "is") { + cx.marked = "keyword" + return cont() + } + } + function typeexpr(type, value) { + if (type == "variable" || value == "void") { + if (value == "keyof") { + cx.marked = "keyword" + return cont(typeexpr) + } else { + cx.marked = "type" + return cont(afterType) + } + } + if (type == "string" || type == "number" || type == "atom") return cont(afterType); + if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) + if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType) + if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType) + } + function maybeReturnType(type) { + if (type == "=>") return cont(typeexpr) + } + function typeprop(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property" + return cont(typeprop) + } else if (value == "?") { + return cont(typeprop) + } else if (type == ":") { + return cont(typeexpr) + } else if (type == "[") { + return cont(expression, maybetype, expect("]"), typeprop) + } + } + function typearg(type) { + if (type == "variable") return cont(typearg) + else if (type == ":") return cont(typeexpr) + } + function afterType(type, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) + if (value == "|" || type == ".") return cont(typeexpr) + if (type == "[") return cont(expect("]"), afterType) + if (value == "extends") return cont(typeexpr) + } + function maybeTypeArgs(_, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) + } + function typeparam() { + return pass(typeexpr, maybeTypeDefault) + } + function maybeTypeDefault(_, value) { + if (value == "=") return cont(typeexpr) + } + function vardef() { + return pass(pattern, maybetype, maybeAssign, vardefCont); + } + function pattern(type, value) { + if (type == "modifier") return cont(pattern) + if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); + if (type == "[") return contCommasep(pattern, "]"); + if (type == "{") return contCommasep(proppattern, "}"); + } + function proppattern(type, value) { + if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { + register(value); + return cont(maybeAssign); + } + if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); + return cont(expect(":"), pattern, maybeAssign); + } + function maybeAssign(_type, value) { + if (value == "=") return cont(expressionNoComma); + } + function vardefCont(type) { + if (type == ",") return cont(vardef); + } + function maybeelse(type, value) { + if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); + } + function forspec(type) { + if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); + } + function forspec1(type) { + if (type == "var") return cont(vardef, expect(";"), forspec2); + if (type == ";") return cont(forspec2); + if (type == "variable") return cont(formaybeinof); + return pass(expression, expect(";"), forspec2); + } + function formaybeinof(_type, value) { + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return cont(maybeoperatorComma, forspec2); + } + function forspec2(type, value) { + if (type == ";") return cont(forspec3); + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } + return pass(expression, expect(";"), forspec3); + } + function forspec3(type) { + if (type != ")") cont(expression); + } + function functiondef(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); + if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) + } + function funarg(type, value) { + if (value == "@") cont(expression, funarg) + if (type == "spread" || type == "modifier") return cont(funarg); + return pass(pattern, maybetype, maybeAssign); + } + function classExpression(type, value) { + // Class expressions may have an optional name. + if (type == "variable") return className(type, value); + return classNameAfter(type, value); + } + function className(type, value) { + if (type == "variable") {register(value); return cont(classNameAfter);} + } + function classNameAfter(type, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter) + if (value == "extends" || value == "implements" || (isTS && type == ",")) + return cont(isTS ? typeexpr : expression, classNameAfter); + if (type == "{") return cont(pushlex("}"), classBody, poplex); + } + function classBody(type, value) { + if (type == "modifier" || type == "async" || + (type == "variable" && + (value == "static" || value == "get" || value == "set") && + cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + return cont(isTS ? classfield : functiondef, classBody); + } + if (type == "[") + return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody) + if (value == "*") { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == ";") return cont(classBody); + if (type == "}") return cont(); + if (value == "@") return cont(expression, classBody) + } + function classfield(type, value) { + if (value == "?") return cont(classfield) + if (type == ":") return cont(typeexpr, maybeAssign) + if (value == "=") return cont(expressionNoComma) + return pass(functiondef) + } + function afterExport(type, value) { + if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } + if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } + if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); + return pass(statement); + } + function exportField(type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); } + if (type == "variable") return pass(expressionNoComma, exportField); + } + function afterImport(type) { + if (type == "string") return cont(); + return pass(importSpec, maybeMoreImports, maybeFrom); + } + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); + if (value == "*") cx.marked = "keyword"; + return cont(maybeAs); + } + function maybeMoreImports(type) { + if (type == ",") return cont(importSpec, maybeMoreImports) + } + function maybeAs(_type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } + } + function arrayLiteral(type) { + if (type == "]") return cont(); + return pass(commasep(expressionNoComma, "]")); + } + + function isContinuedStatement(state, textAfter) { + return state.lastType == "operator" || state.lastType == "," || + isOperatorChar.test(textAfter.charAt(0)) || + /[,.]/.test(textAfter.charAt(0)); + } + + function expressionAllowed(stream, state, backUp) { + return state.tokenize == tokenBase && + /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) + } + + // Interface + + return { + startState: function(basecolumn) { + var state = { + tokenize: tokenBase, + lastType: "sof", + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: basecolumn || 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + findFatArrow(stream, state); + } + if (state.tokenize != tokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == tokenComment) return CodeMirror.Pass; + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top + // Kludge to prevent 'maybelse' from blocking lexical scope pops + if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { + var c = state.cc[i]; + if (c == poplex) lexical = lexical.prev; + else if (c != maybeelse) break; + } + while ((lexical.type == "stat" || lexical.type == "form") && + (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) && + (top == maybeoperatorComma || top == maybeoperatorNoComma) && + !/^[,\.=+\-*:?[\(]/.test(textAfter)))) + lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + blockCommentContinue: jsonMode ? null : " * ", + lineComment: jsonMode ? null : "//", + fold: "brace", + closeBrackets: "()[]{}''\"\"``", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } + }; +}); + +CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/x-javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/pascal/pascal.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("pascal", function() { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var keywords = words("and array begin case const div do downto else end file for forward integer " + + "boolean char function goto if in label mod nil not of or packed procedure " + + "program record repeat set string then to type until var while with"); + var atoms = {"null": true}; + + var isOperatorChar = /[+\-*&%=<>!?|\/]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == "#" && state.startOfLine) { + stream.skipToEnd(); + return "meta"; + } + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (ch == "(" && stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (ch == "/") { + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (atoms.propertyIsEnumerable(cur)) return "atom"; + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) {end = true; break;} + escaped = !escaped && next == "\\"; + } + if (end || !escaped) state.tokenize = null; + return "string"; + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == ")" && maybeEnd) { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + // Interface + + return { + startState: function() { + return {tokenize: null}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment" || style == "meta") return style; + return style; + }, + + electricChars: "{}" + }; +}); + +CodeMirror.defineMIME("text/x-pascal", "pascal"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/haxe/haxe.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("haxe", function(config, parserConfig) { + var indentUnit = config.indentUnit; + + // Tokenizer + + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; + var type = kw("typedef"); + var keywords = { + "if": A, "while": A, "else": B, "do": B, "try": B, + "return": C, "break": C, "continue": C, "new": C, "throw": C, + "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), + "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), + "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "never": kw("property_access"), "trace":kw("trace"), + "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, + "true": atom, "false": atom, "null": atom + }; + + var isOperatorChar = /[+\-*&%=<>!?|]/; + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function toUnescaped(stream, end) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (next == end && !escaped) + return true; + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + + function haxeTokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + return chain(stream, state, haxeTokenString(ch)); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "0" && stream.eat(/x/i)) { + stream.eatWhile(/[\da-f]/i); + return ret("number", "number"); + } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/); + return ret("number", "number"); + } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { + toUnescaped(stream, "/"); + stream.eatWhile(/[gimsu]/); + return ret("regexp", "string-2"); + } else if (ch == "/") { + if (stream.eat("*")) { + return chain(stream, state, haxeTokenComment); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } + } else if (ch == "#") { + stream.skipToEnd(); + return ret("conditional", "meta"); + } else if (ch == "@") { + stream.eat(/:/); + stream.eatWhile(/[\w_]/); + return ret ("metadata", "meta"); + } else if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return ret("operator", null, stream.current()); + } else { + var word; + if(/[A-Z]/.test(ch)) { + stream.eatWhile(/[\w_<>]/); + word = stream.current(); + return ret("type", "variable-3", word); + } else { + stream.eatWhile(/[\w_]/); + var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; + return (known && state.kwAllowed) ? ret(known.type, known.style, word) : + ret("variable", "variable", word); + } + } + } + + function haxeTokenString(quote) { + return function(stream, state) { + if (toUnescaped(stream, quote)) + state.tokenize = haxeTokenBase; + return ret("string", "string"); + }; + } + + function haxeTokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = haxeTokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; + + function HaxeLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + } + + function parseHaxe(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + if (type == "variable" && imported(state, content)) return "variable-3"; + return style; + } + } + } + + function imported(state, typename) { + if (/[a-z]/.test(typename.charAt(0))) + return false; + var len = state.importedtypes.length; + for (var i = 0; i<len; i++) + if(state.importedtypes[i]==typename) return true; + } + + function registerimport(importname) { + var state = cx.state; + for (var t = state.importedtypes; t; t = t.next) + if(t.name == importname) return; + state.importedtypes = { name: importname, next: state.importedtypes }; + } + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function inList(name, list) { + for (var v = list; v; v = v.next) + if (v.name == name) return true; + return false; + } + function register(varname) { + var state = cx.state; + if (state.context) { + cx.marked = "def"; + if (inList(varname, state.localVars)) return; + state.localVars = {name: varname, next: state.localVars}; + } else if (state.globalVars) { + if (inList(varname, state.globalVars)) return; + state.globalVars = {name: varname, next: state.globalVars}; + } + } + + // Combinators + + var defaultVars = {name: "this", next: null}; + function pushcontext() { + if (!cx.state.context) cx.state.localVars = defaultVars; + cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; + } + function popcontext() { + cx.state.localVars = cx.state.context.vars; + cx.state.context = cx.state.context.prev; + } + popcontext.lex = true; + function pushlex(type, info) { + var result = function() { + var state = cx.state; + state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function f(type) { + if (type == wanted) return cont(); + else if (wanted == ";") return pass(); + else return cont(f); + } + return f; + } + + function statement(type) { + if (type == "@") return cont(metadef); + if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext); + if (type == ";") return cont(); + if (type == "attribute") return cont(maybeattribute); + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), + poplex, statement, poplex); + if (type == "variable") return cont(pushlex("stat"), maybelabel); + if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + block, poplex, poplex); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), + statement, poplex, popcontext); + if (type == "import") return cont(importdef, expect(";")); + if (type == "typedef") return cont(typedef); + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function expression(type) { + if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); + if (type == "type" ) return cont(maybeoperator); + if (type == "function") return cont(functiondef); + if (type == "keyword c") return cont(maybeexpression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); + if (type == "operator") return cont(expression); + if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator); + if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperator(type, value) { + if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); + if (type == "operator" || type == ":") return cont(expression); + if (type == ";") return; + if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); + if (type == ".") return cont(property, maybeoperator); + if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); + } + + function maybeattribute(type) { + if (type == "attribute") return cont(maybeattribute); + if (type == "function") return cont(functiondef); + if (type == "var") return cont(vardef1); + } + + function metadef(type) { + if(type == ":") return cont(metadef); + if(type == "variable") return cont(metadef); + if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement); + } + function metaargs(type) { + if(type == "variable") return cont(); + } + + function importdef (type, value) { + if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } + else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef); + } + + function typedef (type, value) + { + if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } + else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); } + } + + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperator, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type) { + if (type == "variable") cx.marked = "property"; + if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); + } + function commasep(what, end) { + function proceed(type) { + if (type == ",") return cont(what, proceed); + if (type == end) return cont(); + return cont(expect(end)); + } + return function(type) { + if (type == end) return cont(); + else return pass(what, proceed); + }; + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function vardef1(type, value) { + if (type == "variable"){register(value); return cont(typeuse, vardef2);} + return cont(); + } + function vardef2(type, value) { + if (value == "=") return cont(expression, vardef2); + if (type == ",") return cont(vardef1); + } + function forspec1(type, value) { + if (type == "variable") { + register(value); + return cont(forin, expression) + } else { + return pass() + } + } + function forin(_type, value) { + if (value == "in") return cont(); + } + function functiondef(type, value) { + //function names starting with upper-case letters are recognised as types, so cludging them together here. + if (type == "variable" || type == "type") {register(value); return cont(functiondef);} + if (value == "new") return cont(functiondef); + if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext); + } + function typeuse(type) { + if(type == ":") return cont(typestring); + } + function typestring(type) { + if(type == "type") return cont(); + if(type == "variable") return cont(); + if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex); + } + function typeprop(type) { + if(type == "variable") return cont(typeuse); + } + function funarg(type, value) { + if (type == "variable") {register(value); return cont(typeuse);} + } + + // Interface + return { + startState: function(basecolumn) { + var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"]; + var state = { + tokenize: haxeTokenBase, + reAllowed: true, + kwAllowed: true, + cc: [], + lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + importedtypes: defaulttypes, + context: parserConfig.localVars && {vars: parserConfig.localVars}, + indented: 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/)); + state.kwAllowed = type != '.'; + return parseHaxe(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize != haxeTokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + if (type == "vardef") return lexical.indented + 4; + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "stat" || type == "form") return lexical.indented + indentUnit; + else if (lexical.info == "switch" && !closing) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricChars: "{}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: "//" + }; +}); + +CodeMirror.defineMIME("text/x-haxe", "haxe"); + +CodeMirror.defineMode("hxml", function () { + + return { + startState: function () { + return { + define: false, + inString: false + }; + }, + token: function (stream, state) { + var ch = stream.peek(); + var sol = stream.sol(); + + ///* comments */ + if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + if (sol && ch == "-") { + var style = "variable-2"; + + stream.eat(/-/); + + if (stream.peek() == "-") { + stream.eat(/-/); + style = "keyword a"; + } + + if (stream.peek() == "D") { + stream.eat(/[D]/); + style = "keyword c"; + state.define = true; + } + + stream.eatWhile(/[A-Z]/i); + return style; + } + + var ch = stream.peek(); + + if (state.inString == false && ch == "'") { + state.inString = true; + stream.next(); + } + + if (state.inString == true) { + if (stream.skipTo("'")) { + + } else { + stream.skipToEnd(); + } + + if (stream.peek() == "'") { + stream.next(); + state.inString = false; + } + + return "string"; + } + + stream.next(); + return null; + }, + lineComment: "#" + }; +}); + +CodeMirror.defineMIME("text/x-hxml", "hxml"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/perl/perl.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) +// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("perl",function(){ + // http://perldoc.perl.org + var PERL={ // null - magic touch + // 1 - keyword + // 2 - def + // 3 - atom + // 4 - operator + // 5 - variable-2 (predefined) + // [x,y] - x=1,2,3; y=must be defined if x{...} + // PERL operators + '->' : 4, + '++' : 4, + '--' : 4, + '**' : 4, + // ! ~ \ and unary + and - + '=~' : 4, + '!~' : 4, + '*' : 4, + '/' : 4, + '%' : 4, + 'x' : 4, + '+' : 4, + '-' : 4, + '.' : 4, + '<<' : 4, + '>>' : 4, + // named unary operators + '<' : 4, + '>' : 4, + '<=' : 4, + '>=' : 4, + 'lt' : 4, + 'gt' : 4, + 'le' : 4, + 'ge' : 4, + '==' : 4, + '!=' : 4, + '<=>' : 4, + 'eq' : 4, + 'ne' : 4, + 'cmp' : 4, + '~~' : 4, + '&' : 4, + '|' : 4, + '^' : 4, + '&&' : 4, + '||' : 4, + '//' : 4, + '..' : 4, + '...' : 4, + '?' : 4, + ':' : 4, + '=' : 4, + '+=' : 4, + '-=' : 4, + '*=' : 4, // etc. ??? + ',' : 4, + '=>' : 4, + '::' : 4, + // list operators (rightward) + 'not' : 4, + 'and' : 4, + 'or' : 4, + 'xor' : 4, + // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) + 'BEGIN' : [5,1], + 'END' : [5,1], + 'PRINT' : [5,1], + 'PRINTF' : [5,1], + 'GETC' : [5,1], + 'READ' : [5,1], + 'READLINE' : [5,1], + 'DESTROY' : [5,1], + 'TIE' : [5,1], + 'TIEHANDLE' : [5,1], + 'UNTIE' : [5,1], + 'STDIN' : 5, + 'STDIN_TOP' : 5, + 'STDOUT' : 5, + 'STDOUT_TOP' : 5, + 'STDERR' : 5, + 'STDERR_TOP' : 5, + '$ARG' : 5, + '$_' : 5, + '@ARG' : 5, + '@_' : 5, + '$LIST_SEPARATOR' : 5, + '$"' : 5, + '$PROCESS_ID' : 5, + '$PID' : 5, + '$$' : 5, + '$REAL_GROUP_ID' : 5, + '$GID' : 5, + '$(' : 5, + '$EFFECTIVE_GROUP_ID' : 5, + '$EGID' : 5, + '$)' : 5, + '$PROGRAM_NAME' : 5, + '$0' : 5, + '$SUBSCRIPT_SEPARATOR' : 5, + '$SUBSEP' : 5, + '$;' : 5, + '$REAL_USER_ID' : 5, + '$UID' : 5, + '$<' : 5, + '$EFFECTIVE_USER_ID' : 5, + '$EUID' : 5, + '$>' : 5, + '$a' : 5, + '$b' : 5, + '$COMPILING' : 5, + '$^C' : 5, + '$DEBUGGING' : 5, + '$^D' : 5, + '${^ENCODING}' : 5, + '$ENV' : 5, + '%ENV' : 5, + '$SYSTEM_FD_MAX' : 5, + '$^F' : 5, + '@F' : 5, + '${^GLOBAL_PHASE}' : 5, + '$^H' : 5, + '%^H' : 5, + '@INC' : 5, + '%INC' : 5, + '$INPLACE_EDIT' : 5, + '$^I' : 5, + '$^M' : 5, + '$OSNAME' : 5, + '$^O' : 5, + '${^OPEN}' : 5, + '$PERLDB' : 5, + '$^P' : 5, + '$SIG' : 5, + '%SIG' : 5, + '$BASETIME' : 5, + '$^T' : 5, + '${^TAINT}' : 5, + '${^UNICODE}' : 5, + '${^UTF8CACHE}' : 5, + '${^UTF8LOCALE}' : 5, + '$PERL_VERSION' : 5, + '$^V' : 5, + '${^WIN32_SLOPPY_STAT}' : 5, + '$EXECUTABLE_NAME' : 5, + '$^X' : 5, + '$1' : 5, // - regexp $1, $2... + '$MATCH' : 5, + '$&' : 5, + '${^MATCH}' : 5, + '$PREMATCH' : 5, + '$`' : 5, + '${^PREMATCH}' : 5, + '$POSTMATCH' : 5, + "$'" : 5, + '${^POSTMATCH}' : 5, + '$LAST_PAREN_MATCH' : 5, + '$+' : 5, + '$LAST_SUBMATCH_RESULT' : 5, + '$^N' : 5, + '@LAST_MATCH_END' : 5, + '@+' : 5, + '%LAST_PAREN_MATCH' : 5, + '%+' : 5, + '@LAST_MATCH_START' : 5, + '@-' : 5, + '%LAST_MATCH_START' : 5, + '%-' : 5, + '$LAST_REGEXP_CODE_RESULT' : 5, + '$^R' : 5, + '${^RE_DEBUG_FLAGS}' : 5, + '${^RE_TRIE_MAXBUF}' : 5, + '$ARGV' : 5, + '@ARGV' : 5, + 'ARGV' : 5, + 'ARGVOUT' : 5, + '$OUTPUT_FIELD_SEPARATOR' : 5, + '$OFS' : 5, + '$,' : 5, + '$INPUT_LINE_NUMBER' : 5, + '$NR' : 5, + '$.' : 5, + '$INPUT_RECORD_SEPARATOR' : 5, + '$RS' : 5, + '$/' : 5, + '$OUTPUT_RECORD_SEPARATOR' : 5, + '$ORS' : 5, + '$\\' : 5, + '$OUTPUT_AUTOFLUSH' : 5, + '$|' : 5, + '$ACCUMULATOR' : 5, + '$^A' : 5, + '$FORMAT_FORMFEED' : 5, + '$^L' : 5, + '$FORMAT_PAGE_NUMBER' : 5, + '$%' : 5, + '$FORMAT_LINES_LEFT' : 5, + '$-' : 5, + '$FORMAT_LINE_BREAK_CHARACTERS' : 5, + '$:' : 5, + '$FORMAT_LINES_PER_PAGE' : 5, + '$=' : 5, + '$FORMAT_TOP_NAME' : 5, + '$^' : 5, + '$FORMAT_NAME' : 5, + '$~' : 5, + '${^CHILD_ERROR_NATIVE}' : 5, + '$EXTENDED_OS_ERROR' : 5, + '$^E' : 5, + '$EXCEPTIONS_BEING_CAUGHT' : 5, + '$^S' : 5, + '$WARNING' : 5, + '$^W' : 5, + '${^WARNING_BITS}' : 5, + '$OS_ERROR' : 5, + '$ERRNO' : 5, + '$!' : 5, + '%OS_ERROR' : 5, + '%ERRNO' : 5, + '%!' : 5, + '$CHILD_ERROR' : 5, + '$?' : 5, + '$EVAL_ERROR' : 5, + '$@' : 5, + '$OFMT' : 5, + '$#' : 5, + '$*' : 5, + '$ARRAY_BASE' : 5, + '$[' : 5, + '$OLD_PERL_VERSION' : 5, + '$]' : 5, + // PERL blocks + 'if' :[1,1], + elsif :[1,1], + 'else' :[1,1], + 'while' :[1,1], + unless :[1,1], + 'for' :[1,1], + foreach :[1,1], + // PERL functions + 'abs' :1, // - absolute value function + accept :1, // - accept an incoming socket connect + alarm :1, // - schedule a SIGALRM + 'atan2' :1, // - arctangent of Y/X in the range -PI to PI + bind :1, // - binds an address to a socket + binmode :1, // - prepare binary files for I/O + bless :1, // - create an object + bootstrap :1, // + 'break' :1, // - break out of a "given" block + caller :1, // - get context of the current subroutine call + chdir :1, // - change your current working directory + chmod :1, // - changes the permissions on a list of files + chomp :1, // - remove a trailing record separator from a string + chop :1, // - remove the last character from a string + chown :1, // - change the ownership on a list of files + chr :1, // - get character this number represents + chroot :1, // - make directory new root for path lookups + close :1, // - close file (or pipe or socket) handle + closedir :1, // - close directory handle + connect :1, // - connect to a remote socket + 'continue' :[1,1], // - optional trailing block in a while or foreach + 'cos' :1, // - cosine function + crypt :1, // - one-way passwd-style encryption + dbmclose :1, // - breaks binding on a tied dbm file + dbmopen :1, // - create binding on a tied dbm file + 'default' :1, // + defined :1, // - test whether a value, variable, or function is defined + 'delete' :1, // - deletes a value from a hash + die :1, // - raise an exception or bail out + 'do' :1, // - turn a BLOCK into a TERM + dump :1, // - create an immediate core dump + each :1, // - retrieve the next key/value pair from a hash + endgrent :1, // - be done using group file + endhostent :1, // - be done using hosts file + endnetent :1, // - be done using networks file + endprotoent :1, // - be done using protocols file + endpwent :1, // - be done using passwd file + endservent :1, // - be done using services file + eof :1, // - test a filehandle for its end + 'eval' :1, // - catch exceptions or compile and run code + 'exec' :1, // - abandon this program to run another + exists :1, // - test whether a hash key is present + exit :1, // - terminate this program + 'exp' :1, // - raise I to a power + fcntl :1, // - file control system call + fileno :1, // - return file descriptor from filehandle + flock :1, // - lock an entire file with an advisory lock + fork :1, // - create a new process just like this one + format :1, // - declare a picture format with use by the write() function + formline :1, // - internal function used for formats + getc :1, // - get the next character from the filehandle + getgrent :1, // - get next group record + getgrgid :1, // - get group record given group user ID + getgrnam :1, // - get group record given group name + gethostbyaddr :1, // - get host record given its address + gethostbyname :1, // - get host record given name + gethostent :1, // - get next hosts record + getlogin :1, // - return who logged in at this tty + getnetbyaddr :1, // - get network record given its address + getnetbyname :1, // - get networks record given name + getnetent :1, // - get next networks record + getpeername :1, // - find the other end of a socket connection + getpgrp :1, // - get process group + getppid :1, // - get parent process ID + getpriority :1, // - get current nice value + getprotobyname :1, // - get protocol record given name + getprotobynumber :1, // - get protocol record numeric protocol + getprotoent :1, // - get next protocols record + getpwent :1, // - get next passwd record + getpwnam :1, // - get passwd record given user login name + getpwuid :1, // - get passwd record given user ID + getservbyname :1, // - get services record given its name + getservbyport :1, // - get services record given numeric port + getservent :1, // - get next services record + getsockname :1, // - retrieve the sockaddr for a given socket + getsockopt :1, // - get socket options on a given socket + given :1, // + glob :1, // - expand filenames using wildcards + gmtime :1, // - convert UNIX time into record or string using Greenwich time + 'goto' :1, // - create spaghetti code + grep :1, // - locate elements in a list test true against a given criterion + hex :1, // - convert a string to a hexadecimal number + 'import' :1, // - patch a module's namespace into your own + index :1, // - find a substring within a string + 'int' :1, // - get the integer portion of a number + ioctl :1, // - system-dependent device control system call + 'join' :1, // - join a list into a string using a separator + keys :1, // - retrieve list of indices from a hash + kill :1, // - send a signal to a process or process group + last :1, // - exit a block prematurely + lc :1, // - return lower-case version of a string + lcfirst :1, // - return a string with just the next letter in lower case + length :1, // - return the number of bytes in a string + 'link' :1, // - create a hard link in the filesytem + listen :1, // - register your socket as a server + local : 2, // - create a temporary value for a global variable (dynamic scoping) + localtime :1, // - convert UNIX time into record or string using local time + lock :1, // - get a thread lock on a variable, subroutine, or method + 'log' :1, // - retrieve the natural logarithm for a number + lstat :1, // - stat a symbolic link + m :null, // - match a string with a regular expression pattern + map :1, // - apply a change to a list to get back a new list with the changes + mkdir :1, // - create a directory + msgctl :1, // - SysV IPC message control operations + msgget :1, // - get SysV IPC message queue + msgrcv :1, // - receive a SysV IPC message from a message queue + msgsnd :1, // - send a SysV IPC message to a message queue + my : 2, // - declare and assign a local variable (lexical scoping) + 'new' :1, // + next :1, // - iterate a block prematurely + no :1, // - unimport some module symbols or semantics at compile time + oct :1, // - convert a string to an octal number + open :1, // - open a file, pipe, or descriptor + opendir :1, // - open a directory + ord :1, // - find a character's numeric representation + our : 2, // - declare and assign a package variable (lexical scoping) + pack :1, // - convert a list into a binary representation + 'package' :1, // - declare a separate global namespace + pipe :1, // - open a pair of connected filehandles + pop :1, // - remove the last element from an array and return it + pos :1, // - find or set the offset for the last/next m//g search + print :1, // - output a list to a filehandle + printf :1, // - output a formatted list to a filehandle + prototype :1, // - get the prototype (if any) of a subroutine + push :1, // - append one or more elements to an array + q :null, // - singly quote a string + qq :null, // - doubly quote a string + qr :null, // - Compile pattern + quotemeta :null, // - quote regular expression magic characters + qw :null, // - quote a list of words + qx :null, // - backquote quote a string + rand :1, // - retrieve the next pseudorandom number + read :1, // - fixed-length buffered input from a filehandle + readdir :1, // - get a directory from a directory handle + readline :1, // - fetch a record from a file + readlink :1, // - determine where a symbolic link is pointing + readpipe :1, // - execute a system command and collect standard output + recv :1, // - receive a message over a Socket + redo :1, // - start this loop iteration over again + ref :1, // - find out the type of thing being referenced + rename :1, // - change a filename + require :1, // - load in external functions from a library at runtime + reset :1, // - clear all variables of a given name + 'return' :1, // - get out of a function early + reverse :1, // - flip a string or a list + rewinddir :1, // - reset directory handle + rindex :1, // - right-to-left substring search + rmdir :1, // - remove a directory + s :null, // - replace a pattern with a string + say :1, // - print with newline + scalar :1, // - force a scalar context + seek :1, // - reposition file pointer for random-access I/O + seekdir :1, // - reposition directory pointer + select :1, // - reset default output or do I/O multiplexing + semctl :1, // - SysV semaphore control operations + semget :1, // - get set of SysV semaphores + semop :1, // - SysV semaphore operations + send :1, // - send a message over a socket + setgrent :1, // - prepare group file for use + sethostent :1, // - prepare hosts file for use + setnetent :1, // - prepare networks file for use + setpgrp :1, // - set the process group of a process + setpriority :1, // - set a process's nice value + setprotoent :1, // - prepare protocols file for use + setpwent :1, // - prepare passwd file for use + setservent :1, // - prepare services file for use + setsockopt :1, // - set some socket options + shift :1, // - remove the first element of an array, and return it + shmctl :1, // - SysV shared memory operations + shmget :1, // - get SysV shared memory segment identifier + shmread :1, // - read SysV shared memory + shmwrite :1, // - write SysV shared memory + shutdown :1, // - close down just half of a socket connection + 'sin' :1, // - return the sine of a number + sleep :1, // - block for some number of seconds + socket :1, // - create a socket + socketpair :1, // - create a pair of sockets + 'sort' :1, // - sort a list of values + splice :1, // - add or remove elements anywhere in an array + 'split' :1, // - split up a string using a regexp delimiter + sprintf :1, // - formatted print into a string + 'sqrt' :1, // - square root function + srand :1, // - seed the random number generator + stat :1, // - get a file's status information + state :1, // - declare and assign a state variable (persistent lexical scoping) + study :1, // - optimize input data for repeated searches + 'sub' :1, // - declare a subroutine, possibly anonymously + 'substr' :1, // - get or alter a portion of a stirng + symlink :1, // - create a symbolic link to a file + syscall :1, // - execute an arbitrary system call + sysopen :1, // - open a file, pipe, or descriptor + sysread :1, // - fixed-length unbuffered input from a filehandle + sysseek :1, // - position I/O pointer on handle used with sysread and syswrite + system :1, // - run a separate program + syswrite :1, // - fixed-length unbuffered output to a filehandle + tell :1, // - get current seekpointer on a filehandle + telldir :1, // - get current seekpointer on a directory handle + tie :1, // - bind a variable to an object class + tied :1, // - get a reference to the object underlying a tied variable + time :1, // - return number of seconds since 1970 + times :1, // - return elapsed time for self and child processes + tr :null, // - transliterate a string + truncate :1, // - shorten a file + uc :1, // - return upper-case version of a string + ucfirst :1, // - return a string with just the next letter in upper case + umask :1, // - set file creation mode mask + undef :1, // - remove a variable or function definition + unlink :1, // - remove one link to a file + unpack :1, // - convert binary structure into normal perl variables + unshift :1, // - prepend more elements to the beginning of a list + untie :1, // - break a tie binding to a variable + use :1, // - load in a module at compile time + utime :1, // - set a file's last access and modify times + values :1, // - return a list of the values in a hash + vec :1, // - test or set particular bits in a string + wait :1, // - wait for any child process to die + waitpid :1, // - wait for a particular child process to die + wantarray :1, // - get void vs scalar vs list context of current subroutine call + warn :1, // - print debugging info + when :1, // + write :1, // - print a picture record + y :null}; // - transliterate a string + + var RXstyle="string-2"; + var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type + + function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) + state.chain=null; // 12 3tail + state.style=null; + state.tail=null; + state.tokenize=function(stream,state){ + var e=false,c,i=0; + while(c=stream.next()){ + if(c===chain[i]&&!e){ + if(chain[++i]!==undefined){ + state.chain=chain[i]; + state.style=style; + state.tail=tail;} + else if(tail) + stream.eatWhile(tail); + state.tokenize=tokenPerl; + return style;} + e=!e&&c=="\\";} + return style;}; + return state.tokenize(stream,state);} + + function tokenSOMETHING(stream,state,string){ + state.tokenize=function(stream,state){ + if(stream.string==string) + state.tokenize=tokenPerl; + stream.skipToEnd(); + return "string";}; + return state.tokenize(stream,state);} + + function tokenPerl(stream,state){ + if(stream.eatSpace()) + return null; + if(state.chain) + return tokenChain(stream,state,state.chain,state.style,state.tail); + if(stream.match(/^\-?[\d\.]/,false)) + if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) + return 'number'; + if(stream.match(/^<<(?=\w)/)){ // NOTE: <<SOMETHING\n...\nSOMETHING\n + stream.eatWhile(/\w/); + return tokenSOMETHING(stream,state,stream.current().substr(2));} + if(stream.sol()&&stream.match(/^\=item(?!\w)/)){// NOTE: \n=item...\n=cut\n + return tokenSOMETHING(stream,state,'=cut');} + var ch=stream.next(); + if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n + if(prefix(stream, 3)=="<<"+ch){ + var p=stream.pos; + stream.eatWhile(/\w/); + var n=stream.current().substr(1); + if(n&&stream.eat(ch)) + return tokenSOMETHING(stream,state,n); + stream.pos=p;} + return tokenChain(stream,state,[ch],"string");} + if(ch=="q"){ + var c=look(stream, -2); + if(!(c&&/\w/.test(c))){ + c=look(stream, 0); + if(c=="x"){ + c=look(stream, 1); + if(c=="("){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} + if(c=="["){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} + if(c=="{"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} + if(c=="<"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} + if(/[\^'"!~\/]/.test(c)){ + eatSuffix(stream, 1); + return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} + else if(c=="q"){ + c=look(stream, 1); + if(c=="("){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[")"],"string");} + if(c=="["){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["]"],"string");} + if(c=="{"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["}"],"string");} + if(c=="<"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[">"],"string");} + if(/[\^'"!~\/]/.test(c)){ + eatSuffix(stream, 1); + return tokenChain(stream,state,[stream.eat(c)],"string");}} + else if(c=="w"){ + c=look(stream, 1); + if(c=="("){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[")"],"bracket");} + if(c=="["){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["]"],"bracket");} + if(c=="{"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["}"],"bracket");} + if(c=="<"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[">"],"bracket");} + if(/[\^'"!~\/]/.test(c)){ + eatSuffix(stream, 1); + return tokenChain(stream,state,[stream.eat(c)],"bracket");}} + else if(c=="r"){ + c=look(stream, 1); + if(c=="("){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} + if(c=="["){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} + if(c=="{"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} + if(c=="<"){ + eatSuffix(stream, 2); + return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);} + if(/[\^'"!~\/]/.test(c)){ + eatSuffix(stream, 1); + return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}} + else if(/[\^'"!~\/(\[{<]/.test(c)){ + if(c=="("){ + eatSuffix(stream, 1); + return tokenChain(stream,state,[")"],"string");} + if(c=="["){ + eatSuffix(stream, 1); + return tokenChain(stream,state,["]"],"string");} + if(c=="{"){ + eatSuffix(stream, 1); + return tokenChain(stream,state,["}"],"string");} + if(c=="<"){ + eatSuffix(stream, 1); + return tokenChain(stream,state,[">"],"string");} + if(/[\^'"!~\/]/.test(c)){ + return tokenChain(stream,state,[stream.eat(c)],"string");}}}} + if(ch=="m"){ + var c=look(stream, -2); + if(!(c&&/\w/.test(c))){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(/[\^'"!~\/]/.test(c)){ + return tokenChain(stream,state,[c],RXstyle,RXmodifiers);} + if(c=="("){ + return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);} + if(c=="["){ + return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);} + if(c=="{"){ + return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);} + if(c=="<"){ + return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}} + if(ch=="s"){ + var c=/[\/>\]})\w]/.test(look(stream, -2)); + if(!c){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(c=="[") + return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); + if(c=="{") + return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); + if(c=="<") + return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); + if(c=="(") + return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); + return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} + if(ch=="y"){ + var c=/[\/>\]})\w]/.test(look(stream, -2)); + if(!c){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(c=="[") + return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); + if(c=="{") + return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); + if(c=="<") + return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); + if(c=="(") + return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); + return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}} + if(ch=="t"){ + var c=/[\/>\]})\w]/.test(look(stream, -2)); + if(!c){ + c=stream.eat("r");if(c){ + c=stream.eat(/[(\[{<\^'"!~\/]/); + if(c){ + if(c=="[") + return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); + if(c=="{") + return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); + if(c=="<") + return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); + if(c=="(") + return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); + return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}} + if(ch=="`"){ + return tokenChain(stream,state,[ch],"variable-2");} + if(ch=="/"){ + if(!/~\s*$/.test(prefix(stream))) + return "operator"; + else + return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);} + if(ch=="$"){ + var p=stream.pos; + if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) + return "variable-2"; + else + stream.pos=p;} + if(/[$@%]/.test(ch)){ + var p=stream.pos; + if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ + var c=stream.current(); + if(PERL[c]) + return "variable-2";} + stream.pos=p;} + if(/[$@%&]/.test(ch)){ + if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ + var c=stream.current(); + if(PERL[c]) + return "variable-2"; + else + return "variable";}} + if(ch=="#"){ + if(look(stream, -2)!="$"){ + stream.skipToEnd(); + return "comment";}} + if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ + var p=stream.pos; + stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); + if(PERL[stream.current()]) + return "operator"; + else + stream.pos=p;} + if(ch=="_"){ + if(stream.pos==1){ + if(suffix(stream, 6)=="_END__"){ + return tokenChain(stream,state,['\0'],"comment");} + else if(suffix(stream, 7)=="_DATA__"){ + return tokenChain(stream,state,['\0'],"variable-2");} + else if(suffix(stream, 7)=="_C__"){ + return tokenChain(stream,state,['\0'],"string");}}} + if(/\w/.test(ch)){ + var p=stream.pos; + if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}")) + return "string"; + else + stream.pos=p;} + if(/[A-Z]/.test(ch)){ + var l=look(stream, -2); + var p=stream.pos; + stream.eatWhile(/[A-Z_]/); + if(/[\da-z]/.test(look(stream, 0))){ + stream.pos=p;} + else{ + var c=PERL[stream.current()]; + if(!c) + return "meta"; + if(c[1]) + c=c[0]; + if(l!=":"){ + if(c==1) + return "keyword"; + else if(c==2) + return "def"; + else if(c==3) + return "atom"; + else if(c==4) + return "operator"; + else if(c==5) + return "variable-2"; + else + return "meta";} + else + return "meta";}} + if(/[a-zA-Z_]/.test(ch)){ + var l=look(stream, -2); + stream.eatWhile(/\w/); + var c=PERL[stream.current()]; + if(!c) + return "meta"; + if(c[1]) + c=c[0]; + if(l!=":"){ + if(c==1) + return "keyword"; + else if(c==2) + return "def"; + else if(c==3) + return "atom"; + else if(c==4) + return "operator"; + else if(c==5) + return "variable-2"; + else + return "meta";} + else + return "meta";} + return null;} + + return { + startState: function() { + return { + tokenize: tokenPerl, + chain: null, + style: null, + tail: null + }; + }, + token: function(stream, state) { + return (state.tokenize || tokenPerl)(stream, state); + }, + lineComment: '#' + }; +}); + +CodeMirror.registerHelper("wordChars", "perl", /[\w$]/); + +CodeMirror.defineMIME("text/x-perl", "perl"); + +// it's like "peek", but need for look-ahead or look-behind if index < 0 +function look(stream, c){ + return stream.string.charAt(stream.pos+(c||0)); +} + +// return a part of prefix of current stream from current position +function prefix(stream, c){ + if(c){ + var x=stream.pos-c; + return stream.string.substr((x>=0?x:0),c);} + else{ + return stream.string.substr(0,stream.pos-1); + } +} + +// return a part of suffix of current stream from current position +function suffix(stream, c){ + var y=stream.string.length; + var x=y-stream.pos+1; + return stream.string.substr(stream.pos,(c&&c<y?c:x)); +} + +// eating and vomiting a part of stream from current position +function eatSuffix(stream, c){ + var x=stream.pos+c; + var y; + if(x<=0) + stream.pos=0; + else if(x>=(y=stream.string.length-1)) + stream.pos=y; + else + stream.pos=x; +} + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/factor/factor.min.js */ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/smarty/smarty.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/** + * Smarty 2 and 3 mode. + */ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("smarty", function(config, parserConf) { + var rightDelimiter = parserConf.rightDelimiter || "}"; + var leftDelimiter = parserConf.leftDelimiter || "{"; + var version = parserConf.version || 2; + var baseMode = CodeMirror.getMode(config, parserConf.baseMode || "null"); + + var keyFunctions = ["debug", "extends", "function", "include", "literal"]; + var regs = { + operatorChars: /[+\-*&%=<>!?]/, + validIdentifier: /[a-zA-Z0-9_]/, + stringChar: /['"]/ + }; + + var last; + function cont(style, lastType) { + last = lastType; + return style; + } + + function chain(stream, state, parser) { + state.tokenize = parser; + return parser(stream, state); + } + + // Smarty 3 allows { and } surrounded by whitespace to NOT slip into Smarty mode + function doesNotCount(stream, pos) { + if (pos == null) pos = stream.pos; + return version === 3 && leftDelimiter == "{" && + (pos == stream.string.length || /\s/.test(stream.string.charAt(pos))); + } + + function tokenTop(stream, state) { + var string = stream.string; + for (var scan = stream.pos;;) { + var nextMatch = string.indexOf(leftDelimiter, scan); + scan = nextMatch + leftDelimiter.length; + if (nextMatch == -1 || !doesNotCount(stream, nextMatch + leftDelimiter.length)) break; + } + if (nextMatch == stream.pos) { + stream.match(leftDelimiter); + if (stream.eat("*")) { + return chain(stream, state, tokenBlock("comment", "*" + rightDelimiter)); + } else { + state.depth++; + state.tokenize = tokenSmarty; + last = "startTag"; + return "tag"; + } + } + + if (nextMatch > -1) stream.string = string.slice(0, nextMatch); + var token = baseMode.token(stream, state.base); + if (nextMatch > -1) stream.string = string; + return token; + } + + // parsing Smarty content + function tokenSmarty(stream, state) { + if (stream.match(rightDelimiter, true)) { + if (version === 3) { + state.depth--; + if (state.depth <= 0) { + state.tokenize = tokenTop; + } + } else { + state.tokenize = tokenTop; + } + return cont("tag", null); + } + + if (stream.match(leftDelimiter, true)) { + state.depth++; + return cont("tag", "startTag"); + } + + var ch = stream.next(); + if (ch == "$") { + stream.eatWhile(regs.validIdentifier); + return cont("variable-2", "variable"); + } else if (ch == "|") { + return cont("operator", "pipe"); + } else if (ch == ".") { + return cont("operator", "property"); + } else if (regs.stringChar.test(ch)) { + state.tokenize = tokenAttribute(ch); + return cont("string", "string"); + } else if (regs.operatorChars.test(ch)) { + stream.eatWhile(regs.operatorChars); + return cont("operator", "operator"); + } else if (ch == "[" || ch == "]") { + return cont("bracket", "bracket"); + } else if (ch == "(" || ch == ")") { + return cont("bracket", "operator"); + } else if (/\d/.test(ch)) { + stream.eatWhile(/\d/); + return cont("number", "number"); + } else { + + if (state.last == "variable") { + if (ch == "@") { + stream.eatWhile(regs.validIdentifier); + return cont("property", "property"); + } else if (ch == "|") { + stream.eatWhile(regs.validIdentifier); + return cont("qualifier", "modifier"); + } + } else if (state.last == "pipe") { + stream.eatWhile(regs.validIdentifier); + return cont("qualifier", "modifier"); + } else if (state.last == "whitespace") { + stream.eatWhile(regs.validIdentifier); + return cont("attribute", "modifier"); + } if (state.last == "property") { + stream.eatWhile(regs.validIdentifier); + return cont("property", null); + } else if (/\s/.test(ch)) { + last = "whitespace"; + return null; + } + + var str = ""; + if (ch != "/") { + str += ch; + } + var c = null; + while (c = stream.eat(regs.validIdentifier)) { + str += c; + } + for (var i=0, j=keyFunctions.length; i<j; i++) { + if (keyFunctions[i] == str) { + return cont("keyword", "keyword"); + } + } + if (/\s/.test(ch)) { + return null; + } + return cont("tag", "tag"); + } + } + + function tokenAttribute(quote) { + return function(stream, state) { + var prevChar = null; + var currChar = null; + while (!stream.eol()) { + currChar = stream.peek(); + if (stream.next() == quote && prevChar !== '\\') { + state.tokenize = tokenSmarty; + break; + } + prevChar = currChar; + } + return "string"; + }; + } + + function tokenBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = tokenTop; + break; + } + stream.next(); + } + return style; + }; + } + + return { + startState: function() { + return { + base: CodeMirror.startState(baseMode), + tokenize: tokenTop, + last: null, + depth: 0 + }; + }, + copyState: function(state) { + return { + base: CodeMirror.copyState(baseMode, state.base), + tokenize: state.tokenize, + last: state.last, + depth: state.depth + }; + }, + innerMode: function(state) { + if (state.tokenize == tokenTop) + return {mode: baseMode, state: state.base}; + }, + token: function(stream, state) { + var style = state.tokenize(stream, state); + state.last = last; + return style; + }, + indent: function(state, text) { + if (state.tokenize == tokenTop && baseMode.indent) + return baseMode.indent(state.base, text); + else + return CodeMirror.Pass; + }, + blockCommentStart: leftDelimiter + "*", + blockCommentEnd: "*" + rightDelimiter + }; + }); + + CodeMirror.defineMIME("text/x-smarty", "smarty"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/vbscript/vbscript.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* +For extra ASP classic objects, initialize CodeMirror instance with this option: + isASP: true + +E.G.: + var editor = CodeMirror.fromTextArea(document.getElementById("code"), { + lineNumbers: true, + isASP: true + }); +*/ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("vbscript", function(conf, parserConf) { + var ERRORCLASS = 'error'; + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); + } + + var singleOperators = new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"); + var doubleOperators = new RegExp("^((<>)|(<=)|(>=))"); + var singleDelimiters = new RegExp('^[\\.,]'); + var brakets = new RegExp('^[\\(\\)]'); + var identifiers = new RegExp("^[A-Za-z][_A-Za-z0-9]*"); + + var openingKeywords = ['class','sub','select','while','if','function', 'property', 'with', 'for']; + var middleKeywords = ['else','elseif','case']; + var endKeywords = ['next','loop','wend']; + + var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']); + var commonkeywords = ['dim', 'redim', 'then', 'until', 'randomize', + 'byval','byref','new','property', 'exit', 'in', + 'const','private', 'public', + 'get','set','let', 'stop', 'on error resume next', 'on error goto 0', 'option explicit', 'call', 'me']; + + //This list was from: http://msdn.microsoft.com/en-us/library/f8tbc79x(v=vs.84).aspx + var atomWords = ['true', 'false', 'nothing', 'empty', 'null']; + //This list was from: http://msdn.microsoft.com/en-us/library/3ca8tfek(v=vs.84).aspx + var builtinFuncsWords = ['abs', 'array', 'asc', 'atn', 'cbool', 'cbyte', 'ccur', 'cdate', 'cdbl', 'chr', 'cint', 'clng', 'cos', 'csng', 'cstr', 'date', 'dateadd', 'datediff', 'datepart', + 'dateserial', 'datevalue', 'day', 'escape', 'eval', 'execute', 'exp', 'filter', 'formatcurrency', 'formatdatetime', 'formatnumber', 'formatpercent', 'getlocale', 'getobject', + 'getref', 'hex', 'hour', 'inputbox', 'instr', 'instrrev', 'int', 'fix', 'isarray', 'isdate', 'isempty', 'isnull', 'isnumeric', 'isobject', 'join', 'lbound', 'lcase', 'left', + 'len', 'loadpicture', 'log', 'ltrim', 'rtrim', 'trim', 'maths', 'mid', 'minute', 'month', 'monthname', 'msgbox', 'now', 'oct', 'replace', 'rgb', 'right', 'rnd', 'round', + 'scriptengine', 'scriptenginebuildversion', 'scriptenginemajorversion', 'scriptengineminorversion', 'second', 'setlocale', 'sgn', 'sin', 'space', 'split', 'sqr', 'strcomp', + 'string', 'strreverse', 'tan', 'time', 'timer', 'timeserial', 'timevalue', 'typename', 'ubound', 'ucase', 'unescape', 'vartype', 'weekday', 'weekdayname', 'year']; + + //This list was from: http://msdn.microsoft.com/en-us/library/ydz4cfk3(v=vs.84).aspx + var builtinConsts = ['vbBlack', 'vbRed', 'vbGreen', 'vbYellow', 'vbBlue', 'vbMagenta', 'vbCyan', 'vbWhite', 'vbBinaryCompare', 'vbTextCompare', + 'vbSunday', 'vbMonday', 'vbTuesday', 'vbWednesday', 'vbThursday', 'vbFriday', 'vbSaturday', 'vbUseSystemDayOfWeek', 'vbFirstJan1', 'vbFirstFourDays', 'vbFirstFullWeek', + 'vbGeneralDate', 'vbLongDate', 'vbShortDate', 'vbLongTime', 'vbShortTime', 'vbObjectError', + 'vbOKOnly', 'vbOKCancel', 'vbAbortRetryIgnore', 'vbYesNoCancel', 'vbYesNo', 'vbRetryCancel', 'vbCritical', 'vbQuestion', 'vbExclamation', 'vbInformation', 'vbDefaultButton1', 'vbDefaultButton2', + 'vbDefaultButton3', 'vbDefaultButton4', 'vbApplicationModal', 'vbSystemModal', 'vbOK', 'vbCancel', 'vbAbort', 'vbRetry', 'vbIgnore', 'vbYes', 'vbNo', + 'vbCr', 'VbCrLf', 'vbFormFeed', 'vbLf', 'vbNewLine', 'vbNullChar', 'vbNullString', 'vbTab', 'vbVerticalTab', 'vbUseDefault', 'vbTrue', 'vbFalse', + 'vbEmpty', 'vbNull', 'vbInteger', 'vbLong', 'vbSingle', 'vbDouble', 'vbCurrency', 'vbDate', 'vbString', 'vbObject', 'vbError', 'vbBoolean', 'vbVariant', 'vbDataObject', 'vbDecimal', 'vbByte', 'vbArray']; + //This list was from: http://msdn.microsoft.com/en-us/library/hkc375ea(v=vs.84).aspx + var builtinObjsWords = ['WScript', 'err', 'debug', 'RegExp']; + var knownProperties = ['description', 'firstindex', 'global', 'helpcontext', 'helpfile', 'ignorecase', 'length', 'number', 'pattern', 'source', 'value', 'count']; + var knownMethods = ['clear', 'execute', 'raise', 'replace', 'test', 'write', 'writeline', 'close', 'open', 'state', 'eof', 'update', 'addnew', 'end', 'createobject', 'quit']; + + var aspBuiltinObjsWords = ['server', 'response', 'request', 'session', 'application']; + var aspKnownProperties = ['buffer', 'cachecontrol', 'charset', 'contenttype', 'expires', 'expiresabsolute', 'isclientconnected', 'pics', 'status', //response + 'clientcertificate', 'cookies', 'form', 'querystring', 'servervariables', 'totalbytes', //request + 'contents', 'staticobjects', //application + 'codepage', 'lcid', 'sessionid', 'timeout', //session + 'scripttimeout']; //server + var aspKnownMethods = ['addheader', 'appendtolog', 'binarywrite', 'end', 'flush', 'redirect', //response + 'binaryread', //request + 'remove', 'removeall', 'lock', 'unlock', //application + 'abandon', //session + 'getlasterror', 'htmlencode', 'mappath', 'transfer', 'urlencode']; //server + + var knownWords = knownMethods.concat(knownProperties); + + builtinObjsWords = builtinObjsWords.concat(builtinConsts); + + if (conf.isASP){ + builtinObjsWords = builtinObjsWords.concat(aspBuiltinObjsWords); + knownWords = knownWords.concat(aspKnownMethods, aspKnownProperties); + }; + + var keywords = wordRegexp(commonkeywords); + var atoms = wordRegexp(atomWords); + var builtinFuncs = wordRegexp(builtinFuncsWords); + var builtinObjs = wordRegexp(builtinObjsWords); + var known = wordRegexp(knownWords); + var stringPrefixes = '"'; + + var opening = wordRegexp(openingKeywords); + var middle = wordRegexp(middleKeywords); + var closing = wordRegexp(endKeywords); + var doubleClosing = wordRegexp(['end']); + var doOpening = wordRegexp(['do']); + var noIndentWords = wordRegexp(['on error resume next', 'exit']); + var comment = wordRegexp(['rem']); + + + function indent(_stream, state) { + state.currentIndent++; + } + + function dedent(_stream, state) { + state.currentIndent--; + } + // tokenizers + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return 'space'; + //return null; + } + + var ch = stream.peek(); + + // Handle Comments + if (ch === "'") { + stream.skipToEnd(); + return 'comment'; + } + if (stream.match(comment)){ + stream.skipToEnd(); + return 'comment'; + } + + + // Handle Number Literals + if (stream.match(/^((&H)|(&O))?[0-9\.]/i, false) && !stream.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) { + var floatLiteral = false; + // Floats + if (stream.match(/^\d*\.\d+/i)) { floatLiteral = true; } + else if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } + else if (stream.match(/^\.\d+/)) { floatLiteral = true; } + + if (floatLiteral) { + // Float literals may be "imaginary" + stream.eat(/J/i); + return 'number'; + } + // Integers + var intLiteral = false; + // Hex + if (stream.match(/^&H[0-9a-f]+/i)) { intLiteral = true; } + // Octal + else if (stream.match(/^&O[0-7]+/i)) { intLiteral = true; } + // Decimal + else if (stream.match(/^[1-9]\d*F?/)) { + // Decimal literals may be "imaginary" + stream.eat(/J/i); + // TODO - Can you have imaginary longs? + intLiteral = true; + } + // Zero by itself with no other piece of number. + else if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } + if (intLiteral) { + // Integer literals may be "long" + stream.eat(/L/i); + return 'number'; + } + } + + // Handle Strings + if (stream.match(stringPrefixes)) { + state.tokenize = tokenStringFactory(stream.current()); + return state.tokenize(stream, state); + } + + // Handle operators and Delimiters + if (stream.match(doubleOperators) + || stream.match(singleOperators) + || stream.match(wordOperators)) { + return 'operator'; + } + if (stream.match(singleDelimiters)) { + return null; + } + + if (stream.match(brakets)) { + return "bracket"; + } + + if (stream.match(noIndentWords)) { + state.doInCurrentLine = true; + + return 'keyword'; + } + + if (stream.match(doOpening)) { + indent(stream,state); + state.doInCurrentLine = true; + + return 'keyword'; + } + if (stream.match(opening)) { + if (! state.doInCurrentLine) + indent(stream,state); + else + state.doInCurrentLine = false; + + return 'keyword'; + } + if (stream.match(middle)) { + return 'keyword'; + } + + + if (stream.match(doubleClosing)) { + dedent(stream,state); + dedent(stream,state); + + return 'keyword'; + } + if (stream.match(closing)) { + if (! state.doInCurrentLine) + dedent(stream,state); + else + state.doInCurrentLine = false; + + return 'keyword'; + } + + if (stream.match(keywords)) { + return 'keyword'; + } + + if (stream.match(atoms)) { + return 'atom'; + } + + if (stream.match(known)) { + return 'variable-2'; + } + + if (stream.match(builtinFuncs)) { + return 'builtin'; + } + + if (stream.match(builtinObjs)){ + return 'variable-2'; + } + + if (stream.match(identifiers)) { + return 'variable'; + } + + // Handle non-detected items + stream.next(); + return ERRORCLASS; + } + + function tokenStringFactory(delimiter) { + var singleline = delimiter.length == 1; + var OUTCLASS = 'string'; + + return function(stream, state) { + while (!stream.eol()) { + stream.eatWhile(/[^'"]/); + if (stream.match(delimiter)) { + state.tokenize = tokenBase; + return OUTCLASS; + } else { + stream.eat(/['"]/); + } + } + if (singleline) { + if (parserConf.singleLineStringErrors) { + return ERRORCLASS; + } else { + state.tokenize = tokenBase; + } + } + return OUTCLASS; + }; + } + + + function tokenLexer(stream, state) { + var style = state.tokenize(stream, state); + var current = stream.current(); + + // Handle '.' connected identifiers + if (current === '.') { + style = state.tokenize(stream, state); + + current = stream.current(); + if (style && (style.substr(0, 8) === 'variable' || style==='builtin' || style==='keyword')){//|| knownWords.indexOf(current.substring(1)) > -1) { + if (style === 'builtin' || style === 'keyword') style='variable'; + if (knownWords.indexOf(current.substr(1)) > -1) style='variable-2'; + + return style; + } else { + return ERRORCLASS; + } + } + + return style; + } + + var external = { + electricChars:"dDpPtTfFeE ", + startState: function() { + return { + tokenize: tokenBase, + lastToken: null, + currentIndent: 0, + nextLineIndent: 0, + doInCurrentLine: false, + ignoreKeyword: false + + + }; + }, + + token: function(stream, state) { + if (stream.sol()) { + state.currentIndent += state.nextLineIndent; + state.nextLineIndent = 0; + state.doInCurrentLine = 0; + } + var style = tokenLexer(stream, state); + + state.lastToken = {style:style, content: stream.current()}; + + if (style==='space') style=null; + + return style; + }, + + indent: function(state, textAfter) { + var trueText = textAfter.replace(/^\s+|\s+$/g, '') ; + if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1); + if(state.currentIndent < 0) return 0; + return state.currentIndent * conf.indentUnit; + } + + }; + return external; +}); + +CodeMirror.defineMIME("text/vbscript", "vbscript"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/dylan/dylan.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function forEach(arr, f) { + for (var i = 0; i < arr.length; i++) f(arr[i], i) +} +function some(arr, f) { + for (var i = 0; i < arr.length; i++) if (f(arr[i], i)) return true + return false +} + +CodeMirror.defineMode("dylan", function(_config) { + // Words + var words = { + // Words that introduce unnamed definitions like "define interface" + unnamedDefinition: ["interface"], + + // Words that introduce simple named definitions like "define library" + namedDefinition: ["module", "library", "macro", + "C-struct", "C-union", + "C-function", "C-callable-wrapper" + ], + + // Words that introduce type definitions like "define class". + // These are also parameterized like "define method" and are + // appended to otherParameterizedDefinitionWords + typeParameterizedDefinition: ["class", "C-subtype", "C-mapped-subtype"], + + // Words that introduce trickier definitions like "define method". + // These require special definitions to be added to startExpressions + otherParameterizedDefinition: ["method", "function", + "C-variable", "C-address" + ], + + // Words that introduce module constant definitions. + // These must also be simple definitions and are + // appended to otherSimpleDefinitionWords + constantSimpleDefinition: ["constant"], + + // Words that introduce module variable definitions. + // These must also be simple definitions and are + // appended to otherSimpleDefinitionWords + variableSimpleDefinition: ["variable"], + + // Other words that introduce simple definitions + // (without implicit bodies). + otherSimpleDefinition: ["generic", "domain", + "C-pointer-type", + "table" + ], + + // Words that begin statements with implicit bodies. + statement: ["if", "block", "begin", "method", "case", + "for", "select", "when", "unless", "until", + "while", "iterate", "profiling", "dynamic-bind" + ], + + // Patterns that act as separators in compound statements. + // This may include any general pattern that must be indented + // specially. + separator: ["finally", "exception", "cleanup", "else", + "elseif", "afterwards" + ], + + // Keywords that do not require special indentation handling, + // but which should be highlighted + other: ["above", "below", "by", "from", "handler", "in", + "instance", "let", "local", "otherwise", "slot", + "subclass", "then", "to", "keyed-by", "virtual" + ], + + // Condition signaling function calls + signalingCalls: ["signal", "error", "cerror", + "break", "check-type", "abort" + ] + }; + + words["otherDefinition"] = + words["unnamedDefinition"] + .concat(words["namedDefinition"]) + .concat(words["otherParameterizedDefinition"]); + + words["definition"] = + words["typeParameterizedDefinition"] + .concat(words["otherDefinition"]); + + words["parameterizedDefinition"] = + words["typeParameterizedDefinition"] + .concat(words["otherParameterizedDefinition"]); + + words["simpleDefinition"] = + words["constantSimpleDefinition"] + .concat(words["variableSimpleDefinition"]) + .concat(words["otherSimpleDefinition"]); + + words["keyword"] = + words["statement"] + .concat(words["separator"]) + .concat(words["other"]); + + // Patterns + var symbolPattern = "[-_a-zA-Z?!*@<>$%]+"; + var symbol = new RegExp("^" + symbolPattern); + var patterns = { + // Symbols with special syntax + symbolKeyword: symbolPattern + ":", + symbolClass: "<" + symbolPattern + ">", + symbolGlobal: "\\*" + symbolPattern + "\\*", + symbolConstant: "\\$" + symbolPattern + }; + var patternStyles = { + symbolKeyword: "atom", + symbolClass: "tag", + symbolGlobal: "variable-2", + symbolConstant: "variable-3" + }; + + // Compile all patterns to regular expressions + for (var patternName in patterns) + if (patterns.hasOwnProperty(patternName)) + patterns[patternName] = new RegExp("^" + patterns[patternName]); + + // Names beginning "with-" and "without-" are commonly + // used as statement macro + patterns["keyword"] = [/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/]; + + var styles = {}; + styles["keyword"] = "keyword"; + styles["definition"] = "def"; + styles["simpleDefinition"] = "def"; + styles["signalingCalls"] = "builtin"; + + // protected words lookup table + var wordLookup = {}; + var styleLookup = {}; + + forEach([ + "keyword", + "definition", + "simpleDefinition", + "signalingCalls" + ], function(type) { + forEach(words[type], function(word) { + wordLookup[word] = type; + styleLookup[word] = styles[type]; + }); + }); + + + function chain(stream, state, f) { + state.tokenize = f; + return f(stream, state); + } + + function tokenBase(stream, state) { + // String + var ch = stream.peek(); + if (ch == "'" || ch == '"') { + stream.next(); + return chain(stream, state, tokenString(ch, "string")); + } + // Comment + else if (ch == "/") { + stream.next(); + if (stream.eat("*")) { + return chain(stream, state, tokenComment); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + stream.backUp(1); + } + // Decimal + else if (/[+\-\d\.]/.test(ch)) { + if (stream.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i) || + stream.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i) || + stream.match(/^[+-]?\d+/)) { + return "number"; + } + } + // Hash + else if (ch == "#") { + stream.next(); + // Symbol with string syntax + ch = stream.peek(); + if (ch == '"') { + stream.next(); + return chain(stream, state, tokenString('"', "string")); + } + // Binary number + else if (ch == "b") { + stream.next(); + stream.eatWhile(/[01]/); + return "number"; + } + // Hex number + else if (ch == "x") { + stream.next(); + stream.eatWhile(/[\da-f]/i); + return "number"; + } + // Octal number + else if (ch == "o") { + stream.next(); + stream.eatWhile(/[0-7]/); + return "number"; + } + // Token concatenation in macros + else if (ch == '#') { + stream.next(); + return "punctuation"; + } + // Sequence literals + else if ((ch == '[') || (ch == '(')) { + stream.next(); + return "bracket"; + // Hash symbol + } else if (stream.match(/f|t|all-keys|include|key|next|rest/i)) { + return "atom"; + } else { + stream.eatWhile(/[-a-zA-Z]/); + return "error"; + } + } else if (ch == "~") { + stream.next(); + ch = stream.peek(); + if (ch == "=") { + stream.next(); + ch = stream.peek(); + if (ch == "=") { + stream.next(); + return "operator"; + } + return "operator"; + } + return "operator"; + } else if (ch == ":") { + stream.next(); + ch = stream.peek(); + if (ch == "=") { + stream.next(); + return "operator"; + } else if (ch == ":") { + stream.next(); + return "punctuation"; + } + } else if ("[](){}".indexOf(ch) != -1) { + stream.next(); + return "bracket"; + } else if (".,".indexOf(ch) != -1) { + stream.next(); + return "punctuation"; + } else if (stream.match("end")) { + return "keyword"; + } + for (var name in patterns) { + if (patterns.hasOwnProperty(name)) { + var pattern = patterns[name]; + if ((pattern instanceof Array && some(pattern, function(p) { + return stream.match(p); + })) || stream.match(pattern)) + return patternStyles[name]; + } + } + if (/[+\-*\/^=<>&|]/.test(ch)) { + stream.next(); + return "operator"; + } + if (stream.match("define")) { + return "def"; + } else { + stream.eatWhile(/[\w\-]/); + // Keyword + if (wordLookup.hasOwnProperty(stream.current())) { + return styleLookup[stream.current()]; + } else if (stream.current().match(symbol)) { + return "variable"; + } else { + stream.next(); + return "variable-2"; + } + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, maybeNested = false, nestedCount = 0, ch; + while ((ch = stream.next())) { + if (ch == "/" && maybeEnd) { + if (nestedCount > 0) { + nestedCount--; + } else { + state.tokenize = tokenBase; + break; + } + } else if (ch == "*" && maybeNested) { + nestedCount++; + } + maybeEnd = (ch == "*"); + maybeNested = (ch == "/"); + } + return "comment"; + } + + function tokenString(quote, style) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end || !escaped) { + state.tokenize = tokenBase; + } + return style; + }; + } + + // Interface + return { + startState: function() { + return { + tokenize: tokenBase, + currentIndent: 0 + }; + }, + token: function(stream, state) { + if (stream.eatSpace()) + return null; + var style = state.tokenize(stream, state); + return style; + }, + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +CodeMirror.defineMIME("text/x-dylan", "dylan"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/asn.1/asn.1.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("asn.1", function(config, parserConfig) { + var indentUnit = config.indentUnit, + keywords = parserConfig.keywords || {}, + cmipVerbs = parserConfig.cmipVerbs || {}, + compareTypes = parserConfig.compareTypes || {}, + status = parserConfig.status || {}, + tags = parserConfig.tags || {}, + storage = parserConfig.storage || {}, + modifier = parserConfig.modifier || {}, + accessTypes = parserConfig.accessTypes|| {}, + multiLineStrings = parserConfig.multiLineStrings, + indentStatements = parserConfig.indentStatements !== false; + var isOperatorChar = /[\|\^]/; + var curPunc; + + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + if (/[\[\]\(\){}:=,;]/.test(ch)) { + curPunc = ch; + return "punctuation"; + } + if (ch == "-"){ + if (stream.eat("-")) { + stream.skipToEnd(); + return "comment"; + } + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + return "number"; + } + if (isOperatorChar.test(ch)) { + stream.eatWhile(isOperatorChar); + return "operator"; + } + + stream.eatWhile(/[\w\-]/); + var cur = stream.current(); + if (keywords.propertyIsEnumerable(cur)) return "keyword"; + if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs"; + if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes"; + if (status.propertyIsEnumerable(cur)) return "comment status"; + if (tags.propertyIsEnumerable(cur)) return "variable-3 tags"; + if (storage.propertyIsEnumerable(cur)) return "builtin storage"; + if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier"; + if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes"; + + return "variable"; + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped){ + var afterNext = stream.peek(); + //look if the character if the quote is like the B in '10100010'B + if (afterNext){ + afterNext = afterNext.toLowerCase(); + if(afterNext == "b" || afterNext == "h" || afterNext == "o") + stream.next(); + } + end = true; break; + } + escaped = !escaped && next == "\\"; + } + if (end || !(escaped || multiLineStrings)) + state.tokenize = null; + return "string"; + }; + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + var indent = state.indented; + if (state.context && state.context.type == "statement") + indent = state.context.indented; + return state.context = new Context(indent, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + //Interface + return { + startState: function(basecolumn) { + return { + tokenize: null, + context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), + indented: 0, + startOfLine: true + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":" || curPunc == ",") + && ctx.type == "statement"){ + popContext(state); + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (indentStatements && (((ctx.type == "}" || ctx.type == "top") + && curPunc != ';') || (ctx.type == "statement" + && curPunc == "newstatement"))) + pushContext(state, stream.column(), "statement"); + + state.startOfLine = false; + return style; + }, + + electricChars: "{}", + lineComment: "--", + fold: "brace" + }; + }); + + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + CodeMirror.defineMIME("text/x-ttcn-asn", { + name: "asn.1", + keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" + + " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" + + " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" + + " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" + + " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" + + " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" + + " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" + + " IMPLIED EXPORTS"), + cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"), + compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" + + " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" + + " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" + + " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" + + " TEXTUAL-CONVENTION"), + status: words("current deprecated mandatory obsolete"), + tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" + + " UNIVERSAL"), + storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" + + " UTCTime InterfaceIndex IANAifType CMIP-Attribute" + + " REAL PACKAGE PACKAGES IpAddress PhysAddress" + + " NetworkAddress BITS BMPString TimeStamp TimeTicks" + + " TruthValue RowStatus DisplayString GeneralString" + + " GraphicString IA5String NumericString" + + " PrintableString SnmpAdminAtring TeletexString" + + " UTF8String VideotexString VisibleString StringStore" + + " ISO646String T61String UniversalString Unsigned32" + + " Integer32 Gauge Gauge32 Counter Counter32 Counter64"), + modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" + + " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" + + " DEFINED"), + accessTypes: words("not-accessible accessible-for-notify read-only" + + " read-create read-write"), + multiLineStrings: true + }); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/ruby/ruby.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("ruby", function(config) { + function wordObj(words) { + var o = {}; + for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; + return o; + } + var keywords = wordObj([ + "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", + "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", + "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", + "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", + "caller", "lambda", "proc", "public", "protected", "private", "require", "load", + "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" + ]); + var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then", + "catch", "loop", "proc", "begin"]); + var dedentWords = wordObj(["end", "until"]); + var matching = {"[": "]", "{": "}", "(": ")"}; + var curPunc; + + function chain(newtok, stream, state) { + state.tokenize.push(newtok); + return newtok(stream, state); + } + + function tokenBase(stream, state) { + if (stream.sol() && stream.match("=begin") && stream.eol()) { + state.tokenize.push(readBlockComment); + return "comment"; + } + if (stream.eatSpace()) return null; + var ch = stream.next(), m; + if (ch == "`" || ch == "'" || ch == '"') { + return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state); + } else if (ch == "/") { + if (regexpAhead(stream)) + return chain(readQuoted(ch, "string-2", true), stream, state); + else + return "operator"; + } else if (ch == "%") { + var style = "string", embed = true; + if (stream.eat("s")) style = "atom"; + else if (stream.eat(/[WQ]/)) style = "string"; + else if (stream.eat(/[r]/)) style = "string-2"; + else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; } + var delim = stream.eat(/[^\w\s=]/); + if (!delim) return "operator"; + if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; + return chain(readQuoted(delim, style, embed, true), stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) { + return chain(readHereDoc(m[1]), stream, state); + } else if (ch == "0") { + if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); + else if (stream.eat("b")) stream.eatWhile(/[01]/); + else stream.eatWhile(/[0-7]/); + return "number"; + } else if (/\d/.test(ch)) { + stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); + return "number"; + } else if (ch == "?") { + while (stream.match(/^\\[CM]-/)) {} + if (stream.eat("\\")) stream.eatWhile(/\w/); + else stream.next(); + return "string"; + } else if (ch == ":") { + if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); + if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); + + // :> :>> :< :<< are valid symbols + if (stream.eat(/[\<\>]/)) { + stream.eat(/[\<\>]/); + return "atom"; + } + + // :+ :- :/ :* :| :& :! are valid symbols + if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) { + return "atom"; + } + + // Symbols can't start by a digit + if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) { + stream.eatWhile(/[\w$\xa1-\uffff]/); + // Only one ? ! = is allowed and only as the last character + stream.eat(/[\?\!\=]/); + return "atom"; + } + return "operator"; + } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) { + stream.eat("@"); + stream.eatWhile(/[\w\xa1-\uffff]/); + return "variable-2"; + } else if (ch == "$") { + if (stream.eat(/[a-zA-Z_]/)) { + stream.eatWhile(/[\w]/); + } else if (stream.eat(/\d/)) { + stream.eat(/\d/); + } else { + stream.next(); // Must be a special global like $: or $! + } + return "variable-3"; + } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) { + stream.eatWhile(/[\w\xa1-\uffff]/); + stream.eat(/[\?\!]/); + if (stream.eat(":")) return "atom"; + return "ident"; + } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { + curPunc = "|"; + return null; + } else if (/[\(\)\[\]{}\\;]/.test(ch)) { + curPunc = ch; + return null; + } else if (ch == "-" && stream.eat(">")) { + return "arrow"; + } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { + var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); + if (ch == "." && !more) curPunc = "."; + return "operator"; + } else { + return null; + } + } + + function regexpAhead(stream) { + var start = stream.pos, depth = 0, next, found = false, escaped = false + while ((next = stream.next()) != null) { + if (!escaped) { + if ("[{(".indexOf(next) > -1) { + depth++ + } else if ("]})".indexOf(next) > -1) { + depth-- + if (depth < 0) break + } else if (next == "/" && depth == 0) { + found = true + break + } + escaped = next == "\\" + } else { + escaped = false + } + } + stream.backUp(stream.pos - start) + return found + } + + function tokenBaseUntilBrace(depth) { + if (!depth) depth = 1; + return function(stream, state) { + if (stream.peek() == "}") { + if (depth == 1) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } else { + state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1); + } + } else if (stream.peek() == "{") { + state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1); + } + return tokenBase(stream, state); + }; + } + function tokenBaseOnce() { + var alreadyCalled = false; + return function(stream, state) { + if (alreadyCalled) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + alreadyCalled = true; + return tokenBase(stream, state); + }; + } + function readQuoted(quote, style, embed, unescaped) { + return function(stream, state) { + var escaped = false, ch; + + if (state.context.type === 'read-quoted-paused') { + state.context = state.context.prev; + stream.eat("}"); + } + + while ((ch = stream.next()) != null) { + if (ch == quote && (unescaped || !escaped)) { + state.tokenize.pop(); + break; + } + if (embed && ch == "#" && !escaped) { + if (stream.eat("{")) { + if (quote == "}") { + state.context = {prev: state.context, type: 'read-quoted-paused'}; + } + state.tokenize.push(tokenBaseUntilBrace()); + break; + } else if (/[@\$]/.test(stream.peek())) { + state.tokenize.push(tokenBaseOnce()); + break; + } + } + escaped = !escaped && ch == "\\"; + } + return style; + }; + } + function readHereDoc(phrase) { + return function(stream, state) { + if (stream.match(phrase)) state.tokenize.pop(); + else stream.skipToEnd(); + return "string"; + }; + } + function readBlockComment(stream, state) { + if (stream.sol() && stream.match("=end") && stream.eol()) + state.tokenize.pop(); + stream.skipToEnd(); + return "comment"; + } + + return { + startState: function() { + return {tokenize: [tokenBase], + indented: 0, + context: {type: "top", indented: -config.indentUnit}, + continuedLine: false, + lastTok: null, + varList: false}; + }, + + token: function(stream, state) { + curPunc = null; + if (stream.sol()) state.indented = stream.indentation(); + var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; + var thisTok = curPunc; + if (style == "ident") { + var word = stream.current(); + style = state.lastTok == "." ? "property" + : keywords.propertyIsEnumerable(stream.current()) ? "keyword" + : /^[A-Z]/.test(word) ? "tag" + : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" + : "variable"; + if (style == "keyword") { + thisTok = word; + if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; + else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; + else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) + kwtype = "indent"; + else if (word == "do" && state.context.indented < state.indented) + kwtype = "indent"; + } + } + if (curPunc || (style && style != "comment")) state.lastTok = thisTok; + if (curPunc == "|") state.varList = !state.varList; + + if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) + state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; + else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) + state.context = state.context.prev; + + if (stream.eol()) + state.continuedLine = (curPunc == "\\" || style == "operator"); + return style; + }, + + indent: function(state, textAfter) { + if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0); + var ct = state.context; + var closing = ct.type == matching[firstChar] || + ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); + return ct.indented + (closing ? 0 : config.indentUnit) + + (state.continuedLine ? config.indentUnit : 0); + }, + + electricInput: /^\s*(?:end|rescue|elsif|else|\})$/, + lineComment: "#", + fold: "indent" + }; +}); + +CodeMirror.defineMIME("text/x-ruby", "ruby"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/nsis/nsis.min.js */ +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/css/css.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("css", function(config, parserConfig) { + var inline = parserConfig.inline + if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); + + var indentUnit = config.indentUnit, + tokenHooks = parserConfig.tokenHooks, + documentTypes = parserConfig.documentTypes || {}, + mediaTypes = parserConfig.mediaTypes || {}, + mediaFeatures = parserConfig.mediaFeatures || {}, + mediaValueKeywords = parserConfig.mediaValueKeywords || {}, + propertyKeywords = parserConfig.propertyKeywords || {}, + nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, + fontProperties = parserConfig.fontProperties || {}, + counterDescriptors = parserConfig.counterDescriptors || {}, + colorKeywords = parserConfig.colorKeywords || {}, + valueKeywords = parserConfig.valueKeywords || {}, + allowNested = parserConfig.allowNested, + lineComment = parserConfig.lineComment, + supportsAtComponent = parserConfig.supportsAtComponent === true; + + var type, override; + function ret(style, tp) { type = tp; return style; } + + // Tokenizers + + function tokenBase(stream, state) { + var ch = stream.next(); + if (tokenHooks[ch]) { + var result = tokenHooks[ch](stream, state); + if (result !== false) return result; + } + if (ch == "@") { + stream.eatWhile(/[\w\\\-]/); + return ret("def", stream.current()); + } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { + return ret(null, "compare"); + } else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "#") { + stream.eatWhile(/[\w\\\-]/); + return ret("atom", "hash"); + } else if (ch == "!") { + stream.match(/^\s*\w*/); + return ret("keyword", "important"); + } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (ch === "-") { + if (/[\d.]/.test(stream.peek())) { + stream.eatWhile(/[\w.%]/); + return ret("number", "unit"); + } else if (stream.match(/^-[\w\\\-]+/)) { + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ret("variable-2", "variable-definition"); + return ret("variable-2", "variable"); + } else if (stream.match(/^\w+-/)) { + return ret("meta", "meta"); + } + } else if (/[,+>*\/]/.test(ch)) { + return ret(null, "select-op"); + } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { + return ret("qualifier", "qualifier"); + } else if (/[:;{}\[\]\(\)]/.test(ch)) { + return ret(null, ch); + } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) || + (ch == "d" && stream.match("omain(")) || + (ch == "r" && stream.match("egexp("))) { + stream.backUp(1); + state.tokenize = tokenParenthesized; + return ret("property", "word"); + } else if (/[\w\\\-]/.test(ch)) { + stream.eatWhile(/[\w\\\-]/); + return ret("property", "word"); + } else { + return ret(null, null); + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + if (quote == ")") stream.backUp(1); + break; + } + escaped = !escaped && ch == "\\"; + } + if (ch == quote || !escaped && quote != ")") state.tokenize = null; + return ret("string", "string"); + }; + } + + function tokenParenthesized(stream, state) { + stream.next(); // Must be '(' + if (!stream.match(/\s*[\"\')]/, false)) + state.tokenize = tokenString(")"); + else + state.tokenize = null; + return ret(null, "("); + } + + // Context management + + function Context(type, indent, prev) { + this.type = type; + this.indent = indent; + this.prev = prev; + } + + function pushContext(state, stream, type, indent) { + state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context); + return type; + } + + function popContext(state) { + if (state.context.prev) + state.context = state.context.prev; + return state.context.type; + } + + function pass(type, stream, state) { + return states[state.context.type](type, stream, state); + } + function popAndPass(type, stream, state, n) { + for (var i = n || 1; i > 0; i--) + state.context = state.context.prev; + return pass(type, stream, state); + } + + // Parser + + function wordAsValue(stream) { + var word = stream.current().toLowerCase(); + if (valueKeywords.hasOwnProperty(word)) + override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; + else + override = "variable"; + } + + var states = {}; + + states.top = function(type, stream, state) { + if (type == "{") { + return pushContext(state, stream, "block"); + } else if (type == "}" && state.context.prev) { + return popContext(state); + } else if (supportsAtComponent && /@component/.test(type)) { + return pushContext(state, stream, "atComponentBlock"); + } else if (/^@(-moz-)?document$/.test(type)) { + return pushContext(state, stream, "documentTypes"); + } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) { + return pushContext(state, stream, "atBlock"); + } else if (/^@(font-face|counter-style)/.test(type)) { + state.stateArg = type; + return "restricted_atBlock_before"; + } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { + return "keyframes"; + } else if (type && type.charAt(0) == "@") { + return pushContext(state, stream, "at"); + } else if (type == "hash") { + override = "builtin"; + } else if (type == "word") { + override = "tag"; + } else if (type == "variable-definition") { + return "maybeprop"; + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } else if (type == ":") { + return "pseudo"; + } else if (allowNested && type == "(") { + return pushContext(state, stream, "parens"); + } + return state.context.type; + }; + + states.block = function(type, stream, state) { + if (type == "word") { + var word = stream.current().toLowerCase(); + if (propertyKeywords.hasOwnProperty(word)) { + override = "property"; + return "maybeprop"; + } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { + override = "string-2"; + return "maybeprop"; + } else if (allowNested) { + override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; + return "block"; + } else { + override += " error"; + return "maybeprop"; + } + } else if (type == "meta") { + return "block"; + } else if (!allowNested && (type == "hash" || type == "qualifier")) { + override = "error"; + return "block"; + } else { + return states.top(type, stream, state); + } + }; + + states.maybeprop = function(type, stream, state) { + if (type == ":") return pushContext(state, stream, "prop"); + return pass(type, stream, state); + }; + + states.prop = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); + if (type == "}" || type == "{") return popAndPass(type, stream, state); + if (type == "(") return pushContext(state, stream, "parens"); + + if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) { + override += " error"; + } else if (type == "word") { + wordAsValue(stream); + } else if (type == "interpolation") { + return pushContext(state, stream, "interpolation"); + } + return "prop"; + }; + + states.propBlock = function(type, _stream, state) { + if (type == "}") return popContext(state); + if (type == "word") { override = "property"; return "maybeprop"; } + return state.context.type; + }; + + states.parens = function(type, stream, state) { + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == ")") return popContext(state); + if (type == "(") return pushContext(state, stream, "parens"); + if (type == "interpolation") return pushContext(state, stream, "interpolation"); + if (type == "word") wordAsValue(stream); + return "parens"; + }; + + states.pseudo = function(type, stream, state) { + if (type == "meta") return "pseudo"; + + if (type == "word") { + override = "variable-3"; + return state.context.type; + } + return pass(type, stream, state); + }; + + states.documentTypes = function(type, stream, state) { + if (type == "word" && documentTypes.hasOwnProperty(stream.current())) { + override = "tag"; + return state.context.type; + } else { + return states.atBlock(type, stream, state); + } + }; + + states.atBlock = function(type, stream, state) { + if (type == "(") return pushContext(state, stream, "atBlock_parens"); + if (type == "}" || type == ";") return popAndPass(type, stream, state); + if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); + + if (type == "interpolation") return pushContext(state, stream, "interpolation"); + + if (type == "word") { + var word = stream.current().toLowerCase(); + if (word == "only" || word == "not" || word == "and" || word == "or") + override = "keyword"; + else if (mediaTypes.hasOwnProperty(word)) + override = "attribute"; + else if (mediaFeatures.hasOwnProperty(word)) + override = "property"; + else if (mediaValueKeywords.hasOwnProperty(word)) + override = "keyword"; + else if (propertyKeywords.hasOwnProperty(word)) + override = "property"; + else if (nonStandardPropertyKeywords.hasOwnProperty(word)) + override = "string-2"; + else if (valueKeywords.hasOwnProperty(word)) + override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; + else + override = "error"; + } + return state.context.type; + }; + + states.atComponentBlock = function(type, stream, state) { + if (type == "}") + return popAndPass(type, stream, state); + if (type == "{") + return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false); + if (type == "word") + override = "error"; + return state.context.type; + }; + + states.atBlock_parens = function(type, stream, state) { + if (type == ")") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); + return states.atBlock(type, stream, state); + }; + + states.restricted_atBlock_before = function(type, stream, state) { + if (type == "{") + return pushContext(state, stream, "restricted_atBlock"); + if (type == "word" && state.stateArg == "@counter-style") { + override = "variable"; + return "restricted_atBlock_before"; + } + return pass(type, stream, state); + }; + + states.restricted_atBlock = function(type, stream, state) { + if (type == "}") { + state.stateArg = null; + return popContext(state); + } + if (type == "word") { + if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || + (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) + override = "error"; + else + override = "property"; + return "maybeprop"; + } + return "restricted_atBlock"; + }; + + states.keyframes = function(type, stream, state) { + if (type == "word") { override = "variable"; return "keyframes"; } + if (type == "{") return pushContext(state, stream, "top"); + return pass(type, stream, state); + }; + + states.at = function(type, stream, state) { + if (type == ";") return popContext(state); + if (type == "{" || type == "}") return popAndPass(type, stream, state); + if (type == "word") override = "tag"; + else if (type == "hash") override = "builtin"; + return "at"; + }; + + states.interpolation = function(type, stream, state) { + if (type == "}") return popContext(state); + if (type == "{" || type == ";") return popAndPass(type, stream, state); + if (type == "word") override = "variable"; + else if (type != "variable" && type != "(" && type != ")") override = "error"; + return "interpolation"; + }; + + return { + startState: function(base) { + return {tokenize: null, + state: inline ? "block" : "top", + stateArg: null, + context: new Context(inline ? "block" : "top", base || 0, null)}; + }, + + token: function(stream, state) { + if (!state.tokenize && stream.eatSpace()) return null; + var style = (state.tokenize || tokenBase)(stream, state); + if (style && typeof style == "object") { + type = style[1]; + style = style[0]; + } + override = style; + if (type != "comment") + state.state = states[state.state](type, stream, state); + return override; + }, + + indent: function(state, textAfter) { + var cx = state.context, ch = textAfter && textAfter.charAt(0); + var indent = cx.indent; + if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; + if (cx.prev) { + if (ch == "}" && (cx.type == "block" || cx.type == "top" || + cx.type == "interpolation" || cx.type == "restricted_atBlock")) { + // Resume indentation from parent context. + cx = cx.prev; + indent = cx.indent; + } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at" || cx.type == "atBlock")) { + // Dedent relative to current context. + indent = Math.max(0, cx.indent - indentUnit); + } + } + return indent; + }, + + electricChars: "}", + blockCommentStart: "/*", + blockCommentEnd: "*/", + blockCommentContinue: " * ", + lineComment: lineComment, + fold: "brace" + }; +}); + + function keySet(array) { + var keys = {}; + for (var i = 0; i < array.length; ++i) { + keys[array[i].toLowerCase()] = true; + } + return keys; + } + + var documentTypes_ = [ + "domain", "regexp", "url", "url-prefix" + ], documentTypes = keySet(documentTypes_); + + var mediaTypes_ = [ + "all", "aural", "braille", "handheld", "print", "projection", "screen", + "tty", "tv", "embossed" + ], mediaTypes = keySet(mediaTypes_); + + var mediaFeatures_ = [ + "width", "min-width", "max-width", "height", "min-height", "max-height", + "device-width", "min-device-width", "max-device-width", "device-height", + "min-device-height", "max-device-height", "aspect-ratio", + "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", + "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", + "max-color", "color-index", "min-color-index", "max-color-index", + "monochrome", "min-monochrome", "max-monochrome", "resolution", + "min-resolution", "max-resolution", "scan", "grid", "orientation", + "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio", + "pointer", "any-pointer", "hover", "any-hover" + ], mediaFeatures = keySet(mediaFeatures_); + + var mediaValueKeywords_ = [ + "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", + "interlace", "progressive" + ], mediaValueKeywords = keySet(mediaValueKeywords_); + + var propertyKeywords_ = [ + "align-content", "align-items", "align-self", "alignment-adjust", + "alignment-baseline", "anchor-point", "animation", "animation-delay", + "animation-direction", "animation-duration", "animation-fill-mode", + "animation-iteration-count", "animation-name", "animation-play-state", + "animation-timing-function", "appearance", "azimuth", "backface-visibility", + "background", "background-attachment", "background-blend-mode", "background-clip", + "background-color", "background-image", "background-origin", "background-position", + "background-repeat", "background-size", "baseline-shift", "binding", + "bleed", "bookmark-label", "bookmark-level", "bookmark-state", + "bookmark-target", "border", "border-bottom", "border-bottom-color", + "border-bottom-left-radius", "border-bottom-right-radius", + "border-bottom-style", "border-bottom-width", "border-collapse", + "border-color", "border-image", "border-image-outset", + "border-image-repeat", "border-image-slice", "border-image-source", + "border-image-width", "border-left", "border-left-color", + "border-left-style", "border-left-width", "border-radius", "border-right", + "border-right-color", "border-right-style", "border-right-width", + "border-spacing", "border-style", "border-top", "border-top-color", + "border-top-left-radius", "border-top-right-radius", "border-top-style", + "border-top-width", "border-width", "bottom", "box-decoration-break", + "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", + "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count", + "column-fill", "column-gap", "column-rule", "column-rule-color", + "column-rule-style", "column-rule-width", "column-span", "column-width", + "columns", "content", "counter-increment", "counter-reset", "crop", "cue", + "cue-after", "cue-before", "cursor", "direction", "display", + "dominant-baseline", "drop-initial-after-adjust", + "drop-initial-after-align", "drop-initial-before-adjust", + "drop-initial-before-align", "drop-initial-size", "drop-initial-value", + "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", + "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", + "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", + "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", + "font-stretch", "font-style", "font-synthesis", "font-variant", + "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", + "font-variant-ligatures", "font-variant-numeric", "font-variant-position", + "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", + "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-gap", + "grid-column-start", "grid-gap", "grid-row", "grid-row-end", "grid-row-gap", + "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", + "grid-template-rows", "hanging-punctuation", "height", "hyphens", + "icon", "image-orientation", "image-rendering", "image-resolution", + "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing", + "line-break", "line-height", "line-stacking", "line-stacking-ruby", + "line-stacking-shift", "line-stacking-strategy", "list-style", + "list-style-image", "list-style-position", "list-style-type", "margin", + "margin-bottom", "margin-left", "margin-right", "margin-top", + "marks", "marquee-direction", "marquee-loop", + "marquee-play-count", "marquee-speed", "marquee-style", "max-height", + "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", + "nav-left", "nav-right", "nav-up", "object-fit", "object-position", + "opacity", "order", "orphans", "outline", + "outline-color", "outline-offset", "outline-style", "outline-width", + "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", + "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", + "page", "page-break-after", "page-break-before", "page-break-inside", + "page-policy", "pause", "pause-after", "pause-before", "perspective", + "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position", + "presentation-level", "punctuation-trim", "quotes", "region-break-after", + "region-break-before", "region-break-inside", "region-fragment", + "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", + "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", + "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", + "shape-outside", "size", "speak", "speak-as", "speak-header", + "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", + "tab-size", "table-layout", "target", "target-name", "target-new", + "target-position", "text-align", "text-align-last", "text-decoration", + "text-decoration-color", "text-decoration-line", "text-decoration-skip", + "text-decoration-style", "text-emphasis", "text-emphasis-color", + "text-emphasis-position", "text-emphasis-style", "text-height", + "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", + "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", + "text-wrap", "top", "transform", "transform-origin", "transform-style", + "transition", "transition-delay", "transition-duration", + "transition-property", "transition-timing-function", "unicode-bidi", + "user-select", "vertical-align", "visibility", "voice-balance", "voice-duration", + "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", + "voice-volume", "volume", "white-space", "widows", "width", "will-change", "word-break", + "word-spacing", "word-wrap", "z-index", + // SVG-specific + "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", + "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", + "color-interpolation", "color-interpolation-filters", + "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", + "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", + "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", + "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", + "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", + "glyph-orientation-vertical", "text-anchor", "writing-mode" + ], propertyKeywords = keySet(propertyKeywords_); + + var nonStandardPropertyKeywords_ = [ + "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", + "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", + "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", + "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", + "searchfield-results-decoration", "zoom" + ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); + + var fontProperties_ = [ + "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", + "font-stretch", "font-weight", "font-style" + ], fontProperties = keySet(fontProperties_); + + var counterDescriptors_ = [ + "additive-symbols", "fallback", "negative", "pad", "prefix", "range", + "speak-as", "suffix", "symbols", "system" + ], counterDescriptors = keySet(counterDescriptors_); + + var colorKeywords_ = [ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", + "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", + "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", + "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", + "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", + "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", + "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", + "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", + "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", + "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", + "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", + "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", + "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", + "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", + "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", + "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", + "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", + "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", + "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", + "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", + "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", + "whitesmoke", "yellow", "yellowgreen" + ], colorKeywords = keySet(colorKeywords_); + + var valueKeywords_ = [ + "above", "absolute", "activeborder", "additive", "activecaption", "afar", + "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", + "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", + "arabic-indic", "armenian", "asterisks", "attr", "auto", "auto-flow", "avoid", "avoid-column", "avoid-page", + "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", + "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", + "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", + "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", + "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", + "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", + "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse", + "compact", "condensed", "contain", "content", "contents", + "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", + "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal", + "decimal-leading-zero", "default", "default-button", "dense", "destination-atop", + "destination-in", "destination-out", "destination-over", "devanagari", "difference", + "disc", "discard", "disclosure-closed", "disclosure-open", "document", + "dot-dash", "dot-dot-dash", + "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", + "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", + "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", + "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", + "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", + "ethiopic-halehame-gez", "ethiopic-halehame-om-et", + "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", + "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", + "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed", + "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes", + "forwards", "from", "geometricPrecision", "georgian", "graytext", "grid", "groove", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew", + "help", "hidden", "hide", "higher", "highlight", "highlighttext", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore", + "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", + "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", + "inline-block", "inline-flex", "inline-grid", "inline-table", "inset", "inside", "intrinsic", "invert", + "italic", "japanese-formal", "japanese-informal", "justify", "kannada", + "katakana", "katakana-iroha", "keep-all", "khmer", + "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", + "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten", + "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", + "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", + "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", + "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d", + "media-controls-background", "media-current-time-display", + "media-fullscreen-button", "media-mute-button", "media-play-button", + "media-return-to-realtime-button", "media-rewind-button", + "media-seek-back-button", "media-seek-forward-button", "media-slider", + "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", + "media-volume-slider-container", "media-volume-sliderthumb", "medium", + "menu", "menulist", "menulist-button", "menulist-text", + "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", + "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize", + "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", + "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", + "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "opacity", "open-quote", + "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", + "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", + "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter", + "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", + "progress", "push-button", "radial-gradient", "radio", "read-only", + "read-write", "read-write-plaintext-only", "rectangle", "region", + "relative", "repeat", "repeating-linear-gradient", + "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", + "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", + "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running", + "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen", + "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield", + "searchfield-cancel-button", "searchfield-decoration", + "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end", + "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", + "simp-chinese-formal", "simp-chinese-informal", "single", + "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", + "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", + "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali", + "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square", + "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", + "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table", + "table-caption", "table-cell", "table-column", "table-column-group", + "table-footer-group", "table-header-group", "table-row", "table-row-group", + "tamil", + "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", + "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", + "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", + "trad-chinese-formal", "trad-chinese-informal", "transform", + "translate", "translate3d", "translateX", "translateY", "translateZ", + "transparent", "ultra-condensed", "ultra-expanded", "underline", "unset", "up", + "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", + "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", + "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", + "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", + "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor", + "xx-large", "xx-small" + ], valueKeywords = keySet(valueKeywords_); + + var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_) + .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_) + .concat(valueKeywords_); + CodeMirror.registerHelper("hintWords", "css", allWords); + + function tokenCComment(stream, state) { + var maybeEnd = false, ch; + while ((ch = stream.next()) != null) { + if (maybeEnd && ch == "/") { + state.tokenize = null; + break; + } + maybeEnd = (ch == "*"); + } + return ["comment", "comment"]; + } + + CodeMirror.defineMIME("text/css", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + tokenHooks: { + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css" + }); + + CodeMirror.defineMIME("text/x-scss", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + lineComment: "//", + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + ":": function(stream) { + if (stream.match(/\s*\{/, false)) + return [null, null] + return false; + }, + "$": function(stream) { + stream.match(/^[\w-]+/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "#": function(stream) { + if (!stream.eat("{")) return false; + return [null, "interpolation"]; + } + }, + name: "css", + helperType: "scss" + }); + + CodeMirror.defineMIME("text/x-less", { + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + fontProperties: fontProperties, + allowNested: true, + lineComment: "//", + tokenHooks: { + "/": function(stream, state) { + if (stream.eat("/")) { + stream.skipToEnd(); + return ["comment", "comment"]; + } else if (stream.eat("*")) { + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } else { + return ["operator", "operator"]; + } + }, + "@": function(stream) { + if (stream.eat("{")) return [null, "interpolation"]; + if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; + stream.eatWhile(/[\w\\\-]/); + if (stream.match(/^\s*:/, false)) + return ["variable-2", "variable-definition"]; + return ["variable-2", "variable"]; + }, + "&": function() { + return ["atom", "atom"]; + } + }, + name: "css", + helperType: "less" + }); + + CodeMirror.defineMIME("text/x-gss", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + supportsAtComponent: true, + tokenHooks: { + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css", + helperType: "gss" + }); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/haskell-literate/haskell-literate.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../haskell/haskell")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../haskell/haskell"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + "use strict" + + CodeMirror.defineMode("haskell-literate", function (config, parserConfig) { + var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell") + + return { + startState: function () { + return { + inCode: false, + baseState: CodeMirror.startState(baseMode) + } + }, + token: function (stream, state) { + if (stream.sol()) { + if (state.inCode = stream.eat(">")) + return "meta" + } + if (state.inCode) { + return baseMode.token(stream, state.baseState) + } else { + stream.skipToEnd() + return "comment" + } + }, + innerMode: function (state) { + return state.inCode ? {state: state.baseState, mode: baseMode} : null + } + } + }, "haskell") + + CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate") +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/mbox/mbox.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var rfc2822 = [ + "From", "Sender", "Reply-To", "To", "Cc", "Bcc", "Message-ID", + "In-Reply-To", "References", "Resent-From", "Resent-Sender", "Resent-To", + "Resent-Cc", "Resent-Bcc", "Resent-Message-ID", "Return-Path", "Received" +]; +var rfc2822NoEmail = [ + "Date", "Subject", "Comments", "Keywords", "Resent-Date" +]; + +CodeMirror.registerHelper("hintWords", "mbox", rfc2822.concat(rfc2822NoEmail)); + +var whitespace = /^[ \t]/; +var separator = /^From /; // See RFC 4155 +var rfc2822Header = new RegExp("^(" + rfc2822.join("|") + "): "); +var rfc2822HeaderNoEmail = new RegExp("^(" + rfc2822NoEmail.join("|") + "): "); +var header = /^[^:]+:/; // Optional fields defined in RFC 2822 +var email = /^[^ ]+@[^ ]+/; +var untilEmail = /^.*?(?=[^ ]+?@[^ ]+)/; +var bracketedEmail = /^<.*?>/; +var untilBracketedEmail = /^.*?(?=<.*>)/; + +function styleForHeader(header) { + if (header === "Subject") return "header"; + return "string"; +} + +function readToken(stream, state) { + if (stream.sol()) { + // From last line + state.inSeparator = false; + if (state.inHeader && stream.match(whitespace)) { + // Header folding + return null; + } else { + state.inHeader = false; + state.header = null; + } + + if (stream.match(separator)) { + state.inHeaders = true; + state.inSeparator = true; + return "atom"; + } + + var match; + var emailPermitted = false; + if ((match = stream.match(rfc2822HeaderNoEmail)) || + (emailPermitted = true) && (match = stream.match(rfc2822Header))) { + state.inHeaders = true; + state.inHeader = true; + state.emailPermitted = emailPermitted; + state.header = match[1]; + return "atom"; + } + + // Use vim's heuristics: recognize custom headers only if the line is in a + // block of legitimate headers. + if (state.inHeaders && (match = stream.match(header))) { + state.inHeader = true; + state.emailPermitted = true; + state.header = match[1]; + return "atom"; + } + + state.inHeaders = false; + stream.skipToEnd(); + return null; + } + + if (state.inSeparator) { + if (stream.match(email)) return "link"; + if (stream.match(untilEmail)) return "atom"; + stream.skipToEnd(); + return "atom"; + } + + if (state.inHeader) { + var style = styleForHeader(state.header); + + if (state.emailPermitted) { + if (stream.match(bracketedEmail)) return style + " link"; + if (stream.match(untilBracketedEmail)) return style; + } + stream.skipToEnd(); + return style; + } + + stream.skipToEnd(); + return null; +}; + +CodeMirror.defineMode("mbox", function() { + return { + startState: function() { + return { + // Is in a mbox separator + inSeparator: false, + // Is in a mail header + inHeader: false, + // If bracketed email is permitted. Only applicable when inHeader + emailPermitted: false, + // Name of current header + header: null, + // Is in a region of mail headers + inHeaders: false + }; + }, + token: readToken, + blankLine: function(state) { + state.inHeaders = state.inSeparator = state.inHeader = false; + } + }; +}); + +CodeMirror.defineMIME("application/mbox", "mbox"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/dtd/dtd.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/* + DTD mode + Ported to CodeMirror by Peter Kroon <plakroon@gmail.com> + Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues + GitHub: @peterkroon +*/ + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("dtd", function(config) { + var indentUnit = config.indentUnit, type; + function ret(style, tp) {type = tp; return style;} + + function tokenBase(stream, state) { + var ch = stream.next(); + + if (ch == "<" && stream.eat("!") ) { + if (stream.eatWhile(/[\-]/)) { + state.tokenize = tokenSGMLComment; + return tokenSGMLComment(stream, state); + } else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent"); + } else if (ch == "<" && stream.eat("?")) { //xml declaration + state.tokenize = inBlock("meta", "?>"); + return ret("meta", ch); + } else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag"); + else if (ch == "|") return ret("keyword", "seperator"); + else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else + else if (ch.match(/[\[\]]/)) return ret("rule", ch); + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) { + var sc = stream.current(); + if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1); + return ret("tag", "tag"); + } else if (ch == "%" || ch == "*" ) return ret("number", "number"); + else { + stream.eatWhile(/[\w\\\-_%.{,]/); + return ret(null, null); + } + } + + function tokenSGMLComment(stream, state) { + var dashes = 0, ch; + while ((ch = stream.next()) != null) { + if (dashes >= 2 && ch == ">") { + state.tokenize = tokenBase; + break; + } + dashes = (ch == "-") ? dashes + 1 : 0; + } + return ret("comment", "comment"); + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return ret("string", "tag"); + }; + } + + function inBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = tokenBase; + break; + } + stream.next(); + } + return style; + }; + } + + return { + startState: function(base) { + return {tokenize: tokenBase, + baseIndent: base || 0, + stack: []}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + var context = state.stack[state.stack.length-1]; + if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule"); + else if (type === "endtag") state.stack[state.stack.length-1] = "endtag"; + else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop(); + else if (type == "[") state.stack.push("["); + return style; + }, + + indent: function(state, textAfter) { + var n = state.stack.length; + + if( textAfter.match(/\]\s+|\]/) )n=n-1; + else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){ + if(textAfter.substr(0,1) === "<") {} + else if( type == "doindent" && textAfter.length > 1 ) {} + else if( type == "doindent")n--; + else if( type == ">" && textAfter.length > 1) {} + else if( type == "tag" && textAfter !== ">") {} + else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--; + else if( type == "tag")n++; + else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--; + else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule") {} + else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1; + else if( textAfter === ">") {} + else n=n-1; + //over rule them all + if(type == null || type == "]")n--; + } + + return state.baseIndent + n * indentUnit; + }, + + electricChars: "]>" + }; +}); + +CodeMirror.defineMIME("application/xml-dtd", "dtd"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/erlang/erlang.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +/*jshint unused:true, eqnull:true, curly:true, bitwise:true */ +/*jshint undef:true, latedef:true, trailing:true */ +/*global CodeMirror:true */ + +// erlang mode. +// tokenizer -> token types -> CodeMirror styles +// tokenizer maintains a parse stack +// indenter uses the parse stack + +// TODO indenter: +// bit syntax +// old guard/bif/conversion clashes (e.g. "float/1") +// type/spec/opaque + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMIME("text/x-erlang", "erlang"); + +CodeMirror.defineMode("erlang", function(cmCfg) { + "use strict"; + +///////////////////////////////////////////////////////////////////////////// +// constants + + var typeWords = [ + "-type", "-spec", "-export_type", "-opaque"]; + + var keywordWords = [ + "after","begin","catch","case","cond","end","fun","if", + "let","of","query","receive","try","when"]; + + var separatorRE = /[\->,;]/; + var separatorWords = [ + "->",";",","]; + + var operatorAtomWords = [ + "and","andalso","band","bnot","bor","bsl","bsr","bxor", + "div","not","or","orelse","rem","xor"]; + + var operatorSymbolRE = /[\+\-\*\/<>=\|:!]/; + var operatorSymbolWords = [ + "=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"]; + + var openParenRE = /[<\(\[\{]/; + var openParenWords = [ + "<<","(","[","{"]; + + var closeParenRE = /[>\)\]\}]/; + var closeParenWords = [ + "}","]",")",">>"]; + + var guardWords = [ + "is_atom","is_binary","is_bitstring","is_boolean","is_float", + "is_function","is_integer","is_list","is_number","is_pid", + "is_port","is_record","is_reference","is_tuple", + "atom","binary","bitstring","boolean","function","integer","list", + "number","pid","port","record","reference","tuple"]; + + var bifWords = [ + "abs","adler32","adler32_combine","alive","apply","atom_to_binary", + "atom_to_list","binary_to_atom","binary_to_existing_atom", + "binary_to_list","binary_to_term","bit_size","bitstring_to_list", + "byte_size","check_process_code","contact_binary","crc32", + "crc32_combine","date","decode_packet","delete_module", + "disconnect_node","element","erase","exit","float","float_to_list", + "garbage_collect","get","get_keys","group_leader","halt","hd", + "integer_to_list","internal_bif","iolist_size","iolist_to_binary", + "is_alive","is_atom","is_binary","is_bitstring","is_boolean", + "is_float","is_function","is_integer","is_list","is_number","is_pid", + "is_port","is_process_alive","is_record","is_reference","is_tuple", + "length","link","list_to_atom","list_to_binary","list_to_bitstring", + "list_to_existing_atom","list_to_float","list_to_integer", + "list_to_pid","list_to_tuple","load_module","make_ref","module_loaded", + "monitor_node","node","node_link","node_unlink","nodes","notalive", + "now","open_port","pid_to_list","port_close","port_command", + "port_connect","port_control","pre_loaded","process_flag", + "process_info","processes","purge_module","put","register", + "registered","round","self","setelement","size","spawn","spawn_link", + "spawn_monitor","spawn_opt","split_binary","statistics", + "term_to_binary","time","throw","tl","trunc","tuple_size", + "tuple_to_list","unlink","unregister","whereis"]; + +// upper case: [A-Z] [Ø-Þ] [À-Ö] +// lower case: [a-z] [ß-ö] [ø-ÿ] + var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/; + var escapesRE = + /[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/; + +///////////////////////////////////////////////////////////////////////////// +// tokenizer + + function tokenizer(stream,state) { + // in multi-line string + if (state.in_string) { + state.in_string = (!doubleQuote(stream)); + return rval(state,stream,"string"); + } + + // in multi-line atom + if (state.in_atom) { + state.in_atom = (!singleQuote(stream)); + return rval(state,stream,"atom"); + } + + // whitespace + if (stream.eatSpace()) { + return rval(state,stream,"whitespace"); + } + + // attributes and type specs + if (!peekToken(state) && + stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) { + if (is_member(stream.current(),typeWords)) { + return rval(state,stream,"type"); + }else{ + return rval(state,stream,"attribute"); + } + } + + var ch = stream.next(); + + // comment + if (ch == '%') { + stream.skipToEnd(); + return rval(state,stream,"comment"); + } + + // colon + if (ch == ":") { + return rval(state,stream,"colon"); + } + + // macro + if (ch == '?') { + stream.eatSpace(); + stream.eatWhile(anumRE); + return rval(state,stream,"macro"); + } + + // record + if (ch == "#") { + stream.eatSpace(); + stream.eatWhile(anumRE); + return rval(state,stream,"record"); + } + + // dollar escape + if (ch == "$") { + if (stream.next() == "\\" && !stream.match(escapesRE)) { + return rval(state,stream,"error"); + } + return rval(state,stream,"number"); + } + + // dot + if (ch == ".") { + return rval(state,stream,"dot"); + } + + // quoted atom + if (ch == '\'') { + if (!(state.in_atom = (!singleQuote(stream)))) { + if (stream.match(/\s*\/\s*[0-9]/,false)) { + stream.match(/\s*\/\s*[0-9]/,true); + return rval(state,stream,"fun"); // 'f'/0 style fun + } + if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) { + return rval(state,stream,"function"); + } + } + return rval(state,stream,"atom"); + } + + // string + if (ch == '"') { + state.in_string = (!doubleQuote(stream)); + return rval(state,stream,"string"); + } + + // variable + if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) { + stream.eatWhile(anumRE); + return rval(state,stream,"variable"); + } + + // atom/keyword/BIF/function + if (/[a-z_ß-öø-ÿ]/.test(ch)) { + stream.eatWhile(anumRE); + + if (stream.match(/\s*\/\s*[0-9]/,false)) { + stream.match(/\s*\/\s*[0-9]/,true); + return rval(state,stream,"fun"); // f/0 style fun + } + + var w = stream.current(); + + if (is_member(w,keywordWords)) { + return rval(state,stream,"keyword"); + }else if (is_member(w,operatorAtomWords)) { + return rval(state,stream,"operator"); + }else if (stream.match(/\s*\(/,false)) { + // 'put' and 'erlang:put' are bifs, 'foo:put' is not + if (is_member(w,bifWords) && + ((peekToken(state).token != ":") || + (peekToken(state,2).token == "erlang"))) { + return rval(state,stream,"builtin"); + }else if (is_member(w,guardWords)) { + return rval(state,stream,"guard"); + }else{ + return rval(state,stream,"function"); + } + }else if (lookahead(stream) == ":") { + if (w == "erlang") { + return rval(state,stream,"builtin"); + } else { + return rval(state,stream,"function"); + } + }else if (is_member(w,["true","false"])) { + return rval(state,stream,"boolean"); + }else{ + return rval(state,stream,"atom"); + } + } + + // number + var digitRE = /[0-9]/; + var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int + if (digitRE.test(ch)) { + stream.eatWhile(digitRE); + if (stream.eat('#')) { // 36#aZ style integer + if (!stream.eatWhile(radixRE)) { + stream.backUp(1); //"36#" - syntax error + } + } else if (stream.eat('.')) { // float + if (!stream.eatWhile(digitRE)) { + stream.backUp(1); // "3." - probably end of function + } else { + if (stream.eat(/[eE]/)) { // float with exponent + if (stream.eat(/[-+]/)) { + if (!stream.eatWhile(digitRE)) { + stream.backUp(2); // "2e-" - syntax error + } + } else { + if (!stream.eatWhile(digitRE)) { + stream.backUp(1); // "2e" - syntax error + } + } + } + } + } + return rval(state,stream,"number"); // normal integer + } + + // open parens + if (nongreedy(stream,openParenRE,openParenWords)) { + return rval(state,stream,"open_paren"); + } + + // close parens + if (nongreedy(stream,closeParenRE,closeParenWords)) { + return rval(state,stream,"close_paren"); + } + + // separators + if (greedy(stream,separatorRE,separatorWords)) { + return rval(state,stream,"separator"); + } + + // operators + if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) { + return rval(state,stream,"operator"); + } + + return rval(state,stream,null); + } + +///////////////////////////////////////////////////////////////////////////// +// utilities + function nongreedy(stream,re,words) { + if (stream.current().length == 1 && re.test(stream.current())) { + stream.backUp(1); + while (re.test(stream.peek())) { + stream.next(); + if (is_member(stream.current(),words)) { + return true; + } + } + stream.backUp(stream.current().length-1); + } + return false; + } + + function greedy(stream,re,words) { + if (stream.current().length == 1 && re.test(stream.current())) { + while (re.test(stream.peek())) { + stream.next(); + } + while (0 < stream.current().length) { + if (is_member(stream.current(),words)) { + return true; + }else{ + stream.backUp(1); + } + } + stream.next(); + } + return false; + } + + function doubleQuote(stream) { + return quote(stream, '"', '\\'); + } + + function singleQuote(stream) { + return quote(stream,'\'','\\'); + } + + function quote(stream,quoteChar,escapeChar) { + while (!stream.eol()) { + var ch = stream.next(); + if (ch == quoteChar) { + return true; + }else if (ch == escapeChar) { + stream.next(); + } + } + return false; + } + + function lookahead(stream) { + var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false); + return m ? m.pop() : ""; + } + + function is_member(element,list) { + return (-1 < list.indexOf(element)); + } + + function rval(state,stream,type) { + + // parse stack + pushToken(state,realToken(type,stream)); + + // map erlang token type to CodeMirror style class + // erlang -> CodeMirror tag + switch (type) { + case "atom": return "atom"; + case "attribute": return "attribute"; + case "boolean": return "atom"; + case "builtin": return "builtin"; + case "close_paren": return null; + case "colon": return null; + case "comment": return "comment"; + case "dot": return null; + case "error": return "error"; + case "fun": return "meta"; + case "function": return "tag"; + case "guard": return "property"; + case "keyword": return "keyword"; + case "macro": return "variable-2"; + case "number": return "number"; + case "open_paren": return null; + case "operator": return "operator"; + case "record": return "bracket"; + case "separator": return null; + case "string": return "string"; + case "type": return "def"; + case "variable": return "variable"; + default: return null; + } + } + + function aToken(tok,col,ind,typ) { + return {token: tok, + column: col, + indent: ind, + type: typ}; + } + + function realToken(type,stream) { + return aToken(stream.current(), + stream.column(), + stream.indentation(), + type); + } + + function fakeToken(type) { + return aToken(type,0,0,type); + } + + function peekToken(state,depth) { + var len = state.tokenStack.length; + var dep = (depth ? depth : 1); + + if (len < dep) { + return false; + }else{ + return state.tokenStack[len-dep]; + } + } + + function pushToken(state,token) { + + if (!(token.type == "comment" || token.type == "whitespace")) { + state.tokenStack = maybe_drop_pre(state.tokenStack,token); + state.tokenStack = maybe_drop_post(state.tokenStack); + } + } + + function maybe_drop_pre(s,token) { + var last = s.length-1; + + if (0 < last && s[last].type === "record" && token.type === "dot") { + s.pop(); + }else if (0 < last && s[last].type === "group") { + s.pop(); + s.push(token); + }else{ + s.push(token); + } + return s; + } + + function maybe_drop_post(s) { + if (!s.length) return s + var last = s.length-1; + + if (s[last].type === "dot") { + return []; + } + if (last > 1 && s[last].type === "fun" && s[last-1].token === "fun") { + return s.slice(0,last-1); + } + switch (s[last].token) { + case "}": return d(s,{g:["{"]}); + case "]": return d(s,{i:["["]}); + case ")": return d(s,{i:["("]}); + case ">>": return d(s,{i:["<<"]}); + case "end": return d(s,{i:["begin","case","fun","if","receive","try"]}); + case ",": return d(s,{e:["begin","try","when","->", + ",","(","[","{","<<"]}); + case "->": return d(s,{r:["when"], + m:["try","if","case","receive"]}); + case ";": return d(s,{E:["case","fun","if","receive","try","when"]}); + case "catch":return d(s,{e:["try"]}); + case "of": return d(s,{e:["case"]}); + case "after":return d(s,{e:["receive","try"]}); + default: return s; + } + } + + function d(stack,tt) { + // stack is a stack of Token objects. + // tt is an object; {type:tokens} + // type is a char, tokens is a list of token strings. + // The function returns (possibly truncated) stack. + // It will descend the stack, looking for a Token such that Token.token + // is a member of tokens. If it does not find that, it will normally (but + // see "E" below) return stack. If it does find a match, it will remove + // all the Tokens between the top and the matched Token. + // If type is "m", that is all it does. + // If type is "i", it will also remove the matched Token and the top Token. + // If type is "g", like "i", but add a fake "group" token at the top. + // If type is "r", it will remove the matched Token, but not the top Token. + // If type is "e", it will keep the matched Token but not the top Token. + // If type is "E", it behaves as for type "e", except if there is no match, + // in which case it will return an empty stack. + + for (var type in tt) { + var len = stack.length-1; + var tokens = tt[type]; + for (var i = len-1; -1 < i ; i--) { + if (is_member(stack[i].token,tokens)) { + var ss = stack.slice(0,i); + switch (type) { + case "m": return ss.concat(stack[i]).concat(stack[len]); + case "r": return ss.concat(stack[len]); + case "i": return ss; + case "g": return ss.concat(fakeToken("group")); + case "E": return ss.concat(stack[i]); + case "e": return ss.concat(stack[i]); + } + } + } + } + return (type == "E" ? [] : stack); + } + +///////////////////////////////////////////////////////////////////////////// +// indenter + + function indenter(state,textAfter) { + var t; + var unit = cmCfg.indentUnit; + var wordAfter = wordafter(textAfter); + var currT = peekToken(state,1); + var prevT = peekToken(state,2); + + if (state.in_string || state.in_atom) { + return CodeMirror.Pass; + }else if (!prevT) { + return 0; + }else if (currT.token == "when") { + return currT.column+unit; + }else if (wordAfter === "when" && prevT.type === "function") { + return prevT.indent+unit; + }else if (wordAfter === "(" && currT.token === "fun") { + return currT.column+3; + }else if (wordAfter === "catch" && (t = getToken(state,["try"]))) { + return t.column; + }else if (is_member(wordAfter,["end","after","of"])) { + t = getToken(state,["begin","case","fun","if","receive","try"]); + return t ? t.column : CodeMirror.Pass; + }else if (is_member(wordAfter,closeParenWords)) { + t = getToken(state,openParenWords); + return t ? t.column : CodeMirror.Pass; + }else if (is_member(currT.token,[",","|","||"]) || + is_member(wordAfter,[",","|","||"])) { + t = postcommaToken(state); + return t ? t.column+t.token.length : unit; + }else if (currT.token == "->") { + if (is_member(prevT.token, ["receive","case","if","try"])) { + return prevT.column+unit+unit; + }else{ + return prevT.column+unit; + } + }else if (is_member(currT.token,openParenWords)) { + return currT.column+currT.token.length; + }else{ + t = defaultToken(state); + return truthy(t) ? t.column+unit : 0; + } + } + + function wordafter(str) { + var m = str.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/); + + return truthy(m) && (m.index === 0) ? m[0] : ""; + } + + function postcommaToken(state) { + var objs = state.tokenStack.slice(0,-1); + var i = getTokenIndex(objs,"type",["open_paren"]); + + return truthy(objs[i]) ? objs[i] : false; + } + + function defaultToken(state) { + var objs = state.tokenStack; + var stop = getTokenIndex(objs,"type",["open_paren","separator","keyword"]); + var oper = getTokenIndex(objs,"type",["operator"]); + + if (truthy(stop) && truthy(oper) && stop < oper) { + return objs[stop+1]; + } else if (truthy(stop)) { + return objs[stop]; + } else { + return false; + } + } + + function getToken(state,tokens) { + var objs = state.tokenStack; + var i = getTokenIndex(objs,"token",tokens); + + return truthy(objs[i]) ? objs[i] : false; + } + + function getTokenIndex(objs,propname,propvals) { + + for (var i = objs.length-1; -1 < i ; i--) { + if (is_member(objs[i][propname],propvals)) { + return i; + } + } + return false; + } + + function truthy(x) { + return (x !== false) && (x != null); + } + +///////////////////////////////////////////////////////////////////////////// +// this object defines the mode + + return { + startState: + function() { + return {tokenStack: [], + in_string: false, + in_atom: false}; + }, + + token: + function(stream, state) { + return tokenizer(stream, state); + }, + + indent: + function(state, textAfter) { + return indenter(state,textAfter); + }, + + lineComment: "%" + }; +}); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/turtle/turtle.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("turtle", function(config) { + var indentUnit = config.indentUnit; + var curPunc; + + function wordRegexp(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var ops = wordRegexp([]); + var keywords = wordRegexp(["@prefix", "@base", "a"]); + var operatorChars = /[*+\-<>=&|]/; + + function tokenBase(stream, state) { + var ch = stream.next(); + curPunc = null; + if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { + stream.match(/^[^\s\u00a0>]*>?/); + return "atom"; + } + else if (ch == "\"" || ch == "'") { + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } + else if (/[{}\(\),\.;\[\]]/.test(ch)) { + curPunc = ch; + return null; + } + else if (ch == "#") { + stream.skipToEnd(); + return "comment"; + } + else if (operatorChars.test(ch)) { + stream.eatWhile(operatorChars); + return null; + } + else if (ch == ":") { + return "operator"; + } else { + stream.eatWhile(/[_\w\d]/); + if(stream.peek() == ":") { + return "variable-3"; + } else { + var word = stream.current(); + + if(keywords.test(word)) { + return "meta"; + } + + if(ch >= "A" && ch <= "Z") { + return "comment"; + } else { + return "keyword"; + } + } + var word = stream.current(); + if (ops.test(word)) + return null; + else if (keywords.test(word)) + return "meta"; + else + return "variable"; + } + } + + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && ch == "\\"; + } + return "string"; + }; + } + + function pushContext(state, type, col) { + state.context = {prev: state.context, indent: state.indent, col: col, type: type}; + } + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function() { + return {tokenize: tokenBase, + context: null, + indent: 0, + col: 0}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) state.context.align = false; + state.indent = stream.indentation(); + } + if (stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + + if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { + state.context.align = true; + } + + if (curPunc == "(") pushContext(state, ")", stream.column()); + else if (curPunc == "[") pushContext(state, "]", stream.column()); + else if (curPunc == "{") pushContext(state, "}", stream.column()); + else if (/[\]\}\)]/.test(curPunc)) { + while (state.context && state.context.type == "pattern") popContext(state); + if (state.context && curPunc == state.context.type) popContext(state); + } + else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); + else if (/atom|string|variable/.test(style) && state.context) { + if (/[\}\]]/.test(state.context.type)) + pushContext(state, "pattern", stream.column()); + else if (state.context.type == "pattern" && !state.context.align) { + state.context.align = true; + state.context.col = stream.column(); + } + } + + return style; + }, + + indent: function(state, textAfter) { + var firstChar = textAfter && textAfter.charAt(0); + var context = state.context; + if (/[\]\}]/.test(firstChar)) + while (context && context.type == "pattern") context = context.prev; + + var closing = context && firstChar == context.type; + if (!context) + return 0; + else if (context.type == "pattern") + return context.col; + else if (context.align) + return context.col + (closing ? 0 : 1); + else + return context.indent + (closing ? 0 : indentUnit); + }, + + lineComment: "#" + }; +}); + +CodeMirror.defineMIME("text/turtle", "turtle"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/troff/troff.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) + define(["../../lib/codemirror"], mod); + else + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('troff', function() { + + var words = {}; + + function tokenBase(stream) { + if (stream.eatSpace()) return null; + + var sol = stream.sol(); + var ch = stream.next(); + + if (ch === '\\') { + if (stream.match('fB') || stream.match('fR') || stream.match('fI') || + stream.match('u') || stream.match('d') || + stream.match('%') || stream.match('&')) { + return 'string'; + } + if (stream.match('m[')) { + stream.skipTo(']'); + stream.next(); + return 'string'; + } + if (stream.match('s+') || stream.match('s-')) { + stream.eatWhile(/[\d-]/); + return 'string'; + } + if (stream.match('\(') || stream.match('*\(')) { + stream.eatWhile(/[\w-]/); + return 'string'; + } + return 'string'; + } + if (sol && (ch === '.' || ch === '\'')) { + if (stream.eat('\\') && stream.eat('\"')) { + stream.skipToEnd(); + return 'comment'; + } + } + if (sol && ch === '.') { + if (stream.match('B ') || stream.match('I ') || stream.match('R ')) { + return 'attribute'; + } + if (stream.match('TH ') || stream.match('SH ') || stream.match('SS ') || stream.match('HP ')) { + stream.skipToEnd(); + return 'quote'; + } + if ((stream.match(/[A-Z]/) && stream.match(/[A-Z]/)) || (stream.match(/[a-z]/) && stream.match(/[a-z]/))) { + return 'attribute'; + } + } + stream.eatWhile(/[\w-]/); + var cur = stream.current(); + return words.hasOwnProperty(cur) ? words[cur] : null; + } + + function tokenize(stream, state) { + return (state.tokens[0] || tokenBase) (stream, state); + }; + + return { + startState: function() {return {tokens:[]};}, + token: function(stream, state) { + return tokenize(stream, state); + } + }; +}); + +CodeMirror.defineMIME('text/troff', 'troff'); +CodeMirror.defineMIME('text/x-troff', 'troff'); +CodeMirror.defineMIME('application/x-troff', 'troff'); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/jinja2/jinja2.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + CodeMirror.defineMode("jinja2", function() { + var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif", + "extends", "filter", "endfilter", "firstof", "for", + "endfor", "if", "endif", "ifchanged", "endifchanged", + "ifequal", "endifequal", "ifnotequal", + "endifnotequal", "in", "include", "load", "not", "now", "or", + "parsed", "regroup", "reversed", "spaceless", + "endspaceless", "ssi", "templatetag", "openblock", + "closeblock", "openvariable", "closevariable", + "openbrace", "closebrace", "opencomment", + "closecomment", "widthratio", "url", "with", "endwith", + "get_current_language", "trans", "endtrans", "noop", "blocktrans", + "endblocktrans", "get_available_languages", + "get_current_language_bidi", "plural"], + operator = /^[+\-*&%=<>!?|~^]/, + sign = /^[:\[\(\{]/, + atom = ["true", "false"], + number = /^(\d[+\-\*\/])?\d+(\.\d+)?/; + + keywords = new RegExp("((" + keywords.join(")|(") + "))\\b"); + atom = new RegExp("((" + atom.join(")|(") + "))\\b"); + + function tokenBase (stream, state) { + var ch = stream.peek(); + + //Comment + if (state.incomment) { + if(!stream.skipTo("#}")) { + stream.skipToEnd(); + } else { + stream.eatWhile(/\#|}/); + state.incomment = false; + } + return "comment"; + //Tag + } else if (state.intag) { + //After operator + if(state.operator) { + state.operator = false; + if(stream.match(atom)) { + return "atom"; + } + if(stream.match(number)) { + return "number"; + } + } + //After sign + if(state.sign) { + state.sign = false; + if(stream.match(atom)) { + return "atom"; + } + if(stream.match(number)) { + return "number"; + } + } + + if(state.instring) { + if(ch == state.instring) { + state.instring = false; + } + stream.next(); + return "string"; + } else if(ch == "'" || ch == '"') { + state.instring = ch; + stream.next(); + return "string"; + } else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) { + state.intag = false; + return "tag"; + } else if(stream.match(operator)) { + state.operator = true; + return "operator"; + } else if(stream.match(sign)) { + state.sign = true; + } else { + if(stream.eat(" ") || stream.sol()) { + if(stream.match(keywords)) { + return "keyword"; + } + if(stream.match(atom)) { + return "atom"; + } + if(stream.match(number)) { + return "number"; + } + if(stream.sol()) { + stream.next(); + } + } else { + stream.next(); + } + + } + return "variable"; + } else if (stream.eat("{")) { + if (stream.eat("#")) { + state.incomment = true; + if(!stream.skipTo("#}")) { + stream.skipToEnd(); + } else { + stream.eatWhile(/\#|}/); + state.incomment = false; + } + return "comment"; + //Open tag + } else if (ch = stream.eat(/\{|%/)) { + //Cache close tag + state.intag = ch; + if(ch == "{") { + state.intag = "}"; + } + stream.eat("-"); + return "tag"; + } + } + stream.next(); + }; + + return { + startState: function () { + return {tokenize: tokenBase}; + }, + token: function (stream, state) { + return state.tokenize(stream, state); + } + }; + }); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/diff/diff.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("diff", function() { + + var TOKEN_NAMES = { + '+': 'positive', + '-': 'negative', + '@': 'meta' + }; + + return { + token: function(stream) { + var tw_pos = stream.string.search(/[\t ]+?$/); + + if (!stream.sol() || tw_pos === 0) { + stream.skipToEnd(); + return ("error " + ( + TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); + } + + var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); + + if (tw_pos === -1) { + stream.skipToEnd(); + } else { + stream.pos = tw_pos; + } + + return token_name; + } + }; +}); + +CodeMirror.defineMIME("text/x-diff", "diff"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/dart/dart.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../clike/clike")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../clike/clike"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var keywords = ("this super static final const abstract class extends external factory " + + "implements get native set typedef with enum throw rethrow " + + "assert break case continue default in return new deferred async await covariant " + + "try catch finally do else for if switch while import library export " + + "part of show hide is as").split(" "); + var blockKeywords = "try catch finally do else for if switch while".split(" "); + var atoms = "true false null".split(" "); + var builtins = "void bool num int double dynamic var String".split(" "); + + function set(words) { + var obj = {}; + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + function pushInterpolationStack(state) { + (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize); + } + + function popInterpolationStack(state) { + return (state.interpolationStack || (state.interpolationStack = [])).pop(); + } + + function sizeInterpolationStack(state) { + return state.interpolationStack ? state.interpolationStack.length : 0; + } + + CodeMirror.defineMIME("application/dart", { + name: "clike", + keywords: set(keywords), + blockKeywords: set(blockKeywords), + builtin: set(builtins), + atoms: set(atoms), + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_\.]/); + return "meta"; + }, + + // custom string handling to deal with triple-quoted strings and string interpolation + "'": function(stream, state) { + return tokenString("'", stream, state, false); + }, + "\"": function(stream, state) { + return tokenString("\"", stream, state, false); + }, + "r": function(stream, state) { + var peek = stream.peek(); + if (peek == "'" || peek == "\"") { + return tokenString(stream.next(), stream, state, true); + } + return false; + }, + + "}": function(_stream, state) { + // "}" is end of interpolation, if interpolation stack is non-empty + if (sizeInterpolationStack(state) > 0) { + state.tokenize = popInterpolationStack(state); + return null; + } + return false; + }, + + "/": function(stream, state) { + if (!stream.eat("*")) return false + state.tokenize = tokenNestedComment(1) + return state.tokenize(stream, state) + } + } + }); + + function tokenString(quote, stream, state, raw) { + var tripleQuoted = false; + if (stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; //empty string + } + function tokenStringHelper(stream, state) { + var escaped = false; + while (!stream.eol()) { + if (!raw && !escaped && stream.peek() == "$") { + pushInterpolationStack(state); + state.tokenize = tokenInterpolation; + return "string"; + } + var next = stream.next(); + if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) { + state.tokenize = null; + break; + } + escaped = !raw && !escaped && next == "\\"; + } + return "string"; + } + state.tokenize = tokenStringHelper; + return tokenStringHelper(stream, state); + } + + function tokenInterpolation(stream, state) { + stream.eat("$"); + if (stream.eat("{")) { + // let clike handle the content of ${...}, + // we take over again when "}" appears (see hooks). + state.tokenize = null; + } else { + state.tokenize = tokenInterpolationIdentifier; + } + return null; + } + + function tokenInterpolationIdentifier(stream, state) { + stream.eatWhile(/[\w_]/); + state.tokenize = popInterpolationStack(state); + return "variable"; + } + + function tokenNestedComment(depth) { + return function (stream, state) { + var ch + while (ch = stream.next()) { + if (ch == "*" && stream.eat("/")) { + if (depth == 1) { + state.tokenize = null + break + } else { + state.tokenize = tokenNestedComment(depth - 1) + return state.tokenize(stream, state) + } + } else if (ch == "/" && stream.eat("*")) { + state.tokenize = tokenNestedComment(depth + 1) + return state.tokenize(stream, state) + } + } + return "comment" + } + } + + CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); + + // This is needed to make loading through meta.js work. + CodeMirror.defineMode("dart", function(conf) { + return CodeMirror.getMode(conf, "application/dart"); + }, "clike"); +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/shell/shell.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode('shell', function() { + + var words = {}; + function define(style, string) { + var split = string.split(' '); + for(var i = 0; i < split.length; i++) { + words[split[i]] = style; + } + }; + + // Atoms + define('atom', 'true false'); + + // Keywords + define('keyword', 'if then do else elif while until for in esac fi fin ' + + 'fil done exit set unset export function'); + + // Commands + define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + + 'curl cut diff echo find gawk gcc get git grep hg kill killall ln ls make ' + + 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + + 'shopt shred source sort sleep ssh start stop su sudo svn tee telnet top ' + + 'touch vi vim wall wc wget who write yes zsh'); + + function tokenBase(stream, state) { + if (stream.eatSpace()) return null; + + var sol = stream.sol(); + var ch = stream.next(); + + if (ch === '\\') { + stream.next(); + return null; + } + if (ch === '\'' || ch === '"' || ch === '`') { + state.tokens.unshift(tokenString(ch, ch === "`" ? "quote" : "string")); + return tokenize(stream, state); + } + if (ch === '#') { + if (sol && stream.eat('!')) { + stream.skipToEnd(); + return 'meta'; // 'comment'? + } + stream.skipToEnd(); + return 'comment'; + } + if (ch === '$') { + state.tokens.unshift(tokenDollar); + return tokenize(stream, state); + } + if (ch === '+' || ch === '=') { + return 'operator'; + } + if (ch === '-') { + stream.eat('-'); + stream.eatWhile(/\w/); + return 'attribute'; + } + if (/\d/.test(ch)) { + stream.eatWhile(/\d/); + if(stream.eol() || !/\w/.test(stream.peek())) { + return 'number'; + } + } + stream.eatWhile(/[\w-]/); + var cur = stream.current(); + if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; + return words.hasOwnProperty(cur) ? words[cur] : null; + } + + function tokenString(quote, style) { + var close = quote == "(" ? ")" : quote == "{" ? "}" : quote + return function(stream, state) { + var next, end = false, escaped = false; + while ((next = stream.next()) != null) { + if (next === close && !escaped) { + end = true; + break; + } + if (next === '$' && !escaped && quote !== "'") { + escaped = true; + stream.backUp(1); + state.tokens.unshift(tokenDollar); + break; + } + if (!escaped && next === quote && quote !== close) { + state.tokens.unshift(tokenString(quote, style)) + return tokenize(stream, state) + } + escaped = !escaped && next === '\\'; + } + if (end) state.tokens.shift(); + return style; + }; + }; + + var tokenDollar = function(stream, state) { + if (state.tokens.length > 1) stream.eat('$'); + var ch = stream.next() + if (/['"({]/.test(ch)) { + state.tokens[0] = tokenString(ch, ch == "(" ? "quote" : ch == "{" ? "def" : "string"); + return tokenize(stream, state); + } + if (!/\d/.test(ch)) stream.eatWhile(/\w/); + state.tokens.shift(); + return 'def'; + }; + + function tokenize(stream, state) { + return (state.tokens[0] || tokenBase) (stream, state); + }; + + return { + startState: function() {return {tokens:[]};}, + token: function(stream, state) { + return tokenize(stream, state); + }, + closeBrackets: "()[]{}''\"\"``", + lineComment: '#', + fold: "brace" + }; +}); + +CodeMirror.defineMIME('text/x-sh', 'shell'); +// Apache uses a slightly different Media Type for Shell scripts +// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +CodeMirror.defineMIME('application/x-sh', 'shell'); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/lua/lua.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's +// CodeMirror 1 mode. +// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("lua", function(config, parserConfig) { + var indentUnit = config.indentUnit; + + function prefixRE(words) { + return new RegExp("^(?:" + words.join("|") + ")", "i"); + } + function wordRE(words) { + return new RegExp("^(?:" + words.join("|") + ")$", "i"); + } + var specials = wordRE(parserConfig.specials || []); + + // long list of standard functions from lua manual + var builtins = wordRE([ + "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", + "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", + "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", + + "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", + + "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", + "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", + "debug.setupvalue","debug.traceback", + + "close","flush","lines","read","seek","setvbuf","write", + + "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", + "io.stdout","io.tmpfile","io.type","io.write", + + "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", + "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", + "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", + "math.sqrt","math.tan","math.tanh", + + "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", + "os.time","os.tmpname", + + "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", + "package.seeall", + + "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", + "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", + + "table.concat","table.insert","table.maxn","table.remove","table.sort" + ]); + var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", + "true","function", "end", "if", "then", "else", "do", + "while", "repeat", "until", "for", "in", "local" ]); + + var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); + var dedentTokens = wordRE(["end", "until", "\\)", "}"]); + var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); + + function readBracket(stream) { + var level = 0; + while (stream.eat("=")) ++level; + stream.eat("["); + return level; + } + + function normal(stream, state) { + var ch = stream.next(); + if (ch == "-" && stream.eat("-")) { + if (stream.eat("[") && stream.eat("[")) + return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); + stream.skipToEnd(); + return "comment"; + } + if (ch == "\"" || ch == "'") + return (state.cur = string(ch))(stream, state); + if (ch == "[" && /[\[=]/.test(stream.peek())) + return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); + if (/\d/.test(ch)) { + stream.eatWhile(/[\w.%]/); + return "number"; + } + if (/[\w_]/.test(ch)) { + stream.eatWhile(/[\w\\\-_.]/); + return "variable"; + } + return null; + } + + function bracketed(level, style) { + return function(stream, state) { + var curlev = null, ch; + while ((ch = stream.next()) != null) { + if (curlev == null) {if (ch == "]") curlev = 0;} + else if (ch == "=") ++curlev; + else if (ch == "]" && curlev == level) { state.cur = normal; break; } + else curlev = null; + } + return style; + }; + } + + function string(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) break; + escaped = !escaped && ch == "\\"; + } + if (!escaped) state.cur = normal; + return "string"; + }; + } + + return { + startState: function(basecol) { + return {basecol: basecol || 0, indentDepth: 0, cur: normal}; + }, + + token: function(stream, state) { + if (stream.eatSpace()) return null; + var style = state.cur(stream, state); + var word = stream.current(); + if (style == "variable") { + if (keywords.test(word)) style = "keyword"; + else if (builtins.test(word)) style = "builtin"; + else if (specials.test(word)) style = "variable-2"; + } + if ((style != "comment") && (style != "string")){ + if (indentTokens.test(word)) ++state.indentDepth; + else if (dedentTokens.test(word)) --state.indentDepth; + } + return style; + }, + + indent: function(state, textAfter) { + var closing = dedentPartial.test(textAfter); + return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); + }, + + lineComment: "--", + blockCommentStart: "--[[", + blockCommentEnd: "]]" + }; +}); + +CodeMirror.defineMIME("text/x-lua", "lua"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/codemirror/mode/groovy/groovy.min.js */ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("groovy", function(config) { + function words(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + var keywords = words( + "abstract as assert boolean break byte case catch char class const continue def default " + + "do double else enum extends final finally float for goto if implements import in " + + "instanceof int interface long native new package private protected public return " + + "short static strictfp super switch synchronized threadsafe throw throws trait transient " + + "try void volatile while"); + var blockKeywords = words("catch class def do else enum finally for if interface switch trait try while"); + var standaloneKeywords = words("return break continue"); + var atoms = words("null true false this"); + + var curPunc; + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + return startString(ch, stream, state); + } + if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + curPunc = ch; + return null; + } + if (/\d/.test(ch)) { + stream.eatWhile(/[\w\.]/); + if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); } + return "number"; + } + if (ch == "/") { + if (stream.eat("*")) { + state.tokenize.push(tokenComment); + return tokenComment(stream, state); + } + if (stream.eat("/")) { + stream.skipToEnd(); + return "comment"; + } + if (expectExpression(state.lastToken, false)) { + return startString(ch, stream, state); + } + } + if (ch == "-" && stream.eat(">")) { + curPunc = "->"; + return null; + } + if (/[+\-*&%=<>!?|\/~]/.test(ch)) { + stream.eatWhile(/[+\-*&%=<>|~]/); + return "operator"; + } + stream.eatWhile(/[\w\$_]/); + if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; } + if (state.lastToken == ".") return "property"; + if (stream.eat(":")) { curPunc = "proplabel"; return "property"; } + var cur = stream.current(); + if (atoms.propertyIsEnumerable(cur)) { return "atom"; } + if (keywords.propertyIsEnumerable(cur)) { + if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + else if (standaloneKeywords.propertyIsEnumerable(cur)) curPunc = "standalone"; + return "keyword"; + } + return "variable"; + } + tokenBase.isBase = true; + + function startString(quote, stream, state) { + var tripleQuoted = false; + if (quote != "/" && stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; + } + function t(stream, state) { + var escaped = false, next, end = !tripleQuoted; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + if (!tripleQuoted) { break; } + if (stream.match(quote + quote)) { end = true; break; } + } + if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { + state.tokenize.push(tokenBaseUntilBrace()); + return "string"; + } + escaped = !escaped && next == "\\"; + } + if (end) state.tokenize.pop(); + return "string"; + } + state.tokenize.push(t); + return t(stream, state); + } + + function tokenBaseUntilBrace() { + var depth = 1; + function t(stream, state) { + if (stream.peek() == "}") { + depth--; + if (depth == 0) { + state.tokenize.pop(); + return state.tokenize[state.tokenize.length-1](stream, state); + } + } else if (stream.peek() == "{") { + depth++; + } + return tokenBase(stream, state); + } + t.isBase = true; + return t; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize.pop(); + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function expectExpression(last, newline) { + return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || + last == "newstatement" || last == "keyword" || last == "proplabel" || + (last == "standalone" && !newline); + } + + function Context(indented, column, type, align, prev) { + this.indented = indented; + this.column = column; + this.type = type; + this.align = align; + this.prev = prev; + } + function pushContext(state, col, type) { + return state.context = new Context(state.indented, col, type, null, state.context); + } + function popContext(state) { + var t = state.context.type; + if (t == ")" || t == "]" || t == "}") + state.indented = state.context.indented; + return state.context = state.context.prev; + } + + // Interface + + return { + startState: function(basecolumn) { + return { + tokenize: [tokenBase], + context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), + indented: 0, + startOfLine: true, + lastToken: null + }; + }, + + token: function(stream, state) { + var ctx = state.context; + if (stream.sol()) { + if (ctx.align == null) ctx.align = false; + state.indented = stream.indentation(); + state.startOfLine = true; + // Automatic semicolon insertion + if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) { + popContext(state); ctx = state.context; + } + } + if (stream.eatSpace()) return null; + curPunc = null; + var style = state.tokenize[state.tokenize.length-1](stream, state); + if (style == "comment") return style; + if (ctx.align == null) ctx.align = true; + + if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); + // Handle indentation for {x -> \n ... } + else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { + popContext(state); + state.context.align = false; + } + else if (curPunc == "{") pushContext(state, stream.column(), "}"); + else if (curPunc == "[") pushContext(state, stream.column(), "]"); + else if (curPunc == "(") pushContext(state, stream.column(), ")"); + else if (curPunc == "}") { + while (ctx.type == "statement") ctx = popContext(state); + if (ctx.type == "}") ctx = popContext(state); + while (ctx.type == "statement") ctx = popContext(state); + } + else if (curPunc == ctx.type) popContext(state); + else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) + pushContext(state, stream.column(), "statement"); + state.startOfLine = false; + state.lastToken = curPunc || style; + return style; + }, + + indent: function(state, textAfter) { + if (!state.tokenize[state.tokenize.length-1].isBase) return CodeMirror.Pass; + var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; + if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) ctx = ctx.prev; + var closing = firstChar == ctx.type; + if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); + else if (ctx.align) return ctx.column + (closing ? 0 : 1); + else return ctx.indented + (closing ? 0 : config.indentUnit); + }, + + electricChars: "{}", + closeBrackets: {triples: "'\""}, + fold: "brace" + }; +}); + +CodeMirror.defineMIME("text/x-groovy", "groovy"); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/simplemde/simplemde.min.js */ +/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SimpleMDE=e()}}(function(){var e;return function t(e,n,r){function i(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;n>t;++t)s[t]=e[t],c[e.charCodeAt(t)]=t;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63}function i(e){var t,n,r,i,o,a,l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[l-2]?2:"="===e[l-1]?1:0,a=new u(3*l/4-o),r=o>0?l-4:l;var s=0;for(t=0,n=0;r>t;t+=4,n+=3)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[s++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[s++]=i>>8&255,a[s++]=255&i),a}function o(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,i=[],a=t;n>a;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(o(r));return i.join("")}function l(e){for(var t,n=e.length,r=n%3,i="",o=[],l=16383,c=0,u=n-r;u>c;c+=l)o.push(a(e,c,c+l>u?u:c+l));return 1===r?(t=e[n-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}n.toByteArray=i,n.fromByteArray=l;var s=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?d(e,t,n,r):"string"==typeof t?f(e,t,n):p(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function c(e,t,n,r){return s(t),0>=t?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}function u(e,t){if(s(t),e=o(e,0>t?0:0|m(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function f(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);return e=o(e,r),e.write(t,n),e}function h(e,t){var n=0|m(t.length);e=o(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function d(e,t,n,r){if(t.byteLength,0>n||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=h(e,t),e}function p(e,t){if(a.isBuffer(t)){var n=0|m(t.length);return e=o(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||K(t.length)?o(e,0):h(e,t);if("Buffer"===t.type&&J(t.data))return h(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,t>=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return N(this,t,n);case"ascii":return E(this,t,n);case"binary":return O(this,t,n);case"base64":return M(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,l=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}for(var s=-1,c=0;a>n+c;c++)if(i(e,n+c)===i(t,-1===s?0:c-s)){if(-1===s&&(s=c),c-s+1===l)return(n+s)*o}else-1!==s&&(c-=c-s),s=-1;return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var l=parseInt(t.substr(2*a,2),16);if(isNaN(l))return a;e[n+a]=l}return a}function k(e,t,n,r){return V(q(t,e.length-n),e,n,r)}function S(e,t,n,r){return V(G(t),e,n,r)}function C(e,t,n,r){return S(e,t,n,r)}function L(e,t,n,r){return V($(t),e,n,r)}function T(e,t,n,r){return V(Y(t,e.length-n),e,n,r)}function M(e,t,n){return 0===t&&n===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,n))}function N(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var o=e[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n>=i+l){var s,c,u,f;switch(l){case 1:128>o&&(a=o);break;case 2:s=e[i+1],128===(192&s)&&(f=(31&o)<<6|63&s,f>127&&(a=f));break;case 3:s=e[i+1],c=e[i+2],128===(192&s)&&128===(192&c)&&(f=(15&o)<<12|(63&s)<<6|63&c,f>2047&&(55296>f||f>57343)&&(a=f));break;case 4:s=e[i+1],c=e[i+2],u=e[i+3],128===(192&s)&&128===(192&c)&&128===(192&u)&&(f=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&u,f>65535&&1114112>f&&(a=f))}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=l}return A(r)}function A(e){var t=e.length;if(Q>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Q));return n}function E(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=U(e[o]);return i}function P(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||o>t)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function H(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);o>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function W(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);o>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function _(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,n,r,52,8),n+8}function z(e){if(e=j(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e){return 16>e?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;r>a;a++){if(n=e.charCodeAt(a),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function G(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function Y(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);a++)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function $(e){return X.toByteArray(z(e))}function V(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function K(e){return e!==e}var X=e("base64-js"),Z=e("ieee754"),J=e("isarray");n.Buffer=a,n.SlowBuffer=g,n.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return l(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return c(null,e,t,n)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);o>i;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return r>n?-1:n>r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=a.allocUnsafe(t),i=0;for(n=0;n<e.length;n++){var o=e[n];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)x(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,r,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),0>t||n>e.length||0>r||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,l=n-t,s=Math.min(o,l),c=this.slice(r,i),u=e.slice(t,n),f=0;s>f;++f)if(c[f]!==u[f]){o=c[f],l=u[f];break}return l>o?-1:o>l?1:0},a.prototype.indexOf=function(e,t,n){if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(this,e,t,n);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):b(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return S(this,e,t,n);case"binary":return C(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=a.prototype;else{var i=t-e;r=new a(i,void 0);for(var o=0;i>o;o++)r[o]=this[o+e]}return r},a.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},a.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):W(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=0,a=1,l=0;for(this[t]=255&e;++o<n&&(a*=256);)0>e&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=n-1,a=1,l=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)0>e&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):W(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return _(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return _(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&t>n&&r>t)for(i=o-1;i>=0;i--)e[i+t]=this[i+n];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);256>i&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(t>=n)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;n>o;o++)this[o]=e;else{var l=a.isBuffer(e)?e:q(new a(e,r).toString()),s=l.length;for(o=0;n-t>o;o++)this[o+t]=l[o%s]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:15,isarray:16}],4:[function(e,t,n){"use strict";function r(e){return e=e||{},"function"!=typeof e.codeMirrorInstance||"function"!=typeof e.codeMirrorInstance.defineMode?void console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`"):(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),void e.codeMirrorInstance.defineMode("spell-checker",function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var a='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',l={token:function(e){var t=e.peek(),n="";if(a.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!a.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},s=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(s,l,!0)}))}var i=e("typo-js");r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,t.exports=r},{"typo-js":18}],5:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})})},{"../../lib/codemirror":10}],6:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})})},{"../../lib/codemirror":10}],7:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,f=0!==c.quote,h=i.getLine(s.line),d=t.exec(h);if(!o[l].empty()||!u&&!f||!d)return void i.execCommand("newlineAndIndent");if(n.test(h))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1}),a[l]="\n";else{var p=d[1],m=d[5],g=r.test(d[2])||d[2].indexOf(">")>=0?d[2]:parseInt(d[3],10)+1+d[4];a[l]="\n"+p+g+m}}i.replaceSelections(a)}})},{"../../lib/codemirror":10}],8:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}})},{"../../lib/codemirror":10}],9:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){e.operation(function(){a(e)})}function n(e){e.state.markedSelection.length&&e.operation(function(){i(e)})}function r(e,t,n,r){if(0!=c(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=t.line;;){var u=a==t.line?t:s(a,0),f=a+l,h=f>=n.line,d=h?n:s(f,0),p=e.markText(u,d,{className:o});if(null==r?i.push(p):i.splice(r++,0,p),h)break;a=f}}function i(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function o(e){i(e);for(var t=e.listSelections(),n=0;n<t.length;n++)r(e,t[n].from(),t[n].to())}function a(e){if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),a=e.state.markedSelection;if(!a.length)return r(e,t,n);var s=a[0].find(),u=a[a.length-1].find();if(!s||!u||n.line-t.line<l||c(t,u.to)>=0||c(n,s.from)<=0)return o(e);for(;c(t,s.from)>0;)a.shift().clear(),s=a[0].find();for(c(t,s.from)<0&&(s.to.line-t.line<l?(a.shift().clear(),r(e,t,s.to,0)):r(e,t,s.from,0));c(n,u.to)<0;)a.pop().clear(),u=a[a.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<l?(a.pop().clear(),r(e,u.from,n)):r(e,u.to,n))}e.defineOption("styleSelectedText",!1,function(r,a,l){var s=l&&l!=e.Init;a&&!s?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof a?a:"CodeMirror-selectedtext",o(r),r.on("cursorActivity",t),r.on("change",n)):!a&&s&&(r.off("cursorActivity",t),r.off("change",n),i(r),r.state.markedSelection=r.state.markedSelectionStyle=null)});var l=8,s=e.Pos,c=e.cmpPos})},{"../../lib/codemirror":10}],10:[function(t,n,r){!function(t){if("object"==typeof r&&"object"==typeof n)n.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);(this||window).CodeMirror=t()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Wi(r):{},Wi(ea,r,!1),d(r);var i=r.value;"string"==typeof i&&(i=new Ca(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!Ao&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ei,keySeq:null,specialChars:null};var s=this;xo&&11>bo&&setTimeout(function(){s.display.input.reset(!0)},20),jt(this),Ki(),bt(this),this.curOp.forceUpdate=!0,Xr(this,i),r.autofocus&&!Ao||s.hasFocus()?setTimeout(Bi(vn,this),20):yn(this);for(var u in ta)ta.hasOwnProperty(u)&&ta[u](this,r[u],na);k(this),r.finishInit&&r.finishInit(this);for(var f=0;f<aa.length;++f)aa[f](this);kt(this),wo&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=ji("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=ji("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ji("div",null,"CodeMirror-code"),r.selectionDiv=ji("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=ji("div",null,"CodeMirror-cursors"),r.measure=ji("div",null,"CodeMirror-measure"),r.lineMeasure=ji("div",null,"CodeMirror-measure"),r.lineSpace=ji("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=ji("div",[ji("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=ji("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=ji("div",null,null,"position: absolute; height: "+Da+"px; width: 1px;"),r.gutters=ji("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=ji("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=ji("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),xo&&8>bo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),wo||go&&Ao||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null, +r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,_e(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function i(e){e.options.lineWrapping?(Ja(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Za(e.display.wrapper,"CodeMirror-wrap"),h(e)),a(e),Dt(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(kr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&ei(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lt(e)}function s(e){c(e),Dt(e),setTimeout(function(){w(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Ui(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(ji("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=mr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=gr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function h(e){var t=e.display,n=e.doc;t.maxLine=Zr(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function d(e){var t=Pi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qe(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ye(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=ji("div",[ji("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=ji("div",[ji("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Ea(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ea(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&8>bo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Za(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ea(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Ja(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var n=e.display.barWidth,r=e.display.barHeight;x(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&O(e),x(e,p(e)),n=e.display.barWidth,r=e.display.barHeight}function x(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function b(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Ue(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ni(t,r),a=ni(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ni(t,ri(Zr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ni(t,ri(Zr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function w(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=S(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(ji("div",[ji("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function S(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function L(e,t,n){var r=e.display;this.viewport=t,this.visible=b(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$e(e),this.force=n,this.dims=P(e),this.events=[]}function T(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ye(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ye(e)+"px",t.scrollbarsClipped=!0)}function M(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Wt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zt(e))return!1;k(e)&&(Wt(e),t.dims=P(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Wo&&(o=br(e.doc,o),a=wr(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=ri(Zr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=zt(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Gi();return s>4&&(n.lineDiv.style.display="none"),R(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Gi()!=c&&c.offsetHeight&&c.focus(),Ui(n.cursorDiv),Ui(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,_e(e,400)),n.updateLineNumbers=null,!0}function N(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=$e(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qe(e.display)-Ve(e),n.top)}),t.visible=b(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);r=!1){O(e);var i=p(e);Re(e),y(e,i),E(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new L(e,t);if(M(e,n)){O(e),N(e,n);var r=p(e);Re(e),y(e,r),E(e,r),n.finish()}}function E(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ye(e)+"px"}function O(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(xo&&8>bo){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(ei(o.line,i),I(o.line),o.rest))for(var c=0;c<o.rest.length;c++)I(o.rest[c])}}}function I(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function P(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function R(e,t,n){function r(t){var n=t.nextSibling;return wo&&Eo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var f=s[u];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=r(l);var h=o&&null!=t&&c>=t&&f.lineNumber;f.changes&&(Pi(f.changes,"gutter")>-1&&(h=!1),D(e,f,c,n)),h&&(Ui(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,c)))),l=f.node.nextSibling}else{var d=U(e,f,c,n);a.insertBefore(d,l)}c+=f.size}for(;l;)l=r(l)}function D(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?_(e,t):"gutter"==o?z(e,t,n,r):"class"==o?F(t):"widget"==o&&j(e,t,r)}t.changes=null}function H(e){return e.node==e.text&&(e.node=ji("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),xo&&8>bo&&(e.node.style.zIndex=2)),e.node}function W(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=H(e);e.background=n.insertBefore(ji("div",null,t),n.firstChild)}}function B(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Br(e,t)}function _(e,t){var n=t.text.className,r=B(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,F(t)):n&&(t.text.className=n)}function F(e){W(e),e.line.wrapClass?H(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function z(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=H(t);t.gutterBackground=ji("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=H(t),a=t.gutter=ji("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(ji("div",S(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=o.hasOwnProperty(s)&&o[s];c&&a.appendChild(ji("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function j(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}q(e,t,n)}function U(e,t,n,r){var i=B(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),F(t),z(e,t,n,r),q(e,t,r),t.node}function q(e,t,n){if(G(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)G(e,t.rest[r],t,n,!1)}function G(e,t,n,r,i){if(t.widgets)for(var o=H(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=ji("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Y(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),Ci(s,"redraw")}}function Y(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function $(e){return Bo(e.line,e.ch)}function V(e,t){return _o(e,t)<0?t:e}function K(e,t){return _o(e,t)<0?e:t}function X(e){e.state.focused||(e.display.input.focus(),vn(e))}function Z(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=o.splitLines(t),s=null;if(a&&r.ranges.length>1)if(Fo&&Fo.text.join("\n")==t){if(r.ranges.length%Fo.text.length==0){s=[];for(var c=0;c<Fo.text.length;c++)s.push(o.splitLines(Fo.text[c]))}}else l.length==r.ranges.length&&(s=Ri(l,function(e){return[e]}));for(var c=r.ranges.length-1;c>=0;c--){var u=r.ranges[c],f=u.from(),h=u.to();u.empty()&&(n&&n>0?f=Bo(f.line,f.ch-n):e.state.overwrite&&!a?h=Bo(h.line,Math.min(Zr(o,h.line).text.length,h.ch+Ii(l).length)):Fo&&Fo.lineWise&&Fo.text.join("\n")==t&&(f=h=Bo(f.line,0)));var d=e.curOp.updateInput,p={from:f,to:h,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,p),Ci(e,"inputRead",e,p)}t&&!a&&Q(e,t),Bn(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||At(t,function(){Z(t,n,0,null,"paste")}),!0):void 0}function Q(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Ci(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:Bo(i,0),head:Bo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ne(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ei,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function re(){var e=ji("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=ji("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return wo?e.style.width="1000px":e.setAttribute("wrap","off"),No&&(e.style.border="1px solid black"),te(e),t}function ie(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ei,this.gracePeriod=!1}function oe(e,t){var n=Qe(e,t.line);if(!n||n.hidden)return null;var r=Zr(e.doc,t.line),i=Xe(n,r,t.line),o=ii(r),a="left";if(o){var l=co(o,t.ch);a=l%2?"right":"left"}var s=nt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ae(e,t){return t&&(e.bad=!0),e}function le(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ae(e.clipPos(Bo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return se(o,t,n)}}function se(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=ti(0>i?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),Bo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Va(i,t))return ae(Bo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?Ii(e.rest):e.line;return ae(Bo(ti(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return ae(f,o);for(var h=s.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=r(h,h.firstChild,0))return ae(Bo(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=s.previousSibling,d=n;p;p=p.previousSibling){if(f=r(p,p.firstChild,-1))return ae(Bo(f.line,f.ch+d),o);d+=h.textContent.length}}function ce(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var u,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(Bo(r,0),Bo(i+1,0),o(+f));return void(h.length&&(u=h[0].find())&&(l+=Jr(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)a(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+=c,s=!1),l+=p}}for(var l="",s=!1,c=e.doc.lineSeparator();a(t),t!=n;)t=t.nextSibling;return l}function ue(e,t){this.ranges=e,this.primIndex=t}function fe(e,t){this.anchor=e,this.head=t}function he(e,t){var n=e[t];e.sort(function(e,t){return _o(e.from(),t.from())}),t=Pi(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(_o(o.to(),i.from())>=0){var a=K(o.from(),i.from()),l=V(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(s?l:a,s?a:l))}}return new ue(e,t)}function de(e,t){return new ue([new fe(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.line<e.first)return Bo(e.first,0);var n=e.first+e.size-1;return t.line>n?Bo(n,Zr(e,n).text.length):ge(t,Zr(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Bo(e.line,t):0>n?Bo(e.line,0):e}function ve(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=me(e,t[r]);return n}function xe(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=_o(n,i)<0;o!=_o(r,i)<0?(i=n,n=r):o!=_o(n,r)<0&&(n=r)}return new fe(i,n)}return new fe(r||n,n)}function be(e,t,n,r){Te(e,new ue([xe(e,e.sel.primary(),t,n)],0),r)}function we(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=xe(e,e.sel.ranges[i],t[i],null);var o=he(r,e.sel.primIndex);Te(e,o,n)}function ke(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Te(e,he(i,e.sel.primIndex),r)}function Se(e,t,n,r){Te(e,de(t,n),r)}function Ce(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new fe(me(e,t[n].anchor),me(e,t[n].head))},origin:n&&n.origin};return Pa(e,"beforeSelectionChange",e,r),e.cm&&Pa(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?he(r.ranges,r.ranges.length-1):t}function Le(e,t,n){var r=e.history.done,i=Ii(r);i&&i.ranges?(r[r.length-1]=t,Me(e,t,n)):Te(e,t,n)}function Te(e,t,n){Me(e,t,n),fi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Me(e,t,n){(Ni(e,"beforeSelectionChange")||e.cm&&Ni(e.cm,"beforeSelectionChange"))&&(t=Ce(e,t,n));var r=n&&n.bias||(_o(t.primary().head,e.sel.primary().head)<0?-1:1);Ne(e,Ee(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Bn(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Mi(e.cm)),Ci(e,"cursorActivity",e))}function Ae(e){Ne(e,Ee(e,e.sel,null,!1),Wa)}function Ee(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ie(e,a.anchor,l&&l.anchor,n,r),c=Ie(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new fe(s,c))}return i?he(i,t.primIndex):t}function Oe(e,t,n,r,i){var o=Zr(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Pa(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var c,u=s.find(0>r?1:-1);if((0>r?s.inclusiveRight:s.inclusiveLeft)&&(u=Pe(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=_o(u,n))&&(0>r?0>c:c>0))return Oe(e,u,t,r,i)}var f=s.find(0>r?-1:1);return(0>r?s.inclusiveLeft:s.inclusiveRight)&&(f=Pe(e,f,r,f.line==t.line?o:null)),f?Oe(e,f,t,r,i):null}}return t}function Ie(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,Bo(e.first,0))}function Pe(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,Bo(t.line-1)):null:n>0&&t.ch==(r||Zr(e,t.line)).text.length?t.line<e.first+e.size-1?Bo(t.line+1,0):null:new Bo(t.line,t.ch+n)}function Re(e){e.display.input.showSelection(e.display.input.prepareSelection())}function De(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&He(e,l.head,i),s||We(e,l,o)}}return r}function He(e,t,n){var r=dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(ji("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(ji("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function We(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(ji("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return ht(e,Bo(t,n),"div",f,r)}var l,s,f=Zr(a,t),h=f.text.length;return eo(ii(f),n||0,null==i?h:i,function(e,t,a){var f,d,p,m=o(e,"left");if(e==t)f=m,d=p=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}d=m.left,p=f.right}null==n&&0==e&&(d=c),f.top-m.top>3&&(r(d,m.top,null,m.bottom),d=c,m.bottom<f.top&&r(d,m.bottom,null,f.top)),null==i&&t==h&&(p=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||f.bottom>s.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>d&&(d=c),r(d,f.top,p-d,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ge(e.display),c=s.left,u=Math.max(o.sizerWidth,$e(e)-o.sizer.offsetLeft)-s.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Zr(a,f.line),p=Zr(a,h.line),m=yr(d)==yr(p),g=i(f.line,f.ch,m?d.text.length+1:null).end,v=i(h.line,m?0:null,h.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function Be(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function _e(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Bi(Fe,e))}function Fe(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=sa(t.mode,je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Rr(e,o,l?sa(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(t.frontier),o.stateAfter=l?r:sa(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&Hr(e,o.text,r),o.stateAfter=t.frontier%5==0?sa(t.mode,r):null;return++t.frontier,+new Date>n?(_e(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;t<i.length;t++)Ht(e,i[t],"text")})}}function ze(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Zr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Fa(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function je(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=ze(e,t,n),a=o>r.first&&Zr(r,o-1).stateAfter;return a=a?sa(r.mode,a):ca(r.mode),r.iter(o,t,function(n){Hr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?sa(r.mode,a):null,++o}),n&&(r.frontier=o),a}function Ue(e){return e.lineSpace.offsetTop}function qe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ge(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=qi(e.measure,ji("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ye(e){return Da-e.display.nativeBarWidth}function $e(e){return e.display.scroller.clientWidth-Ye(e)-e.display.barWidth}function Ve(e){return e.display.scroller.clientHeight-Ye(e)-e.display.barHeight}function Ke(e,t,n){var r=e.options.lineWrapping,i=r&&$e(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Xe(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(ti(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ze(e,t){t=yr(t);var n=ti(t),r=e.display.externalMeasured=new Pt(e.doc,t,n);r.lineN=n;var i=r.built=Br(e,r);return r.text=i.pre,qi(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return tt(e,et(e,t),n,r)}function Qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Bt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function et(e,t){var n=ti(t),r=Qe(e,n);r&&!r.text?r=null:r&&r.changes&&(D(e,r,n,P(e)),e.curOp.forceUpdate=!0),r||(r=Ze(e,t));var i=Xe(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ke(e,t.view,t.rect),t.hasHeights=!0),o=rt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function nt(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function rt(e,t,n,r){var i,o=nt(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&zi(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&zi(t.line.text.charAt(o.coverStart+s));)++s;if(xo&&9>bo&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(xo&&e.options.lineWrapping){var f=qa(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:qo}else i=qa(a,l,s).getBoundingClientRect()||qo;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}xo&&11>bo&&(i=it(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(xo&&9>bo&&!l&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}:qo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(d+p)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=d,x.rbottom=p),x}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Qi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function at(e){e.display.externalMeasure=null,Ui(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function lt(e){at(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ct(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Lr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ri(t);if("local"==r?a+=Ue(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:ct());var s=l.left+("window"==r?0:st());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ft(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=st(), +i-=ct();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ht(e,t,n,r,i){return r||(r=Zr(e.doc,t.line)),ut(e,r,Je(e,r,t.ch,i),n)}function dt(e,t,n,r,i,o){function a(t,a){var l=tt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,ut(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==to(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=no(n)-(n.level%2?0:1),r=!0):e==no(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=to(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Zr(e.doc,t.line),i||(i=et(e,r));var s=ii(r),c=t.ch;if(!s)return a(c);var u=co(s,c),f=l(c,u);return null!=al&&(f.other=l(c,al)),f}function pt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Zr(e.doc,t.line),i=ri(r)+Ue(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=Bo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ni(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Zr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Zr(r,i);;){var l=vt(e,a,i,t,n),s=gr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=ti(a=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=dt(e,Bo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-ri(t),l=!1,s=2*e.display.wrapper.clientWidth,c=et(e,t),u=ii(t),f=t.text.length,h=ro(t),d=io(t),p=o(h),m=l,g=o(d),v=l;if(r>g)return mt(n,d,v,1);for(;;){if(u?d==h||d==fo(t,h,1):1>=d-h){for(var y=p>r||g-r>=r-p?h:d,x=r-(y==h?p:g);zi(t.text.charAt(y));)++y;var b=mt(n,y,y==h?m:v,-1>x?-1:x>1?1:0);return b}var w=Math.ceil(f/2),k=h+w;if(u){k=h;for(var S=0;w>S;++S)k=fo(t,k,1)}var C=o(k);C>r?(d=k,g=C,(v=l)&&(g+=1e3),f=w):(h=k,p=C,m=l,f-=w)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==zo){zo=ji("pre");for(var t=0;49>t;++t)zo.appendChild(document.createTextNode("x")),zo.appendChild(ji("br"));zo.appendChild(document.createTextNode("x"))}qi(e.measure,zo);var n=zo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ui(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ji("span","xxxxxxxxxx"),n=ji("pre",[t]);qi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yo},Go?Go.ops.push(e.curOp):e.curOp.ownsGroup=Go={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function kt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{wt(n)}finally{Go=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;St(n)}}function St(e){for(var t=e.ops,n=0;n<t.length;n++)Ct(t[n]);for(var n=0;n<t.length;n++)Lt(t[n]);for(var n=0;n<t.length;n++)Tt(t[n]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var n=0;n<t.length;n++)Nt(t[n])}function Ct(e){var t=e.cm,n=t.display;T(t),e.updateMaxLine&&h(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new L(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ye(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&on(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Gi()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.updatedDisplay&&E(t,e.barMeasure),e.selectionChanged&&Be(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&X(e.cm)}function Nt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&N(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,w(t)),e.scrollToPos){var i=Rn(t,me(r,e.scrollToPos.from),me(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Pn(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Pa(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&Pa(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pa(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();bt(e);try{return t()}finally{kt(e)}}function Et(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bt(e);try{return t.apply(e,arguments)}finally{kt(e)}}}function Ot(e){return function(){if(this.curOp)return e.apply(this,arguments);bt(this);try{return e.apply(this,arguments)}finally{kt(this)}}}function It(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bt(t);try{return e.apply(this,arguments)}finally{kt(t)}}}function Pt(e,t,n){this.line=t,this.rest=xr(t),this.size=this.rest?ti(Ii(this.rest))-n+1:1,this.node=this.text=null,this.hidden=kr(e,t)}function Rt(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new Pt(e.doc,Zr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function Dt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Wo&&br(e.doc,t)<i.viewTo&&Wt(e);else if(n<=i.viewFrom)Wo&&wr(e.doc,n+r)>i.viewFrom?Wt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Wt(e);else if(t<=i.viewFrom){var o=_t(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Wt(e)}else if(n>=i.viewTo){var o=_t(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Wt(e)}else{var a=_t(e,t,t,-1),l=_t(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Rt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Wt(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Ht(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Bt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Pi(a,n)&&a.push(n)}}}function Wt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function _t(e,t,n,r){var i,o=Bt(e,t),a=e.display.view;if(!Wo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;br(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Rt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Bt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Rt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Bt(e,n)))),r.viewTo=n}function zt(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function jt(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;Ea(i.scroller,"mousedown",Et(e,$t)),xo&&11>bo?Ea(i.scroller,"dblclick",Et(e,function(t){if(!Ti(e,t)){var n=Yt(e,t);if(n&&!Jt(e,t)&&!Gt(e.display,t)){Ma(t);var r=e.findWordAt(n);be(e.doc,r.anchor,r.head)}}})):Ea(i.scroller,"dblclick",function(t){Ti(e,t)||Ma(t)}),Do||Ea(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};Ea(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ea(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ea(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Gt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new fe(Bo(l.line,0),me(e.doc,Bo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ma(n)}t()}),Ea(i.scroller,"touchcancel",t),Ea(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rn(e,i.scroller.scrollTop),on(e,i.scroller.scrollLeft,!0),Pa(e,"scroll",e))}),Ea(i.scroller,"mousewheel",function(t){an(e,t)}),Ea(i.scroller,"DOMMouseScroll",function(t){an(e,t)}),Ea(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Aa(t)},over:function(t){Ti(e,t)||(tn(e,t),Aa(t))},start:function(t){en(e,t)},drop:Et(e,Qt),leave:function(t){Ti(e,t)||nn(e)}};var l=i.input.getField();Ea(l,"keyup",function(t){pn.call(e,t)}),Ea(l,"keydown",Et(e,hn)),Ea(l,"keypress",Et(e,mn)),Ea(l,"focus",Bi(vn,e)),Ea(l,"blur",Bi(yn,e))}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Ea:Ia;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function qt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gt(e,t){for(var n=wi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yt(e,t,n,r){var i=e.display;if(!n&&"true"==wi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=gt(e,o,a);if(r&&1==c.xRel&&(s=Zr(e.doc,c.line).text).length==c.ch){var u=Fa(s,s.length,e.options.tabSize)-s.length;c=Bo(c.line,Math.max(0,Math.round((o-Ge(e.display).left)/xt(e.display))-u))}return c}function $t(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Gt(n,e))return void(wo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(t,e)){var r=Yt(t,e);switch(window.focus(),ki(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Vt(t,e,r):wi(e)==n.scroller&&Ma(e);break;case 2:wo&&(t.state.lastMiddleDown=+new Date),r&&be(t.doc,r),setTimeout(function(){n.input.focus()},20),Ma(e);break;case 3:Do?xn(t,e):gn(t)}}}}function Vt(e,t,n){xo?setTimeout(Bi(X,e),0):e.curOp.focus=Gi();var r,i=+new Date;Uo&&Uo.time>i-400&&0==_o(Uo.pos,n)?r="triple":jo&&jo.time>i-400&&0==_o(jo.pos,n)?(r="double",Uo={time:i,pos:n}):(r="single",jo={time:i,pos:n});var o,a=e.doc.sel,l=Eo?t.metaKey:t.ctrlKey;e.options.dragDrop&&el&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(_o((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(_o(o.to(),n)>0||n.xRel<0)?Kt(e,t,n,l):Xt(e,t,n,r,l)}function Kt(e,t,n,r){var i=e.display,o=+new Date,a=Et(e,function(l){wo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ia(document,"mouseup",a),Ia(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Ma(l),!r&&+new Date-200<o&&be(e.doc,n),wo||xo&&9==bo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});wo&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),Ea(document,"mouseup",a),Ea(i.scroller,"drop",a)}function Xt(e,t,n,r,i){function o(t){if(0!=_o(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Fa(Zr(c,n.line).text,n.ch,o),l=Fa(Zr(c,t.line).text,t.ch,o),s=Math.min(a,l),d=Math.max(a,l),p=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=p;p++){var v=Zr(c,p).text,y=za(v,s,o);s==d?i.push(new fe(Bo(p,y),Bo(p,y))):v.length>y&&i.push(new fe(Bo(p,y),Bo(p,za(v,d,o))))}i.length||i.push(new fe(n,n)),Te(c,he(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=u,b=x.anchor,w=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new fe(Bo(t.line,0),me(c,Bo(t.line+1,0)));_o(k.anchor,b)>0?(w=k.head,b=K(x.from(),k.anchor)):(w=k.anchor,b=V(x.to(),k.head))}var i=h.ranges.slice(0);i[f]=new fe(me(c,b),w),Te(c,he(i,f),Ba)}}function a(t){var n=++y,i=Yt(e,t,!0,"rect"==r);if(i)if(0!=_o(i,g)){e.curOp.focus=Gi(),o(i);var l=b(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(Et(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Et(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(t){e.state.selectingText=!1,y=1/0,Ma(t),s.input.focus(),Ia(document,"mousemove",x),Ia(document,"mouseup",w),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;Ma(t);var u,f,h=c.sel,d=h.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?d[f]:new fe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),Oo?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new fe(n,n)),n=Yt(e,t,!0,!0),f=-1;else if("double"==r){var p=e.findWordAt(n);u=e.display.shift||c.extend?xe(c,u,p.anchor,p.head):p}else if("triple"==r){var m=new fe(Bo(n.line,0),me(c,Bo(n.line+1,0)));u=e.display.shift||c.extend?xe(c,u,m.anchor,m.head):m}else u=xe(c,u,n);i?-1==f?(f=d.length,Te(c,he(d.concat([u]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(d.slice(0,f).concat(d.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),h=c.sel):ke(c,f,u,Ba):(f=0,Te(c,new ue([u],0),Ba),h=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,x=Et(e,function(e){ki(e)?a(e):l(e)}),w=Et(e,l);e.state.selectingText=w,Ea(document,"mousemove",x),Ea(document,"mouseup",w)}function Zt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ma(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ni(e,n))return bi(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=ni(e.doc,o),f=e.options.gutters[s];return Pa(e,n,e,u,f,t),bi(t)}}}function Jt(e,t){return Zt(e,t,"gutterClick",!0)}function Qt(e){var t=this;if(nn(t),!Ti(t,e)&&!Gt(t.display,e)){Ma(e),xo&&($o=+new Date);var n=Yt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=Pi(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Et(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=me(t.doc,n);var s={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,s),Le(t.doc,de(n,Qo(s)))}}),l.readAsText(e)}},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Eo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Me(t.doc,de(n,n)),c)for(var s=0;s<c.length;++s)In(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function en(e,t){if(xo&&(!e.state.draggingText||+new Date-$o<100))return void Aa(t);if(!Ti(e,t)&&!Gt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Lo)){var n=ji("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Co&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),Co&&n.parentNode.removeChild(n)}}function tn(e,t){var n=Yt(e,t);if(n){var r=document.createDocumentFragment();He(e,n,r),e.display.dragCursor||(e.display.dragCursor=ji("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),qi(e.display.dragCursor,r)}}function nn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function rn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,go||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),go&&A(e),_e(e,100))}function on(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,w(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function an(e,t){var n=Xo(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&l||i&&s){if(i&&Eo&&wo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f<u.length;f++)if(u[f].node==c){e.display.currentWheelTarget=c;break e}if(r&&!go&&!Co&&null!=Ko)return i&&s&&rn(e,Math.max(0,Math.min(a.scrollTop+i*Ko,a.scrollHeight-a.clientHeight))),on(e,Math.max(0,Math.min(a.scrollLeft+r*Ko,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&Ma(t),void(o.wheelStartX=null);if(i&&null!=Ko){var h=i*Ko,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;0>h?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),A(e,{top:d,bottom:p})}20>Vo&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ko=(Ko*Vo+n)/(Vo+1),++Vo)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function ln(e,t,n){if("string"==typeof t&&(t=ua[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ha}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function sn(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=ha(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&ha(t,e.options.extraKeys,n,e)||ha(t,e.options.keyMap,n,e)}function cn(e,t,n,r){var i=e.state.keySeq;if(i){if(da(t))return"handled";Zo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=sn(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ci(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(Ma(n),Be(e)),i&&!o&&/\'$/.test(t)?(Ma(n),!0):!!o}function un(e,t){var n=pa(t,!0);return n?t.shiftKey&&!e.state.keySeq?cn(e,"Shift-"+n,t,function(t){return ln(e,t,!0)})||cn(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?ln(e,t):void 0}):cn(e,n,t,function(t){return ln(e,t)}):!1}function fn(e,t,n){return cn(e,"'"+n+"'",t,function(t){return ln(e,t,!0)})}function hn(e){var t=this;if(t.curOp.focus=Gi(),!Ti(t,e)){xo&&11>bo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=un(t,e);Co&&(Jo=r?n:null,!r&&88==n&&!rl&&(Eo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||dn(t)}}function dn(e){function t(e){18!=e.keyCode&&e.altKey||(Za(n,"CodeMirror-crosshair"),Ia(document,"keyup",t),Ia(document,"mouseover",t))}var n=e.display.lineDiv;Ja(n,"CodeMirror-crosshair"),Ea(document,"keyup",t),Ea(document,"mouseover",t)}function pn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ti(this,e)}function mn(e){var t=this;if(!(Gt(t.display,e)||Ti(t,e)||e.ctrlKey&&!e.altKey||Eo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Co&&n==Jo)return Jo=null,void Ma(e);if(!Co||e.which&&!(e.which<10)||!un(t,e)){var i=String.fromCharCode(null==r?n:r);fn(t,e,i)||t.display.input.onKeyPress(e)}}}function gn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function vn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Pa(e,"focus",e),e.state.focused=!0,Ja(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Be(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(Pa(e,"blur",e),e.state.focused=!1,Za(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xn(e,t){Gt(e.display,t)||bn(e,t)||Ti(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function bn(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wn(e,t){if(_o(e,t.from)<0)return e;if(_o(e,t.to)<=0)return Qo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Qo(t).ch-t.to.ch),Bo(n,r)}function kn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new fe(wn(i.anchor,t),wn(i.head,t)))}return he(n,e.sel.primIndex)}function Sn(e,t,n){return e.line==t.line?Bo(n.line,e.ch-t.ch+n.ch):Bo(n.line+(e.line-t.line),e.ch)}function Cn(e,t,n){for(var r=[],i=Bo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Sn(l.from,i,o),c=Sn(Qo(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=_o(u.head,u.anchor)<0;r[a]=new fe(f?c:s,f?s:c)}else r[a]=new fe(s,s)}return new ue(r,e.sel.primIndex)}function Ln(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=me(e,t)),n&&(this.to=me(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),Pa(e,"beforeChange",e,r),e.cm&&Pa(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Tn(e,t,n){if(e.cm){if(!e.cm.curOp)return Et(e.cm,Tn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"))||(t=Ln(e,t,!0))){var r=Ho&&!n&&sr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Mn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Mn(e,t)}}function Mn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=_o(t.from,t.to)){var n=kn(e,t);ci(e,t,n,e.cm?e.cm.curOp.id:NaN),En(e,t,n,or(e,t));var r=[];Kr(e,function(e,n){n||-1!=Pi(r,e.history)||(xi(e.history,t),r.push(e.history)),En(e,t,null,or(e,t))})}}function Nn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(hi(r,l),n&&!r.equals(e.sel))return void Te(e,r,{clearRedo:!1});o=r}var c=[];hi(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var f=r.changes[s];if(f.origin=t,u&&!Ln(e,f,!1))return void(a.length=0);c.push(ai(e,f));var h=s?kn(e,f):Ii(a);En(e,f,h,lr(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Qo(f)});var d=[];Kr(e,function(e,t){t||-1!=Pi(d,e.history)||(xi(e.history,f),d.push(e.history)),En(e,f,null,lr(e,f))})}}}}function An(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(Ri(e.sel.ranges,function(e){return new fe(Bo(e.anchor.line+t,e.anchor.ch),Bo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Ht(e.cm,r,"gutter")}}function En(e,t,n,r){if(e.cm&&!e.cm.curOp)return Et(e.cm,En)(e,t,n,r);if(t.to.line<e.first)return void An(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);An(e,i),t={from:Bo(e.first,0),to:Bo(t.to.line+i,t.to.ch),text:[Ii(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Bo(o,Zr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(e,t.from,t.to),n||(n=kn(e,t)),e.cm?On(e.cm,t,r):Yr(e,t,r),Me(e,n,Wa)}}function On(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=ti(yr(Zr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Mi(e),Yr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),_e(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?Dt(e):a.line!=l.line||1!=t.text.length||Gr(e.doc,t)?Dt(e,a.line,l.line+1,u):Ht(e,a.line,"text");var h=Ni(e,"changes"),d=Ni(e,"change");if(d||h){var p={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};d&&Ci(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function In(e,t,n,r,i){if(r||(r=n),_o(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function Pn(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=ji("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ue(e.display))+"px; height: "+(t.bottom-t.top+Ye(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Rn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=dt(e,t),l=n&&n!=t?dt(e,n):a,s=Hn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(rn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(on(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function Dn(e,t,n,r,i){var o=Hn(e,t,n,r,i);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function Hn(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ve(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+qe(o),f=a>n,h=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var d=Math.min(n,(h?u:i)-s);d!=l&&(c.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=$e(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:p>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+p-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Wn(e,t,n){null==t&&null==n||_n(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Bn(e){_n(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Bo(t.line,t.ch-1):t,r=Bo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function _n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pt(e,t.from),r=pt(e,t.to),i=Hn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=je(e,t):n="prev");var a=e.options.tabSize,l=Zr(o,t),s=Fa(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ha||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Fa(Zr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)h+=a,f+=" ";if(c>h&&(f+=Oi(c-h)),f!=u)return In(o,f,Bo(t,0),Bo(t,u.length),"+input"),l.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==t&&p.head.ch<u.length){var h=Bo(t,u.length);ke(o,d,new fe(h,h));break}}}function zn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Zr(e,pe(e,t)):i=ti(t),null==i?null:(r(o,i)&&e.cm&&Ht(e.cm,i,n),o)}function jn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&_o(o.from,Ii(r).to)<=0;){var a=r.pop();if(_o(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}At(e,function(){for(var t=r.length-1;t>=0;t--)In(e.doc,"",r[t].from,r[t].to,"+delete");Bn(e)})}function Un(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?!1:(l=t,u=Zr(e,t))}function a(e){var t=(i?fo:ho)(u,s,n,!0);if(null==t){if(e||!o())return!1;s=i?(0>n?io:ro)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Zr(e,l);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>n)||a(!p);p=!1){var m=u.text.charAt(s)||"\n",g=_i(m,d)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),f&&f!=g){0>n&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!p))break}var v=Ie(e,Bo(l,s),t,c,!0);return _o(t,v)||(v.hitSide=!0),v}function qn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Gn(t,n,r,i){e.defaults[t]=n,r&&(ta[t]=i?function(e,t,n){n!=na&&r(e,t,n)}:r)}function Yn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{ +if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $n(e){return"string"==typeof e?fa[e]:e}function Vn(e,t,n,r,i){if(r&&r.shared)return Kn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Et(e.cm,Vn)(e,t,n,r,i);var o=new va(e,i),a=_o(t,n);if(r&&Wi(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ji("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vr(e,t.line,t,n,o)||t.line!=n.line&&vr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wo=!0}o.addToHistory&&ci(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&yr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ei(e,0),nr(e,new Qn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){kr(e,t)&&ei(t,0)}),o.clearOnEnter&&Ea(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Ho=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Dt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Ht(c,u,"text");o.atomic&&Ae(c.doc),Ci(c,"markerAdded",c,o)}return o}function Kn(e,t,n,r,i){r=Wi(r),r.shared=!1;var o=[Vn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Kr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Vn(e,me(e,t),me(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Ii(o)}),new ya(o,a)}function Xn(e){return e.findMarks(Bo(e.first,0),e.clipPos(Bo(e.lastLine())),function(e){return e.parent})}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(_o(o,a)){var l=Vn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Jn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Kr(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Pi(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Qn(e,t,n){this.marker=e,this.from=t,this.to=n}function er(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function tr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function nr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function rr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Qn(a,o.from,s?null:o.to))}}return r}function ir(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Qn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function or(e,t){if(t.full)return null;var n=ve(e,t.from.line)&&Zr(e,t.from.line).markedSpans,r=ve(e,t.to.line)&&Zr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==_o(t.from,t.to),l=rr(n,i,a),s=ir(r,o,a),c=1==t.text.length,u=Ii(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var h=l[f];if(null==h.to){var d=er(s,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null!=h.to&&(h.to+=u),null==h.from){var d=er(l,h.marker);d||(h.from=u,c&&(l||(l=[])).push(h))}else h.from+=u,c&&(l||(l=[])).push(h)}l&&(l=ar(l)),s&&s!=l&&(s=ar(s));var p=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var f=0;f<l.length;++f)null==l[f].to&&(m||(m=[])).push(new Qn(l[f].marker,null,null));for(var f=0;g>f;++f)p.push(m);p.push(s)}return p}function ar(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function lr(e,t){var n=mi(e,t),r=or(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function sr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Pi(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(_o(c.to,l.from)<0||_o(c.from,l.to)>0)){var u=[s,1],f=_o(c.from,l.from),h=_o(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function cr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ur(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function fr(e){return e.inclusiveLeft?-1:0}function hr(e){return e.inclusiveRight?1:0}function dr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=_o(r.from,i.from)||fr(e)-fr(t);if(o)return-o;var a=_o(r.to,i.to)||hr(e)-hr(t);return a?a:t.id-e.id}function pr(e,t){var n,r=Wo&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||dr(n,i.marker)<0)&&(n=i.marker);return n}function mr(e){return pr(e,!0)}function gr(e){return pr(e,!1)}function vr(e,t,n,r,i){var o=Zr(e,t),a=Wo&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=_o(c.from,n)||fr(s.marker)-fr(i),f=_o(c.to,r)||hr(s.marker)-hr(i);if(!(u>=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.to,n)>=0:_o(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.from,r)<=0:_o(c.from,r)<0)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=gr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function br(e,t){var n=Zr(e,t),r=yr(n);return n==r?t:ti(r)}function wr(e,t){if(t>e.lastLine())return t;var n,r=Zr(e,t);if(!kr(e,r))return t;for(;n=gr(r);)r=n.find(1,!0).line;return ti(r)+1}function kr(e,t){var n=Wo&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Sr(e,t,r))return!0}}function Sr(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Sr(e,r.line,er(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Sr(e,t,i))return!0}function Cr(e,t,n){ri(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Wn(e,null,n)}function Lr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Va(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),qi(t.display.measure,ji("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Tr(e,t,n,r){var i=new xa(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),zn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!kr(e,t)){var r=ri(t)<e.scrollTop;ei(t,t.height+Lr(i)),r&&Wn(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Mr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),cr(e),ur(e,n);var i=r?r(e):1;i!=e.height&&ei(e,i)}function Nr(e){e.parent=null,cr(e)}function Ar(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Er(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Or(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Ir(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?sa(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=me(a,t);var s,c=Zr(a,t.line),u=je(e,t.line,n),f=new ma(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,o=Or(l,f,u),r&&s.push(i(!0));return r?s:i()}function Pr(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new ma(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&Ar(Er(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&Hr(e,t,r,f.pos),f.pos=t.length,s=null):s=Ar(Or(n,f,r,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e4),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e4);i(p,u),c=p}}function Rr(e,t,n,r){var i=[e.state.modeGen],o={};Pr(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Pr(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=je(e,ti(t)),i=Rr(e,t,t.text.length>e.options.maxHighlightLength?sa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Hr(e,t,n,r){var i=e.doc.mode,o=new ma(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Er(i,n);!o.eol();)Or(i,o,n),o.start=o.pos}function Wr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ka:wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Br(e,t){var n=ji("span",null,null,wo?"padding-right: .1px":null),r={pre:ji("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(xo||wo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,Ji(e.display.measure)&&(o=ii(a))&&(r.addToken=jr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&ti(a);qr(a,r,Dr(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=$i(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=$i(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(wo){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Pa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=$i(r.pre.className,r.textClass||"")),r}function _r(e){var t=ji("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,zr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var h=s.exec(t),d=h?h.index-f:t.length-f;if(d){var p=document.createTextNode(l.slice(f,f+d));xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!h)break;if(f+=d+1," "==h[0]){var m=e.cm.options.tabSize,g=m-e.col%m,p=u.appendChild(ji("span",Oi(g),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=g}else if("\r"==h[0]||"\n"==h[0]){var p=u.appendChild(ji("span","\r"==h[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",h[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(h[0]);p.setAttribute("cm-text",h[0]),xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),xo&&9>bo&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=ji("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function zr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function jr(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=0;f<t.length;f++){var h=t[f];if(h.to>c&&h.from<=c)break}if(h.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,h.to-c),i,o,null,l,s),o=null,r=r.slice(h.to-c),c=h.to}}}function Ur(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function qr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,h,d=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=f=l="",h=null,v=1/0;for(var y,x=[],b=0;b<r.length;++b){var w=r[b],k=w.marker;"bookmark"==k.type&&w.from==p&&k.widgetNode?x.push(k):w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!f&&(f=k.title),k.collapsed&&(!h||dr(h.marker,k)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(var b=0;b<y.length;b+=2)y[b+1]==v&&(c+=" "+y[b]);if(!h||h.from==p)for(var b=0;b<x.length;++b)Ur(t,0,x[b]);if(h&&(h.from||0)==p){if(Ur(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var S=Math.min(d,v);;){if(g){var C=p+g.length;if(!h){var L=C>S?g.slice(0,S-p):g;t.addToken(t,L,a?a+s:s,u,p+L.length==v?c:"",f,l)}if(C>=S){g=g.slice(S-p),p=S;break}p=C,u=""}g=i.slice(o,o=n[m++]),a=Wr(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),Wr(n[m+1],t.cm.options))}function Gr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Ii(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Yr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){Mr(e,n,i,r),Ci(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new ba(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Zr(e,l.line),f=Zr(e,s.line),h=Ii(c),d=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,t)){var m=a(0,c.length-1);o(f,f.text,d),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+h+u.text.slice(s.ch),d);else{var m=a(1,c.length-1);m.push(new ba(h+u.text.slice(s.ch),d,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,h+f.text.slice(s.ch),d);var m=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,m)}Ci(e,"change",e,t)}function $r(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Vr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Kr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Xr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,Dt(e)}function Zr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Jr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Qr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ei(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ti(e){if(null==e.parent)return null;for(var t=e.parent,n=Pi(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ni(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function ri(e){e=yr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function ii(e){var t=e.order;return null==t&&(t=e.order=ll(e.text)),t}function oi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ai(e,t){var n={from:$(t.from),to:Qo(t),text:Jr(e,t.from,t.to)};return di(e,n,t.from.line,t.to.line+1),Kr(e,function(e){di(e,n,t.from.line,t.to.line+1)},!0),n}function li(e){for(;e.length;){var t=Ii(e);if(!t.ranges)break;e.pop()}}function si(e,t){return t?(li(e.done),Ii(e.done)):e.done.length&&!Ii(e.done).ranges?Ii(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ii(e.done)):void 0}function ci(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=si(i,i.lastOp==r))){var l=Ii(o.changes);0==_o(t.from,t.to)&&0==_o(t.from,l.to)?l.to=Qo(t):o.changes.push(ai(e,t))}else{var s=Ii(i.done);for(s&&s.ranges||hi(e.sel,i.done),o={changes:[ai(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Pa(e,"historyAdded")}function ui(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ui(e,o,Ii(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&li(i.undone)}function hi(e,t){var n=Ii(t);n&&n.ranges&&n.equals(e)||t.push(e)}function di(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function mi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(pi(n[r]));return i}function gi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?ue.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&Pi(t,Number(c[1]))>-1&&(Ii(l)[f]=u[f],delete u[f])}}}return i}function vi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function yi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)vi(o.ranges[l].anchor,t,n,r),vi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=Bo(s.from.line+r,s.from.ch),s.to=Bo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;yi(e.done,n,r,i),yi(e.undone,n,r,i)}function bi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function wi(e){return e.target||e.srcElement}function ki(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Eo&&e.ctrlKey&&1==t&&(t=3),t}function Si(e,t,n){var r=e._handlers&&e._handlers[t];return n?r&&r.length>0?r.slice():Oa:r||Oa}function Ci(e,t){function n(e){return function(){e.apply(null,o)}}var r=Si(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Go?i=Go.delayedCallbacks:Ra?i=Ra:(i=Ra=[],setTimeout(Li,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function Li(){var e=Ra;Ra=null;for(var t=0;t<e.length;++t)e[t]()}function Ti(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pa(e,n||t.type,e,t),bi(t)||t.codemirrorIgnore}function Mi(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Pi(n,t[r])&&n.push(t[r])}function Ni(e,t){return Si(e,t).length>0}function Ai(e){e.prototype.on=function(e,t){Ea(this,e,t)},e.prototype.off=function(e,t){Ia(this,e,t)}}function Ei(){this.id=null}function Oi(e){for(;ja.length<=e;)ja.push(Ii(ja)+" ");return ja[e]}function Ii(e){return e[e.length-1]}function Pi(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Ri(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Di(){}function Hi(e,t){var n;return Object.create?n=Object.create(e):(Di.prototype=e,n=new Di),t&&Wi(t,n),n}function Wi(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Bi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function _i(e,t){return t?t.source.indexOf("\\w")>-1&&Ya(e)?!0:t.test(e):Ya(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function zi(e){return e.charCodeAt(0)>=768&&$a.test(e)}function ji(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Ui(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function qi(e,t){return Ui(e).appendChild(t)}function Gi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Yi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $i(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Yi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Vi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Ki(){Qa||(Xi(),Qa=!0)}function Xi(){var e;Ea(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Vi(qt)},100))}),Ea(window,"blur",function(){Vi(yn)})}function Zi(e){if(null==Ka){var t=ji("span","​");qi(e,ji("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ka=t.offsetWidth<=1&&t.offsetHeight>2&&!(xo&&8>bo))}var n=Ka?ji("span","​"):ji("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ji(e){if(null!=Xa)return Xa;var t=qi(e,document.createTextNode("AخA")),n=qa(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=qa(t,1,2).getBoundingClientRect();return Xa=r.right-n.right<3}function Qi(e){if(null!=il)return il;var t=qi(e,ji("span","x")),n=t.getBoundingClientRect(),r=qa(t,0,1).getBoundingClientRect();return il=Math.abs(n.left-r.left)>1}function eo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function ro(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?no(Ii(t)):e.text.length}function oo(e,t){var n=Zr(e.doc,t),r=yr(n);r!=n&&(t=ti(r));var i=ii(r),o=i?i[0].level%2?io(r):ro(r):0;return Bo(t,o)}function ao(e,t){for(var n,r=Zr(e.doc,t);n=gr(r);)r=n.find(1,!0).line,t=null;var i=ii(r),o=i?i[0].level%2?ro(r):io(r):r.text.length;return Bo(null==t?ti(r):t,o)}function lo(e,t){var n=oo(e,t.line),r=Zr(e.doc,n.line),i=ii(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Bo(n.line,a?0:o)}return n}function so(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function co(e,t){al=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return so(e,i.level,e[n].level)?(i.from!=i.to&&(al=n),r):(i.from!=i.to&&(al=r),n);n=r}}return n}function uo(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&zi(e.text.charAt(t)));return t}function fo(e,t,n,r){var i=ii(e);if(!i)return ho(e,t,n,r);for(var o=co(i,t),a=i[o],l=uo(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return co(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?uo(e,a.to,-1,r):uo(e,a.from,1,r)}}function ho(e,t,n,r){var i=t+n;if(r)for(;i>0&&zi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,mo=navigator.platform,go=/gecko\/\d/i.test(po),vo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),xo=vo||yo,bo=xo&&(vo?document.documentMode||6:yo[1]),wo=/WebKit\//.test(po),ko=wo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Co=/Opera\//.test(po),Lo=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Ao=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Eo=No||/Mac/.test(mo),Oo=/\bCrOS\b/.test(po),Io=/win/i.test(mo),Po=Co&&po.match(/Version\/(\d*\.\d*)/);Po&&(Po=Number(Po[1])),Po&&Po>=15&&(Co=!1,wo=!0);var Ro=Eo&&(ko||Co&&(null==Po||12.11>Po)),Do=go||xo&&bo>=9,Ho=!1,Wo=!1;m.prototype=Wi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Eo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ei,this.disableVert=new Ei},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Wi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},L.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},L.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pa.apply(null,this.events[e])};var Bo=e.Pos=function(e,t){return this instanceof Bo?(this.line=e,void(this.ch=t)):new Bo(e,t)},_o=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Fo=null;ne.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Fo.text.join("\n"),Ua(o));else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type?r.setSelections(t.ranges,null,Wa):(n.prevInput="",o.value=t.text.join("\n"),Ua(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}var n=this,r=this.cm,i=this.wrapper=re(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),No&&(o.style.width="0px"),Ea(o,"input",function(){xo&&bo>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Ea(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Ea(o,"cut",t),Ea(o,"copy",t),Ea(e.scroller,"paste",function(t){Gt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Ea(e.lineSpace,"selectstart",function(t){Gt(e,t)||Ma(t)}),Ea(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ea(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var i=dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;qi(n.cursorDiv,e.cursors),qi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rl&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&Ua(this.textarea),xo&&bo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",xo&&bo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Ao||Gi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0; +},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||nl(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&bo>=9&&this.hasSelection===r||Eo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return At(e,function(){Z(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&bo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,xo&&9>bo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!xo||xo&&9>bo)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Et(i,ua.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Yt(i,e),s=o.scroller.scrollTop;if(l&&!Co){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&Et(i,Te)(i.doc,de(l),Wa);var u=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",wo)var d=window.scrollY;if(o.input.focus(),wo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&bo>=9&&t(),Do){Aa(e);var p=function(){Ia(window,"mouseup",p),setTimeout(n,20)};Ea(window,"mouseup",p)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Di,needsContentAttribute:!1},ne.prototype),ie.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Wa),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Fo.text.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Fo.text.join("\n");var o=document.activeElement;Ua(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;te(i),Ea(i,"paste",function(e){Ti(r,e)||J(e,r)}),Ea(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=de(Bo(i.head.line,a),Bo(i.head.line,a+t.length)))}}),Ea(i,"compositionupdate",function(e){n.composing.data=e.data}),Ea(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Ea(i,"touchstart",function(){n.forceCompositionEnd()}),Ea(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||At(n.cm,function(){Dt(r)})}),Ea(i,"copy",t),Ea(i,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=_o(K(n,r),t.from())||0!=_o(V(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=qa(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(!go&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):go&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){qi(this.cm.display.cursorDiv,e.cursors),qi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Va(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,de(n,r),Wa),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Bt(e,r.line)))var a=ti(t.view[0].line),l=t.view[0].node;else var a=ti(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Bt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ti(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=e.doc.splitLines(ce(e,l,u,a,c)),h=Jr(e.doc,Bo(a,0),Bo(c,Zr(e.doc,c).text.length));f.length>1&&h.length>1;)if(Ii(f)==Ii(h))f.pop(),h.pop(),c--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),a++}for(var d=0,p=0,m=f[0],g=h[0],v=Math.min(m.length,g.length);v>d&&m.charCodeAt(d)==g.charCodeAt(d);)++d;for(var y=Ii(f),x=Ii(h),b=Math.min(y.length-(1==f.length?d:0),x.length-(1==h.length?d:0));b>p&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var w=Bo(a,d),k=Bo(c,h.length?Ii(h).length-p:0);return f.length>1||f[0]||_o(w,k)?(In(e.doc,f,w,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Et(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Et(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Et(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Di,resetPosition:Di,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=_o(n.anchor,r.anchor)||0!=_o(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fe($(this.ranges[t].anchor),$(this.ranges[t].head));return new ue(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(_o(t,r.from())>=0&&_o(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return V(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var zo,jo,Uo,qo={left:0,right:0,top:0,bottom:0},Go=null,Yo=0,$o=0,Vo=0,Ko=null;xo?Ko=-.53:go?Ko=15:So?Ko=-.7:Lo&&(Ko=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);return t.x*=Ko,t.y*=Ko,t};var Zo=new Ei,Jo=null,Qo=e.changeEnd=function(e){return e.text?Bo(e.from.line+e.text.length-1,Ii(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ta.hasOwnProperty(e)&&Et(this,ta[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($n(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ot(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,Dt(this)}),removeOverlay:Ot(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Dt(this)}}),indentLine:Ot(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ve(this.doc,e)&&Fn(this,e,t,n)}),indentSelection:Ot(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Bn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)Fn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&ke(this.doc,r,new fe(o,c[r].to()),Wa)}}}),getTokenAt:function(e,t){return Ir(this,e,t)},getLineTokens:function(e,t){return Ir(this,Bo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Zr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!la.hasOwnProperty(t))return n;var r=la[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Pi(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=pe(n,null==e?n.first+n.size-1:e),je(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?me(this.doc,e):e?r.from():r.to(),dt(this,n,t||"page")},charCoords:function(e,t){return ht(this,me(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ft(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ft(this,{top:e,left:0},t||"page").top,ni(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Zr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ri(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ot(function(e,t,n){return zn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Ht(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Zr(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=dt(this,me(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&Dn(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(hn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:pn,execCommand:function(e){return ua.hasOwnProperty(e)?ua[e].call(null,this):void 0},triggerElectric:Ot(function(e){Q(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=me(this.doc,e);t>o&&(a=Un(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Un(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},_a)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):jn(this,function(n){var i=Un(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=me(this.doc,e);t>a;++a){var s=dt(this,l,"div");if(null==o?o=s.left:s.left=o,l=qn(this,s,i,n),l.hitSide)break}return l},moveV:Ot(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=dt(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=qn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Wn(n,null,ht(n,s,"div").top-l.top),s},_a),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Zr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=_i(a,o)?function(e){return _i(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!_i(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new fe(Bo(e.line,r),Bo(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ja(this.display.cursorDiv,"CodeMirror-overwrite"):Za(this.display.cursorDiv,"CodeMirror-overwrite"),Pa(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Gi()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ot(function(e,t){null==e&&null==t||_n(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ye(this)-this.display.barHeight,width:e.scrollWidth-Ye(this)-this.display.barWidth,clientHeight:Ve(this),clientWidth:$e(this)}},scrollIntoView:Ot(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Bo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)_n(this),this.curOp.scrollToPos=e;else{var n=Hn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:Ot(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&at(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Ht(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,Pa(r,"refresh",this)}),operation:function(e){return At(this,e)},refresh:Ot(function(){var e=this.display.cachedTextHeight;Dt(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-yt(this.display))>.5)&&a(this),Pa(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Xr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ci(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ai(e);var ea=e.defaults={},ta=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Gn("value","",function(e,t){e.setValue(t)},!0),Gn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Gn("indentUnit",2,n,!0),Gn("indentWithTabs",!1),Gn("smartIndent",!0),Gn("tabSize",4,function(e){r(e),lt(e),Dt(e)},!0),Gn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Bo(r,o))}r++});for(var i=n.length-1;i>=0;i--)In(e.doc,t,n[i],Bo(n[i].line,n[i].ch+t.length))}}),Gn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Gn("specialCharPlaceholder",_r,function(e){e.refresh()},!0),Gn("electricChars",!0),Gn("inputStyle",Ao?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Gn("rtlMoveVisually",!Io),Gn("wholeLineUpdateBefore",!0),Gn("theme","default",function(e){l(e),s(e)},!0),Gn("keyMap","default",function(t,n,r){var i=$n(n),o=r!=e.Init&&$n(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Gn("extraKeys",null),Gn("lineWrapping",!1,i,!0),Gn("gutters",[],function(e){d(e.options),s(e)},!0),Gn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Gn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Gn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Gn("lineNumbers",!1,function(e){d(e.options),s(e)},!0),Gn("firstLineNumber",1,s,!0),Gn("lineNumberFormatter",function(e){return e},s,!0),Gn("showCursorWhenSelecting",!1,Re,!0),Gn("resetSelectionOnContextMenu",!0),Gn("lineWiseCopyCut",!0),Gn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Gn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Gn("dragDrop",!0,Ut),Gn("allowDropFileTypes",null),Gn("cursorBlinkRate",530),Gn("cursorScrollMargin",0),Gn("cursorHeight",1,Re,!0),Gn("singleCursorHeightPerLine",!0,Re,!0),Gn("workTime",100),Gn("workDelay",100),Gn("flattenSpans",!0,r,!0),Gn("addModeClass",!1,r,!0),Gn("pollInterval",100),Gn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Gn("historyEventDelay",1250),Gn("viewportMargin",10,function(e){e.refresh()},!0),Gn("maxHighlightLength",1e4,r,!0),Gn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Gn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Gn("autofocus",null);var ra=e.modes={},ia=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),ra[t]=n},e.defineMIME=function(e,t){ia[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ia.hasOwnProperty(t))t=ia[t];else if(t&&"string"==typeof t.name&&ia.hasOwnProperty(t.name)){var n=ia[t.name];"string"==typeof n&&(n={name:n}),t=Hi(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=ra[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(oa.hasOwnProperty(n.name)){var o=oa[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var oa=e.modeExtensions={};e.extendMode=function(e,t){var n=oa.hasOwnProperty(e)?oa[e]:oa[e]={};Wi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Ca.prototype[e]=t},e.defineOption=Gn;var aa=[];e.defineInitHook=function(e){aa.push(e)};var la=e.helpers={};e.registerHelper=function(t,n,r){la.hasOwnProperty(t)||(la[t]=e[t]={_global:[]}),la[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),la[t]._global.push({pred:r,val:i})};var sa=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ca=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ua=e.commands={selectAll:function(e){e.setSelection(Bo(e.firstLine(),0),Bo(e.lastLine()),Wa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Wa)},killLine:function(e){jn(e,function(t){if(t.empty()){var n=Zr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Bo(t.head.line+1,0)}:{from:t.head,to:Bo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){jn(e,function(t){return{from:Bo(t.from().line,0),to:me(e.doc,Bo(t.to().line+1,0))}})},delLineLeft:function(e){jn(e,function(e){return{from:Bo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Bo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Bo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return lo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return ao(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},_a)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},_a)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?lo(e,t.head):r},_a)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Fa(e.getLine(o.line),o.ch,r);t.push(Oi(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Zr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Bo(i.line,i.ch-1)),i.ch>0)i=new Bo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Bo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Zr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Bo(i.line-1,a.length-1),Bo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Bn(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},fa=e.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fa["default"]=Eo?fa.macDefault:fa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Ri(n.split(" "),Yn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var ha=e.lookupKey=function(e,t,n,r){t=$n(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return ha(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=ha(e,t.fallthrough[o],n,r); +if(a)return a}}},da=e.isModifierKey=function(e){var t="string"==typeof e?e:ol[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},pa=e.keyName=function(e,t){if(Co&&34==e.keyCode&&e["char"])return!1;var n=ol[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Ro?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(Ro?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n=n?Wi(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=Gi();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Ea(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ia(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ma=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ma.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Fa(this.string,null,this.tabSize)-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ga=0,va=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ga};Ai(va),va.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),Ni(this,"clear")){var n=this.find();n&&Ci(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=er(a.markedSpans,this);e&&!this.collapsed?Ht(e,ti(a),"text"):e&&(null!=l.to&&(i=ti(a)),null!=l.from&&(r=ti(a))),a.markedSpans=tr(a.markedSpans,l),null==l.from&&this.collapsed&&!kr(this.doc,a)&&e&&ei(a,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=yr(this.lines[o]),c=f(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&Ci(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},va.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=er(o.markedSpans,this);if(null!=a.from&&(n=Bo(t?o:ti(o),a.from),-1==e))return n;if(null!=a.to&&(r=Bo(t?o:ti(o),a.to),1==e))return r}return n&&{from:n,to:r}},va.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&At(n,function(){var r=e.line,i=ti(e.line),o=Qe(n,i);if(o&&(ot(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!kr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=Lr(t)-a;l&&ei(r,r.height+l)}})},va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Pi(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},va.prototype.detachLine=function(e){if(this.lines.splice(Pi(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var ga=0,ya=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Ai(ya),ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ci(this,"clear")}},ya.prototype.find=function(e,t){return this.primary.find(e,t)};var xa=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Ai(xa),xa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ti(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Lr(this);ei(n,Math.max(0,n.height-o)),e&&At(e,function(){Cr(e,n,-o),Ht(e,r,"widget")})}},xa.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Lr(this)-e;r&&(ei(n,n.height+r),t&&At(t,function(){t.curOp.forceUpdate=!0,Cr(t,n,r)}))};var ba=e.Line=function(e,t,n){this.text=e,ur(this,t),this.height=n?n(this):1};Ai(ba),ba.prototype.lineNo=function(){return ti(this)};var wa={},ka={};$r.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Nr(i),Ci(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof $r))){var l=[];this.collapse(l),this.children=[new $r(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new $r(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Vr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Pi(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Vr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var Sa=0,Ca=e.Doc=function(e,t,n,r){if(!(this instanceof Ca))return new Ca(e,t,n,r);null==n&&(n=0),Vr.call(this,[new $r([new ba("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=Bo(n,0);this.sel=de(i),this.history=new oi(null),this.id=++Sa,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Yr(this,{from:i,to:i,text:e}),Te(this,de(i),Wa)};Ca.prototype=Hi(Vr.prototype,{constructor:Ca,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:It(function(e){var t=Bo(this.first,0),n=this.first+this.size-1;Tn(this,{from:t,to:Bo(n,Zr(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Te(this,de(t))}),replaceRange:function(e,t,n,r){t=me(this,t),n=n?me(this,n):t,In(this,e,t,n,r)},getRange:function(e,t,n){var r=Jr(this,me(this,e),me(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ve(this,e)?Zr(this,e):void 0},getLineNumber:function(e){return ti(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Zr(this,e)),yr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return me(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:It(function(e,t,n){Se(this,me(this,"number"==typeof e?Bo(e,t||0):e),null,n)}),setSelection:It(function(e,t,n){Se(this,me(this,e),me(this,t||e),n)}),extendSelection:It(function(e,t,n){be(this,me(this,e),t&&me(this,t),n)}),extendSelections:It(function(e,t){we(this,ye(this,e),t)}),extendSelectionsBy:It(function(e,t){var n=Ri(this.sel.ranges,e);we(this,ye(this,n),t)}),setSelections:It(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new fe(me(this,e[r].anchor),me(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,he(i,t),n)}}),addSelection:It(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new fe(me(this,e),me(this,t||e))),Te(this,he(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:It(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&Cn(this,r,t),o=r.length-1;o>=0;o--)Tn(this,r[o]);l?Le(this,l):this.cm&&Bn(this.cm)}),undo:It(function(){Nn(this,"undo")}),redo:It(function(){Nn(this,"redo")}),undoSelection:It(function(){Nn(this,"undo",!0)}),redoSelection:It(function(){Nn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new oi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:gi(this.history.done),undone:gi(this.history.undone)}},setHistory:function(e){var t=this.history=new oi(this.history.maxGeneration);t.done=gi(e.done.slice(0),null,!0),t.undone=gi(e.undone.slice(0),null,!0)},addLineClass:It(function(e,t,n){return zn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Yi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:It(function(e,t,n){return zn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Yi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:It(function(e,t,n){return Tr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vn(this,me(this,e),me(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=me(this,e),Vn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=me(this,e);var t=[],n=Zr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;return o>e?(t=e,!0):(e-=o,void++n)}),me(this,Bo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ca(Qr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ca(Qr(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Zn(r,Xn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Jn(Xn(this));break}}if(t.history==this.history){var i=[t.id];Kr(t,function(e){i.push(e.id)},!0),t.history=new oi(null),t.history.done=gi(this.history.done,i),t.history.undone=gi(this.history.undone,i)}},iterLinkedDocs:function(e){Kr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):tl(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Ca.prototype.eachLine=Ca.prototype.iter;var La="iter insert remove copy getEditor constructor".split(" ");for(var Ta in Ca.prototype)Ca.prototype.hasOwnProperty(Ta)&&Pi(La,Ta)<0&&(e.prototype[Ta]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ca.prototype[Ta]));Ai(Ca);var Ma=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Na=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Aa=e.e_stop=function(e){Ma(e),Na(e)},Ea=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Oa=[],Ia=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var r=Si(e,t,!1),i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}},Pa=e.signal=function(e,t){var n=Si(e,t,!0);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Ra=null,Da=30,Ha=e.Pass={toString:function(){return"CodeMirror.Pass"}},Wa={scroll:!1},Ba={origin:"*mouse"},_a={origin:"+move"};Ei.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Fa=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},za=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},ja=[""],Ua=function(e){e.select()};No?Ua=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&(Ua=function(e){try{e.select()}catch(t){}});var qa,Ga=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ya=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ga.test(e))},$a=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;qa=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Va=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&11>bo&&(Gi=function(){try{return document.activeElement}catch(e){return document.body}});var Ka,Xa,Za=e.rmClass=function(e,t){var n=e.className,r=Yi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ja=e.addClass=function(e,t){var n=e.className;Yi(t).test(n)||(e.className+=(n?" ":"")+t)},Qa=!1,el=function(){if(xo&&9>bo)return!1;var e=ji("div");return"draggable"in e||"dragDrop"in e}(),tl=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},nl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rl=function(){var e=ji("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),il=null,ol=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)ol[e+48]=ol[e+96]=String(e);for(var e=65;90>=e;e++)ol[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ol[e+111]=ol[e+63235]="F"+e}();var al,ll=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],h=0;u>h;++h)f.push(r=e(n.charCodeAt(h)));for(var h=0,d=c;u>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=c;u>h;++h){var r=f[h];"1"==r&&"r"==p?f[h]="n":a.test(r)&&(p=r,"r"==r&&(f[h]="R"))}for(var h=1,d=f[0];u-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=r}for(var h=0;u>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var m=h+1;u>m&&"%"==f[m];++m);for(var g=h&&"!"==f[h-1]||u>m&&"1"==f[m]?"1":"N",v=h;m>v;++v)f[v]=g;h=m-1}}for(var h=0,p=c;u>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;u>h;++h)if(o.test(f[h])){for(var m=h+1;u>m&&o.test(f[m]);++m);for(var y="L"==(h?f[h-1]:c),x="L"==(u>m?f[m]:c),g=y||x?"L":"R",v=h;m>v;++v)f[v]=g;h=m-1}for(var b,w=[],h=0;u>h;)if(l.test(f[h])){var k=h;for(++h;u>h&&l.test(f[h]);++h);w.push(new t(0,k,h))}else{var S=h,C=w.length;for(++h;u>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(s.test(f[v])){v>S&&w.splice(C,0,new t(1,S,v));var L=v;for(++v;h>v&&s.test(f[v]);++v);w.splice(C,0,new t(2,L,v)),S=v}else++v;h>S&&w.splice(C,0,new t(1,S,h))}return 1==w[0].level&&(b=n.match(/^\s+/))&&(w[0].from=b[0].length,w.unshift(new t(0,0,b[0].length))),1==Ii(w).level&&(b=n.match(/\s+$/))&&(Ii(w).to-=b[0].length,w.push(new t(0,u-b[0].length,u))),2==w[0].level&&w.unshift(new t(1,w[0].to,w[0].to)),w[0].level!=Ii(w).level&&w.push(new t(w[0].level,u,u)),w}}();return e.version="5.15.2",e})},{}],11:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],i):i(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},l={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var s in r)l[s]=r[s];return l.name="markdown",e.overlayMode(e.getMode(n,l),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../xml/xml","../meta"],i):i(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,k&&e.f==c&&(e.f=p,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(t,o){var l=t.sol(),s=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,s&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var f=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,S.code):null;if(t.eatSpace())return null;if((f=t.match(A))&&f[1].length<=6)return o.header=f[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(!(a(o.prevLine)||o.quote||s||c)&&(f=t.match(E)))return o.header="="==f[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(t.eat(">"))return o.quote=l?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),h(o);if("["===t.peek())return i(t,o,y);if(t.match(L,!0))return o.hr=!0,S.hr;if((a(o.prevLine)||s)&&(t.match(T,!1)||t.match(M,!1))){var d=null;for(t.match(T,!0)?d="ul":(t.match(M,!0),d="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()<o.listStack[o.listStack.length-1];)o.listStack.pop();return o.listStack.push(o.indentation),n.taskLists&&t.match(N,!1)&&(o.taskList=!0),o.f=o.inline,n.highlightFormatting&&(o.formatting=["list","list-"+d]),h(o)}return n.fencedCodeBlocks&&(f=t.match(I,!0))?(o.fencedChars=f[1],o.localMode=r(f[2]),o.localMode&&(o.localState=e.startState(o.localMode)),o.f=o.block=u,n.highlightFormatting&&(o.formatting="code-block"),o.code=-1,h(o)):i(t,o,o.inline)}function c(t,n){var r=w.token(t,n.htmlState);if(!k){var i=e.innerMode(w,n.htmlState);("xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=p,n.block=s,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S.code)}function f(e,t){e.match(t.fencedChars),t.block=s,t.f=p,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=h(t);return t.code=0,r}function h(e){var t=[];if(e.formatting){t.push(S.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(S.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(S.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(S.linkHref,"url"):(e.strong&&t.push(S.strong),e.em&&t.push(S.em),e.strikethrough&&t.push(S.strikethrough),e.linkText&&t.push(S.linkText),e.code&&t.push(S.code)),e.header&&t.push(S.header,S.header+"-"+e.header),e.quote&&(t.push(S.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.quote+"-"+e.quote):t.push(S.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(S.list2):t.push(S.list3):t.push(S.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(O,!0)?h(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,h(r);if(r.taskList){var a="x"!==t.match(N,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,h(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"), +h(r);var l=t.sol(),s=t.next();if(r.linkTitle){r.linkTitle=!1;var u=s;"("===s&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),!0))return S.linkHref}if("`"===s){var d=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0==r.code)return r.code=p,h(r);if(p==r.code){var v=h(r);return r.code=0,v}return r.formatting=d,h(r)}if(r.code)return h(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var y=h(r),x=S.formatting+"-escape";return y?y+" "+x:x}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=g,S.image;if("["===s&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),h(r);if("]"===s&&r.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=h(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkEmail}if("<"===s&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var k=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(k)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(w),o(t,r,c)}if("<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var L=t.pos-2;if(L>=0){var T=t.string.charAt(L);"_"!==T&&T.match(/(\w)/,!1)&&(C=!0)}}if("*"===s||"_"===s&&!C)if(l&&" "===t.peek());else{if(r.strong===s&&t.eat(s)){n.highlightFormatting&&(r.formatting="strong");var v=h(r);return r.strong=!1,v}if(!r.strong&&t.eat(s))return r.strong=s,n.highlightFormatting&&(r.formatting="strong"),h(r);if(r.em===s){n.highlightFormatting&&(r.formatting="em");var v=h(r);return r.em=!1,v}if(!r.em)return r.em=s,n.highlightFormatting&&(r.formatting="em"),h(r)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return h(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=h(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),h(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return h(r);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),h(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=h(t);return i?i+=" ":i="",i+S.linkInline}return e.match(/^[^>]+/,!0),S.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,h(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=h(r);return r.linkHref=!1,o}return t.match(P[e]),r.linkHref=!0,h(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=x,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,h(t)):i(e,t,p)}function x(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=h(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,S.linkHref+" url")}var w=e.getMode(t,"text/html"),k="null"==w.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var S={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in S)S.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(S[C]=n.tokenTypeOverrides[C]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,M=/^[0-9]+([.)])\s+/,N=/^\[(x| )\](?=\s)/,A=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,O=/^[^#!\[\]*_\\<>` "'(~]+/,I=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},R={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(l(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:R}},blankLine:l,getType:h,fold:"markdown"};return R},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../lib/codemirror")):"function"==typeof e&&e.amd?e(["../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}})},{"../lib/codemirror":10}],14:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=d,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:d}function p(e,t,n){return"word"==e?(n.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||S.matchClosing===!1?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,n){return"endTag"!=e?(M="error",g):(f(n),d)}function v(e,t,n){return M="error",g(e,t,n)}function y(e,t,n){if("word"==e)return M="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),d}return M="error",y}function x(e,t,n){return"equals"==e?b:(S.allowMissing||(M="error"),y(e,t,n))}function b(e,t,n){return"string"==e?w:"word"==e&&S.allowUnquoted?(M="string",y):(M="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var k=r.indentUnit,S={},C=i.htmlMode?t:n;for(var L in C)S[L]=C[L];for(var L in i)S[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:d,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(M=null,t.state=t.state(T||n,e,t),M&&(n="error"==M?n+" error":M)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return S.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!S.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=S.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,c=s>>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=l;u>0;o=256*o+e[t+f],f+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,l,s,c=8*o-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),t+=a+f>=1?h/s:h*Math.pow(2,1-f),t*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*s-1)*Math.pow(2,i),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&l,d+=p,l/=256,i-=8);for(a=a<<i|l,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},{}],16:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],17:[function(t,n,r){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=d.normal,this.options.gfm&&(this.options.tables?this.rules=d.tables:this.rules=d.gfm)}function i(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function o(e){this.options=e||{}}function a(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}function l(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function s(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function f(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function h(e,n,r){if(r||"function"==typeof n){r||(r=n,n=null),n=f({},h.defaults,n||{});var i,o,s=n.highlight,c=0;try{i=t.lex(e,n)}catch(u){return r(u)}o=i.length;var d=function(e){if(e)return n.highlight=s,r(e);var t;try{t=a.parse(i,n)}catch(o){e=o}return n.highlight=s,e?r(e):r(null,t)};if(!s||s.length<3)return d();if(delete n.highlight,!o)return d();for(;c<i.length;c++)!function(e){return"code"!==e.type?--o||d():s(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--o||d():(e.text=n,e.escaped=!0,void(--o||d()))})}(i[c])}else try{return n&&(n=f({},h.defaults,n)),a.parse(t.lex(e,n),n)}catch(u){if(u.message+="\nPlease report this to https://github.com/chjj/marked.",(n||h.defaults).silent)return"<p>An error occured:</p><pre>"+l(u.message+"",!0)+"</pre>";throw u}}var d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=c(d.item,"gm")(/bull/g,d.bullet)(),d.list=c(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=c(d.blockquote)("def",d.def)(),d._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",d.html=c(d.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,d._tag)(),d.paragraph=c(d.paragraph)("hr",d.hr)("heading",d.heading)("lheading",d.lheading)("blockquote",d.blockquote)("tag","<"+d._tag)("def",d.def)(),d.normal=f({},d),d.gfm=f({},d.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),d.gfm.paragraph=c(d.paragraph)("(?!","(?!"+d.gfm.fences.source.replace("\\1","\\2")+"|"+d.list.source.replace("\\1","\\3")+"|")(),d.tables=f({},d.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=d,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,a,l,s,c,u,f,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].split(/ *\| */);this.tokens.push(s)}else if(o=this.rules.lheading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(this.rules.item),r=!1,f=o.length,u=0;f>u;u++)s=o[u],c=s.length,s=s.replace(/^ *([*+-]|\d+\.) +/,""),~s.indexOf("\n ")&&(c-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==f-1&&(l=d.bullet.exec(o[u+1])[0],a===l||a.length>1&&l.length>1||(e=o.slice(u+1).join("\n")+e,u=f-1)),i=r||/\n\n(?!\s*$)/.test(s),u!==f-1&&(r="\n"===s.charAt(s.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),s={type:"table", +header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(s)}else if(t&&(o=this.rules.paragraph.exec(e)))e=e.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var p={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};p._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,p._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=c(p.link)("inside",p._inside)("href",p._href)(),p.reflink=c(p.reflink)("inside",p._inside)(),p.normal=f({},p),p.pedantic=f({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=f({},p.normal,{escape:c(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=f({},p.gfm,{br:c(p.br)("{2,}","*")(),text:c(p.gfm.text)("{2,}","*")()}),i.rules=p,i.output=function(e,t,n){var r=new i(t,n);return r.output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=l(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):l(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(l(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(l(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=l(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=l(t.href),r=t.title?l(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,l(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+l(t,!0)+'">'+(n?e:l(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:l(e,!0))+"\n</code></pre>"},o.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},o.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},o.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},o.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},o.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},o.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},o.prototype.strong=function(e){return"<strong>"+e+"</strong>"},o.prototype.em=function(e){return"<em>"+e+"</em>"},o.prototype.codespan=function(e){return"<code>"+e+"</code>"},o.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},o.prototype.del=function(e){return"<del>"+e+"</del>"},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(s(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>"},o.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},o.prototype.text=function(e){return e},a.parse=function(e,t,n){var r=new a(t,n);return r.parse(e)},a.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",a="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(o+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",i=0;i<t.length;i++)n+=this.renderer.tablecell(this.inline.output(t[i]),{header:!1,align:this.token.align[i]});a+=this.renderer.tablerow(n)}return this.renderer.table(o,a);case"blockquote_start":for(var a="";"blockquote_end"!==this.next().type;)a+=this.tok();return this.renderer.blockquote(a);case"list_start":for(var a="",l=this.token.ordered;"list_end"!==this.next().type;)a+=this.tok();return this.renderer.list(a,l);case"list_item_start":for(var a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(a);case"loose_item_start":for(var a="";"list_item_end"!==this.next().type;)a+=this.tok();return this.renderer.listitem(a);case"html":var s=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(s);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},u.exec=u,h.options=h.setOptions=function(e){return f(h.defaults,e),h},h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new o,xhtml:!1},h.Parser=a,h.parser=a.parse,h.Renderer=o,h.Lexer=t,h.lexer=t.lex,h.InlineLexer=i,h.inlineLexer=i.output,h.parse=h,"undefined"!=typeof n&&"object"==typeof r?n.exports=h:"function"==typeof e&&e.amd?e(function(){return h}):this.marked=h}).call(function(){return this||("undefined"!=typeof window?window:t)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(e,t,n){(function(n,r){"use strict";var i=function(e,t,n,i){if(i=i||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=i.flags||{},e){if(this.dictionary=e,"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension)t||(t=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".aff"))),n||(n=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".dic")));else{if(i.dictionaryPath)var o=i.dictionaryPath;else if("undefined"!=typeof r)var o=r+"/dictionaries";else var o="./dictionaries";t||(t=this._readFile(o+"/"+e+"/"+e+".aff")),n||(n=this._readFile(o+"/"+e+"/"+e+".dic"))}this.rules=this._parseAFF(t),this.compoundRuleCodes={};for(var a=0,l=this.compoundRules.length;l>a;a++)for(var s=this.compoundRules[a],c=0,u=s.length;u>c;c++)this.compoundRuleCodes[s[c]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n);for(var a in this.compoundRuleCodes)0==this.compoundRuleCodes[a].length&&delete this.compoundRuleCodes[a];for(var a=0,l=this.compoundRules.length;l>a;a++){for(var f=this.compoundRules[a],h="",c=0,u=f.length;u>c;c++){var d=f[c];h+=d in this.compoundRuleCodes?"("+this.compoundRuleCodes[d].join("|")+")":d}this.compoundRules[a]=new RegExp(h,"i")}}return this};i.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(t,r){if(r||(r="utf8"),"undefined"!=typeof XMLHttpRequest){var i=new XMLHttpRequest;return i.open("GET",t,!1),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+r),i.send(null),i.responseText}if("undefined"!=typeof e){var o=e("fs");try{if(o.existsSync(t)){var a=o.statSync(t),l=o.openSync(t,"r"),s=new n(a.size);return o.readSync(l,s,0,s.length,null),s.toString(r,0,s.length)}console.log("Path "+t+" does not exist.")}catch(c){return console.log(c),""}}},_parseAFF:function(e){var t={};e=this._removeAffixComments(e);for(var n=e.split("\n"),r=0,i=n.length;i>r;r++){var o=n[r],a=o.split(/\s+/),l=a[0];if("PFX"==l||"SFX"==l){for(var s=a[1],c=a[2],u=parseInt(a[3],10),f=[],h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/),m=p[2],g=p[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),x=p[4],b={};b.add=v,y.length>0&&(b.continuationClasses=y),"."!==x&&("SFX"===l?b.match=new RegExp(x+"$"):b.match=new RegExp("^"+x)),"0"!=m&&("SFX"===l?b.remove=new RegExp(m+"$"):b.remove=m),f.push(b)}t[s]={type:l,combineable:"Y"==c,entries:f},r+=u}else if("COMPOUNDRULE"===l){for(var u=parseInt(a[1],10),h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/);this.compoundRules.push(p[1])}r+=u}else if("REP"===l){var p=o.split(/\s+/);3===p.length&&this.replacementTable.push([p[1],p[2]])}else this.flags[l]=a[1]}return t},_removeAffixComments:function(e){return e=e.replace(/#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in r&&"object"==typeof r[e]||(r[e]=[]),r[e].push(t)}e=this._removeDicComments(e);for(var n=e.split("\n"),r={},i=1,o=n.length;o>i;i++){var a=n[i],l=a.split("/",2),s=l[0];if(l.length>1){var c=this.parseRuleCodes(l[1]);"NEEDAFFIX"in this.flags&&-1!=c.indexOf(this.flags.NEEDAFFIX)||t(s,c);for(var u=0,f=c.length;f>u;u++){var h=c[u],d=this.rules[h];if(d)for(var p=this._applyRule(s,d),m=0,g=p.length;g>m;m++){var v=p[m];if(t(v,[]),d.combineable)for(var y=u+1;f>y;y++){var x=c[y],b=this.rules[x];if(b&&b.combineable&&d.type!=b.type)for(var w=this._applyRule(v,b),k=0,S=w.length;S>k;k++){var C=w[k];t(C,[])}}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(s)}}else t(s.trim(),[])}return r},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,r=e.length;r>n;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?textCode.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;o>i;i++){var a=n[i];if(!a.match||e.match(a.match)){var l=e;if(a.remove&&(l=l.replace(a.remove,"")),"SFX"===t.type?l+=a.add:l=a.add+l,r.push(l),"continuationClasses"in a)for(var s=0,c=a.continuationClasses.length;c>s;s++){var u=this.rules[a.continuationClasses[s]];u&&(r=r.concat(this._applyRule(l,u)))}}}return r},check:function(e){var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var r=t.toLowerCase();if(r!==t){if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if("undefined"==typeof t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;r>n;n++)if(e.match(this.compoundRules[n]))return!0;return!1}if("object"==typeof t){for(var n=0,r=t.length;r>n;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1}},hasFlag:function(e,t,n){if(t in this.flags){if("undefined"==typeof n)var n=Array.prototype.concat.apply([],this.dictionaryTable[e]);if(n&&-1!==n.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(e,t){function n(e){for(var t=[],n=0,r=e.length;r>n;n++){for(var i=e[n],o=[],a=0,l=i.length+1;l>a;a++)o.push([i.substring(0,a),i.substring(a,i.length)]);for(var s=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1]&&s.push(u[0]+u[1].substring(1))}for(var f=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1].length>1&&f.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2))}for(var h=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1].substring(1))}for(var m=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1])}t=t.concat(s),t=t.concat(f),t=t.concat(h),t=t.concat(m)}return t}function r(e){for(var t=[],n=0;n<e.length;n++)c.check(e[n])&&t.push(e[n]);return t}function i(e){function i(e,t){return e[1]<t[1]?-1:1}for(var o=n([e]),a=n(o),l=r(o).concat(r(a)),s={},u=0,f=l.length;f>u;u++)l[u]in s?s[l[u]]+=1:s[l[u]]=1;var h=[];for(var u in s)h.push([u,s[u]]);h.sort(i).reverse();for(var d=[],u=0,f=Math.min(t,h.length);f>u;u++)c.hasFlag(h[u][0],"NOSUGGEST")||d.push(h[u][0]);return d}if(t||(t=5),this.check(e))return[];for(var o=0,a=this.replacementTable.length;a>o;o++){var l=this.replacementTable[o];if(-1!==e.indexOf(l[0])){var s=e.replace(l[0],l[1]);if(this.check(s))return[s]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",i(e)}},"undefined"!=typeof t&&(t.exports=i)}).call(this,e("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(e,t,n){var r=e("codemirror");r.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentMore");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}},r.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentLess");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}}},{codemirror:10}],20:[function(e,t,n){"use strict";function r(e){return e=U?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function i(e,t,n){e=e||{};var r=document.createElement("a");return t=void 0==t?!0:t,e.title&&t&&(r.title=a(e.title,e.action,n),U&&(r.title=r.title.replace("Ctrl","⌘"),r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=e.className,r}function o(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function a(e,t,n){var i,o=e;return t&&(i=Y(t),n[i]&&(o+=" ("+r(n[i])+")")),o}function l(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),a={},l=0;l<o.length;l++)r=o[l],"strong"===r?a.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===r?a.quote=!0:"em"===r?a.italic=!0:"quote"===r?a.quote=!0:"strikethrough"===r?a.strikethrough=!0:"comment"===r?a.code=!0:"link"===r?a.link=!0:"tag"===r?a.image=!0:r.match(/^header(\-[1-6])?$/)&&(a[r.replace("header","heading")]=!0);return a}function s(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(V=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=V;var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen";var r=e.toolbarElements.fullscreen;/active/.test(r.className)?r.className=r.className.replace(/\s*active\s*/g,""):r.className+=" active";var i=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(i.className)&&N(e)}function c(e){P(e,"bold",e.options.blockStyles.bold)}function u(e){P(e,"italic",e.options.blockStyles.italic)}function f(e){P(e,"strikethrough","~~")}function h(e){function t(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function n(e){return e.state.base.base||e.state.base}function r(e,r,i,o,a){i=i||e.getLineHandle(r),o=o||e.getTokenAt({line:r,ch:1}),a=a||!!i.text&&e.getTokenAt({line:r,ch:i.text.length-1});var l=o.type?o.type.split(" "):[];return a&&n(a).indentedCode?"indented":-1===l.indexOf("comment")?!1:n(o).fencedChars||n(a).fencedChars||t(i)?"fenced":"single"}function i(e,t,n,r){var i=t.line+1,o=n.line+1,a=t.line!==n.line,l=r+"\n",s="\n"+r;a&&o++,a&&0===n.ch&&(s=r+"\n",o--),E(e,!1,[l,s]),e.setSelection({line:i,ch:0},{line:o,ch:0})}var o,a,l,s=e.options.blockStyles.code,c=e.codemirror,u=c.getCursor("start"),f=c.getCursor("end"),h=c.getTokenAt({line:u.line,ch:u.ch||1}),d=c.getLineHandle(u.line),p=r(c,u.line,d,h);if("single"===p){var m=d.text.slice(0,u.ch).replace("`",""),g=d.text.slice(u.ch).replace("`","");c.replaceRange(m+g,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),u.ch--,u!==f&&f.ch--,c.setSelection(u,f),c.focus()}else if("fenced"===p)if(u.line!==f.line||u.ch!==f.ch){for(o=u.line;o>=0&&(d=c.getLineHandle(o),!t(d));o--);var v,y,x,b,w=c.getTokenAt({line:o,ch:1}),k=n(w).fencedChars;t(c.getLineHandle(u.line))?(v="",y=u.line):t(c.getLineHandle(u.line-1))?(v="",y=u.line-1):(v=k+"\n",y=u.line),t(c.getLineHandle(f.line))?(x="",b=f.line,0===f.ch&&(b+=1)):0!==f.ch&&t(c.getLineHandle(f.line+1))?(x="",b=f.line+1):(x=k+"\n",b=f.line+1),0===f.ch&&(b-=1),c.operation(function(){c.replaceRange(x,{line:b,ch:0},{line:b+(x?0:1),ch:0}),c.replaceRange(v,{line:y,ch:0},{line:y+(v?0:1),ch:0})}),c.setSelection({line:y+(v?1:0),ch:0},{line:b+(v?1:-1),ch:0}),c.focus()}else{var S=u.line;if(t(c.getLineHandle(u.line))&&("fenced"===r(c,u.line+1)?(o=u.line,S=u.line+1):(a=u.line,S=u.line-1)),void 0===o)for(o=S;o>=0&&(d=c.getLineHandle(o),!t(d));o--);if(void 0===a)for(l=c.lineCount(),a=S;l>a&&(d=c.getLineHandle(a),!t(d));a++);c.operation(function(){c.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),c.replaceRange("",{line:a-1,ch:0},{line:a,ch:0})}),c.focus()}else if("indented"===p){if(u.line!==f.line||u.ch!==f.ch)o=u.line,a=f.line,0===f.ch&&a--;else{for(o=u.line;o>=0;o--)if(d=c.getLineHandle(o),!d.text.match(/^\s*$/)&&"indented"!==r(c,o,d)){o+=1;break}for(l=c.lineCount(),a=u.line;l>a;a++)if(d=c.getLineHandle(a),!d.text.match(/^\s*$/)&&"indented"!==r(c,a,d)){a-=1;break}}var C=c.getLineHandle(a+1),L=C&&c.getTokenAt({line:a+1,ch:C.text.length-1}),T=L&&n(L).indentedCode;T&&c.replaceRange("\n",{line:a+1,ch:0});for(var M=o;a>=M;M++)c.indentLine(M,"subtract");c.focus()}else{var N=u.line===f.line&&u.ch===f.ch&&0===u.ch,A=u.line!==f.line;N||A?i(c,u,f,s):E(c,!1,["`","`"])}}function d(e){var t=e.codemirror;I(t,"quote")}function p(e){var t=e.codemirror;O(t,"smaller")}function m(e){var t=e.codemirror;O(t,"bigger")}function g(e){var t=e.codemirror;O(t,void 0,1)}function v(e){var t=e.codemirror;O(t,void 0,2)}function y(e){var t=e.codemirror;O(t,void 0,3)}function x(e){var t=e.codemirror;I(t,"unordered-list")}function b(e){var t=e.codemirror;I(t,"ordered-list")}function w(e){var t=e.codemirror;R(t)}function k(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.link),!i)?!1:void E(t,n.link,r.insertTexts.link,i)}function S(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.image),!i)?!1:void E(t,n.image,r.insertTexts.image,i)}function C(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.table,r.insertTexts.table)}function L(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.image,r.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function M(e){var t=e.codemirror;t.redo(),t.focus()}function N(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||s(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,c=n.previousSibling;l.className=l.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}var u=function(){r.innerHTML=e.options.previewRender(e.value(),r)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=u),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function A(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=e.options.toolbar?e.toolbarElements.preview:!1,o=n.lastChild;o&&/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&N(e)}function E(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],a=n[1],l=e.getCursor("start"),s=e.getCursor("end");r&&(a=a.replace("#url#",r)),t?(i=e.getLine(l.line),o=i.slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function O(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/);i=void 0!==t?0>=o?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?0>=o?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?0>=o?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):0>=o?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o);e.focus()}}function I(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=l(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)!function(r){var i=e.getLine(r);i=n[t]?i.replace(o[t],"$1"):a[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(s);e.focus()}}function P(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r="undefined"==typeof r?n:r;var i,o=e.codemirror,a=l(o),s=n,c=r,u=o.getCursor("start"),f=o.getCursor("end");a[t]?(i=o.getLine(u.line),s=i.slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==f&&(f.ch-=2)):"italic"==t&&(u.ch-=1,u!==f&&(f.ch-=1))):(i=o.getSelection(),"bold"==t?(i=i.split("**").join(""),i=i.split("__").join("")):"italic"==t?(i=i.split("*").join(""),i=i.split("_").join("")):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,f.ch=u.ch+i.length),o.setSelection(u,f),o.focus()}}function R(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=e.getLine(i),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}function D(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=D(e[n]||{},t[n]):e[n]=t[n]);return e}function H(e){for(var t=1;t<arguments.length;t++)e=D(e,arguments[t]);return e}function W(e){var t=/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),r=0;if(null===n)return r;for(var i=0;i<n.length;i++)r+=n[i].charCodeAt(0)>=19968?n[i].length:1;return r}function B(e){e=e||{},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar){e.toolbar=[];for(var o in K)K.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(K[o]["default"]===!0||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=H({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=H({},X,e.insertTexts||{}),e.promptTexts=Z,e.blockStyles=H({},J,e.blockStyles||{}),e.shortcuts=H({},G,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}function _(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var F=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var z=e("codemirror-spell-checker"),j=e("marked"),U=/Mac/.test(navigator.platform),q={toggleBold:c,toggleItalic:u,drawLink:k,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:S,toggleBlockquote:d,toggleOrderedList:b,toggleUnorderedList:x,toggleCodeBlock:h,togglePreview:A,toggleStrikethrough:f,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:C,drawHorizontalRule:L,undo:T,redo:M,toggleSideBySide:N,toggleFullScreen:s},G={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Y=function(e){for(var t in q)if(q[t]===e)return t;return null},$=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0); +}(navigator.userAgent||navigator.vendor||window.opera),e},V="",K={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:f,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:d,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:x,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:b,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:k,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:S,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:C,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:L,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:A,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:N,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:s,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:M,className:"fa fa-repeat no-disable",title:"Redo"}},X={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Z={link:"URL for the link:",image:"URL of the image:"},J={bold:"**",code:"```",italic:"*"};B.prototype.markdown=function(e){if(j){var t={};return this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),j.setOptions(t),j(e)}},B.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,i={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==q[o]&&!function(e){i[r(t.shortcuts[e])]=function(){q[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(e){e.getOption("fullScreen")&&s(n)},document.addEventListener("keydown",function(e){e=e||window.event,27==e.keyCode&&n.codemirror.getOption("fullScreen")&&s(n)},!1);var a,l;if(t.spellChecker!==!1?(a="spell-checker",l=t.parsingConfig,l.name="gfm",l.gitHubSpice=!1,z({codeMirrorInstance:F})):(a=t.parsingConfig,a.name="gfm",a.gitHubSpice=!1),this.codemirror=F.fromTextArea(e,{mode:a,backdrop:l,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:i,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:void 0!=t.styleSelectedText?t.styleSelectedText:!0}),t.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var u=this.codemirror;setTimeout(function(){u.refresh()}.bind(u),0)}},B.prototype.autosave=function(){if(_()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",a=r;a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=10>i?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.clearAutosavedValue=function(){if(_()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var r=!1,i=!1;return e.on("scroll",function(e){if(r)return void(r=!1);i=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,a=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=a}),n.onscroll=function(){if(i)return void(i=!1);r=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,a=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,a)},n},B.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t;for(t=0;t<e.length;t++)void 0!=K[e[t]]&&(e[t]=K[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var r=this,a={};for(r.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||r.options.toolbarGuideIcon!==!1)&&!(r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&$())){if("|"===e[t]){for(var s=!1,c=t+1;c<e.length;c++)"|"===e[c]||r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[c].name)||(s=!0);if(!s)continue}!function(e){var t;t="|"===e?o():i(e,r.options.toolbarTips,r.options.shortcuts),e.action&&("function"==typeof e.action?t.onclick=function(t){t.preventDefault(),e.action(r)}:"string"==typeof e.action&&(t.href=e.action,t.target="_blank")),a[e.name||e]=t,n.appendChild(t)}(e[t])}r.toolbarElements=a;var u=this.codemirror;u.on("cursorActivity",function(){var e=l(u);for(var t in a)!function(t){var n=a[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)});var f=u.getWrapperElement();return f.parentNode.insertBefore(n,f),n}},B.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var r,i,o,a=[];for(r=0;r<e.length;r++)if(i=void 0,o=void 0,"object"==typeof e[r])a.push({className:e[r].className,defaultValue:e[r].defaultValue,onUpdate:e[r].onUpdate});else{var l=e[r];"words"===l?(o=function(e){e.innerHTML=W(n.getValue())},i=function(e){e.innerHTML=W(n.getValue())}):"lines"===l?(o=function(e){e.innerHTML=n.lineCount()},i=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(o=function(e){e.innerHTML="0:0"},i=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===l&&(o=function(e){void 0!=t.autosave&&t.autosave.enabled===!0&&e.setAttribute("id","autosaved")}),a.push({className:l,defaultValue:o,onUpdate:i})}var s=document.createElement("div");for(s.className="editor-statusbar",r=0;r<a.length;r++){var c=a[r],u=document.createElement("span");u.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(u),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(u,c)),s.appendChild(u)}var f=this.codemirror.getWrapperElement();return f.parentNode.insertBefore(s,f.nextSibling),s}},B.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},B.toggleBold=c,B.toggleItalic=u,B.toggleStrikethrough=f,B.toggleBlockquote=d,B.toggleHeadingSmaller=p,B.toggleHeadingBigger=m,B.toggleHeading1=g,B.toggleHeading2=v,B.toggleHeading3=y,B.toggleCodeBlock=h,B.toggleUnorderedList=x,B.toggleOrderedList=b,B.cleanBlock=w,B.drawLink=k,B.drawImage=S,B.drawTable=C,B.drawHorizontalRule=L,B.undo=T,B.redo=M,B.togglePreview=A,B.toggleSideBySide=N,B.toggleFullScreen=s,B.prototype.toggleBold=function(){c(this)},B.prototype.toggleItalic=function(){u(this)},B.prototype.toggleStrikethrough=function(){f(this)},B.prototype.toggleBlockquote=function(){d(this)},B.prototype.toggleHeadingSmaller=function(){p(this)},B.prototype.toggleHeadingBigger=function(){m(this)},B.prototype.toggleHeading1=function(){g(this)},B.prototype.toggleHeading2=function(){v(this)},B.prototype.toggleHeading3=function(){y(this)},B.prototype.toggleCodeBlock=function(){h(this)},B.prototype.toggleUnorderedList=function(){x(this)},B.prototype.toggleOrderedList=function(){b(this)},B.prototype.cleanBlock=function(){w(this)},B.prototype.drawLink=function(){k(this)},B.prototype.drawImage=function(){S(this)},B.prototype.drawTable=function(){C(this)},B.prototype.drawHorizontalRule=function(){L(this)},B.prototype.undo=function(){T(this)},B.prototype.redo=function(){M(this)},B.prototype.togglePreview=function(){A(this)},B.prototype.toggleSideBySide=function(){N(this)},B.prototype.toggleFullScreen=function(){s(this)},B.prototype.isPreviewActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.lastChild;return/editor-preview-active/.test(n.className)},B.prototype.isSideBySideActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;return/editor-preview-active-side/.test(n.className)},B.prototype.isFullscreenActive=function(){var e=this.codemirror;return e.getOption("fullScreen")},B.prototype.getState=function(){var e=this.codemirror;return l(e)},B.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement();t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=B},{"./codemirror/tablist":19,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,marked:17}]},{},[20])(20)});/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/trumbowyg/trumbowyg.min.js */ +/** + * Trumbowyg v2.10.0 - A lightweight WYSIWYG editor + * Trumbowyg core file + * ------------------------ + * @link http://alex-d.github.io/Trumbowyg + * @license MIT + * @author Alexandre Demode (Alex-D) + * Twitter : @AlexandreDemode + * Website : alex-d.fr + */ + +jQuery.trumbowyg = { + langs: { + en: { + viewHTML: 'View HTML', + + undo: 'Undo', + redo: 'Redo', + + formatting: 'Formatting', + p: 'Paragraph', + blockquote: 'Quote', + code: 'Code', + header: 'Header', + + bold: 'Bold', + italic: 'Italic', + strikethrough: 'Stroke', + underline: 'Underline', + + strong: 'Strong', + em: 'Emphasis', + del: 'Deleted', + + superscript: 'Superscript', + subscript: 'Subscript', + + unorderedList: 'Unordered list', + orderedList: 'Ordered list', + + insertImage: 'Insert Image', + link: 'Link', + createLink: 'Insert link', + unlink: 'Remove link', + + justifyLeft: 'Align Left', + justifyCenter: 'Align Center', + justifyRight: 'Align Right', + justifyFull: 'Align Justify', + + horizontalRule: 'Insert horizontal rule', + removeformat: 'Remove format', + + fullscreen: 'Fullscreen', + + close: 'Close', + + submit: 'Confirm', + reset: 'Cancel', + + required: 'Required', + description: 'Description', + title: 'Title', + text: 'Text', + target: 'Target', + width: 'Width' + } + }, + + // Plugins + plugins: {}, + + // SVG Path globally + svgPath: null, + + hideButtonTexts: null +}; + +// Makes default options read-only +Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { + value: { + lang: 'en', + + fixedBtnPane: false, + fixedFullWidth: false, + autogrow: false, + autogrowOnEnter: false, + imageWidthModalEdit: false, + + prefix: 'trumbowyg-', + + semantic: true, + resetCss: false, + removeformatPasted: false, + tagsToRemove: [], + btns: [ + ['viewHTML'], + ['undo', 'redo'], // Only supported in Blink browsers + ['formatting'], + ['strong', 'em', 'del'], + ['superscript', 'subscript'], + ['link'], + ['insertImage'], + ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], + ['unorderedList', 'orderedList'], + ['horizontalRule'], + ['removeformat'], + ['fullscreen'] + ], + // For custom button definitions + btnsDef: {}, + + inlineElementsSelector: 'a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u', + + pasteHandlers: [], + + // imgDblClickHandler: default is defined in constructor + + plugins: {}, + urlProtocol: false, + minimalLinks: false + }, + writable: false, + enumerable: true, + configurable: false +}); + + +(function (navigator, window, document, $) { + 'use strict'; + + var CONFIRM_EVENT = 'tbwconfirm', + CANCEL_EVENT = 'tbwcancel'; + + $.fn.trumbowyg = function (options, params) { + var trumbowygDataName = 'trumbowyg'; + if (options === Object(options) || !options) { + return this.each(function () { + if (!$(this).data(trumbowygDataName)) { + $(this).data(trumbowygDataName, new Trumbowyg(this, options)); + } + }); + } + if (this.length === 1) { + try { + var t = $(this).data(trumbowygDataName); + switch (options) { + // Exec command + case 'execCmd': + return t.execCmd(params.cmd, params.param, params.forceCss); + + // Modal box + case 'openModal': + return t.openModal(params.title, params.content); + case 'closeModal': + return t.closeModal(); + case 'openModalInsert': + return t.openModalInsert(params.title, params.fields, params.callback); + + // Range + case 'saveRange': + return t.saveRange(); + case 'getRange': + return t.range; + case 'getRangeText': + return t.getRangeText(); + case 'restoreRange': + return t.restoreRange(); + + // Enable/disable + case 'enable': + return t.setDisabled(false); + case 'disable': + return t.setDisabled(true); + + // Toggle + case 'toggle': + return t.toggle(); + + // Destroy + case 'destroy': + return t.destroy(); + + // Empty + case 'empty': + return t.empty(); + + // HTML + case 'html': + return t.html(params); + } + } catch (c) { + } + } + + return false; + }; + + // @param: editorElem is the DOM element + var Trumbowyg = function (editorElem, options) { + var t = this, + trumbowygIconsId = 'trumbowyg-icons', + $trumbowyg = $.trumbowyg; + + // Get the document of the element. It use to makes the plugin + // compatible on iframes. + t.doc = editorElem.ownerDocument || document; + + // jQuery object of the editor + t.$ta = $(editorElem); // $ta : Textarea + t.$c = $(editorElem); // $c : creator + + options = options || {}; + + // Localization management + if (options.lang != null || $trumbowyg.langs[options.lang] != null) { + t.lang = $.extend(true, {}, $trumbowyg.langs.en, $trumbowyg.langs[options.lang]); + } else { + t.lang = $trumbowyg.langs.en; + } + + t.hideButtonTexts = $trumbowyg.hideButtonTexts != null ? $trumbowyg.hideButtonTexts : options.hideButtonTexts; + + // SVG path + var svgPathOption = $trumbowyg.svgPath != null ? $trumbowyg.svgPath : options.svgPath; + t.hasSvg = svgPathOption !== false; + t.svgPath = !!t.doc.querySelector('base') ? window.location.href.split('#')[0] : ''; + if ($('#' + trumbowygIconsId, t.doc).length === 0 && svgPathOption !== false) { + if (svgPathOption == null) { + // Hack to get svgPathOption based on trumbowyg.js path + var scriptElements = document.getElementsByTagName('script'); + for (var i = 0; i < scriptElements.length; i += 1) { + var source = scriptElements[i].src; + var matches = source.match('trumbowyg(\.min)?\.js'); + if (matches != null) { + svgPathOption = source.substring(0, source.indexOf(matches[0])) + 'ui/icons.svg'; + } + } + if (svgPathOption == null) { + console.warn('You must define svgPath: https://goo.gl/CfTY9U'); // jshint ignore:line + } + } + + var div = t.doc.createElement('div'); + div.id = trumbowygIconsId; + t.doc.body.insertBefore(div, t.doc.body.childNodes[0]); + $.ajax({ + async: true, + type: 'GET', + contentType: 'application/x-www-form-urlencoded; charset=UTF-8', + dataType: 'xml', + crossDomain: true, + url: svgPathOption, + data: null, + beforeSend: null, + complete: null, + success: function (data) { + div.innerHTML = new XMLSerializer().serializeToString(data.documentElement); + } + }); + } + + + /** + * When the button is associated to a empty object + * fn and title attributs are defined from the button key value + * + * For example + * foo: {} + * is equivalent to : + * foo: { + * fn: 'foo', + * title: this.lang.foo + * } + */ + var h = t.lang.header, // Header translation + isBlinkFunction = function () { + return (window.chrome || (window.Intl && Intl.v8BreakIterator)) && 'CSS' in window; + }; + t.btnsDef = { + viewHTML: { + fn: 'toggle' + }, + + undo: { + isSupported: isBlinkFunction, + key: 'Z' + }, + redo: { + isSupported: isBlinkFunction, + key: 'Y' + }, + + p: { + fn: 'formatBlock' + }, + blockquote: { + fn: 'formatBlock' + }, + h1: { + fn: 'formatBlock', + title: h + ' 1' + }, + h2: { + fn: 'formatBlock', + title: h + ' 2' + }, + h3: { + fn: 'formatBlock', + title: h + ' 3' + }, + h4: { + fn: 'formatBlock', + title: h + ' 4' + }, + subscript: { + tag: 'sub' + }, + superscript: { + tag: 'sup' + }, + + bold: { + key: 'B', + tag: 'b' + }, + italic: { + key: 'I', + tag: 'i' + }, + underline: { + tag: 'u' + }, + strikethrough: { + tag: 'strike' + }, + + strong: { + fn: 'bold', + key: 'B' + }, + em: { + fn: 'italic', + key: 'I' + }, + del: { + fn: 'strikethrough' + }, + + createLink: { + key: 'K', + tag: 'a' + }, + unlink: {}, + + insertImage: {}, + + justifyLeft: { + tag: 'left', + forceCss: true + }, + justifyCenter: { + tag: 'center', + forceCss: true + }, + justifyRight: { + tag: 'right', + forceCss: true + }, + justifyFull: { + tag: 'justify', + forceCss: true + }, + + unorderedList: { + fn: 'insertUnorderedList', + tag: 'ul' + }, + orderedList: { + fn: 'insertOrderedList', + tag: 'ol' + }, + + horizontalRule: { + fn: 'insertHorizontalRule' + }, + + removeformat: {}, + + fullscreen: { + class: 'trumbowyg-not-disable' + }, + close: { + fn: 'destroy', + class: 'trumbowyg-not-disable' + }, + + // Dropdowns + formatting: { + dropdown: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4'], + ico: 'p' + }, + link: { + dropdown: ['createLink', 'unlink'] + } + }; + + // Defaults Options + t.o = $.extend(true, {}, $trumbowyg.defaultOptions, options); + if (!t.o.hasOwnProperty('imgDblClickHandler')) { + t.o.imgDblClickHandler = t.getDefaultImgDblClickHandler(); + } + + t.urlPrefix = t.setupUrlPrefix(); + + t.disabled = t.o.disabled || (editorElem.nodeName === 'TEXTAREA' && editorElem.disabled); + + if (options.btns) { + t.o.btns = options.btns; + } else if (!t.o.semantic) { + t.o.btns[3] = ['bold', 'italic', 'underline', 'strikethrough']; + } + + $.each(t.o.btnsDef, function (btnName, btnDef) { + t.addBtnDef(btnName, btnDef); + }); + + // put this here in the event it would be merged in with options + t.eventNamespace = 'trumbowyg-event'; + + // Keyboard shortcuts are load in this array + t.keys = []; + + // Tag to button dynamically hydrated + t.tagToButton = {}; + t.tagHandlers = []; + + // Admit multiple paste handlers + t.pasteHandlers = [].concat(t.o.pasteHandlers); + + // Check if browser is IE + t.isIE = (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') !== -1); + + t.init(); + }; + + Trumbowyg.prototype = { + DEFAULT_SEMANTIC_MAP: { + 'b': 'strong', + 'i': 'em', + 's': 'del', + 'strike': 'del', + 'div': 'p' + }, + + init: function () { + var t = this; + t.height = t.$ta.height(); + + t.initPlugins(); + + try { + // Disable image resize, try-catch for old IE + t.doc.execCommand('enableObjectResizing', false, false); + t.doc.execCommand('defaultParagraphSeparator', false, 'p'); + } catch (e) { + } + + t.buildEditor(); + t.buildBtnPane(); + + t.fixedBtnPaneEvents(); + + t.buildOverlay(); + + setTimeout(function () { + if (t.disabled) { + t.setDisabled(true); + } + t.$c.trigger('tbwinit'); + }); + }, + + addBtnDef: function (btnName, btnDef) { + this.btnsDef[btnName] = btnDef; + }, + + setupUrlPrefix: function () { + var protocol = this.o.urlProtocol; + if (!protocol) { + return; + } + + if (typeof(protocol) !== 'string') { + return 'https://'; + } + return /:\/\/$/.test(protocol) ? protocol : protocol + '://'; + }, + + buildEditor: function () { + var t = this, + prefix = t.o.prefix, + html = ''; + + t.$box = $('<div/>', { + class: prefix + 'box ' + prefix + 'editor-visible ' + prefix + t.o.lang + ' trumbowyg' + }); + + // $ta = Textarea + // $ed = Editor + t.isTextarea = t.$ta.is('textarea'); + if (t.isTextarea) { + html = t.$ta.val(); + t.$ed = $('<div/>'); + t.$box + .insertAfter(t.$ta) + .append(t.$ed, t.$ta); + } else { + t.$ed = t.$ta; + html = t.$ed.html(); + + t.$ta = $('<textarea/>', { + name: t.$ta.attr('id'), + height: t.height + }).val(html); + + t.$box + .insertAfter(t.$ed) + .append(t.$ta, t.$ed); + t.syncCode(); + } + + t.$ta + .addClass(prefix + 'textarea') + .attr('tabindex', -1) + ; + + t.$ed + .addClass(prefix + 'editor') + .attr({ + contenteditable: true, + dir: t.lang._dir || 'ltr' + }) + .html(html) + ; + + if (t.o.tabindex) { + t.$ed.attr('tabindex', t.o.tabindex); + } + + if (t.$c.is('[placeholder]')) { + t.$ed.attr('placeholder', t.$c.attr('placeholder')); + } + + if (t.$c.is('[spellcheck]')) { + t.$ed.attr('spellcheck', t.$c.attr('spellcheck')); + } + + if (t.o.resetCss) { + t.$ed.addClass(prefix + 'reset-css'); + } + + if (!t.o.autogrow) { + t.$ta.add(t.$ed).css({ + height: t.height + }); + } + + t.semanticCode(); + + if (t.o.autogrowOnEnter) { + t.$ed.addClass(prefix + 'autogrow-on-enter'); + } + + var ctrl = false, + composition = false, + debounceButtonPaneStatus, + updateEventName = 'keyup'; + + t.$ed + .on('dblclick', 'img', t.o.imgDblClickHandler) + .on('keydown', function (e) { + if ((e.ctrlKey || e.metaKey) && !e.altKey) { + ctrl = true; + var key = t.keys[String.fromCharCode(e.which).toUpperCase()]; + + try { + t.execCmd(key.fn, key.param); + return false; + } catch (c) { + } + } + }) + .on('compositionstart compositionupdate', function () { + composition = true; + }) + .on(updateEventName + ' compositionend', function (e) { + if (e.type === 'compositionend') { + composition = false; + } else if (composition) { + return; + } + + var keyCode = e.which; + + if (keyCode >= 37 && keyCode <= 40) { + return; + } + + if ((e.ctrlKey || e.metaKey) && (keyCode === 89 || keyCode === 90)) { + t.$c.trigger('tbwchange'); + } else if (!ctrl && keyCode !== 17) { + var compositionEndIE = t.isIE ? e.type === 'compositionend' : true; + t.semanticCode(false, compositionEndIE && keyCode === 13); + t.$c.trigger('tbwchange'); + } else if (typeof e.which === 'undefined') { + t.semanticCode(false, false, true); + } + + setTimeout(function () { + ctrl = false; + }, 50); + }) + .on('mouseup keydown keyup', function (e) { + if ((!e.ctrlKey && !e.metaKey) || e.altKey) { + setTimeout(function () { // "hold on" to the ctrl key for 50ms + ctrl = false; + }, 50); + } + clearTimeout(debounceButtonPaneStatus); + debounceButtonPaneStatus = setTimeout(function () { + t.updateButtonPaneStatus(); + }, 50); + }) + .on('focus blur', function (e) { + t.$c.trigger('tbw' + e.type); + if (e.type === 'blur') { + $('.' + prefix + 'active-button', t.$btnPane).removeClass(prefix + 'active-button ' + prefix + 'active'); + } + if (t.o.autogrowOnEnter) { + if (t.autogrowOnEnterDontClose) { + return; + } + if (e.type === 'focus') { + t.autogrowOnEnterWasFocused = true; + t.autogrowEditorOnEnter(); + } + else if (!t.o.autogrow) { + t.$ed.css({height: t.$ed.css('min-height')}); + t.$c.trigger('tbwresize'); + } + } + }) + .on('cut', function () { + setTimeout(function () { + t.semanticCode(false, true); + t.$c.trigger('tbwchange'); + }, 0); + }) + .on('paste', function (e) { + if (t.o.removeformatPasted) { + e.preventDefault(); + + if (window.getSelection && window.getSelection().deleteFromDocument) { + window.getSelection().deleteFromDocument(); + } + + try { + // IE + var text = window.clipboardData.getData('Text'); + + try { + // <= IE10 + t.doc.selection.createRange().pasteHTML(text); + } catch (c) { + // IE 11 + t.doc.getSelection().getRangeAt(0).insertNode(t.doc.createTextNode(text)); + } + t.$c.trigger('tbwchange', e); + } catch (d) { + // Not IE + t.execCmd('insertText', (e.originalEvent || e).clipboardData.getData('text/plain')); + } + } + + // Call pasteHandlers + $.each(t.pasteHandlers, function (i, pasteHandler) { + pasteHandler(e); + }); + + setTimeout(function () { + t.semanticCode(false, true); + t.$c.trigger('tbwpaste', e); + }, 0); + }); + + t.$ta + .on('keyup', function () { + t.$c.trigger('tbwchange'); + }) + .on('paste', function () { + setTimeout(function () { + t.$c.trigger('tbwchange'); + }, 0); + }); + + t.$box.on('keydown', function (e) { + if (e.which === 27 && $('.' + prefix + 'modal-box', t.$box).length === 1) { + t.closeModal(); + return false; + } + }); + }, + + //autogrow when entering logic + autogrowEditorOnEnter: function () { + var t = this; + t.$ed.removeClass('autogrow-on-enter'); + var oldHeight = t.$ed[0].clientHeight; + t.$ed.height('auto'); + var totalHeight = t.$ed[0].scrollHeight; + t.$ed.addClass('autogrow-on-enter'); + if (oldHeight !== totalHeight) { + t.$ed.height(oldHeight); + setTimeout(function () { + t.$ed.css({height: totalHeight}); + t.$c.trigger('tbwresize'); + }, 0); + } + }, + + + // Build button pane, use o.btns option + buildBtnPane: function () { + var t = this, + prefix = t.o.prefix; + + var $btnPane = t.$btnPane = $('<div/>', { + class: prefix + 'button-pane' + }); + + $.each(t.o.btns, function (i, btnGrp) { + if (!$.isArray(btnGrp)) { + btnGrp = [btnGrp]; + } + + var $btnGroup = $('<div/>', { + class: prefix + 'button-group ' + ((btnGrp.indexOf('fullscreen') >= 0) ? prefix + 'right' : '') + }); + $.each(btnGrp, function (i, btn) { + try { // Prevent buildBtn error + if (t.isSupportedBtn(btn)) { // It's a supported button + $btnGroup.append(t.buildBtn(btn)); + } + } catch (c) { + } + }); + + if ($btnGroup.html().trim().length > 0) { + $btnPane.append($btnGroup); + } + }); + + t.$box.prepend($btnPane); + }, + + + // Build a button and his action + buildBtn: function (btnName) { // btnName is name of the button + var t = this, + prefix = t.o.prefix, + btn = t.btnsDef[btnName], + isDropdown = btn.dropdown, + hasIcon = btn.hasIcon != null ? btn.hasIcon : true, + textDef = t.lang[btnName] || btnName, + + $btn = $('<button/>', { + type: 'button', + class: prefix + btnName + '-button ' + (btn.class || '') + (!hasIcon ? ' ' + prefix + 'textual-button' : ''), + html: t.hasSvg && hasIcon ? + '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' : + t.hideButtonTexts ? '' : (btn.text || btn.title || t.lang[btnName] || btnName), + title: (btn.title || btn.text || textDef) + ((btn.key) ? ' (Ctrl + ' + btn.key + ')' : ''), + tabindex: -1, + mousedown: function () { + if (!isDropdown || $('.' + btnName + '-' + prefix + 'dropdown', t.$box).is(':hidden')) { + $('body', t.doc).trigger('mousedown'); + } + + if ((t.$btnPane.hasClass(prefix + 'disable') || t.$box.hasClass(prefix + 'disabled')) && + !$(this).hasClass(prefix + 'active') && + !$(this).hasClass(prefix + 'not-disable')) { + return false; + } + + t.execCmd((isDropdown ? 'dropdown' : false) || btn.fn || btnName, btn.param || btnName, btn.forceCss); + + return false; + } + }); + + if (isDropdown) { + $btn.addClass(prefix + 'open-dropdown'); + var dropdownPrefix = prefix + 'dropdown', + dropdownOptions = { // the dropdown + class: dropdownPrefix + '-' + btnName + ' ' + dropdownPrefix + ' ' + prefix + 'fixed-top' + }; + dropdownOptions['data-' + dropdownPrefix] = btnName; + var $dropdown = $('<div/>', dropdownOptions); + $.each(isDropdown, function (i, def) { + if (t.btnsDef[def] && t.isSupportedBtn(def)) { + $dropdown.append(t.buildSubBtn(def)); + } + }); + t.$box.append($dropdown.hide()); + } else if (btn.key) { + t.keys[btn.key] = { + fn: btn.fn || btnName, + param: btn.param || btnName + }; + } + + if (!isDropdown) { + t.tagToButton[(btn.tag || btnName).toLowerCase()] = btnName; + } + + return $btn; + }, + // Build a button for dropdown menu + // @param n : name of the subbutton + buildSubBtn: function (btnName) { + var t = this, + prefix = t.o.prefix, + btn = t.btnsDef[btnName], + hasIcon = btn.hasIcon != null ? btn.hasIcon : true; + + if (btn.key) { + t.keys[btn.key] = { + fn: btn.fn || btnName, + param: btn.param || btnName + }; + } + + t.tagToButton[(btn.tag || btnName).toLowerCase()] = btnName; + + return $('<button/>', { + type: 'button', + class: prefix + btnName + '-dropdown-button' + (btn.ico ? ' ' + prefix + btn.ico + '-button' : ''), + html: t.hasSvg && hasIcon ? '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' + (btn.text || btn.title || t.lang[btnName] || btnName) : (btn.text || btn.title || t.lang[btnName] || btnName), + title: ((btn.key) ? ' (Ctrl + ' + btn.key + ')' : null), + style: btn.style || null, + mousedown: function () { + $('body', t.doc).trigger('mousedown'); + + t.execCmd(btn.fn || btnName, btn.param || btnName, btn.forceCss); + + return false; + } + }); + }, + // Check if button is supported + isSupportedBtn: function (b) { + try { + return this.btnsDef[b].isSupported(); + } catch (c) { + } + return true; + }, + + // Build overlay for modal box + buildOverlay: function () { + var t = this; + t.$overlay = $('<div/>', { + class: t.o.prefix + 'overlay' + }).appendTo(t.$box); + return t.$overlay; + }, + showOverlay: function () { + var t = this; + $(window).trigger('scroll'); + t.$overlay.fadeIn(200); + t.$box.addClass(t.o.prefix + 'box-blur'); + }, + hideOverlay: function () { + var t = this; + t.$overlay.fadeOut(50); + t.$box.removeClass(t.o.prefix + 'box-blur'); + }, + + // Management of fixed button pane + fixedBtnPaneEvents: function () { + var t = this, + fixedFullWidth = t.o.fixedFullWidth, + $box = t.$box; + + if (!t.o.fixedBtnPane) { + return; + } + + t.isFixed = false; + + $(window) + .on('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace, function () { + if (!$box) { + return; + } + + t.syncCode(); + + var scrollTop = $(window).scrollTop(), + offset = $box.offset().top + 1, + bp = t.$btnPane, + oh = bp.outerHeight() - 2; + + if ((scrollTop - offset > 0) && ((scrollTop - offset - t.height) < 0)) { + if (!t.isFixed) { + t.isFixed = true; + bp.css({ + position: 'fixed', + top: 0, + left: fixedFullWidth ? '0' : 'auto', + zIndex: 7 + }); + $([t.$ta, t.$ed]).css({marginTop: bp.height()}); + } + bp.css({ + width: fixedFullWidth ? '100%' : (($box.width() - 1) + 'px') + }); + + $('.' + t.o.prefix + 'fixed-top', $box).css({ + position: fixedFullWidth ? 'fixed' : 'absolute', + top: fixedFullWidth ? oh : oh + (scrollTop - offset) + 'px', + zIndex: 15 + }); + } else if (t.isFixed) { + t.isFixed = false; + bp.removeAttr('style'); + $([t.$ta, t.$ed]).css({marginTop: 0}); + $('.' + t.o.prefix + 'fixed-top', $box).css({ + position: 'absolute', + top: oh + }); + } + }); + }, + + // Disable editor + setDisabled: function (disable) { + var t = this, + prefix = t.o.prefix; + + t.disabled = disable; + + if (disable) { + t.$ta.attr('disabled', true); + } else { + t.$ta.removeAttr('disabled'); + } + t.$box.toggleClass(prefix + 'disabled', disable); + t.$ed.attr('contenteditable', !disable); + }, + + // Destroy the editor + destroy: function () { + var t = this, + prefix = t.o.prefix; + + if (t.isTextarea) { + t.$box.after( + t.$ta + .css({height: ''}) + .val(t.html()) + .removeClass(prefix + 'textarea') + .show() + ); + } else { + t.$box.after( + t.$ed + .css({height: ''}) + .removeClass(prefix + 'editor') + .removeAttr('contenteditable') + .removeAttr('dir') + .html(t.html()) + .show() + ); + } + + t.$ed.off('dblclick', 'img'); + + t.destroyPlugins(); + + t.$box.remove(); + t.$c.removeData('trumbowyg'); + $('body').removeClass(prefix + 'body-fullscreen'); + t.$c.trigger('tbwclose'); + $(window).off('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace); + }, + + + // Empty the editor + empty: function () { + this.$ta.val(''); + this.syncCode(true); + }, + + + // Function call when click on viewHTML button + toggle: function () { + var t = this, + prefix = t.o.prefix; + + if (t.o.autogrowOnEnter) { + t.autogrowOnEnterDontClose = !t.$box.hasClass(prefix + 'editor-hidden'); + } + + t.semanticCode(false, true); + + setTimeout(function () { + t.doc.activeElement.blur(); + t.$box.toggleClass(prefix + 'editor-hidden ' + prefix + 'editor-visible'); + t.$btnPane.toggleClass(prefix + 'disable'); + $('.' + prefix + 'viewHTML-button', t.$btnPane).toggleClass(prefix + 'active'); + if (t.$box.hasClass(prefix + 'editor-visible')) { + t.$ta.attr('tabindex', -1); + } else { + t.$ta.removeAttr('tabindex'); + } + + if (t.o.autogrowOnEnter && !t.autogrowOnEnterDontClose) { + t.autogrowEditorOnEnter(); + } + }, 0); + }, + + // Open dropdown when click on a button which open that + dropdown: function (name) { + var t = this, + d = t.doc, + prefix = t.o.prefix, + $dropdown = $('[data-' + prefix + 'dropdown=' + name + ']', t.$box), + $btn = $('.' + prefix + name + '-button', t.$btnPane), + show = $dropdown.is(':hidden'); + + $('body', d).trigger('mousedown'); + + if (show) { + var o = $btn.offset().left; + $btn.addClass(prefix + 'active'); + + $dropdown.css({ + position: 'absolute', + top: $btn.offset().top - t.$btnPane.offset().top + $btn.outerHeight(), + left: (t.o.fixedFullWidth && t.isFixed) ? o + 'px' : (o - t.$btnPane.offset().left) + 'px' + }).show(); + + $(window).trigger('scroll'); + + $('body', d).on('mousedown.' + t.eventNamespace, function (e) { + if (!$dropdown.is(e.target)) { + $('.' + prefix + 'dropdown', t.$box).hide(); + $('.' + prefix + 'active', t.$btnPane).removeClass(prefix + 'active'); + $('body', d).off('mousedown.' + t.eventNamespace); + } + }); + } + }, + + + // HTML Code management + html: function (html) { + var t = this; + + if (html != null) { + t.$ta.val(html); + t.syncCode(true); + t.$c.trigger('tbwchange'); + return t; + } + + return t.$ta.val(); + }, + syncTextarea: function () { + var t = this; + t.$ta.val(t.$ed.text().trim().length > 0 || t.$ed.find('hr,img,embed,iframe,input').length > 0 ? t.$ed.html() : ''); + }, + syncCode: function (force) { + var t = this; + if (!force && t.$ed.is(':visible')) { + t.syncTextarea(); + } else { + // wrap the content in a div it's easier to get the innerhtml + var html = $('<div>').html(t.$ta.val()); + //scrub the html before loading into the doc + var safe = $('<div>').append(html); + $(t.o.tagsToRemove.join(','), safe).remove(); + t.$ed.html(safe.contents().html()); + } + + if (t.o.autogrow) { + t.height = t.$ed.height(); + if (t.height !== t.$ta.css('height')) { + t.$ta.css({height: t.height}); + t.$c.trigger('tbwresize'); + } + } + if (t.o.autogrowOnEnter) { + // t.autogrowEditorOnEnter(); + t.$ed.height('auto'); + var totalheight = t.autogrowOnEnterWasFocused ? t.$ed[0].scrollHeight : t.$ed.css('min-height'); + if (totalheight !== t.$ta.css('height')) { + t.$ed.css({height: totalheight}); + t.$c.trigger('tbwresize'); + } + } + }, + + // Analyse and update to semantic code + // @param force : force to sync code from textarea + // @param full : wrap text nodes in <p> + // @param keepRange : leave selection range as it is + semanticCode: function (force, full, keepRange) { + var t = this; + t.saveRange(); + t.syncCode(force); + + if (t.o.semantic) { + t.semanticTag('b'); + t.semanticTag('i'); + t.semanticTag('s'); + t.semanticTag('strike'); + + if (full) { + var inlineElementsSelector = t.o.inlineElementsSelector, + blockElementsSelector = ':not(' + inlineElementsSelector + ')'; + + // Wrap text nodes in span for easier processing + t.$ed.contents().filter(function () { + return this.nodeType === 3 && this.nodeValue.trim().length > 0; + }).wrap('<span data-tbw/>'); + + // Wrap groups of inline elements in paragraphs (recursive) + var wrapInlinesInParagraphsFrom = function ($from) { + if ($from.length !== 0) { + var $finalParagraph = $from.nextUntil(blockElementsSelector).addBack().wrapAll('<p/>').parent(), + $nextElement = $finalParagraph.nextAll(inlineElementsSelector).first(); + $finalParagraph.next('br').remove(); + wrapInlinesInParagraphsFrom($nextElement); + } + }; + wrapInlinesInParagraphsFrom(t.$ed.children(inlineElementsSelector).first()); + + t.semanticTag('div', true); + + // Unwrap paragraphs content, containing nothing usefull + t.$ed.find('p').filter(function () { + // Don't remove currently being edited element + if (t.range && this === t.range.startContainer) { + return false; + } + return $(this).text().trim().length === 0 && $(this).children().not('br,span').length === 0; + }).contents().unwrap(); + + // Get rid of temporial span's + $('[data-tbw]', t.$ed).contents().unwrap(); + + // Remove empty <p> + t.$ed.find('p:empty').remove(); + } + + if (!keepRange) { + t.restoreRange(); + } + + t.syncTextarea(); + } + }, + + semanticTag: function (oldTag, copyAttributes) { + var newTag; + + if (this.o.semantic != null && typeof this.o.semantic === 'object' && this.o.semantic.hasOwnProperty(oldTag)) { + newTag = this.o.semantic[oldTag]; + } else if (this.o.semantic === true && this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(oldTag)) { + newTag = this.DEFAULT_SEMANTIC_MAP[oldTag]; + } else { + return; + } + + $(oldTag, this.$ed).each(function () { + var $oldTag = $(this); + $oldTag.wrap('<' + newTag + '/>'); + if (copyAttributes) { + $.each($oldTag.prop('attributes'), function () { + $oldTag.parent().attr(this.name, this.value); + }); + } + $oldTag.contents().unwrap(); + }); + }, + + // Function call when user click on "Insert Link" + createLink: function () { + var t = this, + documentSelection = t.doc.getSelection(), + node = documentSelection.focusNode, + text = new XMLSerializer().serializeToString(documentSelection.getRangeAt(0).cloneContents()), + url, + title, + target; + + while (['A', 'DIV'].indexOf(node.nodeName) < 0) { + node = node.parentNode; + } + + if (node && node.nodeName === 'A') { + var $a = $(node); + text = $a.text(); + url = $a.attr('href'); + if (!t.o.minimalLinks) { + title = $a.attr('title'); + target = $a.attr('target'); + } + var range = t.doc.createRange(); + range.selectNode(node); + documentSelection.removeAllRanges(); + documentSelection.addRange(range); + } + + t.saveRange(); + + var options = { + url: { + label: 'URL', + required: true, + value: url + }, + text: { + label: t.lang.text, + value: text + } + }; + if (!t.o.minimalLinks) { + Object.assign(options, { + title: { + label: t.lang.title, + value: title + }, + target: { + label: t.lang.target, + value: target + } + }); + } + + t.openModalInsert(t.lang.createLink, options, function (v) { // v is value + var url = t.prependUrlPrefix(v.url); + if (!url.length) { + return false; + } + + var link = $(['<a href="', v.url, '">', v.text || v.url, '</a>'].join('')); + + if (!t.o.minimalLinks) { + if (v.title.length > 0) { + link.attr('title', v.title); + } + if (v.target.length > 0) { + link.attr('target', v.target); + } + } + t.range.deleteContents(); + t.range.insertNode(link[0]); + t.syncCode(); + t.$c.trigger('tbwchange'); + return true; + }); + }, + prependUrlPrefix: function (url) { + var t = this; + if (!t.urlPrefix) { + return url; + } + + const VALID_LINK_PREFIX = /^([a-z][-+.a-z0-9]*:|\/|#)/i; + if (VALID_LINK_PREFIX.test(url)) { + return url; + } + + const SIMPLE_EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + if (SIMPLE_EMAIL_REGEX.test(url)) { + return 'mailto:' + url; + } + + return t.urlPrefix + url; + }, + unlink: function () { + var t = this, + documentSelection = t.doc.getSelection(), + node = documentSelection.focusNode; + + if (documentSelection.isCollapsed) { + while (['A', 'DIV'].indexOf(node.nodeName) < 0) { + node = node.parentNode; + } + + if (node && node.nodeName === 'A') { + var range = t.doc.createRange(); + range.selectNode(node); + documentSelection.removeAllRanges(); + documentSelection.addRange(range); + } + } + t.execCmd('unlink', undefined, undefined, true); + }, + insertImage: function () { + var t = this; + t.saveRange(); + + var options = { + url: { + label: 'URL', + required: true + }, + alt: { + label: t.lang.description, + value: t.getRangeText() + } + }; + + if (t.o.imageWidthModalEdit) { + options.width = {}; + } + + t.openModalInsert(t.lang.insertImage, options, function (v) { // v are values + t.execCmd('insertImage', v.url); + var $img = $('img[src="' + v.url + '"]:not([alt])', t.$box); + $img.attr('alt', v.alt); + + if (t.o.imageWidthModalEdit) { + $img.attr({ + width: v.width + }); + } + + t.syncCode(); + t.$c.trigger('tbwchange'); + + return true; + }); + }, + fullscreen: function () { + var t = this, + prefix = t.o.prefix, + fullscreenCssClass = prefix + 'fullscreen', + isFullscreen; + + t.$box.toggleClass(fullscreenCssClass); + isFullscreen = t.$box.hasClass(fullscreenCssClass); + $('body').toggleClass(prefix + 'body-fullscreen', isFullscreen); + $(window).trigger('scroll'); + t.$c.trigger('tbw' + (isFullscreen ? 'open' : 'close') + 'fullscreen'); + }, + + + /* + * Call method of trumbowyg if exist + * else try to call anonymous function + * and finaly native execCommand + */ + execCmd: function (cmd, param, forceCss, skipTrumbowyg) { + var t = this; + skipTrumbowyg = !!skipTrumbowyg || ''; + + if (cmd !== 'dropdown') { + t.$ed.focus(); + } + + try { + t.doc.execCommand('styleWithCSS', false, forceCss || false); + } catch (c) { + } + + try { + t[cmd + skipTrumbowyg](param); + } catch (c) { + try { + cmd(param); + } catch (e2) { + if (cmd === 'insertHorizontalRule') { + param = undefined; + } else if (cmd === 'formatBlock' && t.isIE) { + param = '<' + param + '>'; + } + + t.doc.execCommand(cmd, false, param); + + t.syncCode(); + t.semanticCode(false, true); + } + + if (cmd !== 'dropdown') { + t.updateButtonPaneStatus(); + t.$c.trigger('tbwchange'); + } + } + }, + + + // Open a modal box + openModal: function (title, content) { + var t = this, + prefix = t.o.prefix; + + // No open a modal box when exist other modal box + if ($('.' + prefix + 'modal-box', t.$box).length > 0) { + return false; + } + if (t.o.autogrowOnEnter) { + t.autogrowOnEnterDontClose = true; + } + + t.saveRange(); + t.showOverlay(); + + // Disable all btnPane btns + t.$btnPane.addClass(prefix + 'disable'); + + // Build out of ModalBox, it's the mask for animations + var $modal = $('<div/>', { + class: prefix + 'modal ' + prefix + 'fixed-top' + }).css({ + top: t.$btnPane.height() + }).appendTo(t.$box); + + // Click on overlay close modal by cancelling them + t.$overlay.one('click', function () { + $modal.trigger(CANCEL_EVENT); + return false; + }); + + // Build the form + var $form = $('<form/>', { + action: '', + html: content + }) + .on('submit', function () { + $modal.trigger(CONFIRM_EVENT); + return false; + }) + .on('reset', function () { + $modal.trigger(CANCEL_EVENT); + return false; + }) + .on('submit reset', function () { + if (t.o.autogrowOnEnter) { + t.autogrowOnEnterDontClose = false; + } + }); + + + // Build ModalBox and animate to show them + var $box = $('<div/>', { + class: prefix + 'modal-box', + html: $form + }) + .css({ + top: '-' + t.$btnPane.outerHeight() + 'px', + opacity: 0 + }) + .appendTo($modal) + .animate({ + top: 0, + opacity: 1 + }, 100); + + + // Append title + $('<span/>', { + text: title, + class: prefix + 'modal-title' + }).prependTo($box); + + $modal.height($box.outerHeight() + 10); + + + // Focus in modal box + $('input:first', $box).focus(); + + + // Append Confirm and Cancel buttons + t.buildModalBtn('submit', $box); + t.buildModalBtn('reset', $box); + + + $(window).trigger('scroll'); + + return $modal; + }, + // @param n is name of modal + buildModalBtn: function (n, $modal) { + var t = this, + prefix = t.o.prefix; + + return $('<button/>', { + class: prefix + 'modal-button ' + prefix + 'modal-' + n, + type: n, + text: t.lang[n] || n + }).appendTo($('form', $modal)); + }, + // close current modal box + closeModal: function () { + var t = this, + prefix = t.o.prefix; + + t.$btnPane.removeClass(prefix + 'disable'); + t.$overlay.off(); + + // Find the modal box + var $modalBox = $('.' + prefix + 'modal-box', t.$box); + + $modalBox.animate({ + top: '-' + $modalBox.height() + }, 100, function () { + $modalBox.parent().remove(); + t.hideOverlay(); + }); + + t.restoreRange(); + }, + // Preformated build and management modal + openModalInsert: function (title, fields, cmd) { + var t = this, + prefix = t.o.prefix, + lg = t.lang, + html = ''; + + $.each(fields, function (fieldName, field) { + var l = field.label || fieldName, + n = field.name || fieldName, + a = field.attributes || {}; + + var attr = Object.keys(a).map(function (prop) { + return prop + '="' + a[prop] + '"'; + }).join(' '); + + html += '<label><input type="' + (field.type || 'text') + '" name="' + n + '"' + + (field.type === 'checkbox' && field.value ? ' checked="checked"' : ' value="' + (field.value || '').replace(/"/g, '&quot;')) + + '"' + attr + '><span class="' + prefix + 'input-infos"><span>' + + (lg[l] ? lg[l] : l) + + '</span></span></label>'; + }); + + return t.openModal(title, html) + .on(CONFIRM_EVENT, function () { + var $form = $('form', $(this)), + valid = true, + values = {}; + + $.each(fields, function (fieldName, field) { + var n = field.name || fieldName; + + var $field = $('input[name="' + n + '"]', $form), + inputType = $field.attr('type'); + + switch (inputType.toLowerCase()) { + case 'checkbox': + values[n] = $field.is(':checked'); + break; + case 'radio': + values[n] = $field.filter(':checked').val(); + break; + default: + values[n] = $.trim($field.val()); + break; + } + // Validate value + if (field.required && values[n] === '') { + valid = false; + t.addErrorOnModalField($field, t.lang.required); + } else if (field.pattern && !field.pattern.test(values[n])) { + valid = false; + t.addErrorOnModalField($field, field.patternError); + } + }); + + if (valid) { + t.restoreRange(); + + if (cmd(values, fields)) { + t.syncCode(); + t.$c.trigger('tbwchange'); + t.closeModal(); + $(this).off(CONFIRM_EVENT); + } + } + }) + .one(CANCEL_EVENT, function () { + $(this).off(CONFIRM_EVENT); + t.closeModal(); + }); + }, + addErrorOnModalField: function ($field, err) { + var prefix = this.o.prefix, + $label = $field.parent(); + + $field + .on('change keyup', function () { + $label.removeClass(prefix + 'input-error'); + }); + + $label + .addClass(prefix + 'input-error') + .find('input+span') + .append( + $('<span/>', { + class: prefix + 'msg-error', + text: err + }) + ); + }, + + getDefaultImgDblClickHandler: function () { + var t = this; + + return function () { + var $img = $(this), + src = $img.attr('src'), + base64 = '(Base64)'; + + if (src.indexOf('data:image') === 0) { + src = base64; + } + + var options = { + url: { + label: 'URL', + value: src, + required: true + }, + alt: { + label: t.lang.description, + value: $img.attr('alt') + } + }; + + if (t.o.imageWidthModalEdit) { + options.width = { + value: $img.attr('width') ? $img.attr('width') : '' + }; + } + + t.openModalInsert(t.lang.insertImage, options, function (v) { + if (v.src !== base64) { + $img.attr({ + src: v.url + }); + } + $img.attr({ + alt: v.alt + }); + + if (t.o.imageWidthModalEdit) { + if (parseInt(v.width) > 0) { + $img.attr({ + width: v.width + }); + } else { + $img.removeAttr('width'); + } + } + + return true; + }); + return false; + }; + }, + + // Range management + saveRange: function () { + var t = this, + documentSelection = t.doc.getSelection(); + + t.range = null; + + if (documentSelection.rangeCount) { + var savedRange = t.range = documentSelection.getRangeAt(0), + range = t.doc.createRange(), + rangeStart; + range.selectNodeContents(t.$ed[0]); + range.setEnd(savedRange.startContainer, savedRange.startOffset); + rangeStart = (range + '').length; + t.metaRange = { + start: rangeStart, + end: rangeStart + (savedRange + '').length + }; + } + }, + restoreRange: function () { + var t = this, + metaRange = t.metaRange, + savedRange = t.range, + documentSelection = t.doc.getSelection(), + range; + + if (!savedRange) { + return; + } + + if (metaRange && metaRange.start !== metaRange.end) { // Algorithm from http://jsfiddle.net/WeWy7/3/ + var charIndex = 0, + nodeStack = [t.$ed[0]], + node, + foundStart = false, + stop = false; + + range = t.doc.createRange(); + + while (!stop && (node = nodeStack.pop())) { + if (node.nodeType === 3) { + var nextCharIndex = charIndex + node.length; + if (!foundStart && metaRange.start >= charIndex && metaRange.start <= nextCharIndex) { + range.setStart(node, metaRange.start - charIndex); + foundStart = true; + } + if (foundStart && metaRange.end >= charIndex && metaRange.end <= nextCharIndex) { + range.setEnd(node, metaRange.end - charIndex); + stop = true; + } + charIndex = nextCharIndex; + } else { + var cn = node.childNodes, + i = cn.length; + + while (i > 0) { + i -= 1; + nodeStack.push(cn[i]); + } + } + } + } + + documentSelection.removeAllRanges(); + documentSelection.addRange(range || savedRange); + }, + getRangeText: function () { + return this.range + ''; + }, + + updateButtonPaneStatus: function () { + var t = this, + prefix = t.o.prefix, + tags = t.getTagsRecursive(t.doc.getSelection().focusNode), + activeClasses = prefix + 'active-button ' + prefix + 'active'; + + $('.' + prefix + 'active-button', t.$btnPane).removeClass(activeClasses); + $.each(tags, function (i, tag) { + var btnName = t.tagToButton[tag.toLowerCase()], + $btn = $('.' + prefix + btnName + '-button', t.$btnPane); + + if ($btn.length > 0) { + $btn.addClass(activeClasses); + } else { + try { + $btn = $('.' + prefix + 'dropdown .' + prefix + btnName + '-dropdown-button', t.$box); + var dropdownBtnName = $btn.parent().data('dropdown'); + $('.' + prefix + dropdownBtnName + '-button', t.$box).addClass(activeClasses); + } catch (e) { + } + } + }); + }, + getTagsRecursive: function (element, tags) { + var t = this; + tags = tags || (element && element.tagName ? [element.tagName] : []); + + if (element && element.parentNode) { + element = element.parentNode; + } else { + return tags; + } + + var tag = element.tagName; + if (tag === 'DIV') { + return tags; + } + if (tag === 'P' && element.style.textAlign !== '') { + tags.push(element.style.textAlign); + } + + $.each(t.tagHandlers, function (i, tagHandler) { + tags = tags.concat(tagHandler(element, t)); + }); + + tags.push(tag); + + return t.getTagsRecursive(element, tags).filter(function (tag) { + return tag != null; + }); + }, + + // Plugins + initPlugins: function () { + var t = this; + t.loadedPlugins = []; + $.each($.trumbowyg.plugins, function (name, plugin) { + if (!plugin.shouldInit || plugin.shouldInit(t)) { + plugin.init(t); + if (plugin.tagHandler) { + t.tagHandlers.push(plugin.tagHandler); + } + t.loadedPlugins.push(plugin); + } + }); + }, + destroyPlugins: function () { + $.each(this.loadedPlugins, function (i, plugin) { + if (plugin.destroy) { + plugin.destroy(); + } + }); + } + }; +})(navigator, window, document, jQuery); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/openrat/init.min.js */ + +// Create own namespace. + +window.Openrat = {}; +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/openrat/view.min.js */ +/** + * View. + * A view is a part of the page. An Action is loaded into this view. + * + * @param action + * @param method + * @param id + * @param params + * @constructor + */ +Openrat.View = function( action,method,id,params ) { + + this.action = action; + this.method = method; + this.id = id; + this.params = params; + + this.before = function() {}; + + this.start = function( element ) { + this.before(); + this.element = element; + this.loadView(); + } + + this.afterLoad = function() { + + } + + this.close = function() { + } + + + function registerViewEvents(element) { + + Openrat.Workbench.afterViewLoadedHandler.fire( element ); + + let f = $(element).data('afterViewLoaded'); + if ( f instanceof Function) + f(element); + } + + + this.loadView = function() { + + let url = Openrat.View.createUrl( this.action,this.method,this.id,this.params,false); // URL für das Laden erzeugen. + let element = this.element; + let view = this; + + let loadViewHtmlPromise = $.ajax( url ); + + $(this.element).addClass('loader'); + + loadViewHtmlPromise.done( function(data,status){ + + if ( ! data ) + data = ''; + + $(element).html(data).removeClass("loader"); + + $(element).find('form').each( function() { + let form = new Openrat.Form(); + form.close = function() { + view.close(); + } + form.initOnElement(this); + + }); + + registerViewEvents( element ); + } ); + + loadViewHtmlPromise.fail( function(jqxhr,status,cause) { + $(element).html(""); + + Openrat.Workbench.notify('','','error','Server Error',['Server Error while requesting url '+url, status]); + }); + + // Load the data for this view. + let apiUrl = Openrat.View.createUrl( this.action,this.method,this.id,this.params,true); + //let loadViewApiPromise = $.getJSON( apiUrl ); + + loadViewHtmlPromise.done( function() { + + //loadViewApiPromise.done( function(data,status){ + // Data binding. + //} ); + } ); + + //loadViewApiPromise.fail( function(jqxhr,status,cause) { + // Openrat.Workbench.notify('','','error','Server Error',['Server Error while requesting url '+apiUrl, status]); + //}); + } + + + + + /** + * Erzeugt eine URL, um die gewünschte Action vom Server zu laden. + * + * @param action + * @param subaction + * @param id + * @param extraid + * @returns URL + */ + Openrat.View.createUrl = function(action,subaction,id,extraid={},api=false ) + { + let url = './'; + + if ( api ) + url += 'api/'; + + url += '?'; + + if(action) + url += '&action='+action; + if(subaction) + url += '&subaction='+subaction; + if(id) + url += '&id='+id; + + if ( typeof extraid === 'string') + { + extraid = extraid.replace(/'/g,'"'); // Replace ' with ". + let extraObject = jQuery.parseJSON(extraid); + jQuery.each(extraObject, function(name, value) { + url = url + '&' + name + '=' + value; + }); + } + else if ( typeof extraid === 'object') + { + jQuery.each(extraid, function(name, field) { + url = url + '&' + name + '=' + field; + }); + } + else + { + } + return url; + } + + +} +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/openrat/form.min.js */ + +/** + * Form. + * + * @constructor + */ +Openrat.Form = function() { + + const modes = { + showBrowserNotice : 1, + keepOpen : 2, + closeAfterSubmit : 4, + closeAfterSuccess : 8, + }; + + this.setLoadStatus = function( isLoading ) { + $(this.element).closest('div.content').toggleClass('loader',isLoading); + } + + this.initOnElement = function( element ) { + this.element = element; + + let form = this; + + // Autosave in Formularen. + // Bei Veränderungen von Checkboxen wird das Formular sofort abgeschickt. + if ( $(this.element).data('autosave') ) { + + $(this.element).find('input[type="checkbox"]').click( function() { + form.submit(modes.keepOpen); + }); + $(this.element).find('select').change( function() { + form.submit(modes.keepOpen); + }); + } + + // After click to "OK" the form is submitted. + // Why this?? input type=submit will submit! + /* + $(event.target).find('input.submit.ok').click( function() { + $(this).closest('form').submit(); + }); + */ + + $(element).find('.or-form-btn--cancel').click( function() { + form.cancel(); + + }); + $(element).find('.or-form-btn--reset').click( function() { + form.rollback(); + + }); + $(element).find('.or-form-btn--apply').click( function() { + form.submit(modes.keepOpen); + }); + + // Submithandler for the whole form. + $(element).submit( function( event ) { + + // + if ($(this).data('target')=='view') + { + form.submit(); + event.preventDefault(); + } + // target=top will load the native way without javascript. + }); + } + + this.cancel = function() { + //$(this.element).html('').parent().removeClass('is-open'); + this.close(); + } + + + this.rollback = function() { + this.element.trigger('reset'); + } + + this.close = function() { + + } + + this.forwardTo = function (action, subaction, id, data) { + + let view = new Openrat.View( action, subaction, id, data ); + view.start( $(this.element).closest('.view') ); + } + + this.submit = function( mode ) { + + if ( mode === undefined ) + if ( $(this.element).data('async') ) + mode = modes.closeAfterSubmit; + else + mode = modes.closeAfterSuccess; + + + // Show progress + let status = $('<div class="notice info"><div class="text loader"></div></div>'); + $('#noticebar').prepend(status); // Notice anhängen. + $(status).show(); + + // Alle vorhandenen Error-Marker entfernen. + // Falls wieder ein Fehler auftritt, werden diese erneut gesetzt. + $(this.element).find('.error').removeClass('error'); + + let params = $(this.element).serializeArray(); + let data = {}; + $(params).each(function(index, obj){ + data[obj.name] = obj.value; + }); + + // If form does not contain action/id, get it from the workbench. + if (!data.id) + data.id = Openrat.Workbench.state.id; + if (!data.action) + data.action = Openrat.Workbench.state.action; + + let formMethod = $(this.element).attr('method').toUpperCase(); + + if ( formMethod == 'GET' ) + { + // Mehrseitiges Formular + // Die eingegebenen Formulardaten werden zur nächsten Action geschickt. + this.forwardTo( data.action, data.subaction,data.id,data ); + $(status).remove(); + } + else + { + let url = './api/'; // Alle Parameter befinden sich im Formular + + // POST-Request + this.setLoadStatus(true); + //url += '?output=json'; + url += ''; + //params['output'] = 'json';// Irgendwie geht das nicht. + data.output = 'json'; + + if ( mode == modes.closeAfterSubmit ) + this.close(); + // Async: Window is closed, but the action will be startet now. + + let form = this; + $.ajax( { 'type':'POST',url:url, data:data, success:function(data, textStatus, jqXHR) + { + form.setLoadStatus(false); + $(status).remove(); + + form.doResponse(data,textStatus,form.element, function() { + + // The data was successful saved. + // Now we can close the form. + if ( mode == modes.closeAfterSuccess ) + { + form.close(); + + // clear the dirty flag. + $(form.element).closest('div.panel').find('div.header ul.views li.action.active').removeClass('dirty'); + } + + let afterSuccess = $(form.element).data('afterSuccess'); + let async = $(form.element).data('async' ); + if ( afterSuccess ) + { + if ( afterSuccess == 'reloadAll' ) + { + Openrat.Workbench.reloadAll(); + } + } else { + if ( async ) + ; // do not reload + else + Openrat.Workbench.reloadViews(); + } + + }); + }, + error:function(jqXHR, textStatus, errorThrown) { + form.setLoadStatus(false); + $(status).remove(); + + try + { + let error = jQuery.parseJSON( jqXHR.responseText ); + Openrat.Workbench.notify('','','error',error.error,[error.description]); + } + catch( e ) + { + let msg = jqXHR.responseText; + Openrat.Workbench.notify('','','error','Server Error',[msg]); + } + + + } + + } ); + $(form.element).fadeIn(); + } + + } + + + + /** + * HTTP-Antwort auf einen POST-Request auswerten. + * + * @param data Formulardaten + * @param status Status + * @param element + */ + this.doResponse = function(data,status,element, onSuccess = $.noop ) + { + if ( status != 'success' ) + { + alert('Server error: ' + status); + return; + } + + let form = this; + // Hinweismeldungen in Statuszeile anzeigen + $.each(data['notices'], function(idx,value) { + + // Bei asynchronen Requests wird zusätzlich eine Browser-Notice erzeugt, da der + // Benutzer bei länger laufenden Aktionen vielleicht das Tab oder Fenster + // gewechselt hat. + let notifyBrowser = $(element).data('async'); + + Openrat.Workbench.notify(value.type, value.name, value.status, value.text, value.log, notifyBrowser ); // Notice anhängen. + + if ( value.status == 'ok' ) // Kein Fehler? + { + onSuccess(); + Openrat.Workbench.dataChangedHandler.fire(); + } + else + // Server liefert Fehler zurück. + { + } + }); + + // Felder mit Fehleingaben markieren, ggf. das übergeordnete Fieldset aktivieren. + $.each(data['errors'], function(idx,value) { + $('input[name='+value+']').addClass('error').parent().addClass('error').parents('fieldset').addClass('show').addClass('open'); + }); + + // Jetzt das erhaltene Dokument auswerten. + + + if ( data.control.redirect ) + // Redirect + window.location.href = data.control.redirect; + } + + + + +} + +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/openrat/workbench.min.js */ + + +Openrat.Workbench = new function() +{ + 'use strict'; // Strict mode + + + this.state = {}; + + + /** + * Initializes the Workbench. + */ + this.initialize = function() { + + // Initialze Ping timer. + this.initializePingTimer(); + this.initializeState(); + this.openModalDialog(); + } + + + /** + * Starts a dialog, if necessary. + */ + this.openModalDialog = function () { + + if ( $('#dialog').data('action') ) { + startDialog('',$('#dialog').data('action'),$('#dialog').data('action'),0,{}) + } + } + + + /** + * Sets the workbench state with action/id. + * + * Example: #/name/1 is translated to the state {action:name,id:1} + */ + this.initializeState = function () { + + let parts = window.location.hash.split('/'); + let state = { action:'index',id:0 }; + + if ( parts.length >= 2 ) + state.action = parts[1].toLowerCase(); + + if ( parts.length >= 3 ) + // Only numbers and '_' allowed in the id. + state.id = parts[2].replace(/[^0-9_]/gim,""); + + Openrat.Workbench.state = state; + + // TODO: Remove this sometimes.... only state. + $('#editor').attr('data-action',state.action); + $('#editor').attr('data-id' ,state.id ); + $('#editor').attr('data-extra' ,'{}' ); + + Openrat.Navigator.toActualHistory( state ); + + } + + /** + * Registriert den Ping-Timer für den Sitzungserhalt. + */ + this.initializePingTimer = function() { + + /** + * Ping den Server. Führt keine Aktion aus, aber sorgt dafür, dass die Sitzung erhalten bleibt. + * + * "Geben Sie mir ein Ping, Vasily. Und bitte nur ein einziges Ping!" (aus: Jagd auf Roter Oktober) + */ + let ping = function() + { + let pingPromise = $.getJSON( Openrat.View.createUrl('profile','ping',0, {}, true) ); + + pingPromise.fail( function() { + console.warn('The server ping has failed.') + } ); + } + + // Alle 5 Minuten pingen. + let timeoutMinutes = 5; + + window.setInterval( ping, timeoutMinutes*60*1000 ); + } + + + + this.loadNewActionState = function(state) { + + Openrat.Workbench.state = state; + Openrat.Workbench.loadNewAction(state.action,state.id,state.data); + + this.afterNewActionHandler.fire(); + } + + + this.afterNewActionHandler = $.Callbacks(); + + + /** + * + */ + + this.loadNewAction = function(action, id, params ) { + + $('#editor').attr('data-action',action); + $('#editor').attr('data-id' ,id ); + $('#editor').attr('data-extra' ,JSON.stringify(params)); + + this.reloadViews(); + } + + + + /** + * + */ + + this.reloadViews = function() { + + // View in geschlossenen Sektionen löschen, damit diese nicht stehen bleiben. + $('#workbench section.closed .view-loader').empty(); + + Openrat.Workbench.loadViews( $('#workbench section.open .view-loader') ); + } + + + this.reloadAll = function() { + + // View in geschlossenen Sektionen löschen, damit diese nicht stehen bleiben. + $('#workbench .view').empty(); + + Openrat.Workbench.loadViews( $('#workbench .view.view-loader, #workbench .view.view-static') ); + + this.loadUserStyle(); + this.loadLanguage(); + this.loadUISettings(); + } + + + this.loadUserStyle = function() { + + let url = Openrat.View.createUrl('profile','userinfo',0, {},true ); + + // Die Inhalte des Zweiges laden. + $.getJSON(url, function (response) { + + let style = response.output['style']; + Openrat.Workbench.setUserStyle(style); + + let color = response.output['theme-color']; + Openrat.Workbench.setThemeColor(color); + }); + } + + + this.settings = {}; + this.language = {}; + + this.loadLanguage = function() { + + let url = Openrat.View.createUrl('profile','language',0, {},true ); + + // Die Inhalte des Zweiges laden. + $.getJSON(url, function (response) { + + Openrat.Workbench.language = response.output.language; + }); + } + + this.loadUISettings = function() { + + let url = Openrat.View.createUrl('profile','uisettings',0, {},true ); + + // Die Inhalte des Zweiges laden. + $.getJSON(url, function (response) { + + Openrat.Workbench.settings = response.output.settings.settings; + }); + } + + + + this.loadViews = function( $views ) + { + + $views.each(function (idx) { + + let $targetDOMElement = $(this); + + Openrat.Workbench.loadNewActionIntoElement( $targetDOMElement ) + }); + } + + + + this.loadNewActionIntoElement = function( $viewElement ) + { + let action; + if ( $viewElement.is('.view-static') ) + // Static views have always the same action. + action = $viewElement.attr('data-action'); + else + action = $('#editor').attr('data-action'); + + let id = $('#editor').attr('data-id' ); + let params = $('#editor').attr('data-extra' ); + + let method = $viewElement.data('method'); + + let view = new Openrat.View( action,method,id,params ); + view.start( $viewElement ); + } + + + + + /** + * Sets a new theme. + * @param styleName + */ + this.setUserStyle = function( styleName ) + { + var html = $('html'); + var classList = html.attr('class').split(/\s+/); + $.each(classList, function(index, item) { + if (item.startsWith('theme-')) { + html.removeClass(item); + } + }); + html.addClass( 'theme-' + styleName.toLowerCase() ); + } + + + /** + * Sets a new theme color. + * @param color Theme-color + */ + this.setThemeColor = function( color ) + { + $('#theme-color').attr('content',color); + } + + + + + /** + * Show a notification in the browser. + * Source: https://developer.mozilla.org/en-US/docs/Web/API/notification + * @param text text of message + */ + let notifyBrowser = function(text) + { + // Let's check if the browser supports notifications + if (!("Notification" in window)) { + return; + } + + // Let's check if the user is okay to get some notification + else if (Notification.permission === "granted") { + // If it's okay let's create a notification + let notification = new Notification(text); + } + + // Otherwise, we need to ask the user for permission + else if (Notification.permission !== 'denied') { + Notification.requestPermission(function (permission) { + // If the user is okay, let's create a notification + if (permission === "granted") { + let notification = new Notification(text); + } + }); + } + + // At last, if the user already denied any notification, and you + // want to be respectful there is no need to bother them any more. + } + + + + /** + * Show a notice bubble in the UI. + * @param type + * @param name + * @param status + * @param msg + * @param log + */ + this.notify = function( type,name,status,msg,log=[],notifyTheBrowser=false ) + { + // Notice-Bar mit dieser Meldung erweitern. + + if ( notifyTheBrowser ) + notifyBrowser( msg ); // Notify browser if wanted. + + let notice = $('<div class="notice '+status+'"></div>'); + + let toolbar = $('<div class="or-notice-toolbar"></div>'); + if ( log.length ) + $(toolbar).append('<i class="or-action-full image-icon image-icon--menu-fullscreen"></i>'); + $(toolbar).append('<i class="or-action-close image-icon image-icon--menu-close"></i>'); + $(notice).append(toolbar); + + let id = 0; // TODO id of objects to click on + if (name) + $(notice).append('<div class="name clickable"><a href="" data-type="open" data-action="'+type+'" data-id="'+id+'"><i class="or-action-full image-icon image-icon--action-'+type+'"></i> '+name+'</a></div>'); + + $(notice).append( '<div class="text">'+htmlEntities(msg)+'</div>'); + + if (log.length) { + + let logLi = log.reduce((result, item) => { + result += '<li><pre>'+htmlEntities(item)+'</pre></li>'; + return result; + }, ''); + $(notice).append('<div class="log"><ul>'+logLi+'</ul></div>'); + } + + $('#noticebar').prepend(notice); // Notice anhängen. + $(notice).orLinkify(); // Enable links + + + // Toogle Fullscreen for notice + $(notice).find('.or-action-full').click( function() { + $(notice).toggleClass('full'); + }); + + // Close the notice on click + $(notice).find('.or-action-close').click( function() { + $(notice).fadeOut('fast',function() { $(notice).remove(); } ); + }); + + // Fadeout the notice after a while. + let timeout = 1; + if ( status == 'ok' ) timeout = 20; + if ( status == 'info' ) timeout = 60; + if ( status == 'warning') timeout = 120; + if ( status == 'error' ) timeout = 120; + + if (timeout > 0) + setTimeout( function() { + $(notice).fadeOut('slow', function() { $(this).remove(); } ); + },timeout*1000 ); + } + + + + this.dataChangedHandler = $.Callbacks(); + + this.dataChangedHandler.add( function() { + if ( popupWindow !== undefined ) + popupWindow.location.reload(); + } ); + + this.afterViewLoadedHandler = $.Callbacks(); + + let afterViewFunctions = []; + + this.registerAfterViewLoaded = function( f ) { + afterViewFunctions.push( f ); + } + + this.afterViewLoaded = function( element ) { + + afterViewFunctions.forEach( function( f ) { + f(element); + }); + } + +} + + +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/openrat/navigator.min.js */ +/** + * Navigation. + */ +Openrat.Navigator = new function () { + 'use strict'; + + /** + * Navigiert zu einer Action. + */ + this.navigateTo = function(state) { + Openrat.Workbench.loadNewActionState(state); + } + + + /** + * + * Navigiert zu einer neue Action und fügt einen neuen History-Eintrag hinzu. + */ + this.navigateToNew = function(obj) { + + this.navigateTo(obj); + + window.history.pushState(obj,obj.name,this.createShortUrl(obj.action,obj.id) ); + } + + /** + * Setzt den State für den aktuellen History-Eintrag. + * @param obj + */ + this.toActualHistory = function(obj) { + window.history.replaceState(obj,obj.name,this.createShortUrl(obj.action,obj.id) ); + } + + + + this.createShortUrl = function(action,id) { + return './#/'+action+(id?'/'+id:''); + } + + +} +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/script/openrat/common.min.js */ + +// The crap in this file should be refactored into namespaced objects... + +var OR_THEMES_EXT_DIR = 'modules/cms-ui/themes/'; + +// Execute after DOM ready: +$( function() { + // JS is available. + $('html').removeClass('nojs'); + + /* Fade in all elements. */ + $('.initial-hidden').removeClass('initial-hidden'); + + + /** + * Registriert alle Events, die in der Workbench laufen sollen. + */ + function registerWorkbenchEvents() + { + // Modalen Dialog erzeugen. + + /* + if ( $('#workbench div.panel.modal').length > 0 ) + { + $('#workbench div.panel.modal').parent().addClass('modal'); + $('div#filler').fadeTo(500,0.5); + $('#workbench').addClass('modal'); + } + */ + + /** + * Schaltet die Vollbildfunktion an oder aus. + * + * @param element Das Element, auf dem die Vollbildfunktion ausgeführt wurde + */ + function fullscreen( element ) { + $(element).closest('div.panel').fadeOut('fast', function() + { + $(this).toggleClass('fullscreen').fadeIn('fast'); + } ); + } + + + $('div.header').dblclick( function() + { + fullscreen( this ); + } ); + } + + + registerWorkbenchEvents(); + + + // Listening to the "popstate" event: + window.onpopstate = function (ev) { + Openrat.Navigator.navigateTo(ev.state); + }; + + Openrat.Workbench.initialize(); + Openrat.Workbench.reloadAll(); + + let registerWorkbenchGlobalEvents = function() { + + // Binding aller Sondertasten. + $('.keystroke').each( function() { + let keystrokeElement = $(this); + let keystroke = keystrokeElement.text(); + if (keystroke.length == 0) + return; // No Keybinding. + let keyaction = function() { + keystrokeElement.click(); + }; + // Keybinding ausfuehren. + $(document).bind('keydown', keystroke, keyaction ); + } ); + + + + $('section.toggle-open-close .on-click-open-close').click(function () { + var section = $(this).closest('section'); + + // disabled sections are ignored. + if (section.hasClass('disabled')) + return; + + // if view is empty, lets load the content. + var view = section.find('div.view-loader'); + if (view.children().length == 0) + Openrat.Workbench.loadNewActionIntoElement(view); + }); + + } + + // Initial Notices + $('.or-initial-notice').each( function() { + Openrat.Workbench.notify('','','info',$(this).text()); + $(this).remove(); + }); + + registerWorkbenchGlobalEvents(); + + + let closeMenu = function() { + // Mit der Maus irgendwo hin geklickt, das Menü muss schließen. + $('body').click( function() { + $('.toolbar-icon.menu').parents('.or-menu').removeClass('open'); + }); + }; + closeMenu(); + + + + Openrat.Workbench.afterNewActionHandler.add( function() { + + let url = './api/?action=tree&subaction=path&id=' + Openrat.Workbench.state.id + '&type=' + Openrat.Workbench.state.action + '&output=json'; + + // Die Inhalte des Zweiges laden. + $.getJSON(url, function (json) { + + $('nav .or-navtree-node').removeClass('or-navtree-node--selected'); + + let output = json['output']; + $.each(output.path, function (idx, path) { + + $nav = $('nav .or-navtree-node[data-type='+path.type+'][data-id='+path.id+'].or-navtree-node--is-closed .or-navtree-node-control'); + $nav.click(); + }); + if ( output.actual ) + $('nav .or-navtree-node[data-type='+output.actual.type+'][data-id='+output.actual.id+']').addClass('or-navtree-node--selected'); + + let $breadcrumb = $('.or-breadcrumb').empty(); + let items = []; + $.each(output.path.concat(output.actual), function (idx, path) { + items.push( '<li class="or-breadcrumb-item clickable" tabindex="0"><a href="'+Openrat.Navigator.createShortUrl(path.action,path.id)+'" data-type="open" data-action="'+path.action+'" data-id="'+path.id+'"><i class="image-icon image-icon--action-'+path.action+'" />'+path.name+'</a></li>'); + }); + $breadcrumb.append( items.join('<li><i class="tree-icon image-icon image-icon--node-closed"></i></li>') ); + $('.or-breadcrumb .clickable').orLinkify(); + + }).fail(function (e) { + // Ups... aber was können wir hier schon tun, außer hässliche Meldungen anzeigen. + console.warn(e); + console.warn('failed to load path from '+url); + }).always(function () { + + }); + } ); + +}); + + + + +let filterMenus = function () +{ + let action = Openrat.Workbench.state.action; + let id = Openrat.Workbench.state.id; + $('div.clickable').addClass('active'); + $('div.clickable.filtered').removeClass('active').addClass('inactive'); + + $('div.clickable.filtered.on-action-'+action).addClass('active').removeClass('inactive'); + + // Jeder Menüeintrag bekommt die Id und Parameter. + $('div.clickable.filtered a').attr('data-id' ,id ); + /* + $('div.clickable.filtered a').attr('data-action',action); + */ + +} + + +$('#title.view').data('afterViewLoaded', function() { + filterMenus(); +} ); + +Openrat.Workbench.afterNewActionHandler.add( function() { + filterMenus(); +} ); + + + + + + +Openrat.Workbench.afterViewLoadedHandler.add( function(element) { + + // Refresh already opened popup windows. + if ( typeof popupWindow != "undefined" ) + $(element).find("a[data-type='popup']").each( function() { + popupWindow.location.href = $(this).attr('data-url'); + }); + +}); + + +/** + * Registriert alle Handler für den Inhalt einer View. + * + * @param viewEl DOM-Element der View + */ +Openrat.Workbench.afterViewLoadedHandler.add( function(viewEl ) { + + // Die Section deaktivieren, wenn die View keinen Inhalt hat. + var section = $(viewEl).closest('section'); + + //var viewHasContent = $(viewEl).children().length > 0; + //section.toggleClass('disabled',!viewHasContent); + section.toggleClass('is-empty',$(viewEl).is(':empty')); + if ( ! $(viewEl).is(':empty') ) + section.slideDown('fast'); + else + section.slideUp('fast'); + + // Untermenüpunkte aus der View in das Fenstermenü kopieren... + $(viewEl).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove(); // Alte Einträge löschen + + $(viewEl).find('.toggle-nav-open-close').click( function() { + $('nav').toggleClass('open'); + }); + + $(viewEl).find('.toggle-nav-small').click( function() { + $('nav').toggleClass('small'); + }); + + $(viewEl).find('div.headermenu > a').each( function(idx,el) + { + // Jeden Untermenüpunkt zum Fenstermenü hinzufügen. + + // Nein, Untermenüs erscheinen jetzt in der View selbst. + // $(el).wrap('<div class="entry clickable modal perview" />').parent().appendTo( $(viewEl).closest('div.panel').find('div.header div.dropdown').first() ); + } ); + + $(viewEl).find('div.header > a.back').each( function(idx,el) + { + // Zurück-Knopf zum Fenstermenü hinzufügen. + $(el).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo( $(viewEl).closest('div.panel').find('div.header div.dropdown').first() ); + } ); + //$(viewEl).find('div.header').html('<!-- moved to window-menu -->'); + +// $(viewEl).find('input,select,textarea').focus( function() { +// $(this).closest('div.panel').find('div.command').css('visibility','visible').fadeIn('slow'); +// }); + + + // Selectors (Einzel-Ausahl für Dateien) initialisieren + // Wurzel des Baums laden + $(viewEl).find('div.selector.tree').each( function() { + var selectorEl = this; + $(this).orTree( { type:'project',selectable:$(selectorEl).attr('data-types').split(','),id:$(selectorEl).attr('data-init-folderid'),onSelect:function(name,type,id) { + + var selector = $(selectorEl).parent(); + + //console.log( 'Selected: '+name+" #"+id ); + $(selector).find('input[type=text]' ).attr( 'value',name ); + $(selector).find('input[type=hidden]').attr( 'value',id ); + } }); + } ); + + + registerDragAndDrop(viewEl); + + + // Bei Änderungen in der View das Tab als 'dirty' markieren + $(viewEl).find('input').change( function() { + $(this).parent('div.view').addClass('dirty'); + }); + + // Theme-Auswahl mit Preview + $(viewEl).find('.or-theme-chooser').change( function() { + Openrat.Workbench.setUserStyle( this.value ); + }); + + + + + function registerMenuEvents($element ) + { + //$e = $($element); + + // Mit der Maus geklicktes Menü aktivieren. + $($element).find('.toolbar-icon.menu').click( function(event) { + event.stopPropagation(); + $(this).parents('.or-menu').toggleClass('open'); + }); + + // Mit der Maus überstrichenes Menü aktivieren. + $($element).find('.toolbar-icon.menu').mouseover( function() { + + // close other menus. + $(this).parents('.or-menu').find('.toolbar-icon.menu').removeClass('open'); + // open the mouse-overed menu. + $(this).addClass('open'); + }); + + } + + function registerGlobalSearch($element ) + { + $($element).find('.search input').orSearch( { + dropdown:'#title div.search div.dropdown', + select: function(obj) { + openNewAction( obj.name, obj.action, obj.id ); + } + } ); + + } + + function registerSelectorSearch( $element ) + { + $($element).find('.selector input').orSearch( { + dropdown: '.dropdown', + select: function(obj) { + $($element).find('.or-selector-link-value').val(obj.id ); + $($element).find('.or-selector-link-name' ).val(obj.name).attr('placeholder',obj.name); + } + } ); + + } + + + + function registerTree(element) { + + // Klick-Funktionen zum Öffnen/Schließen des Zweiges. + $(element).find('.or-navtree-node').orTree(); + + } + + + registerMenuEvents ( viewEl ); + registerGlobalSearch ( viewEl ); + registerSelectorSearch( viewEl ); + registerTree ( viewEl ); + + function registerDragAndDrop(viewEl) + { + + registerDraggable(viewEl); + registerDroppable(viewEl); + } + + registerDragAndDrop(viewEl); + + +} ); + + + +function registerDraggable(viewEl) { + +// Drag n Drop: Inhaltselemente (Dateien,Seiten,Ordner,Verknuepfungen) koennen auf Ordner gezogen werden. + + $(viewEl).find('.or-draggable').draggable( + { + helper: 'clone', + opacity: 0.7, + zIndex: 2, + distance: 10, + cursor: 'move', + revert: 'false' + } + ); + +} + +function registerTreeBranchEvents(viewEl) +{ + registerDraggable(viewEl); +} + + +function registerDroppable(viewEl) { + + + $(viewEl).find('.or-droppable').droppable({ + accept: '.or-draggable', + hoverClass: 'or-droppable--hover', + activeClass: 'or-droppable--active', + + drop: function (event, ui) { + + let dropped = ui.draggable; + + let id = dropped.data('id' ); + let name = dropped.data('name'); + if (!name) + name = id; + + $(this).find('.or-selector-link-value').val( id ); + $(this).find('.or-selector-link-name' ).val( name ).attr('placeholder',name ); + } + }); +} + + + + + + +/** + * Setzt neuen modalen Dialog und aktualisiert alle Fenster. + * @param name + * @param action Action + * @param method + * @param id Id + * @param params + */ +function startDialog( name,action,method,id,params ) +{ + // Attribute aus dem aktuellen Editor holen, falls die Daten beim Aufrufer nicht angegeben sind. + if (!action) + action = $('#editor').attr('data-action'); + + if (!id) + id = $('#editor').attr('data-id'); + + let view = new Openrat.View( action,method,id,params ); + + view.before = function() { + $('#dialog > .view').html('<div class="header"><img class="icon" title="" src="./themes/default/images/icon/'+method+'.png" />'+name+'</div>'); + $('#dialog > .view').data('id',id); + $('#dialog').removeClass('is-closed').addClass('is-open'); + + let view = this; + + this.escapeKeyClosingHandler = function (e) { + if (e.keyCode == 27) { // ESC keycode + view.close(); + + $(document).off('keyup'); // de-register. + } + }; + + $(document).keyup(this.escapeKeyClosingHandler); + + // Nicht-Modale Dialoge durch Klick auf freie Fläche schließen. + $('#dialog .filler').click( function() + { + view.close(); + }); + + } + + view.close = function() { + + // Strong modal dialogs are unable to close. + // Really? + if ( $('div#dialog').hasClass('modal') ) + return; + + $('#dialog .view').html(''); + $('#dialog').removeClass('is-open').addClass('is-closed'); // Dialog schließen + + $(document).unbind('keyup',this.escapeKeyClosingHandler); // Cleanup ESC-Key-Listener + } + + view.start( $('div#dialog > .view') ); +} + + + + +/** + * Setzt einen Fenster-Titel für die ganze Anwendung. + */ +function setTitle( title ) +{ + if ( title ) + $('head > title').text( title + ' - ' + $('head > title').data('default') ); + else + $('head > title').text( $('head > title').data('default') ); +} + + + +/** + * Setzt neue Action und aktualisiert alle Fenster. + * + * @param action Action + * @param id Id + */ +function openNewAction( name,action,id ) +{ + // Im Mobilmodus soll das Menü verschwinden, wenn eine neue Action geoeffnet wird. + $('nav').removeClass('open'); + + setTitle( name ); // Title setzen. + + Openrat.Navigator.navigateToNew( {'action':action, 'id':id } ); +} + + + + +//Quelle: +//http://aktuell.de.selfhtml.org/tippstricks/javascript/bbcode/ +function insert(tagName, aTag, eTag) +{ +var input = document.forms[0].elements[tagName]; +input.focus(); +/* IE */ +if(typeof document.selection != 'undefined') { + /* Einfuegen des Formatierungscodes */ +// alert('IE'); + var range = document.selection.createRange(); + var insText = range.text; + range.text = aTag + insText + eTag; + /* Anpassen der Cursorposition */ + range = document.selection.createRange(); + if (insText.length == 0) { + range.move('character', -eTag.length); + } else { + range.moveStart('character', aTag.length + insText.length + eTag.length); + } + range.select(); +} +/* Gecko */ +else if(typeof input.selectionStart != 'undefined') +{ +// alert('Gecko'); + /* Einfuegen des Formatierungscodes */ + var start = input.selectionStart; + var end = input.selectionEnd; + var insText = input.value.substring(start, end); + input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end); + /* Anpassen der Cursorposition */ + var pos; + if (insText.length == 0) { + pos = start + aTag.length; + } else { + pos = start + aTag.length + insText.length + eTag.length; + } + input.selectionStart = pos; + input.selectionEnd = pos; +} +/* uebrige Browser */ +else +{ + /* Abfrage der Einfuegeposition */ + + /* + var pos; + var re = new RegExp('^[0-9]{0,3}$'); + while(!re.test(pos)) { + pos = prompt("Position (0.." + input.value.length + "):", "0"); + } + if(pos > input.value.length) { + pos = input.value.length; + } + */ + pos = input.value.length; + + /* Einfuegen des Formatierungscodes */ + var insText = prompt("Text"); + input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos); +} +} + + + + + +function help(el,url,suffix) +{ + var action = $(el).closest('div.panel').find('li.action.active').attr('data-action'); + var method = $(el).closest('div.panel').find('li.action.active').attr('data-method'); + + window.open(url + action + '/'+ method + suffix, 'OpenRat_Help', 'location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes'); +} + + +function htmlEntities(str) { + return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); +} + +function registerOpenClose( $el ) +{ + $($el).children('.on-click-open-close').click( function() { + $(this).closest('.toggle-open-close').toggleClass('open closed'); + }); + +}/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/editor/editor.min.js */ +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + $(element).find('textarea').orAutoheight(); + + + // Codemirror-Editor anzeigen + $(element).find("textarea.editor.code-editor").each( function() { + + let mode = $(this).data('mode'); + + let mimetype = $(this).data('mimetype'); + if(mimetype.length>0) + mode = mimetype; + + let textareaEl = this; + + let editor = CodeMirror.fromTextArea( textareaEl, { + lineNumbers: true, + viewportMargin: Infinity, + mode: mode + /** settings **/ }) + + editor.on('change',function() { + // copy back to textarea on form submit... + let newValue = editor.getValue(); + $(textareaEl).val( newValue ); + } ); + + + $(editor.getWrapperElement()).droppable({ + accept: '.or-draggable', + hoverClass: 'or-droppable--hover', + activeClass: 'or-droppable--active', + + drop: function (event, ui) { + + let dropped = ui.draggable; + + // Insert id of dragged element into cursor position + let pos = editor.getCursor(); + editor.setSelection(pos, pos); + let insertText = dropped.data('id') + let toInsert = ''+insertText; + editor.replaceSelection(toInsert); + //editor.setCursor(pos+toInsert.length); geht nicht. + } + + }); + + + } ); + + // Markdown-Editor anzeigen + $(element).find("textarea.editor.markdown-editor").each( function() { + + let textarea = this; + let toolbar = [{ + name: "bold", + action: SimpleMDE.toggleBold, + className: "image-icon image-icon--editor-bold", + title: "Bold", + }, + { + name: "italic", + action: SimpleMDE.toggleItalic, + className: "image-icon image-icon--editor-italic", + title: "Italic", + }, + { + name: "heading", + action: SimpleMDE.toggleHeadingBigger, + className: "image-icon image-icon--editor-headline", + title: "Headline", + }, + "|", // Separator + { + name: "quote", + action: SimpleMDE.toggleBlockquote, + className: "image-icon image-icon--editor-quote", + title: "Quote", + }, + { + name: "code", + action: SimpleMDE.toggleCodeBlock, + className: "image-icon image-icon--editor-code", + title: "Code", + }, + "|", // Separator + { + name: "generic list", + action: SimpleMDE.toggleUnorderedList, + className: "image-icon image-icon--editor-unnumberedlist", + title: "Unnumbered list", + }, + { + name: "numbered list", + action: SimpleMDE.toggleOrderedList, + className: "image-icon image-icon--editor-numberedlist", + title: "Numbered list", + }, + "|", // Separator + { + name: "table", + action: SimpleMDE.drawTable, + className: "image-icon image-icon--editor-table", + title: "Table", + }, + { + name: "horizontalrule", + action: SimpleMDE.drawHorizontalRule, + className: "image-icon image-icon--editor-horizontalrule", + title: "Horizontal rule", + }, + "|", // Separator + { + name: "undo", + action: SimpleMDE.undo, + className: "image-icon image-icon--editor-undo", + title: "Undo", + }, + { + name: "redo", + action: SimpleMDE.redo, + className: "image-icon image-icon--editor-redo", + title: "Redo", + }, + "|", // Separator + { + name: "link", + action: SimpleMDE.drawLink, + className: "image-icon image-icon--editor-link", + title: "Link", + }, + { + name: "image", + action: SimpleMDE.drawImage, + className: "image-icon image-icon--editor-image", + title: "Image", + }, + + /* + "|", // Separator + { + name: "preview", + action: SimpleMDE.togglePreview, + className: "image-icon image-icon--editor-preview", + title: "Preview", + }, + { + name: "sidebyside", + action: SimpleMDE.toggleSideBySide, + className: "image-icon image-icon--editor-sidebyside", + title: "Side by side", + }, + { + name: "fullscreen", + action: SimpleMDE.toggleFullScreen, + className: "image-icon image-icon--editor-fullscreen", + title: "Fullscreen", + }, + */ + "|", // Separator + { + name: "guide", + action: "https://simplemde.com/markdown-guide", + className: "image-icon image-icon--editor-help", + title: "Howto markdown", + }, + ]; + + let mde = new SimpleMDE( + { + element: $(this)[0], + toolbar: toolbar, + autoDownloadFontAwesome: false + } + ); + + let codemirror = mde.codemirror; + + $(codemirror.getWrapperElement()).droppable({ + accept: '.or-draggable', + hoverClass: 'or-droppable--hover', + activeClass: 'or-droppable--active', + + drop: function (event, ui) { + + let dropped = ui.draggable; + + let insertText = ''; + let id = dropped.data('id'); + let url = '__OID__'+id+'__'; + if ( dropped.data('type') == 'image') + insertText = '![]('+url+')'; + else + insertText = '['+id+']('+url+')'; + + // Insert id of dragged element into cursor position + let pos = codemirror.getCursor(); + codemirror.setSelection(pos, pos); + codemirror.replaceSelection( insertText); + } + }); + + codemirror.on('change',function() { + // copy back to textarea on form submit... + let newValue = codemirror.getValue(); + $(textarea).val( newValue ); + } ); + } ); + + // HTML-Editor anzeigen + $(element).find("textarea.editor.html-editor").each( function() { + + let textarea = this; + + $.trumbowyg.svgPath = './modules/editor/trumbowyg/ui/icons.svg'; + $(textarea).trumbowyg(); + + $(textarea).closest('form').find('.trumbowyg-editor').droppable({ + accept: '.or-draggable', + hoverClass: 'or-droppable--hover', + activeClass: 'or-droppable--active', + + drop: function (event, ui) { + + let dropped = ui.draggable; + let id = dropped.data('id'); + let url = './?_='+dropped.data('type')+'-'+id+'&subaction=show&embed=1&__OID__'+id+'__='+id; + let insertText = ''; + if ( dropped.data('type') == 'image') + insertText = '<img src="'+url+'" alt="" />'; + else + insertText = '<a href="'+url+'" />'+id+'</a>'; + + $(textarea).trumbowyg('execCmd', { + cmd: 'insertHTML', + param: insertText, + forceCss: false, + }); + } + }); + + + + + + } ); + + +});/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/link/link.min.js */ +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + // Links aktivieren... + $(element).find('.clickable').orLinkify(); + +}); + + +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/qrcode/qrcode.min.js */ + +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + + // Show QR-Code + $(element).find('.or-qrcode').mouseover( function() { + + let element = this; + if ( $(element).children().length > 0 ) + return; + + let wrapper = $('<div class="or-info-popup"></div>'); + + $(element).append(wrapper); + + var qrcodetext = $(element).attr('data-qrcode'); + + $(wrapper).qrcode( { render : 'div', + text : qrcodetext, + fill : 'currentColor' } ); + + + // Title is disturbing the qr-code. Do not inherit it. + wrapper.attr('title',''); + + } ); + +} );/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/table/table.min.js */ +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + + // Manuelles Sortieren von Tabellen per Drag and drop. + $(element).find('table.or-table--sortable > tbody').sortable(); + + + $(element).find('table.or-table--sortable > tbody').closest('form').submit( function() { + + // Analyse the order of the objects in this folder. + var order = new Array(); + + $(this).find('table.or-table--sortable').find('tbody > tr.data').each(function () { + let objectid = $(this).data('id'); + order.push(objectid); + }); + + // Set the comma-separated list of objects into a input field. + $(this).find('input[name=order]').val(order.join(',')); + } + ); + + + // Alle Checkboxen setzen oder nicht setzen. + $(element).find('tr.headline > td > input.checkbox').click( function() { + $(this).closest('table').find('tr.data > td > input.checkbox').attr('checked',Boolean( $(this).attr('checked') ) ); + }); + + /** + * Table-Filter. + */ + $(element).find('.or-table-filter > input').keyup( function() { + + let filterExpression = $(this).val().toLowerCase(); + + let table = $(this).parents('.or-table-wrapper').find('table'); + table.addClass('loader'); + + setTimeout( () => { + table.find('tr:not(.headline)').filter(function () { + $(this).toggle($(this).text().toLowerCase().indexOf(filterExpression) > -1) + }) + table.removeClass('loader'); + }, 50); + + } ); + + + /** + * Table-Sortierung. + */ + $(element).find('table > tbody > tr.headline > td, table > tbody > tr > th').click( function() { + + let column = $(this); + let table = column.parents('table'); + table.addClass('loader'); + + let isAscending = !column.hasClass('sort-asc'); + table.find('tr.headline > td, tr > th').removeClass('sort-asc sort-desc'); + if ( isAscending ) column.addClass('sort-asc'); else column.addClass('sort-desc'); + + setTimeout(function () { // Sorting should be asynchronous, because we do not want to block the UI. + + let rows = table.find('tr:gt(0)').toArray().sort(comparer(column.index())) + if (!isAscending) { + rows = rows.reverse() + } + for (var i = 0; i < rows.length; i++) { + table.append(rows[i]) + } + table.removeClass('loader'); + }, 50); + + } ); + + function comparer(index) { + return function(a, b) { + let valA = getCellValue(a, index), valB = getCellValue(b, index) + return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.toString().localeCompare(valB) + } + } + + function getCellValue(row, index) { + return $(row).children('td').eq(index).text(); + } + +});/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/column/column.min.js */ +// View loaded... +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + + // Clickable Columns. + // done by orLinkify-Plugin in link.js + +});/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/image/image.min.js */ +/* +$(document).on('orViewLoaded',function(event, data) { + +}); +*//* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/group/group.min.js */ +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + registerOpenClose( $(element).find('.or-group.toggle-open-close') ); + +}); +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/upload/upload.min.js */ +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + + var form = $(element).find('form'); + + // Dateiupload über Drag and Drop + var dropzone = $(element).find('div.or-dropzone-upload > div.input'); + dropzone.on('dragenter', function (e) + { + e.stopPropagation(); + e.preventDefault(); + $(this).css('border', '1px dotted gray'); + }); + dropzone.on('dragover', function (e) + { + e.stopPropagation(); + e.preventDefault(); + }); + dropzone.on('drop', function (e) + { + $(this).css('border','1px dotted red'); + e.preventDefault(); + var files = e.originalEvent.dataTransfer.files; + + //We need to send dropped files to Server + handleFileUpload(form,files); + }); + + + // Dateiupload über File-Input-Button + $(element).find('input[type=file]').change( function() { + + var files = $(this).prop('files'); + + handleFileUpload(form,files); + }); + +}); + + + + + + +function handleFileUpload(form,files) +{ + for (var i = 0, f; f = files[i]; i++) + { + var form_data = new FormData(); + form_data.append('file' , f); + form_data.append('action' ,'folder'); + form_data.append('subaction',$(form).data('method')); + form_data.append('output' ,'json'); + form_data.append('token' ,$(form).find('input[name=token]').val() ); + form_data.append('id' ,$(form).find('input[name=id]' ).val() ); + + var status = $('<div class="notice info"><div class="text loader"></div></div>'); + $('#noticebar').prepend(status); // Notice anhängen. + $(status).show(); + + $.ajax( { 'type':'POST',url:'./api/', cache:false,contentType: false, processData: false, data:form_data, success:function(data, textStatus, jqXHR) + { + $(status).remove(); + let oform = new Openrat.Form(); + oform.doResponse(data,textStatus,form); + }, + error:function(jqXHR, textStatus, errorThrown) { + $(form).closest('div.content').removeClass('loader'); + $(status).remove(); + + var msg; + try + { + var error = jQuery.parseJSON( jqXHR.responseText ); + msg = error.error + '/' + error.description + ': ' + error.reason; + } + catch( e ) + { + msg = jqXHR.responseText; + } + + Openrat.Workbench.notify('Upload error',msg); + } + + } ); + } +} +/* Include script: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/tree/tree.min.js */ +// View loaded... +Openrat.Workbench.afterViewLoadedHandler.add( function(element ) { + + + // Clickable. + // done by link.js +});+ \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat.min.js b/modules/cms/ui/themes/default/script/openrat.min.js @@ -0,0 +1,1672 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!==C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[k]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[k]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[k]&&(v=Ce(v)),y&&!y[k]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[k]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=N[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?i.push(a):o.push(a);(a=N(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=S+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t===C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument===C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(S=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(S=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=k.split("").sort(D).join("")===k,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=k.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&N.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){k.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return k.Deferred(function(r){k.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=k.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var _=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)_(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<k.inArray(o,r))i&&i.push(o);else if(l=oe(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<k(i,this).index(l):k.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Q.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ke:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ne),!1},trigger:function(){return De(this,e),!0},delegateType:t}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Me(o[r],a[r]);else Me(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return _(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Nt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||Nt.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Pt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+$t+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=_t(Wt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k}); +/*! jQuery UI - v1.12.1 - 2018-09-03 +* http://jqueryui.com +* Includes: widget.js, data.js, scroll-parent.js, widgets/draggable.js, widgets/droppable.js, widgets/sortable.js, widgets/mouse.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ +(function(t){if(typeof define==="function"&&define.amd){define(["jquery"],t)} +else{t(jQuery)}}(function(t){t.ui=t.ui||{};var g=t.ui.version="1.12.1"; +/*! + * jQuery UI Widget 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var o=0,s=Array.prototype.slice;t.cleanData=(function(e){return function(i){var s,o,n;for(n=0;(o=i[n])!=null;n++){try{s=t._data(o,"events");if(s&&s.remove){t(o).triggerHandler("remove")}}catch(r){}};e(i)}})(t.cleanData);t.widget=function(e,i,s){var r,o,a,l={};var n=e.split(".")[0];e=e.split(".")[1];var h=n+"-"+e;if(!s){s=i;i=t.Widget};if(t.isArray(s)){s=t.extend.apply(null,[{}].concat(s))};t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)};t[n]=t[n]||{};r=t[n][e];o=t[n][e]=function(t,e){if(!this._createWidget){return new o(t,e)};if(arguments.length){this._createWidget(t,e)}};t.extend(o,r,{version:s.version,_proto:t.extend({},s),_childConstructors:[]});a=new i();a.options=t.widget.extend({},a.options);t.each(s,function(e,s){if(!t.isFunction(s)){l[e]=s;return};l[e]=(function(){function t(){return i.prototype[e].apply(this,arguments)};function o(t){return i.prototype[e].apply(this,t)};return function(){var i=this._super,n=this._superApply,e;this._super=t;this._superApply=o;e=s.apply(this,arguments);this._super=i;this._superApply=n;return e}})()});o.prototype=t.widget.extend(a,{widgetEventPrefix:r?(a.widgetEventPrefix||e):e},l,{constructor:o,namespace:n,widgetName:e,widgetFullName:h});if(r){t.each(r._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)});delete r._childConstructors} +else{i._childConstructors.push(o)};t.widget.bridge(e,o);return o};t.widget.extend=function(e){var r=s.call(arguments,1),n=0,a=r.length,i,o;for(;n<a;n++){for(i in r[n]){o=r[n][i];if(r[n].hasOwnProperty(i)&&o!==undefined){if(t.isPlainObject(o)){e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],o):t.widget.extend({},o)} +else{e[i]=o}}}};return e};t.widget.bridge=function(e,i){var o=i.prototype.widgetFullName||e;t.fn[e]=function(n){var h=typeof n==="string",a=s.call(arguments,1),r=this;if(h){if(!this.length&&n==="instance"){r=undefined} +else{this.each(function(){var i,s=t.data(this,o);if(n==="instance"){r=s;return!1};if(!s){return t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+n+"'")};if(!t.isFunction(s[n])||n.charAt(0)==="_"){return t.error("no such method '"+n+"' for "+e+" widget instance")};i=s[n].apply(s,a);if(i!==s&&i!==undefined){r=i&&i.jquery?r.pushStack(i.get()):i;return!1}})}} +else{if(a.length){n=t.widget.extend.apply(null,[n].concat(a))};this.each(function(){var e=t.data(this,o);if(e){e.option(n||{});if(e._init){e._init()}} +else{t.data(this,o,new i(n,this))}})};return r}};t.Widget=function(){};t.Widget._childConstructors=[];t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0];this.element=t(i);this.uuid=o++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=t();this.hoverable=t();this.focusable=t();this.classesElementLookup={};if(i!==this){t.data(i,this.widgetFullName,this);this._on(!0,this.element,{remove:function(t){if(t.target===i){this.destroy()}}});this.document=t(i.style?i.ownerDocument:i.document||i);this.window=t(this.document[0].defaultView||this.document[0].parentWindow)};this.options=t.widget.extend({},this.options,this._getCreateOptions(),e);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)};this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy();t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var r=e,s,o,n;if(arguments.length===0){return t.widget.extend({},this.options)};if(typeof e==="string"){r={};s=e.split(".");e=s.shift();if(s.length){o=r[e]=t.widget.extend({},this.options[e]);for(n=0;n<s.length-1;n++){o[s[n]]=o[s[n]]||{};o=o[s[n]]};e=s.pop();if(arguments.length===1){return o[e]===undefined?null:o[e]};o[e]=i} +else{if(arguments.length===1){return this.options[e]===undefined?null:this.options[e]};r[e]=i}};this._setOptions(r);return this},_setOptions:function(t){var e;for(e in t){this._setOption(e,t[e])};return this},_setOption:function(t,e){if(t==="classes"){this._setOptionClasses(e)};this.options[t]=e;if(t==="disabled"){this._setOptionDisabled(e)};return this},_setOptionClasses:function(e){var i,o,s;for(i in e){s=this.classesElementLookup[i];if(e[i]===this.options.classes[i]||!s||!s.length){continue};o=t(s.get());this._removeClass(s,i);o.addClass(this._classes({element:o,keys:i,classes:e,add:!0}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],s=this;e=t.extend({element:this.element,classes:this.options.classes||{}},e);function o(o,n){var a,r;for(r=0;r<o.length;r++){a=s.classesElementLookup[o[r]]||t();if(e.add){a=t(t.unique(a.get().concat(e.element.get())))} +else{a=t(a.not(e.element).get())};s.classesElementLookup[o[r]]=a;i.push(o[r]);if(n&&e.classes[o[r]]){i.push(e.classes[o[r]])}}};this._on(e.element,{"remove":"_untrackClassesElement"});if(e.keys){o(e.keys.match(/\S+/g)||[],!0)};if(e.extra){o(e.extra.match(/\S+/g)||[])};return i.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,o){if(t.inArray(e.target,o)!==-1){i.classesElementLookup[s]=t(o.not(e.target).get())}})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s=(typeof s==="boolean")?s:i;var o=(typeof t==="string"||t===null),n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};n.element.toggleClass(this._classes(n),s);return this},_on:function(e,i,s){var n,o=this;if(typeof e!=="boolean"){s=i;i=e;e=!1};if(!s){s=i;i=this.element;n=this.widget()} +else{i=n=t(i);this.bindings=this.bindings.add(i)};t.each(s,function(s,r){function a(){if(!e&&(o.options.disabled===!0||t(this).hasClass("ui-state-disabled"))){return};return(typeof r==="string"?o[r]:r).apply(o,arguments)};if(typeof r!=="string"){a.guid=r.guid=r.guid||a.guid||t.guid++};var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];if(c){n.on(l,c,a)} +else{i.on(l,a)}})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.off(i).off(i);this.bindings=t(this.bindings.not(e).get());this.focusable=t(this.focusable.not(e).get());this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function s(){return(typeof t==="string"?i[t]:t).apply(i,arguments)};var i=this;return setTimeout(s,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var o,n,r=this.options[e];s=s||{};i=t.Event(i);i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase();i.target=this.element[0];n=i.originalEvent;if(n){for(o in n){if(!(o in i)){i[o]=n[o]}}};this.element.trigger(i,s);return!(t.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}};t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,o,n){if(typeof o==="string"){o={effect:o}};var a,r=!o?e:o===!0||typeof o==="number"?i:o.effect||i;o=o||{};if(typeof o==="number"){o={duration:o}};a=!t.isEmptyObject(o);o.complete=n;if(o.delay){s.delay(o.delay)};if(a&&t.effects&&t.effects.effect[r]){s[e](o)} +else if(r!==e&&s[r]){s[r](o.duration,o.easing,n)} +else{s.queue(function(i){t(this)[e]();if(n){n.call(s[0])};i()})}}});var m=t.widget; +/*! + * jQuery UI :data 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var d=t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}); +/*! + * jQuery UI Scroll Parent 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var p=t.fn.scrollParent=function(e){var i=this.css("position"),o=i==="absolute",n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var e=t(this);if(o&&e.css("position")==="static"){return!1};return n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return i==="fixed"||!s.length?t(this[0].ownerDocument||document):s},u=t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()); +/*! + * jQuery UI Mouse 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var e=!1;t(document).on("mouseup",function(){e=!1});var f=t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent")){t.removeData(i.target,e.widgetName+".preventClickEvent");i.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(i){if(e){return};this._mouseMoved=!1;(this._mouseStarted&&this._mouseUp(i));this._mouseDownEvent=i;var s=this,o=(i.which===1),n=(typeof this.options.cancel==="string"&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1);if(!o||n||!this._mouseCapture(i)){return!0};this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)};if(this._mouseDistanceMet(i)&&this._mouseDelayMet(i)){this._mouseStarted=(this._mouseStart(i)!==!1);if(!this._mouseStarted){i.preventDefault();return!0}};if(!0===t.data(i.target,this.widgetName+".preventClickEvent")){t.removeData(i.target,this.widgetName+".preventClickEvent")};this._mouseMoveDelegate=function(t){return s._mouseMove(t)};this._mouseUpDelegate=function(t){return s._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);i.preventDefault();e=!0;return!0},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button){return this._mouseUp(e)} +else if(!e.which){if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey){this.ignoreMissingWhich=!0} +else if(!this.ignoreMissingWhich){return this._mouseUp(e)}}};if(e.which||e.button){this._mouseMoved=!0};if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()};if(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,e)!==!1);(this._mouseStarted?this._mouseDrag(e):this._mouseUp(e))};return!this._mouseStarted},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;if(i.target===this._mouseDownEvent.target){t.data(i.target,this.widgetName+".preventClickEvent",!0)};this._mouseStop(i)};if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer};this.ignoreMissingWhich=!1;e=!1;i.preventDefault()},_mouseDistanceMet:function(t){return(Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});var c=t.ui.plugin={add:function(e,i,s){var o,n=t.ui[e].prototype;for(o in s){n.plugins[o]=n.plugins[o]||[];n.plugins[o].push([i,s[o]])}},call:function(t,e,i,o){var s,n=t.plugins[e];if(!n){return};if(!o&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return};for(s=0;s<n.length;s++){if(t.options[n[s][0]]){n[s][1].apply(t.element,i)}}}};var h=t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body};if(!e){e=t.body};if(!e.nodeName){e=t.body};return e},l=t.ui.safeBlur=function(e){if(e&&e.nodeName.toLowerCase()!=="body"){t(e).trigger("blur")}}; +/*! + * jQuery UI Draggable 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()};if(this.options.addClasses){this._addClass("ui-draggable")};this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return};this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;if(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0){return!1};this.handle=this._getHandle(e);if(!this.handle){return!1};this._blurActiveElement(e);this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix);return!0},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);if(s.closest(i).length){return};t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;this.helper=this._createHelper(e);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(t.ui.ddmanager){t.ui.ddmanager.current=this};this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(!0);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return t(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(e);this.originalPosition=this.position=this._generatePosition(e,!1);this.originalPageX=e.pageX;this.originalPageY=e.pageY;(i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt));this._setContainment();if(this._trigger("start",e)===!1){this._clear();return!1};this._cacheHelperProportions();if(t.ui.ddmanager&&!i.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)};this._mouseDrag(e,!0);if(t.ui.ddmanager){t.ui.ddmanager.dragStart(this,e)};return!0},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()};this.position=this._generatePosition(e,!0);this.positionAbs=this._convertPositionTo("absolute");if(!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1){this._mouseUp(new t.Event("mouseup",e));return!1};this.position=s.position};this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)};return!1},_mouseStop:function(e){var s=this,i=!1;if(t.ui.ddmanager&&!this.options.dropBehaviour){i=t.ui.ddmanager.drop(this,e)};if(this.dropped){i=this.dropped;this.dropped=!1};if((this.options.revert==="invalid"&&!i)||(this.options.revert==="valid"&&i)||this.options.revert===!0||(t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i))){t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(s._trigger("stop",e)!==!1){s._clear()}})} +else{if(this._trigger("stop",e)!==!1){this._clear()}};return!1},_mouseUp:function(e){this._unblockFrames();if(t.ui.ddmanager){t.ui.ddmanager.dragStop(this,e)};if(this.handleElement.is(e.target)){this.element.trigger("focus")};return t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new t.Event("mouseup",{target:this.element[0]}))} +else{this._clear()};return this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var s=this.options,o=t.isFunction(s.helper),i=o?t(s.helper.apply(this.element[0],[e])):(s.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!i.parents("body").length){i.appendTo((s.appendTo==="parent"?this.element[0].parentNode:s.appendTo))};if(o&&i[0]===this.element[0]){this._setPositionRelative()};if(i[0]!==this.element[0]&&!(/(fixed|absolute)/).test(i.css("position"))){i.css("position","absolute")};return i},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")};if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}};if("left" in e){this.offset.click.left=e.left+this.margins.left};if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left};if("top" in e){this.offset.click.top=e.top+this.margins.top};if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_isRootNode:function(t){return(/(html|body)/i).test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()};if(this._isRootNode(this.offsetParent[0])){e={top:0,left:0}};return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var n,e,i,s=this.options,o=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return};if(s.containment==="window"){this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return};if(s.containment==="document"){this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return};if(s.containment.constructor===Array){this.containment=s.containment;return};if(s.containment==="parent"){s.containment=this.helper[0].parentNode};e=t(s.containment);i=e[0];if(!i){return};n=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(n?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(n?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e){e=this.position};var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:(e.top+this.offset.relative.top*i+this.offset.parent.top*i-((this.cssPosition==="fixed"?-this.offset.scroll.top:(s?0:this.offset.scroll.top))*i)),left:(e.left+this.offset.relative.left*i+this.offset.parent.left*i-((this.cssPosition==="fixed"?-this.offset.scroll.left:(s?0:this.offset.scroll.left))*i))}},_generatePosition:function(t,e){var i,h,o,n,s=this.options,l=this._isRootNode(this.scrollParent[0]),r=t.pageX,a=t.pageY;if(!l||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}};if(e){if(this.containment){if(this.relativeContainer){h=this.relativeContainer.offset();i=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]} +else{i=this.containment};if(t.pageX-this.offset.click.left<i[0]){r=i[0]+this.offset.click.left};if(t.pageY-this.offset.click.top<i[1]){a=i[1]+this.offset.click.top};if(t.pageX-this.offset.click.left>i[2]){r=i[2]+this.offset.click.left};if(t.pageY-this.offset.click.top>i[3]){a=i[3]+this.offset.click.top}};if(s.grid){o=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY;a=i?((o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3])?o:((o-this.offset.click.top>=i[1])?o-s.grid[1]:o+s.grid[1])):o;n=s.grid[0]?this.originalPageX+Math.round((r-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX;r=i?((n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2])?n:((n-this.offset.click.left>=i[0])?n-s.grid[0]:n+s.grid[0])):n};if(s.axis==="y"){r=this.originalPageX};if(s.axis==="x"){a=this.originalPageY}};return{top:(a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(l?0:this.offset.scroll.top))),left:(r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(l?0:this.offset.scroll.left)))}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()};this.helper=null;this.cancelHelperRemoval=!1;if(this.destroyOnClear){this.destroy()}},_trigger:function(e,i,s){s=s||this._uiHash();t.ui.plugin.call(this,e,[i,s,this],!0);if(/^(drag|start|stop)/.test(e)){this.positionAbs=this._convertPositionTo("absolute");s.offset=this.positionAbs};return t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var o=t.extend({},i,{item:s.element});s.sortables=[];t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");if(i&&!i.options.disabled){s.sortables.push(i);i.refreshPositions();i._trigger("activate",e,o)}})},stop:function(e,i,s){var o=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1;t.each(s.sortables,function(){var t=this;if(t.isOver){t.isOver=0;s.cancelHelperRemoval=!0;t.cancelHelperRemoval=!1;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper} +else{t.cancelHelperRemoval=!0;t._trigger("deactivate",e,o)}})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs;o.helperProportions=s.helperProportions;o.offset.click=s.offset.click;if(o._intersectsWith(o.containerCache)){n=!0;t.each(s.sortables,function(){this.positionAbs=s.positionAbs;this.helperProportions=s.helperProportions;this.offset.click=s.offset.click;if(this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])){n=!1};return n})};if(n){if(!o.isOver){o.isOver=1;s._parent=i.helper.parent();o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0);o.options._helper=o.options.helper;o.options.helper=function(){return i.helper[0]};e.target=o.currentItem[0];o._mouseCapture(e,!0);o._mouseStart(e,!0,!0);o.offset.click.top=s.offset.click.top;o.offset.click.left=s.offset.click.left;o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left;o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top;s._trigger("toSortable",e);s.dropped=o.element;t.each(s.sortables,function(){this.refreshPositions()});s.currentItem=s.element;o.fromOutside=s};if(o.currentItem){o._mouseDrag(e);i.position=o.position}} +else{if(o.isOver){o.isOver=0;o.cancelHelperRemoval=!0;o.options._revert=o.options.revert;o.options.revert=!1;o._trigger("out",e,o._uiHash(o));o._mouseStop(e,!0);o.options.revert=o.options._revert;o.options.helper=o.options._helper;if(o.placeholder){o.placeholder.remove()};i.helper.appendTo(s._parent);s._refreshOffsets(e);i.position=s._generatePosition(e,!0);s._trigger("fromSortable",e);s.dropped=!1;t.each(s.sortables,function(){this.refreshPositions()})}}})}});t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var o=t("body"),n=s.options;if(o.css("cursor")){n._cursor=o.css("cursor")};o.css("cursor",n.cursor)},stop:function(e,i,s){var o=s.options;if(o._cursor){t("body").css("cursor",o._cursor)}}});t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var o=t(i.helper),n=s.options;if(o.css("opacity")){n._opacity=o.css("opacity")};o.css("opacity",n.opacity)},stop:function(e,i,s){var o=s.options;if(o._opacity){t(i.helper).css("opacity",o._opacity)}}});t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(!1)};if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(e,i,s){var o=s.options,a=!1,r=s.scrollParentNotHidden[0],n=s.document[0];if(r!==n&&r.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((s.overflowOffset.top+r.offsetHeight)-e.pageY<o.scrollSensitivity){r.scrollTop=a=r.scrollTop+o.scrollSpeed} +else if(e.pageY-s.overflowOffset.top<o.scrollSensitivity){r.scrollTop=a=r.scrollTop-o.scrollSpeed}};if(!o.axis||o.axis!=="y"){if((s.overflowOffset.left+r.offsetWidth)-e.pageX<o.scrollSensitivity){r.scrollLeft=a=r.scrollLeft+o.scrollSpeed} +else if(e.pageX-s.overflowOffset.left<o.scrollSensitivity){r.scrollLeft=a=r.scrollLeft-o.scrollSpeed}}} +else{if(!o.axis||o.axis!=="x"){if(e.pageY-t(n).scrollTop()<o.scrollSensitivity){a=t(n).scrollTop(t(n).scrollTop()-o.scrollSpeed)} +else if(t(window).height()-(e.pageY-t(n).scrollTop())<o.scrollSensitivity){a=t(n).scrollTop(t(n).scrollTop()+o.scrollSpeed)}};if(!o.axis||o.axis!=="y"){if(e.pageX-t(n).scrollLeft()<o.scrollSensitivity){a=t(n).scrollLeft(t(n).scrollLeft()-o.scrollSpeed)} +else if(t(window).width()-(e.pageX-t(n).scrollLeft())<o.scrollSensitivity){a=t(n).scrollLeft(t(n).scrollLeft()+o.scrollSpeed)}}};if(a!==!1&&t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(s,e)}}});t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var o=s.options;s.snapElements=[];t(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var e=t(this),i=e.offset();if(this!==s.element[0]){s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})}})},drag:function(e,i,s){var r,a,h,l,c,p,f,u,o,g,v=s.options,n=v.snapTolerance,d=i.offset.left,b=d+s.helperProportions.width,m=i.offset.top,P=m+s.helperProportions.height;for(o=s.snapElements.length-1;o>=0;o--){c=s.snapElements[o].left-s.margins.left;p=c+s.snapElements[o].width;f=s.snapElements[o].top-s.margins.top;u=f+s.snapElements[o].height;if(b<c-n||d>p+n||P<f-n||m>u+n||!t.contains(s.snapElements[o].item.ownerDocument,s.snapElements[o].item)){if(s.snapElements[o].snapping){(s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[o].item})))};s.snapElements[o].snapping=!1;continue};if(v.snapMode!=="inner"){r=Math.abs(f-P)<=n;a=Math.abs(u-m)<=n;h=Math.abs(c-b)<=n;l=Math.abs(p-d)<=n;if(r){i.position.top=s._convertPositionTo("relative",{top:f-s.helperProportions.height,left:0}).top};if(a){i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top};if(h){i.position.left=s._convertPositionTo("relative",{top:0,left:c-s.helperProportions.width}).left};if(l){i.position.left=s._convertPositionTo("relative",{top:0,left:p}).left}};g=(r||a||h||l);if(v.snapMode!=="outer"){r=Math.abs(f-m)<=n;a=Math.abs(u-P)<=n;h=Math.abs(c-d)<=n;l=Math.abs(p-b)<=n;if(r){i.position.top=s._convertPositionTo("relative",{top:f,left:0}).top};if(a){i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top};if(h){i.position.left=s._convertPositionTo("relative",{top:0,left:c}).left};if(l){i.position.left=s._convertPositionTo("relative",{top:0,left:p-s.helperProportions.width}).left}};if(!s.snapElements[o].snapping&&(r||a||h||l||g)){(s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[o].item})))};s.snapElements[o].snapping=(r||a||h||l||g)}}});t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,r=s.options,o=t.makeArray(t(r.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});if(!o.length){return};n=parseInt(t(o[0]).css("zIndex"),10)||0;t(o).each(function(e){t(this).css("zIndex",n+e)});this.css("zIndex",(n+o.length))}});t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var o=t(i.helper),n=s.options;if(o.css("zIndex")){n._zIndex=o.css("zIndex")};o.css("zIndex",n.zIndex)},stop:function(e,i,s){var o=s.options;if(o._zIndex){t(i.helper).css("zIndex",o._zIndex)}}});var a=t.ui.draggable; +/*! + * jQuery UI Droppable 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1;this.isout=!0;this.accept=t.isFunction(s)?s:function(t){return t.is(s)};this.proportions=function(){if(arguments.length){e=arguments[0]} +else{return e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(i.scope);i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[];t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++){if(t[e]===this){t.splice(e,1)}}},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if(e==="accept"){this.accept=t.isFunction(i)?i:function(t){return t.is(i)}} +else if(e==="scope"){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s);this._addToManager(i)};this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass();if(i){this._trigger("activate",e,this.ui(i))}},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass();if(i){this._trigger("deactivate",e,this.ui(i))}},_over:function(e){var i=t.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){this._addHoverClass();this._trigger("over",e,this.ui(i))}},_out:function(e){var i=t.ui.ddmanager.current;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return};if(this.accept.call(this.element[0],(i.currentItem||i.element))){this._removeHoverClass();this._trigger("out",e,this.ui(i))}},_drop:function(e,s){var o=s||t.ui.ddmanager.current,n=!1;if(!o||(o.currentItem||o.element)[0]===this.element[0]){return!1};this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var s=t(this).droppable("instance");if(s.options.greedy&&!s.options.disabled&&s.options.scope===o.options.scope&&s.accept.call(s.element[0],(o.currentItem||o.element))&&i(o,t.extend(s,{offset:s.element.offset()}),s.options.tolerance,e)){n=!0;return!1}});if(n){return!1};if(this.accept.call(this.element[0],(o.currentItem||o.element))){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",e,this.ui(o));return this.element};return!1},ui:function(t){return{draggable:(t.currentItem||t.element),helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var i=t.ui.intersect=(function(){function t(t,e,i){return(t>=e)&&(t<(e+i))};return function(e,i,s,h){if(!i.offset){return!1};var r=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,l=r+e.helperProportions.width,c=a+e.helperProportions.height,o=i.offset.left,n=i.offset.top,f=o+i.proportions().width,p=n+i.proportions().height;switch(s){case"fit":return(o<=r&&l<=f&&n<=a&&c<=p);case"intersect":return(o<r+(e.helperProportions.width/2)&&l-(e.helperProportions.width/2)<f&&n<a+(e.helperProportions.height/2)&&c-(e.helperProportions.height/2)<p);case"pointer":return t(h.pageY,n,i.proportions().height)&&t(h.pageX,o,i.proportions().width);case"touch":return((a>=n&&a<=p)||(c>=n&&c<=p)||(a<n&&c>p))&&((r>=o&&r<=f)||(l>=o&&l<=f)||(r<o&&l>f));default:return!1}}})();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(s=0;s<o.length;s++){if(o[s].options.disabled||(e&&!o[s].accept.call(o[s].element[0],(e.currentItem||e.element)))){continue};for(n=0;n<r.length;n++){if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue;droppablesLoop}};o[s].visible=o[s].element.css("display")!=="none";if(!o[s].visible){continue};if(a==="mousedown"){o[s]._activate.call(o[s],i)};o[s].offset=o[s].element.offset();o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight})}},drop:function(e,s){var o=!1;t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){if(!this.options){return};if(!this.options.disabled&&this.visible&&i(e,this,this.options.tolerance,s)){o=this._drop.call(this,s)||o};if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(e.currentItem||e.element))){this.isout=!0;this.isover=!1;this._deactivate.call(this,s)}});return o},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){if(!e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,i)}})},drag:function(e,s){if(e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,s)};t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return};var o,a,r,h=i(e,this,this.options.tolerance,s),n=!h&&this.isover?"isout":(h&&!this.isover?"isover":null);if(!n){return};if(this.options.greedy){a=this.options.scope;r=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===a});if(r.length){o=t(r[0]).droppable("instance");o.greedyChild=(n==="isover")}};if(o&&n==="isover"){o.isover=!1;o.isout=!0;o._out.call(o,s)};this[n]=!0;this[n==="isout"?"isover":"isout"]=!1;this[n==="isover"?"_over":"_out"].call(this,s);if(o&&n==="isout"){o.isout=!1;o.isover=!0;o._over.call(o,s)}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable");if(!e.options.refreshPositions){t.ui.ddmanager.prepareOffsets(e,i)}}};if(t.uiBackCompat!==!1){t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})};var r=t.ui.droppable; +/*! + * jQuery UI Sortable 1.12.1 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +;var n=t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return(t>=e)&&(t<(e+i))},_isFloating:function(t){return(/left|right/).test(t.css("float"))||(/inline|table-cell/).test(t.css("display"))},_create:function(){this.containerCache={};this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=!0},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--){this.items[t].item.removeData(this.widgetName+"-item")};return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;if(this.reverting){return!1};if(this.options.disabled||this.options.type==="static"){return!1};this._refreshItems(e);t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o){s=t(this);return!1}});if(t.data(e.target,o.widgetName+"-item")===o){s=t(e.target)};if(!s){return!1};if(this.options.handle&&!i){t(this.options.handle,s).find("*").addBack().each(function(){if(this===e.target){n=!0}});if(!n){return!1}};this.currentItem=s;this._removeCurrentsFromItems();return!0},_mouseStart:function(e,i,s){var n,r,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()};this._createPlaceholder();if(o.containment){this._setContainment()};if(o.cursor&&o.cursor!=="auto"){r=this.document.find("body");this.storedCursor=r.css("cursor");r.css("cursor",o.cursor);this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(r)};if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")};this.helper.css("opacity",o.opacity)};if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")};this.helper.css("zIndex",o.zIndex)};if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()};this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()};if(!s){for(n=this.containers.length-1;n>=0;n--){this.containers[n]._trigger("activate",e,this._uiHash(this))}};if(t.ui.ddmanager){t.ui.ddmanager.current=this};if(t.ui.ddmanager&&!o.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)};this.dragging=!0;this._addClass(this.helper,"ui-sortable-helper");this._mouseDrag(e);return!0},_mouseDrag:function(e){var r,o,n,a,i=this.options,s=!1;this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs};if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-e.pageY<i.scrollSensitivity){this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+i.scrollSpeed} +else if(e.pageY-this.overflowOffset.top<i.scrollSensitivity){this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-i.scrollSpeed};if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-e.pageX<i.scrollSensitivity){this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+i.scrollSpeed} +else if(e.pageX-this.overflowOffset.left<i.scrollSensitivity){this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-i.scrollSpeed}} +else{if(e.pageY-this.document.scrollTop()<i.scrollSensitivity){s=this.document.scrollTop(this.document.scrollTop()-i.scrollSpeed)} +else if(this.window.height()-(e.pageY-this.document.scrollTop())<i.scrollSensitivity){s=this.document.scrollTop(this.document.scrollTop()+i.scrollSpeed)};if(e.pageX-this.document.scrollLeft()<i.scrollSensitivity){s=this.document.scrollLeft(this.document.scrollLeft()-i.scrollSpeed)} +else if(this.window.width()-(e.pageX-this.document.scrollLeft())<i.scrollSensitivity){s=this.document.scrollLeft(this.document.scrollLeft()+i.scrollSpeed)}};if(s!==!1&&t.ui.ddmanager&&!i.dropBehaviour){t.ui.ddmanager.prepareOffsets(this,e)}};this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"};if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"};for(r=this.items.length-1;r>=0;r--){o=this.items[r];n=o.item[0];a=this._intersectsWithPointer(o);if(!a){continue};if(o.instance!==this.currentContainer){continue};if(n!==this.currentItem[0]&&this.placeholder[a===1?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&(this.options.type==="semi-dynamic"?!t.contains(this.element[0],n):!0)){this.direction=a===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(o)){this._rearrange(e,o)} +else{break};this._trigger("change",e,this._uiHash());break}};this._contactContainers(e);if(t.ui.ddmanager){t.ui.ddmanager.drag(this,e)};this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(e,i){if(!e){return};if(t.ui.ddmanager&&!this.options.dropBehaviour){t.ui.ddmanager.drop(this,e)};if(this.options.revert){var r=this,n=this.placeholder.offset(),s=this.options.axis,o={};if(!s||s==="x"){o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)};if(!s||s==="y"){o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)};this.reverting=!0;t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(e)})} +else{this._clear(e,i)};return!1},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")} +else{this.currentItem.show()};for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("deactivate",null,this._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,this._uiHash(this));this.containers[e].containerCache.over=0}}};if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])};if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()};t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});if(this.domPosition.prev){t(this.domPosition.prev).after(this.currentItem)} +else{t(this.domPosition.parent).prepend(this.currentItem)}};return this},serialize:function(e){var s=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};t(s).each(function(){var s=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[\-=_](.+)/));if(s){i.push((e.key||s[1]+"[]")+"="+(e.key&&e.expression?s[1]:s[2]))}});if(!i.length&&e.key){i.push(e.key+"=")};return i.join("&")},toArray:function(e){var s=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};s.each(function(){i.push(t(e.item||this).attr(e.attribute||"id")||"")});return i},_intersectsWith:function(t){var e=this.positionAbs.left,l=e+this.helperProportions.width,i=this.positionAbs.top,c=i+this.helperProportions.height,s=t.left,n=s+t.width,o=t.top,r=o+t.height,a=this.offset.click.top,h=this.offset.click.left,f=(this.options.axis==="x")||((i+a)>o&&(i+a)<r),p=(this.options.axis==="y")||((e+h)>s&&(e+h)<n),u=f&&p;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"])){return u} +else{return(s<e+(this.helperProportions.width/2)&&l-(this.helperProportions.width/2)<n&&o<i+(this.helperProportions.height/2)&&c-(this.helperProportions.height/2)<r)}},_intersectsWithPointer:function(t){var e,i,s=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),o=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=s&&o;if(!n){return!1};e=this._getDragVerticalDirection();i=this._getDragHorizontalDirection();return this.floating?((i==="right"||e==="down")?2:1):(e&&(e==="down"?2:1))},_intersectsWithSides:function(t){var s=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+(t.height/2),t.height),o=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+(t.width/2),t.width),e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();if(this.floating&&i){return((i==="right"&&o)||(i==="left"&&!o))} +else{return e&&((e==="down"&&s)||(e==="up"&&!s))}},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return t!==0&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return t!==0&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var s,o,r,i,h=[],n=[],a=this._connectWith();if(a&&e){for(s=a.length-1;s>=0;s--){r=t(a[s],this.document[0]);for(o=r.length-1;o>=0;o--){i=t.data(r[o],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){n.push([t.isFunction(i.options.items)?i.options.items.call(i.element):t(i.options.items,i.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),i])}}}};n.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function l(){h.push(this)};for(s=n.length-1;s>=0;s--){n[s][0].each(l)};return t(h)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++){if(e[i]===t.item[0]){return!1}};return!0})},_refreshItems:function(e){this.items=[];this.containers=[this];var s,o,r,i,a,h,l,f,p=this.items,n=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready){for(s=c.length-1;s>=0;s--){r=t(c[s],this.document[0]);for(o=r.length-1;o>=0;o--){i=t.data(r[o],this.widgetFullName);if(i&&i!==this&&!i.options.disabled){n.push([t.isFunction(i.options.items)?i.options.items.call(i.element[0],e,{item:this.currentItem}):t(i.options.items,i.element),i]);this.containers.push(i)}}}};for(s=n.length-1;s>=0;s--){a=n[s][1];h=n[s][0];for(o=0,f=h.length;o<f;o++){l=t(h[o]);l.data(this.widgetName+"-item",a);p.push({item:l,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(e){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):!1;if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()};var i,s,n,o;for(i=this.items.length-1;i>=0;i--){s=this.items[i];if(s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]){continue};n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item;if(!e){s.width=n.outerWidth();s.height=n.outerHeight()};o=n.offset();s.left=o.left;s.top=o.top};if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)} +else{for(i=this.containers.length-1;i>=0;i--){o=this.containers[i].element.offset();this.containers[i].containerCache.left=o.left;this.containers[i].containerCache.top=o.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}};return this},_createPlaceholder:function(e){e=e||this;var s,i=e.options;if(!i.placeholder||i.placeholder.constructor===String){s=i.placeholder;i.placeholder={element:function(){var o=e.currentItem[0].nodeName.toLowerCase(),i=t("<"+o+">",e.document[0]);e._addClass(i,"ui-sortable-placeholder",s||e.currentItem[0].className)._removeClass(i,"ui-sortable-helper");if(o==="tbody"){e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(i))} +else if(o==="tr"){e._createTrPlaceholder(e.currentItem,i)} +else if(o==="img"){i.attr("src",e.currentItem.attr("src"))};if(!s){i.css("visibility","hidden")};return i},update:function(t,o){if(s&&!i.forcePlaceholderSize){return};if(!o.height()){o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10))};if(!o.width()){o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}};e.placeholder=t(i.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder);i.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var s,o,c,n,p,u,a,f,h,l,r=null,i=null;for(s=this.containers.length-1;s>=0;s--){if(t.contains(this.currentItem[0],this.containers[s].element[0])){continue};if(this._intersectsWith(this.containers[s].containerCache)){if(r&&t.contains(this.containers[s].element[0],r.element[0])){continue};r=this.containers[s];i=s} +else{if(this.containers[s].containerCache.over){this.containers[s]._trigger("out",e,this._uiHash(this));this.containers[s].containerCache.over=0}}};if(!r){return};if(this.containers.length===1){if(!this.containers[i].containerCache.over){this.containers[i]._trigger("over",e,this._uiHash(this));this.containers[i].containerCache.over=1}} +else{c=10000;n=null;h=r.floating||this._isFloating(this.currentItem);p=h?"left":"top";u=h?"width":"height";l=h?"pageX":"pageY";for(o=this.items.length-1;o>=0;o--){if(!t.contains(this.containers[i].element[0],this.items[o].item[0])){continue};if(this.items[o].item[0]===this.currentItem[0]){continue};a=this.items[o].item.offset()[p];f=!1;if(e[l]-a>this.items[o][u]/2){f=!0};if(Math.abs(e[l]-a)<c){c=Math.abs(e[l]-a);n=this.items[o];this.direction=f?"up":"down"}};if(!n&&!this.options.dropOnEmpty){return};if(this.currentContainer===this.containers[i]){if(!this.currentContainer.containerCache.over){this.containers[i]._trigger("over",e,this._uiHash());this.currentContainer.containerCache.over=1};return};n?this._rearrange(e,n,null,!0):this._rearrange(e,null,this.containers[i].element,!0);this._trigger("change",e,this._uiHash());this.containers[i]._trigger("change",e,this._uiHash(this));this.currentContainer=this.containers[i];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[i]._trigger("over",e,this._uiHash(this));this.containers[i].containerCache.over=1}},_createHelper:function(e){var s=this.options,i=t.isFunction(s.helper)?t(s.helper.apply(this.element[0],[e,this.currentItem])):(s.helper==="clone"?this.currentItem.clone():this.currentItem);if(!i.parents("body").length){t(s.appendTo!=="parent"?s.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0])};if(i[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}};if(!i[0].style.width||s.forceHelperSize){i.width(this.currentItem.width())};if(!i[0].style.height||s.forceHelperSize){i.height(this.currentItem.height())};return i},_adjustOffsetFromHelper:function(e){if(typeof e==="string"){e=e.split(" ")};if(t.isArray(e)){e={left:+e[0],top:+e[1]||0}};if("left" in e){this.offset.click.left=e.left+this.margins.left};if("right" in e){this.offset.click.left=this.helperProportions.width-e.right+this.margins.left};if("top" in e){this.offset.click.top=e.top+this.margins.top};if("bottom" in e){this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])){e.left+=this.scrollParent.scrollLeft();e.top+=this.scrollParent.scrollTop()};if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&t.ui.ie)){e={top:0,left:0}};return{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}} +else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,s,o,i=this.options;if(i.containment==="parent"){i.containment=this.helper[0].parentNode};if(i.containment==="document"||i.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,i.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(i.containment==="document"?(this.document.height()||document.body.parentNode.scrollHeight):this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]};if(!(/^(document|window|parent)$/).test(i.containment)){e=t(i.containment)[0];s=t(i.containment).offset();o=(t(e).css("overflow")!=="hidden");this.containment=[s.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,s.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,s.left+(o?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,s.top+(o?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(e,i){if(!i){i=this.position};var s=e==="absolute"?1:-1,o=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,n=(/(html|body)/i).test(o[0].tagName);return{top:(i.top+this.offset.relative.top*s+this.offset.parent.top*s-((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(n?0:o.scrollTop()))*s)),left:(i.left+this.offset.relative.left*s+this.offset.parent.left*s-((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():n?0:o.scrollLeft())*s))}},_generatePosition:function(e){var s,o,i=this.options,n=e.pageX,r=e.pageY,a=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(a[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()};if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){n=this.containment[0]+this.offset.click.left};if(e.pageY-this.offset.click.top<this.containment[1]){r=this.containment[1]+this.offset.click.top};if(e.pageX-this.offset.click.left>this.containment[2]){n=this.containment[2]+this.offset.click.left};if(e.pageY-this.offset.click.top>this.containment[3]){r=this.containment[3]+this.offset.click.top}};if(i.grid){s=this.originalPageY+Math.round((r-this.originalPageY)/i.grid[1])*i.grid[1];r=this.containment?((s-this.offset.click.top>=this.containment[1]&&s-this.offset.click.top<=this.containment[3])?s:((s-this.offset.click.top>=this.containment[1])?s-i.grid[1]:s+i.grid[1])):s;o=this.originalPageX+Math.round((n-this.originalPageX)/i.grid[0])*i.grid[0];n=this.containment?((o-this.offset.click.left>=this.containment[0]&&o-this.offset.click.left<=this.containment[2])?o:((o-this.offset.click.left>=this.containment[0])?o-i.grid[0]:o+i.grid[0])):o}};return{top:(r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(h?0:a.scrollTop())))),left:(n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():h?0:a.scrollLeft())))}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?e.item[0]:e.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){if(o===this.counter){this.refreshPositions(!s)}})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)};this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}};this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")} +else{this.currentItem.show()};if(this.fromOutside&&!e){s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})};if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!e){s.push(function(t){this._trigger("update",t,this._uiHash())})};if(this!==this.currentContainer){if(!e){s.push(function(t){this._trigger("remove",t,this._uiHash())});s.push((function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}).call(this,this.currentContainer));s.push((function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}).call(this,this.currentContainer))}};function o(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}};for(i=this.containers.length-1;i>=0;i--){if(!e){s.push(o("deactivate",this,this.containers[i]))};if(this.containers[i].containerCache.over){s.push(o("out",this,this.containers[i]));this.containers[i].containerCache.over=0}};if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()};if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)};if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)};this.dragging=!1;if(!e){this._trigger("beforeStop",t,this._uiHash())};this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()};this.helper=null};if(!e){for(i=0;i<s.length;i++){s[i].call(this,t)};this._trigger("stop",t,this._uiHash())};this.fromOutside=!1;return!this.cancelHelperRemoval},_trigger:function(){if(t.Widget.prototype._trigger.apply(this,arguments)===!1){this.cancel()}},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}));;jQuery.fn.orSearch=function(e){var t=$.extend({'dropdown':$(),'select':function(e){}},e);return $(this).on('input',function(){let searchArgument=$(this).val();let dropdownEl=$(t.dropdown);if(searchArgument.length>3){$(dropdownEl).empty();$.ajax({'type':'GET',url:'./api/?action=search&subaction=quicksearch&output=json&search='+searchArgument,data:null,success:function(e,n,r){for(id in e.output.result){let result=e.output.result[id];let div=$('<div class="entry or-search-result" title="'+result.desc+'"></div>');div.data('object',{'name':result.name,'action':result.type,'id':result.id});let link=$('<a />').attr('href',Openrat.Navigator.createShortUrl(result.type,result.id));link.click(function(e){e.preventDefault()});$(link).append('<i class="image-icon image-icon--action-'+result.type+'" />');$(link).append('<span>'+result.name+'</span>');$(div).append(link);$(dropdownEl).append(div)};$(dropdownEl).closest('.or-menu').addClass('open');$(dropdownEl).find('.or-search-result').click(function(e){t.select($(this).data('object'))})}})} +else{$(dropdownEl).empty()}})};;var popupWindow;jQuery.fn.orLinkify=function(){$(this).find('a').click(function(t){t.preventDefault()});return $(this).click(function(){$(this).find('a').first().each(function(){let type=$(this).attr('data-type');if($(this).parent().hasClass('inactive'))return;switch(type){case'post':$form=$('<form />').attr('method','POST').addClass('invisible');$form.data('afterSuccess',$(this).data('afterSuccess'));let params=jQuery.parseJSON($(this).attr('data-data'));params.output='json';$.each(params,function(t,a){let $input=$('<input />').attr('type','hidden').attr('name',t).attr('value',a);$form.append($input)});let form=new Openrat.Form();form.initOnElement($form);form.submit();break;case'edit':case'dialog':startDialog($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-method'),$(this).attr('data-id'),$(this).attr('data-extra'));break;case'external':window.open($(this).attr('data-url'),' _blank');break;case'popup':popupWindow=window.open($(this).attr('data-url'),'Popup','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes');break;case'help':help(this,$(this).attr('data-url'),$(this).attr('data-suffix'));break;case'fullscreen':fullscreen(this);break;case'open':openNewAction($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-id'));break;default:throw'UI error: Unknown link type: '+type+' in link '+$(this).html()}})})};;jQuery.fn.orTree=function(){$(this).each(function(a,e){$(e).children('.or-navtree-node-control').click(function(){var a=$(this).parent('.or-navtree-node');if($(a).is('.or-navtree-node--is-open')){$(a).children('ul').slideUp('fast').remove();$(a).removeClass('or-navtree-node--is-open').addClass('or-navtree-node--is-closed').find('.tree-icon').removeClass('image-icon--node-open').addClass('image-icon--node-closed')} +else{$(e).closest('div.view').addClass('loader');var i=$(a).data('type'),o=$(a).data('id'),t=$(a).data('extra'),n='./api/?action=tree&subaction=loadBranch&id='+o+'&type='+i+'&output=json';if(typeof t==='string'){jQuery.each(jQuery.parseJSON(t.replace(/'/g,'"')),function(e,a){n=n+'&'+e+'='+a})} +else if(typeof t==='object'){jQuery.each(t,function(e,a){n=n+'&'+e+'='+a})} +else{};$.getJSON(n,function(a){let ul=$('<ul class="or-navtree-list" />');$(e).append(ul);let output=a['output'];$.each(output['branch'],function(a,e){let new_li=$('<li class="or-navtree-node or-navtree-node--is-closed or-draggable or-draggable--type-'+e.type+'" data-name="'+e.text+'" data-id="'+e.internalId+'" data-type="'+e.type+'" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'"><div class="tree or-navtree-node-control"><i class="tree-icon image-icon image-icon--node-closed"></i></div><div class="clickable"><a href="'+Openrat.Navigator.createShortUrl(e.action,e.internalId)+'" class="entry" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'" data-id="'+e.internalId+'" data-action="'+e.action+'" data-type="open" title="'+e.description+'"><i class="image-icon image-icon--action-'+e['icon']+'"></i> '+e.text+'</a></div></li>');$(ul).append(new_li);$(new_li).orTree();$(new_li).find('.clickable').orLinkify();$(new_li).find('.clickable a').click(function(e){e.preventDefault()});registerTreeBranchEvents(ul)});$(ul).slideDown('fast')}).fail(function(){Openrat.Workbench.notify('','','ERROR','failed to load subtree',[],!1)}).always(function(){$(e).closest('div.view').removeClass('loader')});$(a).addClass('or-navtree-node--is-open').removeClass('or-navtree-node--is-closed').find('.tree-icon').addClass('image-icon--node-open').removeClass('image-icon--node-closed')}})})};;jQuery.fn.orAutoheight=function(){var t=function(t){var n=$(t).val().split('\n').length;$(t).attr('rows',n+3)};$(this).each(function(n){t(this)});return $(this).keypress(function(){t(this)})};/*! jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */ +!function(r){"use strict";function t(t,e,n,o){function a(r,t){return r-=o,t-=o,0>r||r>=c||0>t||t>=c?!1:f.isDark(r,t)}function i(r,t,e,n){var o=u.isDark,a=1/l;u.isDark=function(i,u){var f=u*a,c=i*a,l=f+a,g=c+a;return o(i,u)&&(r>l||f>e||t>g||c>n)}}var u={},f=r(n,e);f.addData(t),f.make(),o=o||0;var c=f.getModuleCount(),l=f.getModuleCount()+2*o;return u.text=t,u.level=e,u.version=n,u.moduleCount=l,u.isDark=a,u.addBlank=i,u}function e(r,e,n,o,a){n=Math.max(1,n||1),o=Math.min(40,o||40);for(var i=n;o>=i;i+=1)try{return t(r,e,i,a)}catch(u){}}function n(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,a=w("<canvas/>")[0].getContext("2d");a.font=o;var i=a.measureText(e.label).width,u=e.mSize,f=i/n,c=(1-f)*e.mPosX,l=(1-u)*e.mPosY,g=c+f,s=l+u,v=.01;1===e.mode?r.addBlank(0,l-v,n,s+v):r.addBlank(c-v,l-v,g+v,s+v),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,l*n+.75*e.mSize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalWidth||1,a=e.image.naturalHeight||1,i=e.mSize,u=i*o/a,f=(1-u)*e.mPosX,c=(1-i)*e.mPosY,l=f+u,g=c+i,s=.01;3===e.mode?r.addBlank(0,c-s,n,g+s):r.addBlank(f-s,c-s,l+s,g+s),t.drawImage(e.image,f*n,c*n,u*n,i*n)}function a(r,t,e){w(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var a=e.mode;1===a||2===a?n(r,t,e):(3===a||4===a)&&o(r,t,e)}function i(r,t,e,n,o,a,i,u){r.isDark(i,u)&&t.rect(n,o,a,a)}function u(r,t,e,n,o,a,i,u,f,c){i?r.moveTo(t+a,e):r.moveTo(t,e),u?(r.lineTo(n-a,e),r.arcTo(n,e,n,o,a)):r.lineTo(n,e),f?(r.lineTo(n,o-a),r.arcTo(n,o,t,o,a)):r.lineTo(n,o),c?(r.lineTo(t+a,o),r.arcTo(t,o,t,e,a)):r.lineTo(t,o),i?(r.lineTo(t,e+a),r.arcTo(t,e,n,e,a)):r.lineTo(t,e)}function f(r,t,e,n,o,a,i,u,f,c){i&&(r.moveTo(t+a,e),r.lineTo(t,e),r.lineTo(t,e+a),r.arcTo(t,e,t+a,e,a)),u&&(r.moveTo(n-a,e),r.lineTo(n,e),r.lineTo(n,e+a),r.arcTo(n,e,n-a,e,a)),f&&(r.moveTo(n-a,o),r.lineTo(n,o),r.lineTo(n,o-a),r.arcTo(n,o,n-a,o,a)),c&&(r.moveTo(t+a,o),r.lineTo(t,o),r.lineTo(t,o-a),r.arcTo(t,o,t+a,o,a))}function c(r,t,e,n,o,a,i,c){var l=r.isDark,g=n+a,s=o+a,v=e.radius*a,h=i-1,d=i+1,w=c-1,m=c+1,y=l(i,c),T=l(h,w),p=l(h,c),B=l(h,m),A=l(i,m),E=l(d,m),k=l(d,c),M=l(d,w),C=l(i,w);y?u(t,n,o,g,s,v,!p&&!C,!p&&!A,!k&&!A,!k&&!C):f(t,n,o,g,s,v,p&&C&&T,p&&A&&B,k&&A&&E,k&&C&&M)}function l(r,t,e){var n,o,a=r.moduleCount,u=e.size/a,f=i;for(e.radius>0&&e.radius<=.5&&(f=c),t.beginPath(),n=0;a>n;n+=1)for(o=0;a>o;o+=1){var l=e.left+o*u,g=e.top+n*u,s=u;f(r,t,e,l,g,s,n,o)}if(w(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var v=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=v,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}function g(r,t){var n=e(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!n)return null;var o=w(r).data("qrcode",n),i=o[0].getContext("2d");return a(n,i,t),l(n,i,t),o}function s(r){var t=w("<canvas/>").attr("width",r.size).attr("height",r.size);return g(t,r)}function v(r){return w("<img/>").attr("src",s(r)[0].toDataURL("image/png"))}function h(r){var t=e(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var n,o,a=r.size,i=r.background,u=Math.floor,f=t.moduleCount,c=u(a/f),l=u(.5*(a-c*f)),g={position:"relative",left:0,top:0,padding:0,margin:0,width:a,height:a},s={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},v=w("<div/>").data("qrcode",t).css(g);for(i&&v.css("background-color",i),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isDark(n,o)&&w("<div/>").css(s).css({left:l+o*c,top:l+n*c}).appendTo(v);return v}function d(r){return m&&"canvas"===r.render?s(r):m&&"image"===r.render?v(r):h(r)}var w=window.jQuery,m=function(){var r=document.createElement("canvas");return!(!r.getContext||!r.getContext("2d"))}(),y={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};w.fn.qrcode=function(r){var t=w.extend({},y,r);return this.each(function(r,e){"canvas"===e.nodeName.toLowerCase()?g(e,t):w(e).append(d(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new Error(t.length+"/"+e);var n=function(){for(var r=0;r<t.length&&0==t[r];)r+=1;for(var n=new Array(t.length-r+e),o=0;o<t.length-r;o+=1)n[o]=t[o+r];return n}(),o={};return o.getAt=function(r){return n[r]},o.getLength=function(){return n.length},o.multiply=function(t){for(var e=new Array(o.getLength()+t.getLength()-1),n=0;n<o.getLength();n+=1)for(var a=0;a<t.getLength();a+=1)e[n+a]^=i.gexp(i.glog(o.getAt(n))+i.glog(t.getAt(a)));return r(e,0)},o.mod=function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=i.glog(o.getAt(0))-i.glog(t.getAt(0)),n=new Array(o.getLength()),a=0;a<o.getLength();a+=1)n[a]=o.getAt(a);for(var a=0;a<t.getLength();a+=1)n[a]^=i.gexp(i.glog(t.getAt(a))+e);return r(n,0).mod(t)},o}var t=function(t,e){var o=236,i=17,l=t,g=n[e],s=null,v=0,d=null,w=new Array,m={},y=function(r,t){v=4*l+17,s=function(r){for(var t=new Array(r),e=0;r>e;e+=1){t[e]=new Array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(v),T(0,0),T(v-7,0),T(0,v-7),A(),B(),k(r,t),l>=7&&E(r),null==d&&(d=D(l,g,w)),M(d,t)},T=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=v))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=v||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?s[r+e][t+n]=!0:s[r+e][t+n]=!1)},p=function(){for(var r=0,t=0,e=0;8>e;e+=1){y(!0,e);var n=a.getLostPoint(m);(0==e||r>n)&&(r=n,t=e)}return t},B=function(){for(var r=8;v-8>r;r+=1)null==s[r][6]&&(s[r][6]=r%2==0);for(var t=8;v-8>t;t+=1)null==s[6][t]&&(s[6][t]=t%2==0)},A=function(){for(var r=a.getPatternPosition(l),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==s[n][o])for(var i=-2;2>=i;i+=1)for(var u=-2;2>=u;u+=1)-2==i||2==i||-2==u||2==u||0==i&&0==u?s[n+i][o+u]=!0:s[n+i][o+u]=!1}},E=function(r){for(var t=a.getBCHTypeNumber(l),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[Math.floor(e/3)][e%3+v-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);s[e%3+v-8-3][Math.floor(e/3)]=n}},k=function(r,t){for(var e=g<<3|t,n=a.getBCHTypeInfo(e),o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);6>o?s[o][8]=i:8>o?s[o+1][8]=i:s[v-15+o][8]=i}for(var o=0;15>o;o+=1){var i=!r&&1==(n>>o&1);8>o?s[8][v-o-1]=i:9>o?s[8][15-o-1+1]=i:s[8][15-o-1]=i}s[v-8][8]=!r},M=function(r,t){for(var e=-1,n=v-1,o=7,i=0,u=a.getMaskFunction(t),f=v-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==s[n][f-c]){var l=!1;i<r.length&&(l=1==(r[i]>>>o&1));var g=u(n,f-c);g&&(l=!l),s[n][f-c]=l,o-=1,-1==o&&(i+=1,o=7)}if(n+=e,0>n||n>=v){n-=e,e=-e;break}}},C=function(t,e){for(var n=0,o=0,i=0,u=new Array(e.length),f=new Array(e.length),c=0;c<e.length;c+=1){var l=e[c].dataCount,g=e[c].totalCount-l;o=Math.max(o,l),i=Math.max(i,g),u[c]=new Array(l);for(var s=0;s<u[c].length;s+=1)u[c][s]=255&t.getBuffer()[s+n];n+=l;var v=a.getErrorCorrectPolynomial(g),h=r(u[c],v.getLength()-1),d=h.mod(v);f[c]=new Array(v.getLength()-1);for(var s=0;s<f[c].length;s+=1){var w=s+d.getLength()-f[c].length;f[c][s]=w>=0?d.getAt(w):0}}for(var m=0,s=0;s<e.length;s+=1)m+=e[s].totalCount;for(var y=new Array(m),T=0,s=0;o>s;s+=1)for(var c=0;c<e.length;c+=1)s<u[c].length&&(y[T]=u[c][s],T+=1);for(var s=0;i>s;s+=1)for(var c=0;c<e.length;c+=1)s<f[c].length&&(y[T]=f[c][s],T+=1);return y},D=function(r,t,e){for(var n=u.getRSBlocks(r,t),c=f(),l=0;l<e.length;l+=1){var g=e[l];c.put(g.getMode(),4),c.put(g.getLength(),a.getLengthInBits(g.getMode(),r)),g.write(c)}for(var s=0,l=0;l<n.length;l+=1)s+=n[l].dataCount;if(c.getLengthInBits()>8*s)throw new Error("code length overflow. ("+c.getLengthInBits()+">"+8*s+")");for(c.getLengthInBits()+4<=8*s&&c.put(0,4);c.getLengthInBits()%8!=0;)c.putBit(!1);for(;;){if(c.getLengthInBits()>=8*s)break;if(c.put(o,8),c.getLengthInBits()>=8*s)break;c.put(i,8)}return C(c,n)};return m.addData=function(r){var t=c(r);w.push(t),d=null},m.isDark=function(r,t){if(0>r||r>=v||0>t||t>=v)throw new Error(r+","+t);return s[r][t]},m.getModuleCount=function(){return v},m.make=function(){y(!1,p())},m.createTableTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+t+"px;",e+='">',e+="<tbody>";for(var n=0;n<m.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<m.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=m.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return e+="</tbody>",e+="</table>"},m.createImgTag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=m.getModuleCount()*r+2*t,n=t,o=e-t;return h(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var a=Math.floor((t-n)/r),i=Math.floor((e-n)/r);return m.isDark(i,a)?0:1}return 1})},m};t.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},t.createStringToBytes=function(r,t){var e=function(){for(var e=s(r),n=function(){var r=e.read();if(-1==r)throw new Error;return r},o=0,a={};;){var i=e.read();if(-1==i)break;var u=n(),f=n(),c=n(),l=String.fromCharCode(i<<8|u),g=f<<8|c;a[l]=g,o+=1}if(o!=t)throw new Error(o+" != "+t);return a}(),n="?".charCodeAt(0);return function(r){for(var t=new Array,o=0;o<r.length;o+=1){var a=r.charCodeAt(o);if(128>a)t.push(a);else{var i=e[r.charAt(o)];"number"==typeof i?(255&i)==i?t.push(i):(t.push(i>>>8),t.push(255&i)):t.push(n)}}return t}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},a=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,a=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getBCHTypeInfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<<c(t)-c(n);return(r<<10|t)^u},f.getBCHTypeNumber=function(r){for(var t=r<<12;c(t)-c(a)>=0;)t^=a<<c(t)-c(a);return r<<12|t},f.getPatternPosition=function(r){return t[r-1]},f.getMaskFunction=function(r){switch(r){case o.PATTERN000:return function(r,t){return(r+t)%2==0};case o.PATTERN001:return function(r,t){return r%2==0};case o.PATTERN010:return function(r,t){return t%3==0};case o.PATTERN011:return function(r,t){return(r+t)%3==0};case o.PATTERN100:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case o.PATTERN101:return function(r,t){return r*t%2+r*t%3==0};case o.PATTERN110:return function(r,t){return(r*t%2+r*t%3)%2==0};case o.PATTERN111:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},f.getErrorCorrectPolynomial=function(t){for(var e=r([1],0),n=0;t>n;n+=1)e=e.multiply(r([1,i.gexp(n)],0));return e},f.getLengthInBits=function(r,t){if(t>=1&&10>t)switch(r){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(27>t)switch(r){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else{if(!(41>t))throw new Error("type:"+t);switch(r){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}}},f.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var a=0,i=r.isDark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&i==r.isDark(n+u,o+f)&&(a+=1);a>5&&(e+=3+a-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);for(var l=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isDark(n,o)&&(l+=1);var g=Math.abs(100*l/t/t-50)/5;return e+=10*g},f}(),i=function(){for(var r=new Array(256),t=new Array(256),e=0;8>e;e+=1)r[e]=1<<e;for(var e=8;256>e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new Error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalCount=r,e.dataCount=t,e},e={},o=function(t,e){switch(e){case n.L:return r[4*(t-1)+0];case n.M:return r[4*(t-1)+1];case n.Q:return r[4*(t-1)+2];case n.H:return r[4*(t-1)+3];default:return}};return e.getRSBlocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+e);for(var a=n.length/3,i=new Array,u=0;a>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],l=n[3*u+2],g=0;f>g;g+=1)i.push(t(c,l));return i},e}(),f=function(){var r=new Array,t=0,e={};return e.getBuffer=function(){return r},e.getAt=function(t){var e=Math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putBit(1==(r>>>t-n-1&1))},e.getLengthInBits=function(){return t},e.putBit=function(e){var n=Math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.MODE_8BIT_BYTE,o=t.stringToBytes(r),a={};return a.getMode=function(){return n},a.getLength=function(r){return o.length},a.write=function(r){for(var t=0;t<o.length;t+=1)r.put(o[t],8)},a},l=function(){var r=new Array,t={};return t.writeByte=function(t){r.push(255&t)},t.writeShort=function(r){t.writeByte(r),t.writeByte(r>>>8)},t.writeBytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writeByte(r[o+e])},t.writeString=function(r){for(var e=0;e<r.length;e+=1)t.writeByte(r.charCodeAt(e))},t.toByteArray=function(){return r},t.toString=function(){var t="";t+="[";for(var e=0;e<r.length;e+=1)e>0&&(t+=","),t+=r[e];return t+="]"},t},g=function(){var r=0,t=0,e=0,n="",o={},a=function(r){n+=String.fromCharCode(i(63&r))},i=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new Error("n:"+r)};return o.writeByte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)a(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(a(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,i=0;o>i;i+=1)n+="="},o.toString=function(){return n},o},s=function(r){var t=r,e=0,n=0,o=0,a={};a.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new Error("unexpected end of file./"+o)}var r=t.charAt(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|i(r.charCodeAt(0)),o+=6)}var a=n>>>o-8&255;return o-=8,a};var i=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return a},v=function(r,t){var e=r,n=t,o=new Array(r*t),a={};a.setPixel=function(r,t,n){o[t*e+r]=n},a.write=function(r){r.writeString("GIF87a"),r.writeShort(e),r.writeShort(n),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(e),r.writeShort(n),r.writeByte(0);var t=2,o=u(t);r.writeByte(t);for(var a=0;o.length-a>255;)r.writeByte(255),r.writeBytes(o,a,255),a+=255;r.writeByte(o.length-a),r.writeBytes(o,a,o.length-a),r.writeByte(0),r.writeString(";")};var i=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new Error("length over");for(;e+o>=8;)t.writeByte(255&(r<<e|n)),o-=8-e,r>>>=8-e,n=0,e=0;n=r<<e|n,e+=o},o.flush=function(){e>0&&t.writeByte(n)},o},u=function(r){for(var t=1<<r,e=(1<<r)+1,n=r+1,a=f(),u=0;t>u;u+=1)a.add(String.fromCharCode(u));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(e));var c=l(),g=i(c);g.write(t,n);var s=0,v=String.fromCharCode(o[s]);for(s+=1;s<o.length;){var h=String.fromCharCode(o[s]);s+=1,a.contains(v+h)?v+=h:(g.write(a.indexOf(v),n),a.size()<4095&&(a.size()==1<<n&&(n+=1),a.add(v+h)),v=h)}return g.write(a.indexOf(v),n),g.write(e,n),g.flush(),c.toByteArray()},f=function(){var r={},t=0,e={};return e.add=function(n){if(e.contains(n))throw new Error("dup key:"+n);r[n]=t,t+=1},e.size=function(){return t},e.indexOf=function(t){return r[t]},e.contains=function(t){return"undefined"!=typeof r[t]},e};return a},h=function(r,t,e,n){for(var o=v(r,t),a=0;t>a;a+=1)for(var i=0;r>i;i+=1)o.setPixel(i,a,e(i,a));var u=l();o.write(u);for(var f=g(),c=u.toByteArray(),s=0;s<c.length;s+=1)f.writeByte(c[s]);f.flush();var h="";return h+="<img",h+=' src="',h+="data:image/gif;base64,",h+=f,h+='"',h+=' width="',h+=r,h+='"',h+=' height="',h+=t,h+='"',n&&(h+=' alt="',h+=n,h+='"'),h+="/>"};return t}();return function(r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r())}(function(){return r}),!function(r){r.stringToBytes=function(r){function t(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);128>n?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}());(function(t){t.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}};function e(e){if(typeof e.data==="string"){e.data={keys:e.data}};if(!e.data||!e.data.keys||typeof e.data.keys!=="string"){return};var a=e.handler,s=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this!==e.target&&(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||(t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable"))||(t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1))){return};var n=e.type!=="keypress"&&t.hotkeys.specialKeys[e.which],f=String.fromCharCode(e.which).toLowerCase(),i="",r={};t.each(["alt","ctrl","shift"],function(t,s){if(e[s+"Key"]&&n!==s){i+=s+"+"}});if(e.metaKey&&!e.ctrlKey&&n!=="meta"){i+="meta+"};if(e.metaKey&&n!=="meta"&&i.indexOf("alt+ctrl+shift+")>-1){i=i.replace("alt+ctrl+shift+","hyper+")};if(n){r[i+n]=!0} +else{r[i+f]=!0;r[i+t.hotkeys.shiftNums[f]]=!0;if(i==="shift+"){r[t.hotkeys.shiftNums[f]]=!0}};for(var o=0,p=s.length;o<p;o++){if(r[s[o]]){return a.apply(this,arguments)}}}};t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})})(jQuery||this.jQuery||window.jQuery);(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e.CodeMirror=t())}(this,(function(){"use strict";var S=navigator.userAgent,Kr=navigator.platform,ie=/gecko\/\d/i.test(S),Xr=/MSIE \d/.test(S),jr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(S),st=/Edge\/(\d+)/.exec(S),l=Xr||jr||st,c=l&&(Xr?document.documentMode||6:+(st||jr)[1]),x=!st&&/WebKit\//.test(S),yl=x&&/Qt\/\d+\.\d+/.test(S),Kt=!st&&/Chrome\//.test(S),E=/Opera\//.test(S),Yr=/Apple Computer/.test(navigator.vendor),bl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(S),wl=/PhantomJS/.test(S),at=!st&&/AppleWebKit/.test(S)&&/Mobile\/\w+/.test(S),Xt=/Android/.test(S),ut=at||Xt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(S),I=at||/Mac/.test(Kr),xl=/\bCrOS\b/.test(S),Cl=/win/i.test(Kr),pe=E&&S.match(/Version\/(\d*\.\d*)/);if(pe){pe=Number(pe[1])};if(pe&&pe>=15){E=!1;x=!0};var Vr=I&&(yl||E&&(pe==null||pe<12.11)),Ni=ie||(l&&c>=9);function ft(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")};var de=function(e,t){var r=e.className,i=ft(t).exec(r);if(i){var n=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(n?i[1]+n:"")}};function re(e){for(var t=e.childNodes.length;t>0;--t){e.removeChild(e.firstChild)};return e};function W(e,t){return re(e).appendChild(t)};function i(e,t,i,r){var n=document.createElement(e);if(i){n.className=i};if(r){n.style.cssText=r};if(typeof t=="string"){n.appendChild(document.createTextNode(t))} +else if(t){for(var o=0;o<t.length;++o){n.appendChild(t[o])}};return n};function Fe(e,t,r,n){var o=i(e,t,r,n);o.setAttribute("role","presentation");return o};var he;if(document.createRange){he=function(e,t,i,r){var n=document.createRange();n.setEnd(r||e,i);n.setStart(e,t);return n}} +else{he=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n};n.collapse(!0);n.moveEnd("character",i);n.moveStart("character",t);return n}};function ne(e,t){if(t.nodeType==3){t=t.parentNode};if(e.contains){return e.contains(t)};do{if(t.nodeType==11){t=t.host};if(t==e){return!0}} +while(t=t.parentNode)};function Y(){var t;try{t=document.activeElement}catch(e){t=document.body||null} +while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement};return t};function ge(e,t){var i=e.className;if(!ft(t).test(i)){e.className+=(i?" ":"")+t}};function Oi(e,t){var r=e.split(" ");for(var i=0;i<r.length;i++){if(r[i]&&!ft(r[i]).test(t)){t+=" "+r[i]}};return t};var lt=function(e){e.select()};if(at){lt=function(e){e.selectionStart=0;e.selectionEnd=e.value.length}} +else if(l){lt=function(e){try{e.select()}catch(t){}}};function Ai(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}};function ve(e,t,i){if(!t){t={}};for(var r in e){if(e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))){t[r]=e[r]}};return t};function H(e,t,i,r,n){if(t==null){t=e.search(/[^\s\u00a0]/);if(t==-1){t=e.length}};for(var l=r||0,s=n||0;;){var o=e.indexOf("\t",l);if(o<0||o>=t){return s+(t-l)};s+=o-l;s+=i-(s%i);l=o+1}};var ce=function(){this.id=null};ce.prototype.set=function(e,t){clearTimeout(this.id);this.id=setTimeout(t,e)};function b(e,t){for(var i=0;i<e.length;++i){if(e[i]==t){return i}};return-1};var Ur=30,Vt={toString:function(){return"CodeMirror.Pass"}};var G={scroll:!1};var Mi={origin:"*mouse"};var ot={origin:"+move"};function Wi(e,t,i){for(var n=0,o=0;;){var r=e.indexOf("\t",n);if(r==-1){r=e.length};var l=r-n;if(r==e.length||o+l>=t){return n+Math.min(l,t-o)};o+=r-n;o+=i-(o%i);n=r+1;if(o>=t){return n}}};var Ut=[""];function Di(e){while(Ut.length<=e){Ut.push(a(Ut)+" ")};return Ut[e]};function a(e){return e[e.length-1]};function jt(e,t){var r=[];for(var i=0;i<e.length;i++){r[i]=t(e[i],i)};return r};function Sl(e,t,i){var r=0,n=i(t);while(r<e.length&&i(e[r])<=n){r++};e.splice(r,0,t)};function qr(){};function Zr(e,t){var i;if(Object.create){i=Object.create(e)} +else{qr.prototype=e;i=new qr()};if(t){ve(t,i)};return i};var ml=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Hi(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ml.test(e))};function Yt(e,t){if(!t){return Hi(e)};if(t.source.indexOf("\\w")>-1&&Hi(e)){return!0};return t.test(e)};function Qr(e){for(var t in e){if(e.hasOwnProperty(t)&&e[t]){return!1}};return!0};var vl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Fi(e){return e.charCodeAt(0)>=768&&vl.test(e)};function Jr(e,t,i){while((i<0?t>0:t<e.length)&&Fi(e.charAt(t))){t+=i};return t};function ct(e,t,i){var o=t>i?-1:1;for(;;){if(t==i){return t};var n=(t+i)/2,r=o<0?Math.ceil(n):Math.floor(n);if(r==t){return e(r)?t:i};if(e(r)){i=r} +else{t=r+o}}};function Ll(e,t,r){var n=this;this.input=r;n.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler");n.scrollbarFiller.setAttribute("cm-not-content","true");n.gutterFiller=i("div",null,"CodeMirror-gutter-filler");n.gutterFiller.setAttribute("cm-not-content","true");n.lineDiv=Fe("div",null,"CodeMirror-code");n.selectionDiv=i("div",null,null,"position: relative; z-index: 1");n.cursorDiv=i("div",null,"CodeMirror-cursors");n.measure=i("div",null,"CodeMirror-measure");n.lineMeasure=i("div",null,"CodeMirror-measure");n.lineSpace=Fe("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var o=Fe("div",[n.lineSpace],"CodeMirror-lines");n.mover=i("div",[o],null,"position: relative");n.sizer=i("div",[n.mover],"CodeMirror-sizer");n.sizerWidth=null;n.heightForcer=i("div",null,null,"position: absolute; height: "+Ur+"px; width: 1px;");n.gutters=i("div",null,"CodeMirror-gutters");n.lineGutter=null;n.scroller=i("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll");n.scroller.setAttribute("tabIndex","-1");n.wrapper=i("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror");if(l&&c<8){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0};if(!x&&!(ie&&ut)){n.scroller.draggable=!0};if(e){if(e.appendChild){e.appendChild(n.wrapper)} +else{e(n.wrapper)}};n.viewFrom=n.viewTo=t.first;n.reportedViewFrom=n.reportedViewTo=t.first;n.view=[];n.renderedView=null;n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.nativeBarWidth=n.barHeight=n.barWidth=0;n.scrollbarsClipped=!1;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.alignWidgets=!1;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null;n.activeTouch=null;r.init(n)};function t(e,t){t-=e.first;if(t<0||t>=e.size){throw new Error("There is no line "+(t+e.first)+" in the document.")};var i=e;while(!i.lines){for(var o=0;;++o){var r=i.children[o],n=r.chunkSize();if(t<n){i=r;break};t-=n}};return i.lines[t]};function me(e,t,i){var n=[],r=t.line;e.iter(t.line,i.line+1,function(e){var o=e.text;if(r==i.line){o=o.slice(0,i.ch)};if(r==t.line){o=o.slice(t.ch)};n.push(o)++r});return n};function Pi(e,t,i){var r=[];e.iter(t,i,function(e){r.push(e.text)});return r};function U(e,t){var r=t-e.height;if(r){for(var i=e;i;i=i.parent){i.height+=r}}};function u(e){if(e.parent==null){return null};var i=e.parent,n=b(i.lines,e);for(var t=i.parent;t;i=t,t=t.parent){for(var r=0;;++r){if(t.children[r]==i){break};n+=t.children[r].chunkSize()}};return n+i.first};function ye(e,t){var o=e.first;outer:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue;outer};t-=s;o+=r.chunkSize()};return o} +while(!e.lines)var i=0;for(;i<e.lines.length;++i){var a=e.lines[i],l=a.height;if(t<l){break};t-=l};return o+i};function ht(e,t){return t>=e.first&&t<e.first+e.size};function Ei(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))};function e(t,i,r){if(r===void 0)r=null;if(!(this instanceof e)){return new e(t,i,r)};this.line=t;this.ch=i;this.sticky=r};function n(e,t){return e.line-t.line||e.ch-t.ch};function Ii(e,t){return e.sticky==t.sticky&&n(e,t)==0};function zi(t){return e(t.line,t.ch)};function qt(e,t){return n(e,t)<0?t:e};function Zt(e,t){return n(e,t)<0?e:t};function en(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))};function o(i,r){if(r.line<i.first){return e(i.first,0)};var n=i.first+i.size-1;if(r.line>n){return e(n,t(i,n).text.length)};return kl(r,t(i,r.line).text.length)};function kl(t,i){var r=t.ch;if(r==null||r>i){return e(t.line,i)} +else if(r<0){return e(t.line,0)} +else{return t}};function tn(e,t){var r=[];for(var i=0;i<t.length;i++){r[i]=o(e,t[i])};return r};var Gr=!1,te=!1;function Tl(){Gr=!0};function Ml(){te=!0};function Qt(e,t,i){this.marker=e;this.from=t;this.to=i};function dt(e,t){if(e){for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t){return r}}}};function Nl(e,t){var r;for(var i=0;i<e.length;++i){if(e[i]!=t){(r||(r=[])).push(e[i])}};return r};function Ol(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t];t.marker.attachLine(e)};function Al(e,t,i){var l;if(e){for(var o=0;o<e.length;++o){var r=e[o],n=r.marker,a=r.from==null||(n.inclusiveLeft?r.from<=t:r.from<t);if(a||r.from==t&&n.type=="bookmark"&&(!i||!r.marker.insertLeft)){var s=r.to==null||(n.inclusiveRight?r.to>=t:r.to>t);(l||(l=[])).push(new Qt(n,r.from,s?null:r.to))}}};return l};function Wl(e,t,i){var l;if(e){for(var o=0;o<e.length;++o){var r=e[o],n=r.marker,a=r.to==null||(n.inclusiveRight?r.to>=t:r.to>t);if(a||r.from==t&&n.type=="bookmark"&&(!i||r.marker.insertLeft)){var s=r.from==null||(n.inclusiveLeft?r.from<=t:r.from<t);(l||(l=[])).push(new Qt(n,s?null:r.from-t,r.to==null?null:r.to-t))}}};return l};function Ri(e,i){if(i.full){return null};var x=ht(e,i.from.line)&&t(e,i.from.line).markedSpans,C=ht(e,i.to.line)&&t(e,i.to.line).markedSpans;if(!x&&!C){return null};var m=i.from.ch,L=i.to.ch,w=n(i.from,i.to)==0,r=Al(x,m,w),o=Wl(C,L,w),s=i.text.length==1,c=a(i.text).length+(s?m:0);if(r){for(var v=0;v<r.length;++v){var f=r[v];if(f.to==null){var g=dt(o,f.marker);if(!g){f.to=m} +else if(s){f.to=g.to==null?null:g.to+c}}}};if(o){for(var p=0;p<o.length;++p){var l=o[p];if(l.to!=null){l.to+=c};if(l.from==null){var S=dt(r,l.marker);if(!S){l.from=c;if(s){(r||(r=[])).push(l)}}} +else{l.from+=c;if(s){(r||(r=[])).push(l)}}}};if(r){r=rn(r)};if(o&&o!=r){o=rn(o)};var d=[r];if(!s){var b=i.text.length-2,h;if(b>0&&r){for(var u=0;u<r.length;++u){if(r[u].to==null){(h||(h=[])).push(new Qt(r[u].marker,null,null))}}};for(var y=0;y<b;++y){d.push(h)};d.push(o)};return d};function rn(e){for(var i=0;i<e.length;++i){var t=e[i];if(t.from!=null&&t.from==t.to&&t.marker.clearWhenEmpty!==!1){e.splice(i--,1)}};if(!e.length){return null};return e};function Dl(e,t,i){var r=null;e.iter(t.line,i.line+1,function(e){if(e.markedSpans){for(var i=0;i<e.markedSpans.length;++i){var t=e.markedSpans[i].marker;if(t.readOnly&&(!r||b(r,t)==-1)){(r||(r=[])).push(t)}}}});if(!r){return null};var a=[{from:t,to:i}];for(var c=0;c<r.length;++c){var f=r[c],l=f.find(0);for(var s=0;s<a.length;++s){var o=a[s];if(n(o.to,l.from)<0||n(o.from,l.to)>0){continue};var u=[s,1],h=n(o.from,l.from),d=n(o.to,l.to);if(h<0||!f.inclusiveLeft&&!h){u.push({from:o.from,to:l.from})};if(d>0||!f.inclusiveRight&&!d){u.push({from:l.to,to:o.to})};a.splice.apply(a,u);s+=u.length-3}};return a};function nn(e){var i=e.markedSpans;if(!i){return};for(var t=0;t<i.length;++t){i[t].marker.detachLine(e)};e.markedSpans=null};function on(e,t){if(!t){return};for(var i=0;i<t.length;++i){t[i].marker.attachLine(e)};e.markedSpans=t};function Jt(e){return e.inclusiveLeft?-1:0};function ei(e){return e.inclusiveRight?1:0};function ln(e,t){var s=e.lines.length-t.lines.length;if(s!=0){return s};var r=e.find(),o=t.find(),l=n(r.from,o.from)||Jt(e)-Jt(t);if(l){return-l};var i=n(r.to,o.to)||ei(e)-ei(t);if(i){return i};return t.id-e.id};function sn(e,t){var o=te&&e.markedSpans,r;if(o){for(var i=(void 0),n=0;n<o.length;++n){i=o[n];if(i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||ln(r,i.marker)<0)){r=i.marker}}};return r};function an(e){return sn(e,!0)};function pt(e){return sn(e,!1)};function un(e,i,r,o,l){var d=t(e,i),c=te&&d.markedSpans;if(c){for(var f=0;f<c.length;++f){var a=c[f];if(!a.marker.collapsed){continue};var s=a.marker.find(0),u=n(s.from,r)||Jt(a.marker)-Jt(l),h=n(s.to,o)||ei(a.marker)-ei(l);if(u>=0&&h<=0||u<=0&&h>=0){continue};if(u<=0&&(a.marker.inclusiveRight&&l.inclusiveLeft?n(s.to,r)>=0:n(s.to,r)>0)||u>=0&&(a.marker.inclusiveRight&&l.inclusiveLeft?n(s.from,o)<=0:n(s.from,o)<0)){return!0}}}};function V(e){var t;while(t=an(e)){e=t.find(-1,!0).line};return e};function Hl(e){var t;while(t=pt(e)){e=t.find(1,!0).line};return e};function Fl(e){var i,t;while(i=pt(e)){e=i.find(1,!0).line;(t||(t=[])).push(e)};return t};function Bi(e,i){var r=t(e,i),n=V(r);if(r==n){return i};return u(n)};function fn(e,i){if(i>e.lastLine()){return i};var r=t(e,i),n;if(!be(e,r)){return i} +while(n=pt(r)){r=n.find(1,!0).line};return u(r)+1};function be(e,t){var n=te&&t.markedSpans;if(n){for(var i=(void 0),r=0;r<n.length;++r){i=n[r];if(!i.marker.collapsed){continue};if(i.from==null){return!0};if(i.marker.widgetNode){continue};if(i.from==0&&i.marker.inclusiveLeft&&Gi(e,t,i)){return!0}}}};function Gi(e,t,i){if(i.to==null){var o=i.marker.find(1,!0);return Gi(e,o.line,dt(o.line.markedSpans,i.marker))};if(i.marker.inclusiveRight&&i.to==t.text.length){return!0};for(var r=(void 0),n=0;n<t.markedSpans.length;++n){r=t.markedSpans[n];if(r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&Gi(e,t,r)){return!0}}};function q(e){e=V(e);var o=0,t=e.parent;for(var n=0;n<t.lines.length;++n){var s=t.lines[n];if(s==e){break} +else{o+=s.height}};for(var i=t.parent;i;t=i,i=t.parent){for(var r=0;r<i.children.length;++r){var l=i.children[r];if(l==t){break} +else{o+=l.height}}};return o};function ti(e){if(e.height==0){return 0};var i=e.text.length,r,t=e;while(r=an(t)){var o=r.find(0,!0);t=o.from.line;i+=o.from.ch-o.to.ch};t=e;while(r=pt(t)){var n=r.find(0,!0);i-=t.text.length-n.from.ch;t=n.to.line;i+=t.text.length-n.to.ch};return i};function Ui(e){var i=e.display,r=e.doc;i.maxLine=t(r,r.first);i.maxLineLength=ti(i.maxLine);i.maxLineChanged=!0;r.iter(function(e){var t=ti(e);if(t>i.maxLineLength){i.maxLineLength=t;i.maxLine=e}})};function Pl(e,t,i,r){if(!e){return r(t,i,"ltr",0)};var l=!1;for(var o=0;o<e.length;++o){var n=e[o];if(n.from<i&&n.to>t||t==i&&n.to==t){r(Math.max(n.from,t),Math.min(n.to,i),n.level==1?"rtl":"ltr",o);l=!0}};if(!l){r(t,i,"ltr")}};var nt=null;function gt(e,t,i){var o;nt=null;for(var n=0;n<e.length;++n){var r=e[n];if(r.from<t&&r.to>t){return n};if(r.to==t){if(r.from!=r.to&&i=="before"){o=n} +else{nt=n}};if(r.from==t){if(r.from!=r.to&&i!="before"){o=n} +else{nt=n}}};return o!=null?o:nt};var gl=(function(){var l="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",s="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(e){if(e<=0xf7){return l.charAt(e)} +else if(0x590<=e&&e<=0x5f4){return"R"} +else if(0x600<=e&&e<=0x6f9){return s.charAt(e-0x600)} +else if(0x6ee<=e&&e<=0x8ac){return"r"} +else if(0x2000<=e&&e<=0x200b){return"w"} +else if(e==0x200c){return"b"} +else{return"L"}};var o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,n=/[1n]/;function e(e,t,i){this.level=e;this.from=t;this.to=i};return function(l,s){var S=s=="ltr"?"L":"R";if(l.length==0||s=="ltr"&&!o.test(l)){return!1};var h=l.length,f=[];for(var H=0;H<h;++H){f.push(u(l.charCodeAt(H)))};for(var M=0,R=S;M<h;++M){var z=f[M];if(z=="m"){f[M]=R} +else{R=z}};for(var L=0,I=S;L<h;++L){var T=f[L];if(T=="1"&&I=="r"){f[L]="n"} +else if(i.test(T)){I=T;if(T=="r"){f[L]="R"}}};for(var b=1,C=f[0];b<h-1;++b){var D=f[b];if(D=="+"&&C=="1"&&f[b+1]=="1"){f[b]="1"} +else if(D==","&&C==f[b+1]&&(C=="1"||C=="n")){f[b]=C};C=D};for(var g=0;g<h;++g){var E=f[g];if(E==","){f[g]="N"} +else if(E=="%"){var y=(void 0);for(y=g+1;y<h&&f[y]=="%";++y){};var K=(g&&f[g-1]=="!")||(y<h&&f[y]=="1")?"1":"N";for(var W=g;W<y;++W){f[W]=K};g=y-1}};for(var k=0,P=S;k<h;++k){var A=f[k];if(P=="L"&&A=="1"){f[k]="L"} +else if(i.test(A)){P=A}};for(var m=0;m<h;++m){if(t.test(f[m])){var v=(void 0);for(v=m+1;v<h&&t.test(f[v]);++v){};var F=(m?f[m-1]:S)=="L",U=(v<h?f[v]:S)=="L",V=F==U?(F?"L":"R"):S;for(var O=m;O<v;++O){f[O]=V};m=v-1}};var d=[],x;for(var c=0;c<h;){if(r.test(f[c])){var G=c;for(++c;c<h&&r.test(f[c]);++c){};d.push(new e(0,G,c))} +else{var w=c,N=d.length;for(++c;c<h&&f[c]!="L";++c){};for(var p=w;p<c;){if(n.test(f[p])){if(w<p){d.splice(N,0,new e(1,w,p))};var B=p;for(++p;p<c&&n.test(f[p]);++p){};d.splice(N,0,new e(2,B,p));w=p} +else{++p}};if(w<c){d.splice(N,0,new e(1,w,c))}}};if(s=="ltr"){if(d[0].level==1&&(x=l.match(/^\s+/))){d[0].from=x[0].length;d.unshift(new e(0,0,x[0].length))};if(a(d).level==1&&(x=l.match(/\s+$/))){a(d).to-=x[0].length;d.push(new e(0,h-x[0].length,h))}};return s=="rtl"?d.reverse():d}})();function Z(e,t){var i=e.order;if(i==null){i=e.order=gl(e.text,t)};return i};var Br=[],r=function(e,t,i){if(e.addEventListener){e.addEventListener(t,i,!1)} +else if(e.attachEvent){e.attachEvent("on"+t,i)} +else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Br).concat(i)}};function Vi(e,t){return e._handlers&&e._handlers[t]||Br};function D(e,t,i){if(e.removeEventListener){e.removeEventListener(t,i,!1)} +else if(e.detachEvent){e.detachEvent("on"+t,i)} +else{var o=e._handlers,r=o&&o[t];if(r){var n=b(r,i);if(n>-1){o[t]=r.slice(0,n).concat(r.slice(n+1))}}}};function p(e,t){var r=Vi(e,t);if(!r.length){return};var n=Array.prototype.slice.call(arguments,2);for(var i=0;i<r.length;++i){r[i].apply(null,n)}};function v(e,t,i){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=!0}}};p(e,i||t.type,e,t);return Ki(t)||t.codemirrorIgnore};function cn(e){var i=e._handlers&&e._handlers.cursorActivity;if(!i){return};var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var t=0;t<i.length;++t){if(b(r,i[t])==-1){r.push(i[t])}}};function F(e,t){return Vi(e,t).length>0};function Pe(e){e.prototype.on=function(e,t){r(this,e,t)};e.prototype.off=function(e,t){D(this,e,t)}};function T(e){if(e.preventDefault){e.preventDefault()} +else{e.returnValue=!1}};function hn(e){if(e.stopPropagation){e.stopPropagation()} +else{e.cancelBubble=!0}};function Ki(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1};function vt(e){T(e);hn(e)};function Xi(e){return e.target||e.srcElement};function dn(e){var t=e.which;if(t==null){if(e.button&1){t=1} +else if(e.button&2){t=3} +else if(e.button&4){t=2}};if(I&&e.ctrlKey&&t==1){t=3};return t};var pl=function(){if(l&&c<9){return!1};var e=i("div");return"draggable" in e||"dragDrop" in e}(),Ti;function El(e){if(Ti==null){var t=i("span","\u200b");W(e,i("span",[t,document.createTextNode("x")]));if(e.firstChild.offsetHeight!=0){Ti=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&c<8)}};var r=Ti?i("span","\u200b"):i("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");r.setAttribute("cm-text","");return r};var ki;function Il(e){if(ki!=null){return ki};var i=W(e,document.createTextNode("A\u062eA")),t=he(i,0,1).getBoundingClientRect(),r=he(i,1,2).getBoundingClientRect();re(e);if(!t||t.left==t.right){return!1};return ki=(r.right-t.right<3)};var Si="\n\nb".split(/\n/).length!=3?function(e){var i=0,o=[],l=e.length;while(i<=l){var t=e.indexOf("\n",i);if(t==-1){t=e.length};var r=e.slice(i,e.charAt(t-1)=="\r"?t-1:t),n=r.indexOf("\r");if(n!=-1){o.push(r.slice(0,n));i+=n+1} +else{o.push(r);i=t+1}};return o}:function(e){return e.split(/\r\n?|\n/)},hl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var i;try{i=e.ownerDocument.selection.createRange()}catch(t){};if(!i||i.parentElement()!=e){return!1};return i.compareEndPoints("StartToEnd",i)!=0},dl=(function(){var e=i("div");if("oncopy" in e){return!0};e.setAttribute("oncopy","return;");return typeof e.oncopy=="function"})(),Li=null;function zl(e){if(Li!=null){return Li};var t=W(e,i("span","x")),r=t.getBoundingClientRect(),n=he(t,0,1).getBoundingClientRect();return Li=Math.abs(r.left-n.left)>1};var Ci={};var He={};function Rl(e,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)};Ci[e]=t};function Bl(e,t){He[e]=t};function ii(e){if(typeof e=="string"&&He.hasOwnProperty(e)){e=He[e]} +else if(e&&typeof e.name=="string"&&He.hasOwnProperty(e.name)){var t=He[e.name];if(typeof t=="string"){t={name:t}};e=Zr(t,e);e.name=t.name} +else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e)){return ii("application/xml")} +else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e)){return ii("application/json")};if(typeof e=="string"){return{name:e}} +else{return e||{name:"null"}}};function ji(e,t){t=ii(t);var l=Ci[t.name];if(!l){return ji(e,"text/plain")};var i=l(e,t);if(De.hasOwnProperty(t.name)){var n=De[t.name];for(var r in n){if(!n.hasOwnProperty(r)){continue};if(i.hasOwnProperty(r)){i["_"+r]=i[r]};i[r]=n[r]}};i.name=t.name;if(t.helperType){i.helperType=t.helperType};if(t.modeProps){for(var o in t.modeProps){i[o]=t.modeProps[o]}};return i};var De={};function Gl(e,t){var i=De.hasOwnProperty(e)?De[e]:(De[e]={});ve(t,i)};function we(e,t){if(t===!0){return t};if(e.copyState){return e.copyState(t)};var n={};for(var r in t){var i=t[r];if(i instanceof Array){i=i.concat([])};n[r]=i};return n};function Yi(e,t){var i;while(e.innerMode){i=e.innerMode(t);if(!i||i.mode==e){break};t=i.state;e=i.mode};return i||{mode:e,state:t}};function pn(e,t,i){return e.startState?e.startState(t,i):!0};var d=function(e,t,i){this.pos=this.start=0;this.string=e;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=i};d.prototype.eol=function(){return this.pos>=this.string.length};d.prototype.sol=function(){return this.pos==this.lineStart};d.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};d.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};d.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"){i=t==e} +else{i=t&&(e.test?e.test(t):e(t))};if(i){++this.pos;return t}};d.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e)){};return this.pos>t};d.prototype.eatSpace=function(){var e=this,t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++e.pos};return this.pos>t};d.prototype.skipToEnd=function(){this.pos=this.string.length};d.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1){this.pos=t;return!0}};d.prototype.backUp=function(e){this.pos-=e};d.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start};return this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)};d.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)};d.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(e){return i?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(n(o)==n(e)){if(t!==!1){this.pos+=e.length};return!0}} +else{var r=this.string.slice(this.pos).match(e);if(r&&r.index>0){return null};if(r&&t!==!1){this.pos+=r[0].length};return r}};d.prototype.current=function(){return this.string.slice(this.start,this.pos)};d.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};d.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};d.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Gt=function(e,t){this.state=e;this.lookAhead=t},B=function(e,t,i,r){this.state=t;this.doc=e;this.line=i;this.maxLookAhead=r||0;this.baseTokens=null;this.baseTokenPos=1};B.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);if(t!=null&&e>this.maxLookAhead){this.maxLookAhead=e};return t};B.prototype.baseToken=function(e){var i=this;if(!this.baseTokens){return null} +while(this.baseTokens[this.baseTokenPos]<=e){i.baseTokenPos+=2};var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}};B.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};B.fromSaved=function(e,t,i){if(t instanceof Gt){return new B(e,we(e.mode,t.state),i,t.lookAhead)} +else{return new B(e,we(e.mode,t),i)}};B.prototype.save=function(e){var t=e!==!1?we(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Gt(t,this.maxLookAhead):t};function gn(e,t,i,r){var n=[e.state.modeGen],o={};wn(e,t.text,e.doc.mode,i,function(e,t){return n.push(e,t)},o,r);var s=i.state,a=function(r){i.baseTokens=n;var a=e.state.overlays[r],l=1,u=0;i.state=!0;wn(e,t.text,a.mode,i,function(e,t){var i=l;while(u<e){var r=n[l];if(r>e){n.splice(l,1,e,n[l+1],r)};l+=2;u=Math.min(e,r)};if(!t){return};if(a.opaque){n.splice(i,l-i,e,"overlay "+t);l=i+2} +else{for(;i<l;i+=2){var o=n[i+1];n[i+1]=(o?o+" ":"")+"overlay "+t}}},o);i.state=s;i.baseTokens=null;i.baseTokenPos=1};for(var l=0;l<e.state.overlays.length;++l)a(l);return{styles:n,classes:o.bgClass||o.textClass?o:null}};function vn(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mt(e,u(t)),n=t.text.length>e.options.maxHighlightLength&&we(e.doc.mode,r.state),o=gn(e,t,r);if(n){r.state=n};t.stateAfter=r.save(!n);t.styles=o.styles;if(o.classes){t.styleClasses=o.classes} +else if(t.styleClasses){t.styleClasses=null};if(i===e.doc.highlightFrontier){e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier)}};return t.styles};function mt(e,i,r){var n=e.doc,a=e.display;if(!n.mode.startState){return new B(n,!0,i)};var l=Ul(e,i,r),s=l>n.first&&t(n,l-1).stateAfter,o=s?B.fromSaved(n,s,l):new B(n,pn(n.mode),l);n.iter(l,i,function(t){qi(e,t.text,o);var r=o.line;t.stateAfter=r==i-1||r%5==0||r>=a.viewFrom&&r<a.viewTo?o.save():null;o.nextLine()});if(r){n.modeFrontier=o.line};return o};function qi(e,t,i,r){var o=e.doc.mode,n=new d(t,e.options.tabSize,i);n.start=n.pos=r||0;if(t==""){mn(o,i.state)} +while(!n.eol()){Zi(o,n,i.state);n.start=n.pos}};function mn(e,t){if(e.blankLine){return e.blankLine(t)};if(!e.innerMode){return};var i=Yi(e,t);if(i.mode.blankLine){return i.mode.blankLine(i.state)}};function Zi(e,t,i,r){for(var n=0;n<10;n++){if(r){r[0]=Yi(e,i).mode};var o=e.token(t,i);if(t.pos>t.start){return o}};throw new Error("Mode "+e.name+" failed to advance stream.")};var Rr=function(e,t,i){this.start=e.start;this.end=e.pos;this.string=e.current();this.type=t||null;this.state=i};function yn(e,i,r,n){var a=e.doc,h=a.mode,f;i=o(a,i);var c=t(a,i.line),s=mt(e,i.line,r),l=new d(c.text,e.options.tabSize,s),u;if(n){u=[]} +while((n||l.pos<i.ch)&&!l.eol()){l.start=l.pos;f=Zi(h,l,s.state);if(n){u.push(new Rr(l,f,we(a.mode,s.state)))}};return n?u:new Rr(l,f,s.state)};function bn(e,t){if(e){for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i){break};e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";if(t[r]==null){t[r]=i[2]} +else if(!(new RegExp("(?:^|\s)"+i[2]+"(?:$|\s)")).test(t[r])){t[r]+=" "+i[2]}}};return e};function wn(e,t,i,r,n,l,u){var c=i.flattenSpans;if(c==null){c=e.options.flattenSpans};var s=0,f=null,o=new d(t,e.options.tabSize,r),a,p=e.options.addModeClass&&[null];if(t==""){bn(mn(i,r.state),l)} +while(!o.eol()){if(o.pos>e.options.maxHighlightLength){c=!1;if(u){qi(e,t,r,o.pos)};o.pos=t.length;a=null} +else{a=bn(Zi(i,o,r.state,p),l)};if(p){var h=p[0].name;if(h){a="m-"+(a?h+" "+a:h)}};if(!c||f!=a){while(s<o.start){s=Math.min(o.start,s+5000);n(s,f)};f=a};o.start=o.pos} +while(s<o.pos){var g=Math.min(o.pos,s+5000);n(g,f);s=g}};function Ul(e,i,r){var f,s,o=e.doc,c=r?-1:i-(e.doc.mode.innerMode?1000:100);for(var n=i;n>c;--n){if(n<=o.first){return o.first};var u=t(o,n-1),l=u.stateAfter;if(l&&(!r||n+(l instanceof Gt?l.lookAhead:0)<=o.modeFrontier)){return n};var a=H(u.text,null,e.options.tabSize);if(s==null||f>a){s=n-1;f=a}};return s};function Vl(e,i){e.modeFrontier=Math.min(e.modeFrontier,i);if(e.highlightFrontier<i-10){return};var o=e.first;for(var r=i-1;r>o;r--){var n=t(e,r).stateAfter;if(n&&(!(n instanceof Gt)||r+n.lookAhead<i)){o=r+1;break}};e.highlightFrontier=Math.min(e.highlightFrontier,o)};var We=function(e,t,i){this.text=e;on(this,t);this.height=i?i(this):1};We.prototype.lineNo=function(){return u(this)};Pe(We);function Kl(e,t,i,r){e.text=t;if(e.stateAfter){e.stateAfter=null};if(e.styles){e.styles=null};if(e.order!=null){e.order=null};nn(e);on(e,i);var n=r?r(e):1;if(n!=e.height){U(e,n)}};function Xl(e){e.parent=null;nn(e)};var cl={};var fl={};function xn(e,t){if(!e||/^\s*$/.test(e)){return null};var i=t.addModeClass?fl:cl;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))};function Cn(e,t){var a=Fe("span",null,null,x?"padding-right: .1px":null),i={pre:Fe("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(l||x)&&e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var r=n?t.rest[n-1]:t.line,s=(void 0);i.pos=0;i.addToken=Yl;if(Il(e.display.measure)&&(s=Z(r,e.doc.direction))){i.addToken=Zl(i.addToken,s)};i.map=[];var f=t!=e.display.externalMeasured&&u(r);Ql(r,i,vn(e,r,f));if(r.styleClasses){if(r.styleClasses.bgClass){i.bgClass=Oi(r.styleClasses.bgClass,i.bgClass||"")};if(r.styleClasses.textClass){i.textClass=Oi(r.styleClasses.textClass,i.textClass||"")}};if(i.map.length==0){i.map.push(0,0,i.content.appendChild(El(e.display.measure)))};if(n==0){t.measure.map=i.map;t.measure.cache={}} +else{;(t.measure.maps||(t.measure.maps=[])).push(i.map);(t.measure.caches||(t.measure.caches=[])).push({})}};if(x){var o=i.content.lastChild;if(/\bcm-tab\b/.test(o.className)||(o.querySelector&&o.querySelector(".cm-tab"))){i.content.className="cm-tab-wrap-hack"}};p(e,"renderLine",e,t.line,i.pre);if(i.pre.className){i.textClass=Oi(i.pre.className,i.textClass||"")};return i};function jl(e){var t=i("span","\u2022","cm-invalidchar");t.title="\\u"+e.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t};function Yl(e,t,r,n,o,f,h){if(!t){return};var m=e.splitSpaces?ql(t,e.trailingSpace):t,y=e.cm.state.specialChars,C=!1,s;if(!y.test(t)){e.col+=t.length;s=document.createTextNode(m);e.map.push(e.pos,e.pos+t.length,s);if(l&&c<9){C=!0};e.pos+=t.length} +else{s=document.createDocumentFragment();var p=0;while(!0){y.lastIndex=p;var u=y.exec(t),d=u?u.index-p:t.length-p;if(d){var v=document.createTextNode(m.slice(p,p+d));if(l&&c<9){s.appendChild(i("span",[v]))} +else{s.appendChild(v)};e.map.push(e.pos,e.pos+d,v);e.col+=d;e.pos+=d};if(!u){break};p+=d+1;var a=(void 0);if(u[0]=="\t"){var w=e.cm.options.tabSize,x=w-e.col%w;a=s.appendChild(i("span",Di(x),"cm-tab"));a.setAttribute("role","presentation");a.setAttribute("cm-text","\t");e.col+=x} +else if(u[0]=="\r"||u[0]=="\n"){a=s.appendChild(i("span",u[0]=="\r"?"\u240d":"\u2424","cm-invalidchar"));a.setAttribute("cm-text",u[0]);e.col+=1} +else{a=e.cm.options.specialCharPlaceholder(u[0]);a.setAttribute("cm-text",u[0]);if(l&&c<9){s.appendChild(i("span",[a]))} +else{s.appendChild(a)};e.col+=1};e.map.push(e.pos,e.pos+1,a);e.pos++}};e.trailingSpace=m.charCodeAt(t.length-1)==32;if(r||n||o||C||h){var g=r||"";if(n){g+=n};if(o){g+=o};var b=i("span",[s],g,h);if(f){b.title=f};return e.content.appendChild(b)};e.content.appendChild(s)};function ql(e,t){if(e.length>1&&!/ /.test(e)){return e};var n=t,o="";for(var i=0;i<e.length;i++){var r=e.charAt(i);if(r==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)){r="\u00a0"};o+=r;n=r==" "};return o};function Zl(e,t){return function(i,r,n,o,l,s,u){n=n?n+" cm-force-border":"cm-force-border";var f=i.pos,h=f+r.length;for(;;){var a=(void 0);for(var c=0;c<t.length;c++){a=t[c];if(a.to>f&&a.from<=f){break}};if(a.to>=h){return e(i,r,n,o,l,s,u)};e(i,r.slice(0,a.to-f),n,o,null,s,u);o=null;r=r.slice(a.to-f);f=a.to}}};function Sn(e,t,i,r){var n=!r&&i.widgetNode;if(n){e.map.push(e.pos,e.pos+t,n)};if(!r&&e.cm.display.input.needsContentAttribute){if(!n){n=e.content.appendChild(document.createElement("span"))};n.setAttribute("cm-marker",i.id)};if(n){e.cm.display.input.setUneditable(n);e.content.appendChild(n)};e.pos+=t;e.trailingSpace=!1};function Ql(e,t,i){var k=e.markedSpans,T=e.text,y=0;if(!k){for(var m=1;m<i.length;m+=2){t.addToken(t,T.slice(y,y=i[m]),xn(i[m+1],t.cm.options))};return};var S=T.length,r=0,N=1,a="",L,c,s=0,d,p,g,v,l;for(;;){if(s==r){d=p=g=v=c="";l=null;s=Infinity;var C=[],u=(void 0);for(var x=0;x<k.length;++x){var n=k[x],o=n.marker;if(o.type=="bookmark"&&n.from==r&&o.widgetNode){C.push(o)} +else if(n.from<=r&&(n.to==null||n.to>r||o.collapsed&&n.to==r&&n.from==r)){if(n.to!=null&&n.to!=r&&s>n.to){s=n.to;p=""};if(o.className){d+=" "+o.className};if(o.css){c=(c?c+";":"")+o.css};if(o.startStyle&&n.from==r){g+=" "+o.startStyle};if(o.endStyle&&n.to==s){(u||(u=[])).push(o.endStyle,n.to)};if(o.title&&!v){v=o.title};if(o.collapsed&&(!l||ln(l.marker,o)<0)){l=n}} +else if(n.from>r&&s>n.from){s=n.from}};if(u){for(var h=0;h<u.length;h+=2){if(u[h+1]==s){p+=" "+u[h]}}};if(!l||l.from==r){for(var w=0;w<C.length;++w){Sn(t,0,C[w])}};if(l&&(l.from||0)==r){Sn(t,(l.to==null?S+1:l.to)-r,l.marker,l.from==null);if(l.to==null){return};if(l.to==r){l=!1}}};if(r>=S){break};var f=Math.min(S,s);while(!0){if(a){var b=r+a.length;if(!l){var M=b>f?a.slice(0,f-r):a;t.addToken(t,M,L?L+d:d,g,r+M.length==s?p:"",v,c)};if(b>=f){a=a.slice(f-r);r=f;break};r=b;g=""};a=T.slice(y,y=i[N++]);L=xn(i[N++],t.cm.options)}}};function Ln(e,t,i){this.line=t;this.rest=Fl(t);this.size=this.rest?u(a(this.rest))-i+1:1;this.node=this.text=null;this.hidden=be(e,t)};function ri(e,i,r){var l=[],s;for(var n=i;n<r;n=s){var o=new Ln(e.doc,t(e.doc,n),n);s=n+o.size;l.push(o)};return l};var Ae=null;function Jl(e){if(Ae){Ae.ops.push(e)} +else{e.ownsGroup=Ae={ops:[e],delayedCallbacks:[]}}};function es(e){var n=e.delayedCallbacks,i=0;do{for(;i<n.length;i++){n[i].call(null)};for(var r=0;r<e.ops.length;r++){var t=e.ops[r];if(t.cursorActivityHandlers){while(t.cursorActivityCalled<t.cursorActivityHandlers.length){t.cursorActivityHandlers[t.cursorActivityCalled++].call(null,t.cm)}}}} +while(i<n.length)};function ts(e,t){var i=e.ownsGroup;if(!i){return};try{es(i)}finally{Ae=null;t(i)}};var rt=null;function w(e,t){var n=Vi(e,t);if(!n.length){return};var l=Array.prototype.slice.call(arguments,2),i;if(Ae){i=Ae.delayedCallbacks} +else if(rt){i=rt} +else{i=rt=[];setTimeout(is,0)};var o=function(e){i.push(function(){return n[e].apply(null,l)})};for(var r=0;r<n.length;++r)o(r)};function is(){var t=rt;rt=null;for(var e=0;e<t.length;++e){t[e]()}};function kn(e,t,i,r){for(var o=0;o<t.changes.length;o++){var n=t.changes[o];if(n=="text"){ns(e,t)} +else if(n=="gutter"){Mn(e,t,i,r)} +else if(n=="class"){Qi(e,t)} +else if(n=="widget"){os(e,t,r)}};t.changes=null};function yt(e){if(e.node==e.text){e.node=i("div",null,null,"position: relative");if(e.text.parentNode){e.text.parentNode.replaceChild(e.node,e.text)};e.node.appendChild(e.text);if(l&&c<8){e.node.style.zIndex=2}};return e.node};function rs(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r){r+=" CodeMirror-linebackground"};if(t.background){if(r){t.background.className=r} +else{t.background.parentNode.removeChild(t.background);t.background=null}} +else if(r){var n=yt(t);t.background=n.insertBefore(i("div",null,r),n.firstChild);e.display.input.setUneditable(t.background)}};function Tn(e,t){var i=e.display.externalMeasured;if(i&&i.line==t.line){e.display.externalMeasured=null;t.measure=i.measure;return i.built};return Cn(e,t)};function ns(e,t){var r=t.text.className,i=Tn(e,t);if(t.text==t.node){t.node=i.pre};t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;if(i.bgClass!=t.bgClass||i.textClass!=t.textClass){t.bgClass=i.bgClass;t.textClass=i.textClass;Qi(e,t)} +else if(r){t.text.className=r}};function Qi(e,t){rs(e,t);if(t.line.wrapClass){yt(t).className=t.line.wrapClass} +else if(t.node!=t.text){t.node.className=""};var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""};function Mn(e,t,r,n){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null};if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null};if(t.line.gutterClass){var c=yt(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,("left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+(n.gutterTotalWidth)+"px"));e.display.input.setUneditable(t.gutterBackground);c.insertBefore(t.gutterBackground,t.text)};var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var f=yt(t),l=t.gutter=i("div",null,"CodeMirror-gutter-wrapper",("left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px"));e.display.input.setUneditable(l);f.insertBefore(l,t.text);if(t.line.gutterClass){l.className+=" "+t.line.gutterClass};if(e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){t.lineNumber=l.appendChild(i("div",Ei(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt",("left: "+(n.gutterLeft["CodeMirror-linenumbers"])+"px; width: "+(e.display.lineNumInnerWidth)+"px")))};if(o){for(var a=0;a<e.options.gutters.length;++a){var s=e.options.gutters[a],u=o.hasOwnProperty(s)&&o[s];if(u){l.appendChild(i("div",[u],"CodeMirror-gutter-elt",("left: "+(n.gutterLeft[s])+"px; width: "+(n.gutterWidth[s])+"px")))}}}}};function os(e,t,i){if(t.alignable){t.alignable=null};for(var r=t.node.firstChild,n=(void 0);r;r=n){n=r.nextSibling;if(r.className=="CodeMirror-linewidget"){t.node.removeChild(r)}};Nn(e,t,i)};function ls(e,t,i,r){var n=Tn(e,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass};if(n.textClass){t.textClass=n.textClass};Qi(e,t);Mn(e,t,i,r);Nn(e,t,r);return t.node};function Nn(e,t,i){On(e,t.line,t,i,!0);if(t.rest){for(var r=0;r<t.rest.length;r++){On(e,t.rest[r],t,i,!1)}}};function On(e,t,r,n,o){if(!t.widgets){return};var f=yt(r);for(var a=0,u=t.widgets;a<u.length;++a){var l=u[a],s=i("div",[l.node],"CodeMirror-linewidget");if(!l.handleMouseEvents){s.setAttribute("cm-ignore-events","true")};ss(l,s,r,n);e.display.input.setUneditable(s);if(o&&l.above){f.insertBefore(s,r.gutter||r.text)} +else{f.appendChild(s)};w(l,"redraw")}};function ss(e,t,i,r){if(e.noHScroll){;(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px";if(!e.coverGutter){n-=r.gutterTotalWidth;t.style.paddingLeft=r.gutterTotalWidth+"px"};t.style.width=n+"px"};if(e.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!e.noHScroll){t.style.marginLeft=-r.gutterTotalWidth+"px"}}};function bt(e){if(e.height!=null){return e.height};var t=e.doc.cm;if(!t){return 0};if(!ne(document.body,e.node)){var r="position: relative;";if(e.coverGutter){r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"};if(e.noHScroll){r+="width: "+t.display.wrapper.clientWidth+"px;"};W(t.display.measure,i("div",[e.node],null,r))};return e.height=e.node.parentNode.offsetHeight};function Q(e,t){for(var i=Xi(t);i!=e.wrapper;i=i.parentNode){if(!i||(i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true")||(i.parentNode==e.sizer&&i!=e.mover)){return!0}}};function ni(e){return e.lineSpace.offsetTop};function Ji(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight};function An(e){if(e.cachedPaddingH){return e.cachedPaddingH};var r=W(e.measure,i("pre","x")),n=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,t={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};if(!isNaN(t.left)&&!isNaN(t.right)){e.cachedPaddingH=t};return t};function K(e){return Ur-e.display.nativeBarWidth};function xe(e){return e.display.scroller.clientWidth-K(e)-e.display.barWidth};function er(e){return e.display.scroller.clientHeight-K(e)-e.display.barHeight};function as(e,t,i){var o=e.options.lineWrapping,u=o&&xe(e);if(!t.measure.heights||o&&t.measure.width!=u){var a=t.measure.heights=[];if(o){t.measure.width=u;var n=t.text.firstChild.getClientRects();for(var r=0;r<n.length-1;r++){var l=n[r],s=n[r+1];if(Math.abs(l.bottom-s.bottom)>2){a.push((l.bottom+s.top)/2-i.top)}}};a.push(i.bottom-i.top)}};function Wn(e,t,i){if(e.line==t){return{map:e.measure.map,cache:e.measure.cache}};for(var n=0;n<e.rest.length;n++){if(e.rest[n]==t){return{map:e.measure.maps[n],cache:e.measure.caches[n]}}};for(var r=0;r<e.rest.length;r++){if(u(e.rest[r])>i){return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}}};function us(e,t){t=V(t);var n=u(t),i=e.display.externalMeasured=new Ln(e.doc,t,n);i.lineN=n;var r=i.built=Cn(e,i);i.text=r.pre;W(e.display.lineMeasure,r.pre);return i};function Dn(e,t,i,r){return X(e,Ee(e,t),i,r)};function tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo){return e.display.view[Le(e,t)]};var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size){return i}};function Ee(e,t){var n=u(t),i=tr(e,n);if(i&&!i.text){i=null} +else if(i&&i.changes){kn(e,i,n,sr(e));e.curOp.forceUpdate=!0};if(!i){i=us(e,t)};var r=Wn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}};function X(e,t,i,r,n){if(t.before){i=-1};var l=i+(r||""),o;if(t.cache.hasOwnProperty(l)){o=t.cache[l]} +else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()};if(!t.hasHeights){as(e,t.view,t.rect);t.hasHeights=!0};o=cs(e,t,i,r);if(!o.bogus){t.cache[l]=o}};return{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}};var zr={left:0,right:0,top:0,bottom:0};function Hn(e,t,i){var a,n,u,s,l,o;for(var r=0;r<e.length;r+=3){l=e[r];o=e[r+1];if(t<l){n=0;u=1;s="left"} +else if(t<o){n=t-l;u=n+1} +else if(r==e.length-3||t==o&&e[r+3]>t){u=o-l;n=u-1;if(t>=o){s="right"}};if(n!=null){a=e[r+2];if(l==o&&i==(a.insertLeft?"left":"right")){s=i};if(i=="left"&&n==0){while(r&&e[r-2]==e[r-3]&&e[r-1].insertLeft){a=e[(r-=3)+2];s="left"}};if(i=="right"&&n==o-l){while(r<e.length-3&&e[r+3]==e[r+4]&&!e[r+5].insertLeft){a=e[(r+=3)+2];s="right"}};break}};return{node:a,start:n,end:u,collapse:s,coverStart:l,coverEnd:o}};function fs(e,t){var i=zr;if(t=="left"){for(var n=0;n<e.length;n++){if((i=e[n]).left!=i.right){break}}} +else{for(var r=e.length-1;r>=0;r--){if((i=e[r]).left!=i.right){break}}};return i};function cs(e,t,i,r){var s=Hn(t.map,i,r),u=s.node,o=s.start,f=s.end,g=s.collapse,n;if(u.nodeType==3){for(var b=0;b<4;b++){while(o&&Fi(t.line.text.charAt(s.coverStart+o))){--o} +while(s.coverStart+f<s.coverEnd&&Fi(t.line.text.charAt(s.coverStart+f))){++f};if(l&&c<9&&o==0&&f==s.coverEnd-s.coverStart){n=u.parentNode.getBoundingClientRect()} +else{n=fs(he(u,o,f).getClientRects(),r)};if(n.left||n.right||o==0){break};f=o;o=o-1;g="right"};if(l&&c<11){n=hs(e.display.measure,n)}} +else{if(o>0){g=r="right"};var v;if(e.options.lineWrapping&&(v=u.getClientRects()).length>1){n=v[r=="right"?v.length-1:0]} +else{n=u.getBoundingClientRect()}};if(l&&c<9&&!o&&(!n||!n.left&&!n.right)){var h=u.parentNode.getClientRects()[0];if(h){n={left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}} +else{n=zr}};var m=n.top-t.rect.top,y=n.bottom-t.rect.top,C=(m+y)/2,p=t.view.measure.heights,a=0;for(;a<p.length-1;a++){if(C<p[a]){break}};var w=a?p[a-1]:0,x=p[a],d={left:(g=="right"?n.right:n.left)-t.rect.left,right:(g=="left"?n.left:n.right)-t.rect.left,top:w,bottom:x};if(!n.left&&!n.right){d.bogus=!0};if(!e.options.singleCursorHeightPerLine){d.rtop=m;d.rbottom=y};return d};function hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!zl(e)){return t};var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}};function Fn(e){if(e.measure){e.measure.cache={};e.measure.heights=null;if(e.rest){for(var t=0;t<e.rest.length;t++){e.measure.caches[t]={}}}}};function Pn(e){e.display.externalMeasure=null;re(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++){Fn(e.display.view[t])}};function wt(e){Pn(e);e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null;if(!e.options.lineWrapping){e.display.maxLineChanged=!0};e.display.lineNumChars=null};function En(){if(Kt&&Xt){return-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft))};return window.pageXOffset||(document.documentElement||document.body).scrollLeft};function In(){if(Kt&&Xt){return-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop))};return window.pageYOffset||(document.documentElement||document.body).scrollTop};function ir(e){var i=0;if(e.widgets){for(var t=0;t<e.widgets.length;++t){if(e.widgets[t].above){i+=bt(e.widgets[t])}}};return i};function oi(e,t,i,r,n){if(!n){var a=ir(t);i.top+=a;i.bottom+=a};if(r=="line"){return i};if(!r){r="local"};var o=q(t);if(r=="local"){o+=ni(e.display)} +else{o-=e.display.viewOffset};if(r=="page"||r=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(r=="window"?0:In());var l=s.left+(r=="window"?0:En());i.left+=l;i.right+=l};i.top+=o;i.bottom+=o;return i};function zn(e,t,i){if(i=="div"){return t};var r=t.left,n=t.top;if(i=="page"){r-=En();n-=In()} +else if(i=="local"||!i){var l=e.display.sizer.getBoundingClientRect();r+=l.left;n+=l.top};var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:n-o.top}};function rr(e,i,r,n,o){if(!n){n=t(e.doc,i.line)};return oi(e,n,Dn(e,n,i.ch,o),r)};function z(e,i,r,n,o,a){n=n||t(e.doc,i.line);if(!o){o=Ee(e,n)};function h(t,i){var l=X(e,o,t,i?"right":"left",a);if(i){l.left=l.right} +else{l.right=l.left};return oi(e,n,l,r)};var u=Z(n,e.doc.direction),l=i.ch,s=i.sticky;if(l>=n.text.length){l=n.text.length;s="before"} +else if(l<=0){l=0;s="after"};if(!u){return h(s=="before"?l-1:l,s=="before")};function d(e,t,i){var r=u[t],n=r.level==1;return h(i?e-1:e,n!=i)};var p=gt(u,l,s),f=nt,c=d(l,p,s=="before");if(f!=null){c.other=d(l,f,s!="before")};return c};function Rn(e,i){var r=0;i=o(e.doc,i);if(!e.options.lineWrapping){r=xt(e.display)*i.ch};var n=t(e.doc,i.line),l=q(n)+ni(e.display);return{left:r,right:r,top:l,bottom:l+n.height}};function nr(t,i,r,n,o){var l=e(t,i,r);l.xRel=o;if(n){l.outside=!0};return l};function or(e,i,r){var n=e.doc;r+=e.display.viewOffset;if(r<0){return nr(n.first,0,null,!0,-1)};var l=ye(n,r),c=n.first+n.size-1;if(l>c){return nr(n.first+n.size-1,t(n,c).text.length,null,!0,1)};if(i<0){i=0};var f=t(n,l);for(;;){var o=ds(e,f,l,i,r),s=pt(f),a=s&&s.find(0,!0);if(s&&(o.ch>a.from.ch||o.ch==a.from.ch&&o.xRel>0)){l=u(f=a.to.line)} +else{return o}}};function Bn(e,t,i,r){r-=ir(t);var n=t.text.length,o=ct(function(t){return X(e,i,t-1).bottom<=r},n,0);n=ct(function(t){return X(e,i,t).top>r},o,n);return{begin:o,end:n}};function Gn(e,t,i,r){if(!i){i=Ee(e,t)};var n=oi(e,t,X(e,i,r),"line").top;return Bn(e,t,i,n)};function lr(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t};function ds(t,i,r,n,o){o-=q(i);var c=Ee(t,i),p=ir(i),g=0,v=i.text.length,s=!0,x=Z(i,t.doc.direction);if(x){var u=(t.options.lineWrapping?gs:ps)(t,i,r,c,x,n,o);s=u.level!=1;g=s?u.from:u.to-1;v=s?u.to:u.from-1};var b=null,a=null,l=ct(function(e){var i=X(t,c,e);i.top+=p;i.bottom+=p;if(!lr(i,n,o,!1)){return!1};if(i.top<=o&&i.left<=n){b=e;a=i};return!0},g,v),d,f,w=!1;if(a){var m=n-a.left<a.right-n,y=m==s;l=b+(y?0:1);f=y?"after":"before";d=m?a.left:a.right} +else{if(!s&&(l==v||l==g)){l++};f=l==0?"after":l==i.text.length?"before":(X(t,c,l-(s?1:0)).bottom+p<=o)==s?"after":"before";var h=z(t,e(r,l,f),"line",i,c);d=h.left;w=o<h.top||o>=h.bottom};l=Jr(i.text,l,1);return nr(r,l,f,w,n-d)};function ps(t,i,r,n,o,l,s){var u=ct(function(a){var u=o[a],f=u.level!=1;return lr(z(t,e(r,f?u.to:u.from,f?"before":"after"),"line",i,n),l,s,!0)},0,o.length-1),a=o[u];if(u>0){var f=a.level!=1,c=z(t,e(r,f?a.from:a.to,f?"after":"before"),"line",i,n);if(lr(c,l,s,!0)&&c.top>s){a=o[u-1]}};return a};function gs(e,t,i,r,n,l,u){var g=Bn(e,t,r,u),f=g.begin,a=g.end;if(/\s/.test(t.text.charAt(a-1))){a--};var o=null,p=null;for(var h=0;h<n.length;h++){var s=n[h];if(s.from>=a||s.to<=f){continue};var v=s.level!=1,c=X(e,r,v?Math.min(a,s.to)-1:Math.max(f,s.from)).right,d=c<l?l-c+1e9:c-l;if(!o||p>d){o=s;p=d}};if(!o){o=n[n.length-1]};if(o.from<f){o={from:f,to:o.to,level:o.level}};if(o.to>a){o={from:o.from,to:a,level:o.level}};return o};var fe;function Ce(e){if(e.cachedTextHeight!=null){return e.cachedTextHeight};if(fe==null){fe=i("pre");for(var r=0;r<49;++r){fe.appendChild(document.createTextNode("x"));fe.appendChild(i("br"))};fe.appendChild(document.createTextNode("x"))};W(e.measure,fe);var t=fe.offsetHeight/50;if(t>3){e.cachedTextHeight=t};re(e.measure);return t||1};function xt(e){if(e.cachedCharWidth!=null){return e.cachedCharWidth};var n=i("span","xxxxxxxxxx"),o=i("pre",[n]);W(e.measure,o);var r=n.getBoundingClientRect(),t=(r.right-r.left)/10;if(t>2){e.cachedCharWidth=t};return t||10};function sr(e){var i=e.display,n={},o={};var l=i.gutters.clientLeft;for(var t=i.gutters.firstChild,r=0;t;t=t.nextSibling,++r){n[e.options.gutters[r]]=t.offsetLeft+t.clientLeft+l;o[e.options.gutters[r]]=t.clientWidth};return{fixedPos:ar(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:n,gutterWidth:o,wrapperWidth:i.wrapper.clientWidth}};function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left};function Un(e){var t=Ce(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(n){if(be(e.doc,n)){return 0};var l=0;if(n.widgets){for(var o=0;o<n.widgets.length;o++){if(n.widgets[o].height){l+=n.widgets[o].height}}};if(i){return l+(Math.ceil(n.text.length/r)||1)*t} +else{return l+t}}};function ur(e){var t=e.doc,i=Un(e);t.iter(function(e){var t=i(e);if(t!=e.height){U(e,t)}})};function Se(i,r,n,o){var d=i.display;if(!n&&Xi(r).getAttribute("cm-not-content")=="true"){return null};var u,f,c=d.lineSpace.getBoundingClientRect();try{u=r.clientX-c.left;f=r.clientY-c.top}catch(l){return null};var s=or(i,u,f),a;if(o&&s.xRel==1&&(a=t(i.doc,s.line).text).length==s.ch){var h=H(a,a.length,i.options.tabSize)-a.length;s=e(s.line,Math.max(0,Math.round((u-An(i.display).left)/xt(i.display))-h))};return s};function Le(e,t){if(t>=e.display.viewTo){return null};t-=e.display.viewFrom;if(t<0){return null};var r=e.display.view;for(var i=0;i<r.length;i++){t-=r[i].size;if(t<0){return i}}};function Ct(e){e.display.input.showSelection(e.display.input.prepareSelection())};function Vn(e,t){if(t===void 0)t=!0;var n=e.doc,o={};var s=o.cursors=document.createDocumentFragment(),a=o.selection=document.createDocumentFragment();for(var r=0;r<n.sel.ranges.length;r++){if(!t&&r==n.sel.primIndex){continue};var i=n.sel.ranges[r];if(i.from().line>=e.display.viewTo||i.to().line<e.display.viewFrom){continue};var l=i.empty();if(l||e.options.showCursorWhenSelecting){Kn(e,i.head,s)};if(!l){vs(e,i,a)}};return o};function Kn(e,t,r){var n=z(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),l=r.appendChild(i("div","\u00a0","CodeMirror-cursor"));l.style.left=n.left+"px";l.style.top=n.top+"px";l.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px";if(n.other){var o=r.appendChild(i("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=n.other.left+"px";o.style.top=n.other.top+"px";o.style.height=(n.other.bottom-n.other.top)*.85+"px"}};function li(e,t){return e.top-t.top||e.left-t.left};function vs(r,n,o){var y=r.display,p=r.doc,b=document.createDocumentFragment(),w=An(r.display),a=w.left,h=Math.max(y.sizerWidth,xe(r)-y.sizer.offsetLeft)-w.right,s=p.direction=="ltr";function u(e,t,r,n){if(t<0){t=0};t=Math.round(t);n=Math.round(n);b.appendChild(i("div",null,"CodeMirror-selected",("position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(r==null?h-e:r)+"px;\n height: "+(n-t)+"px")))};function v(i,n,o){var c=t(p,i),m=c.text.length,l,f;function v(t,n){return rr(r,e(i,t),"div",c,n)};function d(e,t,i){var n=Gn(r,c,null,e),o=(t=="ltr")==(i=="after")?"left":"right",l=i=="after"?n.begin:n.end-(/\s/.test(c.text.charAt(n.end-1))?2:1);return v(l,o)[o]};var g=Z(c,p.direction);Pl(g,n||0,o==null?m:o,function(e,t,i,r){var y=i=="ltr",c=v(e,y?"left":"right"),p=v(t-1,y?"right":"left"),x=n==null&&e==0,C=o==null&&t==m,k=r==0,T=!g||r==g.length-1;if(p.top-c.top<=3){var N=(s?x:C)&&k,O=(s?C:x)&&T,M=N?a:(y?c:p).left,A=O?h:(y?p:c).right;u(M,c.top,A-M,c.bottom)} +else{var b,S,w,L;if(y){b=s&&x&&k?a:c.left;S=s?h:d(e,i,"before");w=s?a:d(t,i,"after");L=s&&C&&T?h:p.right} +else{b=!s?a:d(e,i,"before");S=!s&&x&&k?h:c.right;w=!s&&C&&T?a:p.left;L=!s?h:d(t,i,"after")};u(b,c.top,S-b,c.bottom);if(c.bottom<p.top){u(a,c.bottom,null,p.top)};u(w,p.top,L-w,p.bottom)};if(!l||li(c,l)<0){l=c};if(li(p,l)<0){l=p};if(!f||li(c,f)<0){f=c};if(li(p,f)<0){f=p}});return{start:l,end:f}};var c=n.from(),d=n.to();if(c.line==d.line){v(c.line,c.ch,d.ch)} +else{var m=t(p,c.line),x=t(p,d.line),g=V(m)==V(x),l=v(c.line,c.ch,g?m.text.length+1:null).end,f=v(d.line,g?0:null,d.ch).start;if(g){if(l.top<f.top-2){u(l.right,l.top,null,l.bottom);u(a,f.top,f.left,f.bottom)} +else{u(l.right,l.top,f.left-l.right,l.bottom)}};if(l.bottom<f.top){u(a,l.bottom,null,f.top)}};o.appendChild(b)};function fr(e){if(!e.state.focused){return};var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="";if(e.options.cursorBlinkRate>0){t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate)} +else if(e.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}};function Xn(e){if(!e.state.focused){e.display.input.focus();cr(e)}};function jn(e){e.state.delayingBlurEvent=!0;setTimeout(function(){if(e.state.delayingBlurEvent){e.state.delayingBlurEvent=!1;St(e)}},100)};function cr(e,t){if(e.state.delayingBlurEvent){e.state.delayingBlurEvent=!1};if(e.options.readOnly=="nocursor"){return};if(!e.state.focused){p(e,"focus",e,t);e.state.focused=!0;ge(e.display.wrapper,"CodeMirror-focused");if(!e.curOp&&e.display.selForContextMenu!=e.doc.sel){e.display.input.reset();if(x){setTimeout(function(){return e.display.input.reset(!0)},20)}};e.display.input.receivedFocus()};fr(e)};function St(e,t){if(e.state.delayingBlurEvent){return};if(e.state.focused){p(e,"blur",e,t);e.state.focused=!1;de(e.display.wrapper,"CodeMirror-focused")};clearInterval(e.display.blinker);setTimeout(function(){if(!e.state.focused){e.display.shift=!1}},150)};function si(e){var r=e.display,f=r.lineDiv.offsetTop;for(var o=0;o<r.view.length;o++){var t=r.view[o],i=(void 0);if(t.hidden){continue};if(l&&c<8){var u=t.node.offsetTop+t.node.offsetHeight;i=u-f;f=u} +else{var a=t.node.getBoundingClientRect();i=a.bottom-a.top};var s=t.line.height-i;if(i<2){i=Ce(r)};if(s>.005||s<-.005){U(t.line,i);Yn(t.line);if(t.rest){for(var n=0;n<t.rest.length;n++){Yn(t.rest[n])}}}}};function Yn(e){if(e.widgets){for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;if(r){i.height=r.offsetHeight}}}};function hr(e,i,r){var l=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;l=Math.floor(l-ni(e));var u=r&&r.bottom!=null?r.bottom:l+e.wrapper.clientHeight,n=ye(i,l),o=ye(i,u);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;if(s<n){n=s;o=ye(i,q(t(i,s))+e.wrapper.clientHeight)} +else if(Math.min(a,i.lastLine())>=o){n=ye(i,q(t(i,a))-e.wrapper.clientHeight);o=a}};return{from:n,to:Math.max(o,n+1)}};function qn(e){var i=e.display,r=i.view;if(!i.alignWidgets&&(!i.gutters.firstChild||!e.options.fixedGutter)){return};var s=ar(i)-i.scroller.scrollLeft+e.doc.scrollLeft,a=i.gutters.offsetWidth,l=s+"px";for(var t=0;t<r.length;t++){if(!r[t].hidden){if(e.options.fixedGutter){if(r[t].gutter){r[t].gutter.style.left=l};if(r[t].gutterBackground){r[t].gutterBackground.style.left=l}};var o=r[t].alignable;if(o){for(var n=0;n<o.length;n++){o[n].style.left=l}}}};if(e.options.fixedGutter){i.gutters.style.left=(s+a)+"px"}};function Zn(e){if(!e.options.lineNumbers){return!1};var s=e.doc,r=Ei(e.options,s.first+s.size-1),t=e.display;if(r.length!=t.lineNumChars){var n=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,l=n.offsetWidth-o;t.lineGutter.style.width="";t.lineNumInnerWidth=Math.max(o,t.lineGutter.offsetWidth-l)+1;t.lineNumWidth=t.lineNumInnerWidth+l;t.lineNumChars=t.lineNumInnerWidth?r.length:-1;t.lineGutter.style.width=t.lineNumWidth+"px";mr(e);return!0};return!1};function ms(e,t){if(v(e,"scrollCursorIntoView")){return};var o=e.display,l=o.sizer.getBoundingClientRect(),r=null;if(t.top+l.top<0){r=!0} +else if(t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)){r=!1};if(r!=null&&!wl){var n=i("div","\u200b",null,("position: absolute;\n top: "+(t.top-o.viewOffset-ni(e.display))+"px;\n height: "+(t.bottom-t.top+K(e)+o.barHeight)+"px;\n left: "+(t.left)+"px; width: "+(Math.max(2,t.right-t.left))+"px;"));e.display.lineSpace.appendChild(n);n.scrollIntoView(r);e.display.lineSpace.removeChild(n)}};function ys(t,i,r,n){if(n==null){n=0};var u;if(!t.options.lineWrapping&&i==r){i=i.ch?e(i.line,i.sticky=="before"?i.ch-1:i.ch,"after"):i;r=i.sticky=="before"?e(i.line,i.ch+1,"before"):i};for(var f=0;f<5;f++){var a=!1,o=z(t,i),s=!r||r==i?o:z(t,r);u={left:Math.min(o.left,s.left),top:Math.min(o.top,s.top)-n,right:Math.max(o.left,s.left),bottom:Math.max(o.bottom,s.bottom)+n};var l=dr(t,u),c=t.doc.scrollTop,h=t.doc.scrollLeft;if(l.scrollTop!=null){kt(t,l.scrollTop);if(Math.abs(t.doc.scrollTop-c)>1){a=!0}};if(l.scrollLeft!=null){ke(t,l.scrollLeft);if(Math.abs(t.doc.scrollLeft-h)>1){a=!0}};if(!a){break}};return u};function bs(e,t){var i=dr(e,t);if(i.scrollTop!=null){kt(e,i.scrollTop)};if(i.scrollLeft!=null){ke(e,i.scrollLeft)}};function dr(e,t){var o=e.display,c=Ce(e.display);if(t.top<0){t.top=0};var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,n=er(e),i={};if(t.bottom-t.top>n){t.bottom=t.top+n};var f=e.doc.height+Ji(o),h=t.top<c,d=t.bottom>f-c;if(t.top<s){i.scrollTop=h?0:t.top} +else if(t.bottom>s+n){var u=Math.min(t.top,(d?f:t.bottom)-n);if(u!=s){i.scrollTop=u}};var a=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft,r=xe(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),l=t.right-t.left>r;if(l){t.right=t.left+r};if(t.left<10){i.scrollLeft=0} +else if(t.left<a){i.scrollLeft=Math.max(0,t.left-(l?0:10))} +else if(t.right>r+a-3){i.scrollLeft=t.right+(l?0:10)-r};return i};function pr(e,t){if(t==null){return};ai(e);e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t};function Ie(e){ai(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}};function Lt(e,t,i){if(t!=null||i!=null){ai(e)};if(t!=null){e.curOp.scrollLeft=t};if(i!=null){e.curOp.scrollTop=i}};function ws(e,t){ai(e);e.curOp.scrollToPos=t};function ai(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Rn(e,t.from),r=Rn(e,t.to);Qn(e,i,r,t.margin)}};function Qn(e,t,i,r){var n=dr(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Lt(e,n.scrollLeft,n.scrollTop)};function kt(e,t){if(Math.abs(e.doc.scrollTop-t)<2){return};if(!ie){vr(e,{top:t})};Jn(e,t,!0);if(ie){vr(e)};Mt(e,100)};function Jn(e,t,i){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t);if(e.display.scroller.scrollTop==t&&!i){return};e.doc.scrollTop=t;e.display.scrollbars.setScrollTop(t);if(e.display.scroller.scrollTop!=t){e.display.scroller.scrollTop=t}};function ke(e,t,i,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth);if((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r){return};e.doc.scrollLeft=t;qn(e);if(e.display.scroller.scrollLeft!=t){e.display.scroller.scrollLeft=t};e.display.scrollbars.setScrollLeft(t)};function Tt(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ji(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+K(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}};var ue=function(e,t,n){this.cm=n;var o=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(o);e(s);r(o,"scroll",function(){if(o.clientHeight){t(o.scrollTop,"vertical")}});r(s,"scroll",function(){if(s.clientWidth){t(s.scrollLeft,"horizontal")}});this.checkedZeroWidth=!1;if(l&&c<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};ue.prototype.update=function(e){var i=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,t=e.nativeBarWidth;if(r){this.vert.style.display="block";this.vert.style.bottom=i?t+"px":"0";var o=e.viewHeight-(i?t:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"} +else{this.vert.style.display="";this.vert.firstChild.style.height="0"};if(i){this.horiz.style.display="block";this.horiz.style.right=r?t+"px":"0";this.horiz.style.left=e.barLeft+"px";var n=e.viewWidth-e.barLeft-(r?t:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+n)+"px"} +else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"};if(!this.checkedZeroWidth&&e.clientHeight>0){if(t==0){this.zeroWidthHack()};this.checkedZeroWidth=!0};return{right:r?t:0,bottom:i?t:0}};ue.prototype.setScrollLeft=function(e){if(this.horiz.scrollLeft!=e){this.horiz.scrollLeft=e};if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};ue.prototype.setScrollTop=function(e){if(this.vert.scrollTop!=e){this.vert.scrollTop=e};if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};ue.prototype.zeroWidthHack=function(){var e=I&&!bl?"12px":"18px";this.horiz.style.height=this.vert.style.width=e;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new ce;this.disableVert=new ce};ue.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(o!=e){e.style.pointerEvents="none"} +else{t.set(1000,r)}};t.set(1000,r)};ue.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz);e.removeChild(this.vert)};var it=function(){};it.prototype.update=function(){return{bottom:0,right:0}};it.prototype.setScrollLeft=function(){};it.prototype.setScrollTop=function(){};it.prototype.clear=function(){};function ze(e,t){if(!t){t=Tt(e)};var i=e.display.barWidth,n=e.display.barHeight;eo(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++){if(i!=e.display.barWidth&&e.options.lineWrapping){si(e)};eo(e,Tt(e));i=e.display.barWidth;n=e.display.barHeight}};function eo(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px";i.heightForcer.style.borderBottom=r.bottom+"px solid transparent";if(r.right&&r.bottom){i.scrollbarFiller.style.display="block";i.scrollbarFiller.style.height=r.bottom+"px";i.scrollbarFiller.style.width=r.right+"px"} +else{i.scrollbarFiller.style.display=""};if(r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter){i.gutterFiller.style.display="block";i.gutterFiller.style.height=r.bottom+"px";i.gutterFiller.style.width=t.gutterWidth+"px"} +else{i.gutterFiller.style.display=""}};var Ir={"native":ue,"null":it};function to(e){if(e.display.scrollbars){e.display.scrollbars.clear();if(e.display.scrollbars.addClass){de(e.display.wrapper,e.display.scrollbars.addClass)}};e.display.scrollbars=new Ir[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);r(t,"mousedown",function(){if(e.state.focused){setTimeout(function(){return e.display.input.focus()},0)}});t.setAttribute("cm-not-content","true")},function(t,i){if(i=="horizontal"){ke(e,t)} +else{kt(e,t)}},e);if(e.display.scrollbars.addClass){ge(e.display.wrapper,e.display.scrollbars.addClass)}};var ul=0;function Te(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ul};Jl(e.curOp)};function Me(e){var t=e.curOp;ts(t,function(e){for(var t=0;t<e.ops.length;t++){e.ops[t].cm.curOp=null};xs(e)})};function xs(e){var t=e.ops;for(var l=0;l<t.length;l++){Cs(t[l])};for(var o=0;o<t.length;o++){Ss(t[o])};for(var n=0;n<t.length;n++){Ls(t[n])};for(var r=0;r<t.length;r++){ks(t[r])};for(var i=0;i<t.length;i++){Ts(t[i])}};function Cs(e){var t=e.cm,i=t.display;Os(t);if(e.updateMaxLine){Ui(t)};e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;e.update=e.mustUpdate&&new Bt(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)};function Ss(e){e.updatedDisplay=e.mustUpdate&&gr(e.cm,e.update)};function Ls(e){var t=e.cm,i=t.display;if(e.updatedDisplay){si(t)};e.barMeasure=Tt(t);if(i.maxLineChanged&&!t.options.lineWrapping){e.adjustWidthTo=Dn(t,i.maxLine,i.maxLine.text.length).left+3;t.display.sizerWidth=e.adjustWidthTo;e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+K(t)+t.display.barWidth);e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-xe(t))};if(e.updatedDisplay||e.selectionChanged){e.preparedSelection=i.input.prepareSelection()}};function ks(e){var t=e.cm;if(e.adjustWidthTo!=null){t.display.sizer.style.minWidth=e.adjustWidthTo+"px";if(e.maxScrollLeft<t.doc.scrollLeft){ke(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0)};t.display.maxLineChanged=!1};var i=e.focus&&e.focus==Y();if(e.preparedSelection){t.display.input.showSelection(e.preparedSelection,i)};if(e.updatedDisplay||e.startHeight!=t.doc.height){ze(t,e.barMeasure)};if(e.updatedDisplay){yr(t,e.barMeasure)};if(e.selectionChanged){fr(t)};if(t.state.focused&&e.updateInput){t.display.input.reset(e.typing)};if(i){Xn(e.cm)}};function Ts(e){var t=e.cm,s=t.display,a=t.doc;if(e.updatedDisplay){ro(t,e.update)};if(s.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)){s.wheelStartX=s.wheelStartY=null};if(e.scrollTop!=null){Jn(t,e.scrollTop,e.forceScroll)};if(e.scrollLeft!=null){ke(t,e.scrollLeft,!0,!0)};if(e.scrollToPos){var u=ys(t,o(a,e.scrollToPos.from),o(a,e.scrollToPos.to),e.scrollToPos.margin);ms(t,u)};var n=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(n){for(var r=0;r<n.length;++r){if(!n[r].lines.length){p(n[r],"hide")}}};if(l){for(var i=0;i<l.length;++i){if(l[i].lines.length){p(l[i],"unhide")}}};if(s.wrapper.offsetHeight){a.scrollTop=t.display.scroller.scrollTop};if(e.changeObjs){p(t,"changes",t,e.changeObjs)};if(e.update){e.update.finish()}};function N(e,t){if(e.curOp){return t()};Te(e);try{return t()}finally{Me(e)}};function m(e,t){return function(){if(e.curOp){return t.apply(e,arguments)};Te(e);try{return t.apply(e,arguments)}finally{Me(e)}}};function L(e){return function(){if(this.curOp){return e.apply(this,arguments)};Te(this);try{return e.apply(this,arguments)}finally{Me(this)}}};function y(e){return function(){var t=this.cm;if(!t||t.curOp){return e.apply(this,arguments)};Te(t);try{return e.apply(this,arguments)}finally{Me(t)}}};function M(e,t,i,r){if(t==null){t=e.doc.first};if(i==null){i=e.doc.first+e.doc.size};if(!r){r=0};var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t};e.curOp.viewChanged=!0;if(t>=n.viewTo){if(te&&Bi(e.doc,t)<n.viewTo){le(e)}} +else if(i<=n.viewFrom){if(te&&fn(e.doc,i+r)>n.viewFrom){le(e)} +else{n.viewFrom+=r;n.viewTo+=r}} +else if(t<=n.viewFrom&&i>=n.viewTo){le(e)} +else if(t<=n.viewFrom){var u=ui(e,i,i+r,1);if(u){n.view=n.view.slice(u.index);n.viewFrom=u.lineN;n.viewTo+=r} +else{le(e)}} +else if(i>=n.viewTo){var a=ui(e,t,t,-1);if(a){n.view=n.view.slice(0,a.index);n.viewTo=a.lineN} +else{le(e)}} +else{var l=ui(e,t,t,-1),s=ui(e,i,i+r,1);if(l&&s){n.view=n.view.slice(0,l.index).concat(ri(e,l.lineN,s.lineN)).concat(n.view.slice(s.index));n.viewTo+=r} +else{le(e)}};var o=n.externalMeasured;if(o){if(i<o.lineN){o.lineN+=r} +else if(t<o.lineN+o.size){n.externalMeasured=null}}};function oe(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){r.externalMeasured=null};if(t<r.viewFrom||t>=r.viewTo){return};var o=r.view[Le(e,t)];if(o.node==null){return};var l=o.changes||(o.changes=[]);if(b(l,i)==-1){l.push(i)}};function le(e){e.display.viewFrom=e.display.viewTo=e.doc.first;e.display.view=[];e.display.viewOffset=0};function ui(e,t,i,r){var n=Le(e,t),s,o=e.display.view;if(!te||i==e.doc.first+e.doc.size){return{index:n,lineN:i}};var l=e.display.viewFrom;for(var a=0;a<n;a++){l+=o[a].size};if(l!=t){if(r>0){if(n==o.length-1){return null};s=(l+o[n].size)-t;n++} +else{s=l-t};t+=s;i+=s} +while(Bi(e.doc,i)!=i){if(n==(r<0?0:o.length-1)){return null};i+=r*o[n-(r<0?1:0)].size;n+=r};return{index:n,lineN:i}};function Ms(e,t,i){var r=e.display,n=r.view;if(n.length==0||t>=r.viewTo||i<=r.viewFrom){r.view=ri(e,t,i);r.viewFrom=t} +else{if(r.viewFrom>t){r.view=ri(e,t,r.viewFrom).concat(r.view)} +else if(r.viewFrom<t){r.view=r.view.slice(Le(e,t))};r.viewFrom=t;if(r.viewTo<i){r.view=r.view.concat(ri(e,r.viewTo,i))} +else if(r.viewTo>i){r.view=r.view.slice(0,Le(e,i))}};r.viewTo=i};function io(e){var r=e.display.view,n=0;for(var i=0;i<r.length;i++){var t=r[i];if(!t.hidden&&(!t.node||t.changes)){++n}};return n};function Mt(e,t){if(e.doc.highlightFrontier<e.display.viewTo){e.state.highlight.set(t,Ai(Ns,e))}};function Ns(e){var i=e.doc;if(i.highlightFrontier>=e.display.viewTo){return};var n=+new Date+e.options.workTime,t=mt(e,i.highlightFrontier),r=[];i.iter(t.line,Math.min(i.first+i.size,e.display.viewTo+500),function(o){if(t.line>=e.display.viewFrom){var u=o.styles,c=o.text.length>e.options.maxHighlightLength?we(i.mode,t.state):null,h=gn(e,o,t,!0);if(c){t.state=c};o.styles=h.styles;var s=o.styleClasses,l=h.classes;if(l){o.styleClasses=l} +else if(s){o.styleClasses=null};var f=!u||u.length!=o.styles.length||s!=l&&(!s||!l||s.bgClass!=l.bgClass||s.textClass!=l.textClass);for(var a=0;!f&&a<u.length;++a){f=u[a]!=o.styles[a]};if(f){r.push(t.line)};o.stateAfter=t.save();t.nextLine()} +else{if(o.text.length<=e.options.maxHighlightLength){qi(e,o.text,t)};o.stateAfter=t.line%5==0?t.save():null;t.nextLine()};if(+new Date>n){Mt(e,e.options.workDelay);return!0}});i.highlightFrontier=t.line;i.modeFrontier=Math.max(i.modeFrontier,t.line);if(r.length){N(e,function(){for(var t=0;t<r.length;t++){oe(e,r[t],"text")}})}};var Bt=function(e,t,i){var r=e.display;this.viewport=t;this.visible=hr(r,e.doc,t);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=xe(e);this.force=i;this.dims=sr(e);this.events=[]};Bt.prototype.signal=function(e,t){if(F(e,t)){this.events.push(arguments)}};Bt.prototype.finish=function(){var t=this;for(var e=0;e<this.events.length;e++){p.apply(null,t.events[e])}};function Os(e){var t=e.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=K(e)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=K(e)+"px";t.scrollbarsClipped=!0}};function As(e){if(e.hasFocus()){return null};var r=Y();if(!r||!ne(e.display.lineDiv,r)){return null};var i={activeElt:r};if(window.getSelection){var t=window.getSelection();if(t.anchorNode&&t.extend&&ne(e.display.lineDiv,t.anchorNode)){i.anchorNode=t.anchorNode;i.anchorOffset=t.anchorOffset;i.focusNode=t.focusNode;i.focusOffset=t.focusOffset}};return i};function Ws(e){if(!e||!e.activeElt||e.activeElt==Y()){return};e.activeElt.focus();if(e.anchorNode&&ne(document.body,e.anchorNode)&&ne(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset);i.collapse(!1);t.removeAllRanges();t.addRange(i);t.extend(e.focusNode,e.focusOffset)}};function gr(e,i){var r=e.display,l=e.doc;if(i.editorIsHidden){le(e);return!1};if(!i.force&&i.visible.from>=r.viewFrom&&i.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&io(e)==0){return!1};if(Zn(e)){le(e);i.dims=sr(e)};var u=l.first+l.size,n=Math.max(i.visible.from-e.options.viewportMargin,l.first),o=Math.min(u,i.visible.to+e.options.viewportMargin);if(r.viewFrom<n&&n-r.viewFrom<20){n=Math.max(l.first,r.viewFrom)};if(r.viewTo>o&&r.viewTo-o<20){o=Math.min(u,r.viewTo)};if(te){n=Bi(e.doc,n);o=fn(e.doc,o)};var a=n!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=i.wrapperHeight||r.lastWrapWidth!=i.wrapperWidth;Ms(e,n,o);r.viewOffset=q(t(e.doc,r.viewFrom));e.display.mover.style.top=r.viewOffset+"px";var s=io(e);if(!a&&s==0&&!i.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)){return!1};var f=As(e);if(s>4){r.lineDiv.style.display="none"};Ds(e,r.updateLineNumbers,i.dims);if(s>4){r.lineDiv.style.display=""};r.renderedView=r.view;Ws(f);re(r.cursorDiv);re(r.selectionDiv);r.gutters.style.height=r.sizer.style.minHeight=0;if(a){r.lastWrapHeight=i.wrapperHeight;r.lastWrapWidth=i.wrapperWidth;Mt(e,400)};r.updateLineNumbers=null;return!0};function ro(e,t){var i=t.viewport;for(var n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==xe(e)){if(i&&i.top!=null){i={top:Math.min(e.doc.height+Ji(e.display)-er(e),i.top)}};t.visible=hr(e.display,e.doc,i);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo){break}};if(!gr(e,t)){break};si(e);var r=Tt(e);Ct(e);ze(e,r);yr(e,r);t.force=!1};t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo){t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo);e.display.reportedViewFrom=e.display.viewFrom;e.display.reportedViewTo=e.display.viewTo}};function vr(e,t){var i=new Bt(e,t);if(gr(e,i)){si(e);ro(e,i);var r=Tt(e);Ct(e);ze(e,r);yr(e,r);i.finish()}};function Ds(e,t,i){var s=e.display,d=e.options.lineNumbers,a=s.lineDiv,n=a.firstChild;function c(t){var i=t.nextSibling;if(x&&I&&e.display.currentWheelTarget==t){t.style.display="none"} +else{t.parentNode.removeChild(t)};return i};var f=s.view,o=s.viewFrom;for(var l=0;l<f.length;l++){var r=f[l];if(r.hidden){} +else if(!r.node||r.node.parentNode!=a){var h=ls(e,r,o,i);a.insertBefore(h,n)} +else{while(n!=r.node){n=c(n)};var u=d&&t!=null&&t<=o&&r.lineNumber;if(r.changes){if(b(r.changes,"gutter")>-1){u=!1};kn(e,r,o,i)};if(u){re(r.lineNumber);r.lineNumber.appendChild(document.createTextNode(Ei(e.options,o)))};n=r.node.nextSibling};o+=r.size} +while(n){n=c(n)}};function mr(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"};function yr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";e.display.heightForcer.style.top=t.docHeight+"px";e.display.gutters.style.height=(t.docHeight+e.display.barHeight+K(e))+"px"};function no(e){var r=e.display.gutters,l=e.options.gutters;re(r);var t=0;for(;t<l.length;++t){var n=l[t],o=r.appendChild(i("div",null,"CodeMirror-gutter "+n));if(n=="CodeMirror-linenumbers"){e.display.lineGutter=o;o.style.width=(e.display.lineNumWidth||1)+"px"}};r.style.display=t?"":"none";mr(e)};function br(e){var t=b(e.gutters,"CodeMirror-linenumbers");if(t==-1&&e.lineNumbers){e.gutters=e.gutters.concat(["CodeMirror-linenumbers"])} +else if(t>-1&&!e.lineNumbers){e.gutters=e.gutters.slice(0);e.gutters.splice(t,1)}};var Rt=0,A=null;if(l){A=-.53} +else if(ie){A=15} +else if(Kt){A=-.7} +else if(Yr){A=-1/3};function oo(e){var i=e.wheelDeltaX,t=e.wheelDeltaY;if(i==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS){i=e.detail};if(t==null&&e.detail&&e.axis==e.VERTICAL_AXIS){t=e.detail} +else if(t==null){t=e.wheelDelta};return{x:i,y:t}};function Hs(e){var t=oo(e);t.x*=A;t.y*=A;return t};function lo(e,t){var d=oo(t),l=d.x,n=d.y,i=e.display,r=i.scroller,p=r.scrollWidth>r.clientWidth,c=r.scrollHeight>r.clientHeight;if(!(l&&p||n&&c)){return};if(n&&I&&x){outer:for(var o=t.target,h=i.view;o!=r;o=o.parentNode){for(var f=0;f<h.length;f++){if(h[f].node==o){e.display.currentWheelTarget=o;break outer}}}};if(l&&!ie&&!E&&A!=null){if(n&&c){kt(e,Math.max(0,r.scrollTop+n*A))};ke(e,Math.max(0,r.scrollLeft+l*A));if(!n||(n&&c)){T(t)};i.wheelStartX=null;return};if(n&&A!=null){var a=n*A,s=e.doc.scrollTop,u=s+i.wrapper.clientHeight;if(a<0){s=Math.max(0,s+a-50)} +else{u=Math.min(e.doc.height,u+a+50)};vr(e,{top:s,bottom:u})};if(Rt<20){if(i.wheelStartX==null){i.wheelStartX=r.scrollLeft;i.wheelStartY=r.scrollTop;i.wheelDX=l;i.wheelDY=n;setTimeout(function(){if(i.wheelStartX==null){return};var e=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,n=(t&&i.wheelDY&&t/i.wheelDY)||(e&&i.wheelDX&&e/i.wheelDX);i.wheelStartX=i.wheelStartY=null;if(!n){return};A=(A*Rt+n)/(Rt+1)++Rt},200)} +else{i.wheelDX+=l;i.wheelDY+=n}}};var O=function(e,t){this.ranges=e;this.primIndex=t};O.prototype.primary=function(){return this.ranges[this.primIndex]};O.prototype.equals=function(e){var n=this;if(e==this){return!0};if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length){return!1};for(var t=0;t<this.ranges.length;t++){var i=n.ranges[t],r=e.ranges[t];if(!Ii(i.anchor,r.anchor)||!Ii(i.head,r.head)){return!1}};return!0};O.prototype.deepCopy=function(){var t=this,i=[];for(var e=0;e<this.ranges.length;e++){i[e]=new s(zi(t.ranges[e].anchor),zi(t.ranges[e].head))};return new O(i,this.primIndex)};O.prototype.somethingSelected=function(){var t=this;for(var e=0;e<this.ranges.length;e++){if(!t.ranges[e].empty()){return!0}};return!1};O.prototype.contains=function(e,t){var o=this;if(!t){t=e};for(var i=0;i<this.ranges.length;i++){var r=o.ranges[i];if(n(t,r.from())>=0&&n(e,r.to())<=0){return i}};return-1};var s=function(e,t){this.anchor=e;this.head=t};s.prototype.from=function(){return Zt(this.anchor,this.head)};s.prototype.to=function(){return qt(this.anchor,this.head)};s.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function R(e,t){var f=e[t];e.sort(function(e,t){return n(e.from(),t.from())});t=b(e,f);for(var r=1;r<e.length;r++){var o=e[r],i=e[r-1];if(n(i.to(),o.from())>=0){var l=Zt(i.from(),o.from()),a=qt(i.to(),o.to()),u=i.empty()?o.from()==o.head:i.from()==i.head;if(r<=t){--t};e.splice(--r,2,new s(u?a:l,u?l:a))}};return new O(e,t)};function se(e,t){return new O([new s(e,t||e)],0)};function ae(t){if(!t.text){return t.to};return e(t.from.line+t.text.length-1,a(t.text).length+(t.text.length==1?t.from.ch:0))};function so(t,i){if(n(t,i.from)<0){return t};if(n(t,i.to)<=0){return ae(i)};var o=t.line+i.text.length-(i.to.line-i.from.line)-1,r=t.ch;if(t.line==i.to.line){r+=ae(i).ch-i.to.ch};return e(o,r)};function wr(e,t){var n=[];for(var i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new s(so(r.anchor,t),so(r.head,t)))};return R(n,e.sel.primIndex)};function ao(t,i,r){if(t.line==i.line){return e(r.line,t.ch-i.ch+r.ch)} +else{return e(r.line+(t.line-i.line),t.ch)}};function Fs(t,i,r){var c=[],a=e(t.first,0),h=a;for(var o=0;o<i.length;o++){var u=i[o],l=ao(u.from,a,h),f=ao(ae(u),a,h);a=u.to;h=f;if(r=="around"){var d=t.sel.ranges[o],p=n(d.head,d.anchor)<0;c[o]=new s(p?f:l,p?l:f)} +else{c[o]=new s(l,l)}};return new O(c,t.sel.primIndex)};function xr(e){e.doc.mode=ji(e.options,e.doc.modeOption);Nt(e)};function Nt(e){e.doc.iter(function(e){if(e.stateAfter){e.stateAfter=null};if(e.styles){e.styles=null}});e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first;Mt(e,100);e.state.modeGen++;if(e.curOp){M(e)}};function uo(e,t){return t.from.ch==0&&t.to.ch==0&&a(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)};function Cr(e,i,r,n){function d(e){return r?r[e]:null};function c(e,t,r){Kl(e,t,r,n);w(e,"change",e,i)};function g(e,t){var r=[];for(var i=e;i<t;++i){r.push(new We(o[i],d(i),n))};return r};var l=i.from,u=i.to,o=i.text,s=t(e,l.line),f=t(e,u.line),v=a(o),p=d(o.length-1),h=u.line-l.line;if(i.full){e.insert(0,g(0,o.length));e.remove(o.length,e.size-o.length)} +else if(uo(e,i)){var y=g(0,o.length-1);c(f,f.text,p);if(h){e.remove(l.line,h)};if(y.length){e.insert(l.line,y)}} +else if(s==f){if(o.length==1){c(s,s.text.slice(0,l.ch)+v+s.text.slice(u.ch),p)} +else{var m=g(1,o.length-1);m.push(new We(v+s.text.slice(u.ch),p,n));c(s,s.text.slice(0,l.ch)+o[0],d(0));e.insert(l.line+1,m)}} +else if(o.length==1){c(s,s.text.slice(0,l.ch)+o[0]+f.text.slice(u.ch),d(0));e.remove(l.line+1,h)} +else{c(s,s.text.slice(0,l.ch)+o[0],d(0));c(f,v+f.text.slice(u.ch),p);var b=g(1,o.length-1);if(h>1){e.remove(l.line+1,h-1)};e.insert(l.line+1,b)};w(e,"change",e,i)};function Ne(e,t,i){function r(e,n,o){if(e.linked){for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc==n){continue};var s=o&&l.sharedHist;if(i&&!s){continue};t(l.doc,s);r(l.doc,e,s)}}};r(e,null,!0)};function fo(e,t){if(t.cm){throw new Error("This document is already in use.")};e.doc=t;t.cm=e;ur(e);xr(e);co(e);if(!e.options.lineWrapping){Ui(e)};e.options.mode=t.modeOption;M(e)};function co(e){;(e.doc.direction=="rtl"?ge:de)(e.display.lineDiv,"CodeMirror-rtl")};function Ps(e){N(e,function(){co(e);M(e)})};function fi(e){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=e||1};function Sr(e,t){var i={from:zi(t.from),to:ae(t),text:me(e,t.from,t.to)};go(e,i,t.from.line,t.to.line+1);Ne(e,function(e){return go(e,i,t.from.line,t.to.line+1)},!0);return i};function ho(e){while(e.length){var t=a(e);if(t.ranges){e.pop()} +else{break}}};function Es(e,t){if(t){ho(e.done);return a(e.done)} +else if(e.done.length&&!a(e.done).ranges){return a(e.done)} +else if(e.done.length>1&&!e.done[e.done.length-2].ranges){e.done.pop();return a(e.done)}};function po(e,t,i,r){var o=e.history;o.undone.length=0;var f=+new Date,l,s;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&((t.origin.charAt(0)=="+"&&e.cm&&o.lastModTime>f-e.cm.options.historyEventDelay)||t.origin.charAt(0)=="*"))&&(l=Es(o,o.lastOp==r))){s=a(l.changes);if(n(t.from,t.to)==0&&n(t.from,s.to)==0){s.to=ae(t)} +else{l.changes.push(Sr(e,t))}} +else{var u=a(o.done);if(!u||!u.ranges){ci(e.sel,o.done)};l={changes:[Sr(e,t)],generation:o.generation};o.done.push(l);while(o.done.length>o.undoDepth){o.done.shift();if(!o.done[0].ranges){o.done.shift()}}};o.done.push(i);o.generation=++o.maxGeneration;o.lastModTime=o.lastSelTime=f;o.lastOp=o.lastSelOp=r;o.lastOrigin=o.lastSelOrigin=t.origin;if(!s){p(e,"historyAdded")}};function Is(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)};function zs(e,t,i,r){var n=e.history,o=r&&r.origin;if(i==n.lastSelOp||(o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Is(e,o,a(n.done),t)))){n.done[n.done.length-1]=t} +else{ci(t,n.done)};n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=i;if(r&&r.clearRedo!==!1){ho(n.undone)}};function ci(e,t){var i=a(t);if(!(i&&i.ranges&&i.equals(e))){t.push(e)}};function go(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(i){if(i.markedSpans){(n||(n=t["spans_"+e.id]={}))[o]=i.markedSpans};++o})};function Rs(e){if(!e){return null};var t;for(var i=0;i<e.length;++i){if(e[i].marker.explicitlyCleared){if(!t){t=e.slice(0,i)}} +else if(t){t.push(e[i])}};return!t?e:t.length?t:null};function Bs(e,t){var n=t["spans_"+e.id];if(!n){return null};var r=[];for(var i=0;i<t.text.length;++i){r.push(Rs(n[i]))};return r};function vo(e,t){var i=Bs(e,t),a=Ri(e,t);if(!i){return a};if(!a){return i};for(var n=0;n<i.length;++n){var o=i[n],r=a[n];if(o&&r){spans:for(var s=0;s<r.length;++s){var u=r[s];for(var l=0;l<o.length;++l){if(o[l].marker==u.marker){continue;spans}};o.push(u)}} +else if(r){i[n]=r}};return i};function Re(e,t,i){var f=[];for(var u=0;u<e.length;++u){var o=e[u];if(o.ranges){f.push(i?O.prototype.deepCopy.call(o):o);continue};var h=o.changes,s=[];f.push({changes:s});for(var l=0;l<h.length;++l){var r=h[l],c=(void 0);s.push({from:r.from,to:r.to,text:r.text});if(t){for(var n in r){if(c=n.match(/^spans_(\d+)$/)){if(b(t,Number(c[1]))>-1){a(s)[n]=r[n];delete r[n]}}}}}};return f};function Lr(e,t,i,r){if(r){var o=e.anchor;if(i){var l=n(t,o)<0;if(l!=(n(i,o)<0)){o=t;t=i} +else if(l!=(n(t,i)<0)){t=i}};return new s(o,t)} +else{return new s(i||t,t)}};function hi(e,t,i,r,n){if(n==null){n=e.cm&&(e.cm.display.shift||e.extend)};C(e,new O([Lr(e.sel.primary(),t,i,n)],0),r)};function mo(e,t,i){var n=[],l=e.cm&&(e.cm.display.shift||e.extend);for(var r=0;r<e.sel.ranges.length;r++){n[r]=Lr(e.sel.ranges[r],t[r],null,l)};var o=R(n,e.sel.primIndex);C(e,o,i)};function kr(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i;C(e,R(n,e.sel.primIndex),r)};function yo(e,t,i,r){C(e,se(t,i),r)};function Gs(e,t,i){var r={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var i=0;i<t.length;i++){r.ranges[i]=new s(o(e,t[i].anchor),o(e,t[i].head))}},origin:i&&i.origin};p(e,"beforeSelectionChange",e,r);if(e.cm){p(e.cm,"beforeSelectionChange",e.cm,r)};if(r.ranges!=t.ranges){return R(r.ranges,r.ranges.length-1)} +else{return t}};function bo(e,t,i){var r=e.history.done,n=a(r);if(n&&n.ranges){r[r.length-1]=t;di(e,t,i)} +else{C(e,t,i)}};function C(e,t,i){di(e,t,i);zs(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)};function di(e,t,i){if(F(e,"beforeSelectionChange")||e.cm&&F(e.cm,"beforeSelectionChange")){t=Gs(e,t,i)};var r=i&&i.bias||(n(t.primary().head,e.sel.primary().head)<0?-1:1);wo(e,Co(e,t,r,!0));if(!(i&&i.scroll===!1)&&e.cm){Ie(e.cm)}};function wo(e,t){if(t.equals(e.sel)){return};e.sel=t;if(e.cm){e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0;cn(e.cm)};w(e,"cursorActivity",e)};function xo(e){wo(e,Co(e,e.sel,null,!1))};function Co(e,t,i,r){var o;for(var n=0;n<t.ranges.length;n++){var l=t.ranges[n],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[n],u=Tr(e,l.anchor,a&&a.anchor,i,r),f=Tr(e,l.head,a&&a.head,i,r);if(o||u!=l.anchor||f!=l.head){if(!o){o=t.ranges.slice(0,n)};o[n]=new s(u,f)}};return o?R(o,t.primIndex):t};function Be(e,i,r,o,l){var f=t(e,i.line);if(f.markedSpans){for(var h=0;h<f.markedSpans.length;++h){var u=f.markedSpans[h],s=u.marker;if((u.from==null||(s.inclusiveLeft?u.from<=i.ch:u.from<i.ch))&&(u.to==null||(s.inclusiveRight?u.to>=i.ch:u.to>i.ch))){if(l){p(s,"beforeCursorEnter");if(s.explicitlyCleared){if(!f.markedSpans){break} +else{--h;continue}}};if(!s.atomic){continue};if(r){var a=s.find(o<0?1:-1),d=(void 0);if(o<0?s.inclusiveRight:s.inclusiveLeft){a=So(e,a,-o,a&&a.line==i.line?f:null)};if(a&&a.line==i.line&&(d=n(a,r))&&(o<0?d<0:d>0)){return Be(e,a,i,o,l)}};var c=s.find(o<0?-1:1);if(o<0?s.inclusiveLeft:s.inclusiveRight){c=So(e,c,o,c.line==i.line?f:null)};return c?Be(e,c,i,o,l):null}}};return i};function Tr(t,i,r,n,o){var l=n||1,s=Be(t,i,r,l,o)||(!o&&Be(t,i,r,l,!0))||Be(t,i,r,-l,o)||(!o&&Be(t,i,r,-l,!0));if(!s){t.cantEdit=!0;return e(t.first,0)};return s};function So(i,r,n,l){if(n<0&&r.ch==0){if(r.line>i.first){return o(i,e(r.line-1))} +else{return null}} +else if(n>0&&r.ch==(l||t(i,r.line)).text.length){if(r.line<i.first+i.size-1){return e(r.line+1,0)} +else{return null}} +else{return new e(r.line,r.ch+n)}};function Lo(t){t.setSelection(e(t.firstLine(),0),e(t.lastLine()),G)};function ko(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};if(i){r.update=function(t,i,n,l){if(t){r.from=o(e,t)};if(i){r.to=o(e,i)};if(n){r.text=n};if(l!==undefined){r.origin=l}}};p(e,"beforeChange",e,r);if(e.cm){p(e.cm,"beforeChange",e.cm,r)};if(r.canceled){return null};return{from:r.from,to:r.to,text:r.text,origin:r.origin}};function Ge(e,t,i){if(e.cm){if(!e.cm.curOp){return m(e.cm,Ge)(e,t,i)};if(e.cm.state.suppressEdits){return}};if(F(e,"beforeChange")||e.cm&&F(e.cm,"beforeChange")){t=ko(e,t,!0);if(!t){return}};var n=Gr&&!i&&Dl(e,t.from,t.to);if(n){for(var r=n.length-1;r>=0;--r){To(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin})}} +else{To(e,t)}};function To(e,t){if(t.text.length==1&&t.text[0]==""&&n(t.from,t.to)==0){return};var r=wr(e,t);po(e,t,r,e.cm?e.cm.curOp.id:NaN);Ot(e,t,r,Ri(e,t));var i=[];Ne(e,function(e,r){if(!r&&b(i,e.history)==-1){Ao(e.history,t);i.push(e.history)};Ot(e,t,null,Ri(e,t))})};function pi(e,t,i){if(e.cm&&e.cm.state.suppressEdits&&!i){return};var n=e.history,r,h=e.sel,o=t=="undo"?n.done:n.undone,u=t=="undo"?n.undone:n.done,l=0;for(;l<o.length;l++){r=o[l];if(i?r.ranges&&!r.equals(e.sel):!r.ranges){break}};if(l==o.length){return};n.lastOrigin=n.lastSelOrigin=null;for(;;){r=o.pop();if(r.ranges){ci(r,u);if(i&&!r.equals(e.sel)){C(e,r,{clearRedo:!1});return};h=r} +else{break}};var c=[];ci(h,u);u.push({changes:c,generation:n.generation});n.generation=r.generation||++n.maxGeneration;var d=F(e,"beforeChange")||e.cm&&F(e.cm,"beforeChange"),p=function(i){var n=r.changes[i];n.origin=t;if(d&&!ko(e,n,!1)){o.length=0;return{}};c.push(Sr(e,n));var s=i?wr(e,n):a(o);Ot(e,n,s,vo(e,n));if(!i&&e.cm){e.cm.scrollIntoView({from:n.from,to:ae(n)})};var l=[];Ne(e,function(e,t){if(!t&&b(l,e.history)==-1){Ao(e.history,n);l.push(e.history)};Ot(e,n,null,vo(e,n))})};for(var s=r.changes.length-1;s>=0;--s){var f=p(s);if(f)return f.v}};function Mo(t,i){if(i==0){return};t.first+=i;t.sel=new O(jt(t.sel.ranges,function(t){return new s(e(t.anchor.line+i,t.anchor.ch),e(t.head.line+i,t.head.ch))}),t.sel.primIndex);if(t.cm){M(t.cm,t.first,t.first-i,i);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++){oe(t.cm,r,"gutter")}}};function Ot(i,r,n,o){if(i.cm&&!i.cm.curOp){return m(i.cm,Ot)(i,r,n,o)};if(r.to.line<i.first){Mo(i,r.text.length-1-(r.to.line-r.from.line));return};if(r.from.line>i.lastLine()){return};if(r.from.line<i.first){var s=r.text.length-1-(i.first-r.from.line);Mo(i,s);r={from:e(i.first,0),to:e(r.to.line+s,r.to.ch),text:[a(r.text)],origin:r.origin}};var l=i.lastLine();if(r.to.line>l){r={from:r.from,to:e(l,t(i,l).text.length),text:[r.text[0]],origin:r.origin}};r.removed=me(i,r.from,r.to);if(!n){n=wr(i,r)};if(i.cm){Us(i.cm,r,o)} +else{Cr(i,r,o)};di(i,n,G)};function Us(e,i,r){var o=e.doc,l=e.display,n=i.from,s=i.to,a=!1,f=n.line;if(!e.options.lineWrapping){f=u(V(t(o,n.line)));o.iter(f,s.line+1,function(e){if(e==l.maxLine){a=!0;return!0}})};if(o.sel.contains(i.from,i.to)>-1){cn(e)};Cr(o,i,r,Un(e));if(!e.options.lineWrapping){o.iter(f,n.line+i.text.length,function(e){var t=ti(e);if(t>l.maxLineLength){l.maxLine=e;l.maxLineLength=t;l.maxLineChanged=!0;a=!1}});if(a){e.curOp.updateMaxLine=!0}};Vl(o,n.line);Mt(e,400);var p=i.text.length-(s.line-n.line)-1;if(i.full){M(e)} +else if(n.line==s.line&&i.text.length==1&&!uo(e.doc,i)){oe(e,n.line,"text")} +else{M(e,n.line,s.line+1,p)};var h=F(e,"changes"),d=F(e,"change");if(d||h){var c={from:n,to:s,text:i.text,removed:i.removed,origin:i.origin};if(d){w(e,"change",e,c)};if(h){(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(c)}};e.display.selForContextMenu=null};function Ue(e,t,i,r,o){if(!r){r=i};if(n(r,i)<0){var l;(l=[r,i],i=l[0],r=l[1],l)};if(typeof t=="string"){t=e.splitLines(t)};Ge(e,{from:i,to:r,text:t,origin:o})};function No(e,t,i,r){if(i<e.line){e.line+=r} +else if(t<e.line){e.line=t;e.ch=0}};function Oo(t,i,r,n){for(var s=0;s<t.length;++s){var o=t[s],f=!0;if(o.ranges){if(!o.copied){o=t[s]=o.deepCopy();o.copied=!0};for(var a=0;a<o.ranges.length;a++){No(o.ranges[a].anchor,i,r,n);No(o.ranges[a].head,i,r,n)};continue};for(var u=0;u<o.changes.length;++u){var l=o.changes[u];if(r<l.from.line){l.from=e(l.from.line+n,l.from.ch);l.to=e(l.to.line+n,l.to.ch)} +else if(i<=l.to.line){f=!1;break}};if(!f){t.splice(0,s+1);s=0}}};function Ao(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;Oo(e.done,i,r,n);Oo(e.undone,i,r,n)};function At(e,i,r,n){var o=i,l=i;if(typeof i=="number"){l=t(e,en(e,i))} +else{o=u(i)};if(o==null){return null};if(n(l,o)&&e.cm){oe(e.cm,o,r)};return l};function Wt(e){var r=this;this.lines=e;this.parent=null;var i=0;for(var t=0;t<e.length;++t){e[t].parent=r;i+=e[t].height};this.height=i};Wt.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){var n=this;for(var r=e,o=e+t;r<o;++r){var i=n.lines[r];n.height-=i.height;Xl(i);w(i,"delete")};this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){var n=this;this.height+=i;this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r){t[r].parent=n}},iterN:function(e,t,i){var n=this;for(var r=e+t;e<r;++e){if(i(n.lines[e])){return!0}}}};function Dt(e){var o=this;this.children=e;var r=0,n=0;for(var i=0;i<e.length;++i){var t=e[i];r+=t.chunkSize();n+=t.height;t.parent=o};this.size=r;this.height=n;this.parent=null};Dt.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var l=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=l.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),a=i.height;i.removeInner(e,o);l.height-=a-i.height;if(r==o){l.children.splice(n--,1);i.parent=null};if((t-=o)==0){break};e=0} +else{e-=r}};if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Wt))){var s=[];this.collapse(s);this.children=[new Wt(s)];this.children[0].parent=this}},collapse:function(e){var i=this;for(var t=0;t<this.children.length;++t){i.children[t].collapse(e)}},insertInner:function(e,t,i){var o=this;this.size+=t.length;this.height+=i;for(var n=0;n<this.children.length;++n){var r=o.children[n],u=r.chunkSize();if(e<=u){r.insertInner(e,t,i);if(r.lines&&r.lines.length>50){var a=r.lines.length%25+25;for(var s=a;s<r.lines.length;){var l=new Wt(r.lines.slice(s,s+=25));r.height-=l.height;o.children.splice(++n,0,l);l.parent=o};r.lines=r.lines.slice(0,a);o.maybeSpill()};break};e-=u}},maybeSpill:function(){if(this.children.length<=10){return};var e=this;do{var n=e.children.splice(e.children.length-5,5),t=new Dt(n);if(!e.parent){var i=new Dt(e.children);i.parent=e;e.children=[i,t];e=i} +else{e.size-=t.size;e.height-=t.height;var r=b(e.parent.children,e);e.parent.children.splice(r+1,0,t)};t.parent=e.parent} +while(e.children.length>10)e.parent.maybeSpill()},iterN:function(e,t,i){var s=this;for(var n=0;n<this.children.length;++n){var l=s.children[n],r=l.chunkSize();if(e<r){var o=Math.min(t,r-e);if(l.iterN(e,o,i)){return!0};if((t-=o)==0){break};e=0} +else{e-=r}}}};var tt=function(e,t,i){var n=this;if(i){for(var r in i){if(i.hasOwnProperty(r)){n[r]=i[r]}}};this.doc=e;this.node=t};tt.prototype.clear=function(){var l=this,e=this.doc.cm,t=this.line.widgets,i=this.line,n=u(i);if(n==null||!t){return};for(var r=0;r<t.length;++r){if(t[r]==l){t.splice(r--,1)}};if(!t.length){i.widgets=null};var o=bt(this);U(i,Math.max(0,i.height-o));if(e){N(e,function(){Wo(e,i,-o);oe(e,n,"widget")});w(e,"lineWidgetCleared",e,this,n)}};tt.prototype.changed=function(){var r=this,n=this.height,e=this.doc.cm,t=this.line;this.height=null;var i=bt(this)-n;if(!i){return};U(t,t.height+i);if(e){N(e,function(){e.curOp.forceUpdate=!0;Wo(e,t,i);w(e,"lineWidgetChanged",e,r,u(t))})}};Pe(tt);function Wo(e,t,i){if(q(t)<((e.curOp&&e.curOp.scrollTop)||e.doc.scrollTop)){pr(e,i)}};function Vs(e,t,i,r){var n=new tt(e,i,r),o=e.cm;if(o&&n.noHScroll){o.display.alignWidgets=!0};At(e,t,"widget",function(t){var i=t.widgets||(t.widgets=[]);if(n.insertAt==null){i.push(n)} +else{i.splice(Math.min(i.length-1,Math.max(0,n.insertAt)),0,n)};n.line=t;if(o&&!be(e,t)){var r=q(t)<e.scrollTop;U(t,t.height+bt(n));if(r){pr(o,n.height)};o.curOp.forceUpdate=!0};return!0});w(o,"lineWidgetAdded",o,n,typeof t=="number"?t:u(t));return n};var Er=0,ee=function(e,t){this.lines=[];this.type=t;this.doc=e;this.id=++Er};ee.prototype.clear=function(){var i=this;if(this.explicitlyCleared){return};var e=this.doc.cm,h=e&&!e.curOp;if(h){Te(e)};if(F(this,"clear")){var a=this.find();if(a){w(this,"clear",a.from,a.to)}};var n=null,s=null;for(var l=0;l<this.lines.length;++l){var t=i.lines[l],r=dt(t.markedSpans,i);if(e&&!i.collapsed){oe(e,u(t),"text")} +else if(e){if(r.to!=null){s=u(t)};if(r.from!=null){n=u(t)}};t.markedSpans=Nl(t.markedSpans,r);if(r.from==null&&i.collapsed&&!be(i.doc,t)&&e){U(t,Ce(e.display))}};if(e&&this.collapsed&&!e.options.lineWrapping){for(var o=0;o<this.lines.length;++o){var f=V(i.lines[o]),c=ti(f);if(c>e.display.maxLineLength){e.display.maxLine=f;e.display.maxLineLength=c;e.display.maxLineChanged=!0}}};if(n!=null&&e&&this.collapsed){M(e,n,s+1)};this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;if(e){xo(e.doc)}};if(e){w(e,"markerCleared",e,this,n,s)};if(h){Me(e)};if(this.parent){this.parent.clear()}};ee.prototype.find=function(t,i){var a=this;if(t==null&&this.type=="bookmark"){t=1};var o,s;for(var l=0;l<this.lines.length;++l){var r=a.lines[l],n=dt(r.markedSpans,a);if(n.from!=null){o=e(i?r:u(r),n.from);if(t==-1){return o}};if(n.to!=null){s=e(i?r:u(r),n.to);if(t==1){return s}}};return o&&{from:o,to:s}};ee.prototype.changed=function(){var r=this,i=this.find(-1,!0),t=this,e=this.doc.cm;if(!i||!e){return};N(e,function(){var n=i.line,a=u(i.line),l=tr(e,a);if(l){Fn(l);e.curOp.selectionChanged=e.curOp.forceUpdate=!0};e.curOp.updateMaxLine=!0;if(!be(t.doc,n)&&t.height!=null){var s=t.height;t.height=null;var o=bt(t)-s;if(o){U(n,n.height+o)}};w(e,"markerChanged",e,r)})};ee.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||b(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}};this.lines.push(e)};ee.prototype.detachLine=function(e){this.lines.splice(b(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};Pe(ee);function Ve(e,t,i,o,s){if(o&&o.shared){return Ks(e,t,i,o,s)};if(e.cm&&!e.cm.curOp){return m(e.cm,Ve)(e,t,i,o,s)};var l=new ee(e,s),h=n(t,i);if(o){ve(o,l,!1)};if(h>0||h==0&&l.clearWhenEmpty!==!1){return l};if(l.replacedWith){l.collapsed=!0;l.widgetNode=Fe("span",[l.replacedWith],"CodeMirror-widget");if(!o.handleMouseEvents){l.widgetNode.setAttribute("cm-ignore-events","true")};if(o.insertLeft){l.widgetNode.insertLeft=!0}};if(l.collapsed){if(un(e,t.line,t,i,l)||t.line!=i.line&&un(e,i.line,t,i,l)){throw new Error("Inserting collapsed marker partially overlapping an existing one")};Ml()};if(l.addToHistory){po(e,{from:t,to:i,origin:"markText"},e.sel,NaN)};var u=t.line,a=e.cm,c;e.iter(u,i.line+1,function(e){if(a&&l.collapsed&&!a.options.lineWrapping&&V(e)==a.display.maxLine){c=!0};if(l.collapsed&&u!=t.line){U(e,0)};Ol(e,new Qt(l,u==t.line?t.ch:null,u==i.line?i.ch:null))++u});if(l.collapsed){e.iter(t.line,i.line+1,function(t){if(be(e,t)){U(t,0)}})};if(l.clearOnEnter){r(l,"beforeCursorEnter",function(){return l.clear()})};if(l.readOnly){Tl();if(e.history.done.length||e.history.undone.length){e.clearHistory()}};if(l.collapsed){l.id=++Er;l.atomic=!0};if(a){if(c){a.curOp.updateMaxLine=!0};if(l.collapsed){M(a,t.line,i.line+1)} +else if(l.className||l.title||l.startStyle||l.endStyle||l.css){for(var f=t.line;f<=i.line;f++){oe(a,f,"text")}};if(l.atomic){xo(a.doc)};w(a,"markerAdded",a,l)};return l};var et=function(e,t){var r=this;this.markers=e;this.primary=t;for(var i=0;i<e.length;++i){e[i].parent=r}};et.prototype.clear=function(){var t=this;if(this.explicitlyCleared){return};this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e){t.markers[e].clear()};w(this,"clear")};et.prototype.find=function(e,t){return this.primary.find(e,t)};Pe(et);function Ks(e,t,i,r,n){r=ve(r);r.shared=!1;var l=[Ve(e,t,i,r,n)],s=l[0],u=r.widgetNode;Ne(e,function(e){if(u){r.widgetNode=u.cloneNode(!0)};l.push(Ve(e,o(e,t),o(e,i),r,n));for(var f=0;f<e.linked.length;++f){if(e.linked[f].isParent){return}};s=a(l)});return new et(l,s)};function Do(t){return t.findMarks(e(t.first,0),t.clipPos(e(t.lastLine())),function(e){return e.parent})};function Xs(e,t){for(var r=0;r<t.length;r++){var i=t[r],l=i.find(),s=e.clipPos(l.from),a=e.clipPos(l.to);if(n(s,a)){var o=Ve(e,s,a,i.primary,i.primary.type);i.markers.push(o);o.parent=i}}};function js(e){var i=function(t){var i=e[t],o=[i.primary.doc];Ne(i.primary.doc,function(e){return o.push(e)});for(var r=0;r<i.markers.length;r++){var n=i.markers[r];if(b(o,n.doc)==-1){n.parent=null;i.markers.splice(r--,1)}}};for(var t=0;t<e.length;t++)i(t)};var al=0,k=function(t,i,r,n,o){if(!(this instanceof k)){return new k(t,i,r,n,o)};if(r==null){r=0};Dt.call(this,[new Wt([new We("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=r;var l=e(r,0);this.sel=se(l);this.history=new fi(null);this.id=++al;this.modeOption=i;this.lineSep=n;this.direction=(o=="rtl")?"rtl":"ltr";this.extend=!1;if(typeof t=="string"){t=this.splitLines(t)};Cr(this,{from:l,to:l,text:t});C(this,se(l),G)};k.prototype=Zr(Dt.prototype,{constructor:k,iter:function(e,t,i){if(i){this.iterN(e-this.first,t-e,i)} +else{this.iterN(this.first,this.first+this.size,e)}},insert:function(e,t){var r=0;for(var i=0;i<t.length;++i){r+=t[i].height};this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Pi(this,this.first,this.first+this.size);if(e===!1){return t};return t.join(e||this.lineSeparator())},setValue:y(function(i){var r=e(this.first,0),n=this.first+this.size-1;Ge(this,{from:r,to:e(n,t(this,n).text.length),text:this.splitLines(i),origin:"setValue",full:!0},!0);if(this.cm){Lt(this.cm,0,0)};C(this,se(r),G)}),replaceRange:function(e,t,i,r){t=o(this,t);i=i?o(this,i):t;Ue(this,e,t,i,r)},getRange:function(e,t,i){var r=me(this,o(this,e),o(this,t));if(i===!1){return r};return r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ht(this,e)){return t(this,e)}},getLineNumber:function(e){return u(e)},getLineHandleVisualStart:function(e){if(typeof e=="number"){e=t(this,e)};return V(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var i=this.sel.primary(),t;if(e==null||e=="head"){t=i.head} +else if(e=="anchor"){t=i.anchor} +else if(e=="end"||e=="to"||e===!1){t=i.to()} +else{t=i.from()};return t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:y(function(t,i,r){yo(this,o(this,typeof t=="number"?e(t,i||0):t),null,r)}),setSelection:y(function(e,t,i){yo(this,o(this,e),o(this,t||e),i)}),extendSelection:y(function(e,t,i){hi(this,o(this,e),t&&o(this,t),i)}),extendSelections:y(function(e,t){mo(this,tn(this,e),t)}),extendSelectionsBy:y(function(e,t){var i=jt(this.sel.ranges,e);mo(this,tn(this,i),t)}),setSelections:y(function(e,t,i){var l=this;if(!e.length){return};var n=[];for(var r=0;r<e.length;r++){n[r]=new s(o(l,e[r].anchor),o(l,e[r].head))};if(t==null){t=Math.min(e.length-1,this.sel.primIndex)};C(this,R(n,t),i)}),addSelection:y(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new s(o(this,e),o(this,t||e)));C(this,R(r,r.length-1),i)}),getSelection:function(e){var o=this,r=this.sel.ranges,t;for(var i=0;i<r.length;i++){var n=me(o,r[i].from(),r[i].to());t=t?t.concat(n):n};if(e===!1){return t} +else{return t.join(e||this.lineSeparator())}},getSelections:function(e){var n=this,o=[],r=this.sel.ranges;for(var t=0;t<r.length;t++){var i=me(n,r[t].from(),r[t].to());if(e!==!1){i=i.join(e||n.lineSeparator())};o[t]=i};return o},replaceSelection:function(e,t,i){var n=[];for(var r=0;r<this.sel.ranges.length;r++){n[r]=e};this.replaceSelections(n,t,i||"+input")},replaceSelections:y(function(e,t,i){var a=this,n=[],u=this.sel;for(var r=0;r<u.ranges.length;r++){var s=u.ranges[r];n[r]={from:s.from(),to:s.to(),text:a.splitLines(e[r]),origin:i}};var l=t&&t!="end"&&Fs(this,n,t);for(var o=n.length-1;o>=0;o--){Ge(a,n[o])};if(l){bo(this,l)} +else if(this.cm){Ie(this.cm)}}),undo:y(function(){pi(this,"undo")}),redo:y(function(){pi(this,"redo")}),undoSelection:y(function(){pi(this,"undo",!0)}),redoSelection:y(function(){pi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,r=0,n=0;for(var i=0;i<e.done.length;i++){if(!e.done[i].ranges){++r}};for(var t=0;t<e.undone.length;t++){if(!e.undone[t].ranges){++n}};return{undo:r,redo:n}},clearHistory:function(){this.history=new fi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){if(e){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null};return this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Re(this.history.done),undone:Re(this.history.undone)}},setHistory:function(e){var t=this.history=new fi(this.history.maxGeneration);t.done=Re(e.done.slice(0),null,!0);t.undone=Re(e.undone.slice(0),null,!0)},setGutterMarker:y(function(e,t,i){return At(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});r[t]=i;if(!i&&Qr(r)){e.gutterMarkers=null};return!0})}),clearGutter:y(function(e){var t=this;this.iter(function(i){if(i.gutterMarkers&&i.gutterMarkers[e]){At(t,i,"gutter",function(){i.gutterMarkers[e]=null;if(Qr(i.gutterMarkers)){i.gutterMarkers=null};return!0})}})}),lineInfo:function(e){var i;if(typeof e=="number"){if(!ht(this,e)){return null};i=e;e=t(this,e);if(!e){return null}} +else{i=u(e);if(i==null){return null}};return{line:i,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:y(function(e,t,i){return At(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!e[r]){e[r]=i} +else if(ft(i).test(e[r])){return!1} +else{e[r]+=" "+i};return!0})}),removeLineClass:y(function(e,t,i){return At(this,e,t=="gutter"?"gutter":"class",function(e){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",n=e[o];if(!n){return!1} +else if(i==null){e[o]=null} +else{var r=n.match(ft(i));if(!r){return!1};var l=r.index+r[0].length;e[o]=n.slice(0,r.index)+(!r.index||l==n.length?"":" ")+n.slice(l)||null};return!0})}),addLineWidget:y(function(e,t,i){return Vs(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ve(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};e=o(this,e);return Ve(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var l=[],n=t(this,e.line).markedSpans;if(n){for(var r=0;r<n.length;++r){var i=n[r];if((i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)){l.push(i.marker.parent||i.marker)}}};return l},findMarks:function(e,t,i){e=o(this,e);t=o(this,t);var n=[],r=e.line;this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a){for(var s=0;s<a.length;s++){var l=a[s];if(!(l.to!=null&&r==e.line&&e.ch>=l.to||l.from==null&&r!=e.line||l.from!=null&&r==t.line&&l.from>=t.ch)&&(!i||i(l.marker))){n.push(l.marker.parent||l.marker)}}};++r});return n},getAllMarks:function(){var e=[];this.iter(function(t){var r=t.markedSpans;if(r){for(var i=0;i<r.length;++i){if(r[i].from!=null){e.push(r[i].marker)}}}});return e},posFromIndex:function(t){var i,r=this.first,n=this.lineSeparator().length;this.iter(function(e){var o=e.text.length+n;if(o>t){i=t;return!0};t-=o++r});return o(this,e(r,i))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0){return 0};var i=this.lineSeparator().length;this.iter(this.first,e.line,function(e){t+=e.text.length+i});return t},copy:function(e){var t=new k(Pi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=!1;if(e){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())};return t},linkedDoc:function(e){if(!e){e={}};var i=this.first,r=this.first+this.size;if(e.from!=null&&e.from>i){i=e.from};if(e.to!=null&&e.to<r){r=e.to};var t=new k(Pi(this,i,r),e.mode||this.modeOption,i,this.lineSep,this.direction);if(e.sharedHist){t.history=this.history}(this.linked||(this.linked=[])).push({doc:t,sharedHist:e.sharedHist});t.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}];Xs(t,Do(this));return t},unlinkDoc:function(e){var i=this;if(e instanceof h){e=e.doc};if(this.linked){for(var t=0;t<this.linked.length;++t){var n=i.linked[t];if(n.doc!=e){continue};i.linked.splice(t,1);e.unlinkDoc(i);js(Do(i));break}};if(e.history==this.history){var r=[e.id];Ne(e,function(e){return r.push(e.id)},!0);e.history=new fi(null);e.history.done=Re(this.history.done,r);e.history.undone=Re(this.history.undone,r)}},iterLinkedDocs:function(e){Ne(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){if(this.lineSep){return e.split(this.lineSep)};return Si(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:y(function(e){if(e!="rtl"){e="ltr"};if(e==this.direction){return};this.direction=e;this.iter(function(e){return e.order=null});if(this.cm){Ps(this.cm)}})});k.prototype.eachLine=k.prototype.iter;var Pr=0;function Ys(e){var t=this;Ho(t);if(v(t,e)||Q(t.display,e)){return};T(e);if(l){Pr=+new Date};var r=Se(t,e,!0),u=e.dataTransfer.files;if(!r||t.isReadOnly()){return};if(u&&u.length&&window.FileReader&&window.File){var f=u.length,h=Array(f),d=0,p=function(e,i){if(t.options.allowDropFileTypes&&b(t.options.allowDropFileTypes,e.type)==-1){return};var n=new FileReader;n.onload=m(t,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){e=""};h[i]=e;if(++d==f){r=o(t.doc,r);var l={from:r,to:r,text:t.doc.splitLines(h.join(t.doc.lineSeparator())),origin:"paste"};Ge(t.doc,l);bo(t.doc,se(r,ae(l)))}});n.readAsText(e)};for(var a=0;a<f;++a){p(u[a],a)}} +else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e);setTimeout(function(){return t.display.input.focus()},20);return};try{var c=e.dataTransfer.getData("Text");if(c){var n;if(t.state.draggingText&&!t.state.draggingText.copy){n=t.listSelections()};di(t.doc,se(r,r));if(n){for(var s=0;s<n.length;++s){Ue(t.doc,"",n[s].anchor,n[s].head,"drag")}};t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(i){}}};function qs(e,t){if(l&&(!e.state.draggingText||+new Date-Pr<100)){vt(t);return};if(v(e,t)||Q(e.display,t)){return};t.dataTransfer.setData("Text",e.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!Yr){var r=i("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(E){r.width=r.height=1;e.display.wrapper.appendChild(r);r._top=r.offsetTop};t.dataTransfer.setDragImage(r,0,0);if(E){r.parentNode.removeChild(r)}}};function Zs(e,t){var n=Se(e,t);if(!n){return};var r=document.createDocumentFragment();Kn(e,n,r);if(!e.display.dragCursor){e.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors");e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)};W(e.display.dragCursor,r)};function Ho(e){if(e.display.dragCursor){e.display.lineSpace.removeChild(e.display.dragCursor);e.display.dragCursor=null}};function Fo(e){if(!document.getElementsByClassName){return};var r=document.getElementsByClassName("CodeMirror");for(var t=0;t<r.length;t++){var i=r[t].CodeMirror;if(i){e(i)}}};var Fr=!1;function Qs(){if(Fr){return};Js();Fr=!0};function Js(){var e;r(window,"resize",function(){if(e==null){e=setTimeout(function(){e=null;Fo(ea)},100)}});r(window,"blur",function(){return Fo(St)})};function ea(e){var t=e.display;if(t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth){return};t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=!1;e.setSize()};var J={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var Je=0;Je<10;Je++){J[Je+48]=J[Je+96]=String(Je)};for(var zt=65;zt<=90;zt++){J[zt]=String.fromCharCode(zt)};for(var Qe=1;Qe<=12;Qe++){J[Qe+111]=J[Qe+63235]="F"+Qe};var j={};j.basic={"Left":"goCharLeft","Right":"goCharRight","Up":"goLineUp","Down":"goLineDown","End":"goLineEnd","Home":"goLineStartSmart","PageUp":"goPageUp","PageDown":"goPageDown","Delete":"delCharAfter","Backspace":"delCharBefore","Shift-Backspace":"delCharBefore","Tab":"defaultTab","Shift-Tab":"indentAuto","Enter":"newlineAndIndent","Insert":"toggleOverwrite","Esc":"singleSelection"};j.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};j.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};j.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};j["default"]=I?j.macDefault:j.pcDefault;function ta(e){var i=e.split(/-(?!$)/);e=i[i.length-1];var n,o,l,s;for(var r=0;r<i.length-1;r++){var t=i[r];if(/^(cmd|meta|m)$/i.test(t)){s=!0} +else if(/^a(lt)?$/i.test(t)){n=!0} +else if(/^(c|ctrl|control)$/i.test(t)){o=!0} +else if(/^s(hift)?$/i.test(t)){l=!0} +else{throw new Error("Unrecognized modifier name: "+t)}};if(n){e="Alt-"+e};if(o){e="Ctrl-"+e};if(s){e="Cmd-"+e};if(l){e="Shift-"+e};return e};function ia(e){var l={};for(var t in e){if(e.hasOwnProperty(t)){var u=e[t];if(/^(name|fallthrough|(de|at)tach)$/.test(t)){continue};if(u=="..."){delete e[t];continue};var o=jt(t.split(" "),ta);for(var n=0;n<o.length;n++){var r=(void 0),i=(void 0);if(n==o.length-1){i=o.join(" ");r=u} +else{i=o.slice(0,n+1).join(" ");r="..."};var a=l[i];if(!a){l[i]=r} +else if(a!=r){throw new Error("Inconsistent bindings for "+i)}};delete e[t]}};for(var s in l){e[s]=l[s]};return e};function Ke(e,t,i,r){t=gi(t);var n=t.call?t.call(e,r):t[e];if(n===!1){return"nothing"};if(n==="..."){return"multi"};if(n!=null&&i(n)){return"handled"};if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Ke(e,t.fallthrough,i,r)};for(var o=0;o<t.fallthrough.length;o++){var l=Ke(e,t.fallthrough[o],i,r);if(l){return l}}}};function Po(e){var t=typeof e=="string"?e:J[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"};function Eo(e,t,i){var r=e;if(t.altKey&&r!="Alt"){e="Alt-"+e};if((Vr?t.metaKey:t.ctrlKey)&&r!="Ctrl"){e="Ctrl-"+e};if((Vr?t.ctrlKey:t.metaKey)&&r!="Cmd"){e="Cmd-"+e};if(!i&&t.shiftKey&&r!="Shift"){e="Shift-"+e};return e};function Io(e,t){if(E&&e.keyCode==34&&e["char"]){return!1};var i=J[e.keyCode];if(i==null||e.altGraphKey){return!1};return Eo(i,e,t)};function gi(e){return typeof e=="string"?j[e]:e};function Xe(e,t){var s=e.doc.sel.ranges,i=[];for(var o=0;o<s.length;o++){var r=t(s[o]);while(i.length&&n(r.from,a(i).to)<=0){var l=i.pop();if(n(l.from,r.from)<0){r.from=l.from;break}};i.push(r)};N(e,function(){for(var t=i.length-1;t>=0;t--){Ue(e.doc,"",i[t].from,i[t].to,"+delete")};Ie(e)})};function Mr(e,t,i){var r=Jr(e.text,t+i,i);return r<0||r>e.text.length?null:r};function Nr(t,i,r){var n=Mr(t,i.ch,r);return n==null?null:new e(i.line,n,r<0?"after":"before")};function Or(t,i,r,n,o){if(t){var u=Z(r,i.doc.direction);if(u){var s=o<0?a(u):u[0],d=(o<0)==(s.level==1),c=d?"after":"before",l;if(s.level>0||i.doc.direction=="rtl"){var f=Ee(i,r);l=o<0?r.text.length-1:0;var h=X(i,f,l).top;l=ct(function(e){return X(i,f,e).top==h},(o<0)==(s.level==1)?s.from:s.to-1,l);if(c=="before"){l=Mr(r,l,1)}} +else{l=o<0?s.to:s.from};return new e(n,l,c)}};return new e(n,o<0?r.text.length:0,o<0?"before":"after")};function ra(t,i,r,n){var a=Z(i,t.doc.direction);if(!a){return Nr(i,r,n)};if(r.ch>=i.text.length){r.ch=i.text.length;r.sticky="before"} +else if(r.ch<=0){r.ch=0;r.sticky="after"};var v=gt(a,r.ch,r.sticky),o=a[v];if(t.doc.direction=="ltr"&&o.level%2==0&&(n>0?o.to>r.ch:o.from<r.ch)){return Nr(i,r,n)};var s=function(t,r){return Mr(i,t instanceof e?t.ch:t,r)},d,g=function(e){if(!t.options.lineWrapping){return{begin:0,end:i.text.length}};d=d||Ee(t,i);return Gn(t,i,d,e)},f=g(r.sticky=="before"?s(r,-1):r.ch);if(t.doc.direction=="rtl"||o.level==1){var h=(o.level==1)==(n<0),l=s(r,h?1:-1);if(l!=null&&(!h?l>=o.from&&l>=f.begin:l<=o.to&&l<=f.end)){var m=h?"before":"after";return new e(r.line,l,m)}};var p=function(t,i,n){var f=function(t,i){return i?new e(r.line,s(t,1),"before"):new e(r.line,t,"after")};for(;t>=0&&t<a.length;t+=i){var l=a[t],u=(i>0)==(l.level!=1),o=u?n.begin:s(n.end,-1);if(l.from<=o&&o<l.to){return f(o,u)};o=u?l.from:s(l.to,-1);if(n.begin<=o&&o<n.end){return f(o,u)}}},u=p(v+n,n,f);if(u){return u};var c=n>0?f.end:s(f.begin,-1);if(c!=null&&!(n>0&&c==i.text.length)){u=p(n>0?0:a.length-1,n,g(c));if(u){return u}};return null};var Ze={selectAll:Lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(i){return Xe(i,function(r){if(r.empty()){var n=t(i.doc,r.head.line).text.length;if(r.head.ch==n&&r.head.line<i.lastLine()){return{from:r.head,to:e(r.head.line+1,0)}} +else{return{from:r.head,to:e(r.head.line,n)}}} +else{return{from:r.from(),to:r.to()}}})},deleteLine:function(t){return Xe(t,function(i){return({from:e(i.from().line,0),to:o(t.doc,e(i.to().line+1,0))})})},delLineLeft:function(t){return Xe(t,function(t){return({from:e(t.from().line,0),to:t.from()})})},delWrappedLineLeft:function(e){return Xe(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Xe(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(t){return t.extendSelection(e(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(e(t.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return zo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ro(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return na(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},ot)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},ot)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");if(i.ch<e.getLine(i.line).search(/\S/)){return Ro(e,t.head)};return i},ot)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){var n=[],o=e.listSelections(),i=e.options.tabSize;for(var t=0;t<o.length;t++){var r=o[t].from(),l=H(e.getLine(r.line),r.ch,i);n.push(Di(i-l%i))};e.replaceSelections(n)},defaultTab:function(e){if(e.somethingSelected()){e.indentSelection("add")} +else{e.execCommand("insertTab")}},transposeChars:function(i){return N(i,function(){var a=i.listSelections(),u=[];for(var l=0;l<a.length;l++){if(!a[l].empty()){continue};var r=a[l].head,n=t(i.doc,r.line).text;if(n){if(r.ch==n.length){r=new e(r.line,r.ch-1)};if(r.ch>0){r=new e(r.line,r.ch+1);i.replaceRange(n.charAt(r.ch-1)+n.charAt(r.ch-2),e(r.line,r.ch-2),r,"+transpose")} +else if(r.line>i.doc.first){var o=t(i.doc,r.line-1).text;if(o){r=new e(r.line,1);i.replaceRange(n.charAt(0)+i.doc.lineSeparator()+o.charAt(o.length-1),e(r.line-1,o.length-1),r,"+transpose")}}};u.push(new s(r,r))};i.setSelections(u)})},newlineAndIndent:function(e){return N(e,function(){var t=e.listSelections();for(var i=t.length-1;i>=0;i--){e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input")};t=e.listSelections();for(var r=0;r<t.length;r++){e.indentLine(t[r].from().line,null,!0)};Ie(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function zo(e,i){var n=t(e.doc,i),r=V(n);if(r!=n){i=u(r)};return Or(!0,e,r,i,1)};function na(e,i){var r=t(e.doc,i),n=Hl(r);if(n!=r){i=u(n)};return Or(!0,e,r,i,-1)};function Ro(i,r){var n=zo(i,r.line),l=t(i.doc,n.line),s=Z(l,i.doc.direction);if(!s||s[0].level==0){var o=Math.max(0,l.text.search(/\S/)),a=r.line==n.line&&r.ch<=o&&r.ch;return e(n.line,a?0:o,n.sticky)};return n};function vi(e,t,i){if(typeof t=="string"){t=Ze[t];if(!t){return!1}};e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{if(e.isReadOnly()){e.state.suppressEdits=!0};if(i){e.display.shift=!1};r=t(e)!=Vt}finally{e.display.shift=n;e.state.suppressEdits=!1};return r};function oa(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Ke(t,e.state.keyMaps[r],i,e);if(n){return n}};return(e.options.extraKeys&&Ke(t,e.options.extraKeys,i,e))||Ke(t,e.options.keyMap,i,e)};var sl=new ce;function Ht(e,t,i,r){var n=e.state.keySeq;if(n){if(Po(t)){return"handled"};if(/'$/.test(t)){e.state.keySeq=null} +else{sl.set(50,function(){if(e.state.keySeq==n){e.state.keySeq=null;e.display.input.reset()}})};if(Bo(e,n+" "+t,i,r)){return!0}};return Bo(e,t,i,r)};function Bo(e,t,i,r){var n=oa(e,t,r);if(n=="multi"){e.state.keySeq=t};if(n=="handled"){w(e,"keyHandled",e,t,i)};if(n=="handled"||n=="multi"){T(i);fr(e)};return!!n};function Go(e,t){var i=Io(t,!0);if(!i){return!1};if(t.shiftKey&&!e.state.keySeq){return Ht(e,"Shift-"+i,t,function(t){return vi(e,t,!0)})||Ht(e,i,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return vi(e,t)}})} +else{return Ht(e,i,t,function(t){return vi(e,t)})}};function la(e,t,i){return Ht(e,"'"+i+"'",t,function(t){return vi(e,t,!0)})};var xi=null;function Uo(e){var t=this;t.curOp.focus=Y();if(v(t,e)){return};if(l&&c<11&&e.keyCode==27){e.returnValue=!1};var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Go(t,e);if(E){xi=r?i:null;if(!r&&i==88&&!dl&&(I?e.metaKey:e.ctrlKey)){t.replaceSelection("",null,"cut")}};if(i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){sa(t)}};function sa(e){var i=e.display.lineDiv;ge(i,"CodeMirror-crosshair");function t(e){if(e.keyCode==18||!e.altKey){de(i,"CodeMirror-crosshair");D(document,"keyup",t);D(document,"mouseover",t)}};r(document,"keyup",t);r(document,"mouseover",t)};function Vo(e){if(e.keyCode==16){this.doc.sel.shift=!1};v(this,e)};function Ko(e){var t=this;if(Q(t.display,e)||v(t,e)||e.ctrlKey&&!e.altKey||I&&e.metaKey){return};var r=e.keyCode,n=e.charCode;if(E&&r==xi){xi=null;T(e);return};if((E&&(!e.which||e.which<10))&&Go(t,e)){return};var i=String.fromCharCode(n==null?r:n);if(i=="\x08"){return};if(la(t,e,i)){return};t.display.input.onKeyPress(e)};var ll=400,wi=function(e,t,i){this.time=e;this.pos=t;this.button=i};wi.prototype.compare=function(e,t,i){return this.time+ll>e&&n(t,this.pos)==0&&i==this.button};var Ye,qe;function aa(e,t){var i=+new Date;if(qe&&qe.compare(i,e,t)){Ye=qe=null;return"triple"} +else if(Ye&&Ye.compare(i,e,t)){qe=new wi(i,e,t);Ye=null;return"double"} +else{Ye=new wi(i,e,t);qe=null;return"single"}};function Xo(e){var t=this,i=t.display;if(v(t,e)||i.activeTouch&&i.input.supportsTouch()){return};i.input.ensurePolled();i.shift=e.shiftKey;if(Q(i,e)){if(!x){i.scroller.draggable=!1;setTimeout(function(){return i.scroller.draggable=!0},100)};return};if(Ar(t,e)){return};var r=Se(t,e),n=dn(e),o=r?aa(r,n):"single";window.focus();if(n==1&&t.state.selectingText){t.state.selectingText(e)};if(r&&ua(t,n,r,o,e)){return};if(n==1){if(r){ca(t,r,o,e)} +else if(Xi(e)==i.scroller){T(e)}} +else if(n==2){if(r){hi(t.doc,r)};setTimeout(function(){return i.input.focus()},20)} +else if(n==3){if(Ni){qo(t,e)} +else{jn(t)}}};function ua(e,t,i,r,n){var o="Click";if(r=="double"){o="Double"+o} +else if(r=="triple"){o="Triple"+o};o=(t==1?"Left":t==2?"Middle":"Right")+o;return Ht(e,Eo(o,n),n,function(t){if(typeof t=="string"){t=Ze[t]};if(!t){return!1};var r=!1;try{if(e.isReadOnly()){e.state.suppressEdits=!0};r=t(e,i)!=Vt}finally{e.state.suppressEdits=!1};return r})};function fa(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var o=xl?i.shiftKey&&i.metaKey:i.altKey;r.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"};if(r.extend==null||e.doc.extend){r.extend=e.doc.extend||i.shiftKey};if(r.addNew==null){r.addNew=I?i.metaKey:i.ctrlKey};if(r.moveOnDrag==null){r.moveOnDrag=!(I?i.altKey:i.ctrlKey)};return r};function ca(e,t,i,r){if(l){setTimeout(Ai(Xn,e),0)} +else{e.curOp.focus=Y()};var s=fa(e,i,r),a=e.doc.sel,o;if(e.options.dragDrop&&pl&&!e.isReadOnly()&&i=="single"&&(o=a.contains(t))>-1&&(n((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(n(o.to(),t)>0||t.xRel<0)){ha(e,r,t,s)} +else{da(e,r,t,s)}};function ha(e,t,i,n){var o=e.display,a=!1,s=m(e,function(t){if(x){o.scroller.draggable=!1};e.state.draggingText=!1;D(document,"mouseup",s);D(document,"mousemove",u);D(o.scroller,"dragstart",f);D(o.scroller,"drop",s);if(!a){T(t);if(!n.addNew){hi(e.doc,i,null,null,n.extend)};if(x||l&&c==9){setTimeout(function(){document.body.focus();o.input.focus()},20)} +else{o.input.focus()}}}),u=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return a=!0};if(x){o.scroller.draggable=!0};e.state.draggingText=s;s.copy=!n.moveOnDrag;if(o.scroller.dragDrop){o.scroller.dragDrop()};r(document,"mouseup",s);r(document,"mousemove",u);r(o.scroller,"dragstart",f);r(o.scroller,"drop",s);jn(e);setTimeout(function(){return o.input.focus()},20)};function jo(t,i,r){if(r=="char"){return new s(i,i)};if(r=="word"){return t.findWordAt(i)};if(r=="line"){return new s(e(i.line,0),o(t.doc,e(i.line+1,0)))};var n=r(t,i);return new s(n.from,n.to)};function da(i,l,a,u){var v=i.display,f=i.doc;T(l);var h,c,p=f.sel,d=p.ranges;if(u.addNew&&!u.extend){c=f.sel.contains(a);if(c>-1){h=d[c]} +else{h=new s(a,a)}} +else{h=f.sel.primary();c=f.sel.primIndex};if(u.unit=="rectangle"){if(!u.addNew){h=new s(a,a)};a=Se(i,l,!0,!0);c=-1} +else{var w=jo(i,a,u.unit);if(u.extend){h=Lr(h,w.anchor,w.head,u.extend)} +else{h=w}};if(!u.addNew){c=0;C(f,new O([h],0),Mi);p=f.sel} +else if(c==-1){c=d.length;C(f,R(d.concat([h]),c),{scroll:!1,origin:"*mouse"})} +else if(d.length>1&&d[c].empty()&&u.unit=="char"&&!u.extend){C(f,R(d.slice(0,c).concat(d.slice(c+1)),0),{scroll:!1,origin:"*mouse"});p=f.sel} +else{kr(f,c,h,Mi)};var b=a;function M(r){if(n(b,r)==0){return};b=r;if(u.unit=="rectangle"){var g=[],y=i.options.tabSize,k=H(t(f,a.line).text,a.ch,y),T=H(t(f,r.line).text,r.ch,y),M=Math.min(k,T),N=Math.max(k,T);for(var l=Math.min(a.line,r.line),O=Math.min(i.lastLine(),Math.max(a.line,r.line));l<=O;l++){var S=t(f,l).text,m=Wi(S,M,y);if(M==N){g.push(new s(e(l,m),e(l,m)))} +else if(S.length>m){g.push(new s(e(l,m),e(l,Wi(S,N,y))))}};if(!g.length){g.push(new s(a,a))};C(f,R(p.ranges.slice(0,c).concat(g),c),{origin:"*mouse",scroll:!1});i.scrollIntoView(r)} +else{var w=h,d=jo(i,r,u.unit),v=w.anchor,x;if(n(d.anchor,v)>0){x=d.head;v=Zt(w.from(),d.anchor)} +else{x=d.anchor;v=qt(w.to(),d.head)};var L=p.ranges.slice(0);L[c]=pa(i,new s(o(f,v),x));C(f,R(L,c),Mi)}};var L=v.wrapper.getBoundingClientRect(),g=0;function x(e){var l=++g,t=Se(i,e,!0,u.unit=="rectangle");if(!t){return};if(n(t,b)!=0){i.curOp.focus=Y();M(t);var o=hr(v,f);if(t.line>=o.to||t.line<o.from){setTimeout(m(i,function(){if(g==l){x(e)}}),150)}} +else{var r=e.clientY<L.top?-20:e.clientY>L.bottom?20:0;if(r){setTimeout(m(i,function(){if(g!=l){return};v.scroller.scrollTop+=r;x(e)}),50)}}};function k(e){i.state.selectingText=!1;g=Infinity;T(e);v.input.focus();D(document,"mousemove",S);D(document,"mouseup",y);f.history.lastSelOrigin=null};var S=m(i,function(e){if(!dn(e)){k(e)} +else{x(e)}}),y=m(i,k);i.state.selectingText=y;r(document,"mousemove",S);r(document,"mouseup",y)};function pa(i,r){var o=r.anchor,l=r.head,b=t(i.doc,o.line);if(n(o,l)==0&&o.sticky==l.sticky){return r};var a=Z(b);if(!a){return r};var p=gt(a,o.ch,o.sticky),c=a[p];if(c.from!=o.ch&&c.to!=o.ch){return r};var f=p+((c.from==o.ch)==(c.level!=1)?0:1);if(f==0||f==a.length){return r};var u;if(l.line!=o.line){u=(l.line-o.line)*(i.doc.direction=="ltr"?1:-1)>0} +else{var d=gt(a,l.ch,l.sticky),y=d-p||(l.ch-o.ch)*(c.level==1?-1:1);if(d==f-1||d==f){u=y<0} +else{u=y>0}};var h=a[f+(u?-1:0)],g=u==(h.level==1),v=g?h.from:h.to,m=g?"after":"before";return o.ch==v&&o.sticky==m?r:new s(new e(o.line,v,m),l)};function Yo(e,t,i,r){var s,o;if(t.touches){s=t.touches[0].clientX;o=t.touches[0].clientY} +else{try{s=t.clientX;o=t.clientY}catch(n){return!1}};if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right)){return!1};if(r){T(t)};var a=e.display,f=a.lineDiv.getBoundingClientRect();if(o>f.bottom||!F(e,i)){return Ki(t)};o-=f.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=s){var c=ye(e.doc,o),h=e.options.gutters[l];p(e,i,e,c,h,t);return Ki(t)}}};function Ar(e,t){return Yo(e,t,"gutterClick",!0)};function qo(e,t){if(Q(e.display,t)||ga(e,t)){return};if(v(e,t,"contextmenu")){return};e.display.input.onContextMenu(t)};function ga(e,t){if(!F(e,"gutterContextMenu")){return!1};return Yo(e,t,"gutterContextMenu",!1)};function Zo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-");wt(e)};var Oe={toString:function(){return"CodeMirror.Init"}};var Hr={};var It={};function va(t){var r=t.optionHandlers;function i(e,i,n,o){t.defaults[e]=i;if(n){r[e]=o?function(e,t,i){if(i!=Oe){n(e,t,i)}}:n}};t.defineOption=i;t.Init=Oe;i("value","",function(e,t){return e.setValue(t)},!0);i("mode",null,function(e,t){e.doc.modeOption=t;xr(e)},!0);i("indentUnit",2,xr,!0);i("indentWithTabs",!1);i("smartIndent",!0);i("tabSize",4,function(e){Nt(e);wt(e);M(e)},!0);i("lineSeparator",null,function(t,i){t.doc.lineSep=i;if(!i){return};var n=[],o=t.doc.first;t.doc.iter(function(t){for(var l=0;;){var r=t.text.indexOf(i,l);if(r==-1){break};l=r+i.length;n.push(e(o,r))};o++});for(var r=n.length-1;r>=0;r--){Ue(t.doc,i,n[r],e(n[r].line,n[r].ch+i.length))}});i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,i){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(i!=Oe){e.refresh()}});i("specialCharPlaceholder",jl,function(e){return e.refresh()},!0);i("electricChars",!0);i("inputStyle",ut?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0);i("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0);i("rtlMoveVisually",!Cl);i("wholeLineUpdateBefore",!0);i("theme","default",function(e){Zo(e);Ft(e)},!0);i("keyMap","default",function(e,t,i){var n=gi(t),r=i!=Oe&&gi(i);if(r&&r.detach){r.detach(e,n)};if(n.attach){n.attach(e,r||null)}});i("extraKeys",null);i("configureMouse",null);i("lineWrapping",!1,ya,!0);i("gutters",[],function(e){br(e.options);Ft(e)},!0);i("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0";e.refresh()},!0);i("coverGutterNextToScrollbar",!1,function(e){return ze(e)},!0);i("scrollbarStyle","native",function(e){to(e);ze(e);e.display.scrollbars.setScrollTop(e.doc.scrollTop);e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0);i("lineNumbers",!1,function(e){br(e.options);Ft(e)},!0);i("firstLineNumber",1,Ft,!0);i("lineNumberFormatter",function(e){return e},Ft,!0);i("showCursorWhenSelecting",!1,Ct,!0);i("resetSelectionOnContextMenu",!0);i("lineWiseCopyCut",!0);i("pasteLinesPerSelection",!0);i("readOnly",!1,function(e,t){if(t=="nocursor"){St(e);e.display.input.blur()};e.display.input.readOnlyChanged(t)});i("disableInput",!1,function(e,t){if(!t){e.display.input.reset()}},!0);i("dragDrop",!0,ma);i("allowDropFileTypes",null);i("cursorBlinkRate",530);i("cursorScrollMargin",0);i("cursorHeight",1,Ct,!0);i("singleCursorHeightPerLine",!0,Ct,!0);i("workTime",100);i("workDelay",100);i("flattenSpans",!0,Nt,!0);i("addModeClass",!1,Nt,!0);i("pollInterval",100);i("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t});i("historyEventDelay",1250);i("viewportMargin",10,function(e){return e.refresh()},!0);i("maxHighlightLength",10000,Nt,!0);i("moveInputWithCursor",!0,function(e,t){if(!t){e.display.input.resetPosition()}});i("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""});i("autofocus",null);i("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)};function Ft(e){no(e);M(e);qn(e)};function ma(e,t,i){var l=i&&i!=Oe;if(!t!=!l){var n=e.display.dragFunctions,o=t?r:D;o(e.display.scroller,"dragstart",n.start);o(e.display.scroller,"dragenter",n.enter);o(e.display.scroller,"dragover",n.over);o(e.display.scroller,"dragleave",n.leave);o(e.display.scroller,"drop",n.drop)}};function ya(e){if(e.options.lineWrapping){ge(e.display.wrapper,"CodeMirror-wrap");e.display.sizer.style.minWidth="";e.display.sizerWidth=null} +else{de(e.display.wrapper,"CodeMirror-wrap");Ui(e)};ur(e);M(e);wt(e);setTimeout(function(){return ze(e)},100)};function h(e,t){var s=this;if(!(this instanceof h)){return new h(e,t)};this.options=t=t?ve(t):{};ve(Hr,t,!1);br(t);var i=t.value;if(typeof i=="string"){i=new k(i,t.mode,null,t.lineSeparator,t.direction)};this.doc=i;var a=new h.inputStyles[t.inputStyle](this),r=this.display=new Ll(e,i,a);r.wrapper.CodeMirror=this;no(this);Zo(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"};to(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new ce(),keySeq:null,specialChars:null};if(t.autofocus&&!ut){r.input.focus()};if(l&&c<11){setTimeout(function(){return s.display.input.reset(!0)},20)};ba(this);Qs();Te(this);this.curOp.forceUpdate=!0;fo(this,i);if((t.autofocus&&!ut)||this.hasFocus()){setTimeout(Ai(cr,this),20)} +else{St(this)};for(var o in It){if(It.hasOwnProperty(o)){It[o](s,t[o],Oe)}};Zn(this);if(t.finishInit){t.finishInit(this)};for(var n=0;n<bi.length;++n){bi[n](s)};Me(this);if(x&&t.lineWrapping&&getComputedStyle(r.lineDiv).textRendering=="optimizelegibility"){r.lineDiv.style.textRendering="auto"}};h.defaults=Hr;h.optionHandlers=It;function ba(t){var i=t.display;r(i.scroller,"mousedown",m(t,Xo));if(l&&c<11){r(i.scroller,"dblclick",m(t,function(e){if(v(t,e)){return};var r=Se(t,e);if(!r||Ar(t,e)||Q(t.display,e)){return};T(e);var i=t.findWordAt(r);hi(t.doc,i.anchor,i.head)}))} +else{r(i.scroller,"dblclick",function(e){return v(t,e)||T(e)})};if(!Ni){r(i.scroller,"contextmenu",function(e){return qo(t,e)})};var u,a={end:0};function f(){if(i.activeTouch){u=setTimeout(function(){return i.activeTouch=null},1000);a=i.activeTouch;a.end=+new Date}};function d(e){if(e.touches.length!=1){return!1};var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1};function h(e,t){if(t.left==null){return!0};var i=t.left-e.left,r=t.top-e.top;return i*i+r*r>20*20};r(i.scroller,"touchstart",function(e){if(!v(t,e)&&!d(e)&&!Ar(t,e)){i.input.ensurePolled();clearTimeout(u);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null};if(e.touches.length==1){i.activeTouch.left=e.touches[0].pageX;i.activeTouch.top=e.touches[0].pageY}}});r(i.scroller,"touchmove",function(){if(i.activeTouch){i.activeTouch.moved=!0}});r(i.scroller,"touchend",function(r){var n=i.activeTouch;if(n&&!Q(i,r)&&n.left!=null&&!n.moved&&new Date-n.start<300){var l=t.coordsChar(i.activeTouch,"page"),a;if(!n.prev||h(n,n.prev)){a=new s(l,l)} +else if(!n.prev.prev||h(n,n.prev.prev)){a=t.findWordAt(l)} +else{a=new s(e(l.line,0),o(t.doc,e(l.line+1,0)))};t.setSelection(a.anchor,a.head);t.focus();T(r)};f()});r(i.scroller,"touchcancel",f);r(i.scroller,"scroll",function(){if(i.scroller.clientHeight){kt(t,i.scroller.scrollTop);ke(t,i.scroller.scrollLeft,!0);p(t,"scroll",t)}});r(i.scroller,"mousewheel",function(e){return lo(t,e)});r(i.scroller,"DOMMouseScroll",function(e){return lo(t,e)});r(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0});i.dragFunctions={enter:function(e){if(!v(t,e)){vt(e)}},over:function(e){if(!v(t,e)){Zs(t,e);vt(e)}},start:function(e){return qs(t,e)},drop:m(t,Ys),leave:function(e){if(!v(t,e)){Ho(t)}}};var n=i.input.getField();r(n,"keyup",function(e){return Vo.call(t,e)});r(n,"keydown",m(t,Uo));r(n,"keypress",m(t,Ko));r(n,"focus",function(e){return cr(t,e)});r(n,"blur",function(e){return St(t,e)})};var bi=[];h.defineInitHook=function(e){return bi.push(e)};function Pt(i,r,n,o){var a=i.doc,b;if(n==null){n="add"};if(n=="smart"){if(!a.mode.indent){n="prev"} +else{b=mt(i,r).state}};var d=i.options.tabSize,u=t(a,r),g=H(u.text,null,d);if(u.stateAfter){u.stateAfter=null};var f=u.text.match(/^\s*/)[0],l;if(!o&&!/\S/.test(u.text)){l=0;n="not"} +else if(n=="smart"){l=a.mode.indent(b,u.text.slice(f.length),u.text);if(l==Vt||l>150){if(!o){return};n="prev"}};if(n=="prev"){if(r>a.first){l=H(t(a,r-1).text,null,d)} +else{l=0}} +else if(n=="add"){l=g+i.options.indentUnit} +else if(n=="subtract"){l=g-i.options.indentUnit} +else if(typeof n=="number"){l=g+n};l=Math.max(0,l);var h="",p=0;if(i.options.indentWithTabs){for(var y=Math.floor(l/d);y;--y){p+=d;h+="\t"}};if(p<l){h+=Di(l-p)};if(h!=f){Ue(a,h,e(r,0),e(r,f.length),"+input");u.stateAfter=null;return!0} +else{for(var c=0;c<a.sel.ranges.length;c++){var m=a.sel.ranges[c];if(m.head.line==r&&m.head.ch<f.length){var v=e(r,f.length);kr(a,c,new s(v,v));break}}}};var P=null;function mi(e){P=e};function Wr(i,r,n,o,l){var v=i.doc;i.display.shift=!1;if(!o){o=v.sel};var h=i.state.pasteIncoming||l=="paste",d=Si(r),f=null;if(h&&o.ranges.length>1){if(P&&P.text.join("\n")==r){if(o.ranges.length%P.text.length==0){f=[];for(var g=0;g<P.text.length;g++){f.push(v.splitLines(P.text[g]))}}} +else if(d.length==o.ranges.length&&i.options.pasteLinesPerSelection){f=jt(d,function(e){return[e]})}};var y;for(var c=o.ranges.length-1;c>=0;c--){var p=o.ranges[c],s=p.from(),u=p.to();if(p.empty()){if(n&&n>0){s=e(s.line,s.ch-n)} +else if(i.state.overwrite&&!h){u=e(u.line,Math.min(t(v,u.line).text.length,u.ch+a(d).length))} +else if(P&&P.lineWise&&P.text.join("\n")==r){s=u=e(s.line,0)}};y=i.curOp.updateInput;var m={from:s,to:u,text:f?f[c%f.length]:d,origin:l||(h?"paste":i.state.cutIncoming?"cut":"+input")};Ge(i.doc,m);w(i,"inputRead",i,m)};if(r&&!h){Jo(i,r)};Ie(i);i.curOp.updateInput=y;i.curOp.typing=!0;i.state.pasteIncoming=i.state.cutIncoming=!1};function Qo(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i){e.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput){N(t,function(){return Wr(t,i,0,null,"paste")})};return!0}};function Jo(e,i){if(!e.options.electricChars||!e.options.smartIndent){return};var a=e.doc.sel;for(var o=a.ranges.length-1;o>=0;o--){var r=a.ranges[o];if(r.head.ch>100||(o&&a.ranges[o-1].head.line==r.head.line)){continue};var n=e.getModeAt(r.head),s=!1;if(n.electricChars){for(var l=0;l<n.electricChars.length;l++){if(i.indexOf(n.electricChars.charAt(l))>-1){s=Pt(e,r.head.line,"smart");break}}} +else if(n.electricInput){if(n.electricInput.test(t(e.doc,r.head.line).text.slice(0,r.head.ch))){s=Pt(e,r.head.line,"smart")}};if(s){w(e,"electricInput",e,r.head.line)}}};function el(t){var o=[],l=[];for(var r=0;r<t.doc.sel.ranges.length;r++){var n=t.doc.sel.ranges[r].head.line,i={anchor:e(n,0),head:e(n+1,0)};l.push(i);o.push(t.getRange(i.anchor,i.head))};return{text:o,ranges:l}};function tl(e,t){e.setAttribute("autocorrect","off");e.setAttribute("autocapitalize","off");e.setAttribute("spellcheck",!!t)};function il(){var e=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(x){e.style.width="1000px"} +else{e.setAttribute("wrap","off")};if(at){e.style.border="1px solid black"};tl(e);return t};function wa(i){var n=i.optionHandlers,r=i.helpers={};i.prototype={constructor:i,focus:function(){window.focus();this.display.input.focus()},setOption:function(e,t){var i=this.options,r=i[e];if(i[e]==t&&e!="mode"){return};i[e]=t;if(n.hasOwnProperty(e)){m(this,n[e])(this,t,r)};p(this,"optionChange",this,e)},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](gi(e))},removeKeyMap:function(e){var i=this.state.keyMaps;for(var t=0;t<i.length;++t){if(i[t]==e||i[t].name==e){i.splice(t,1);return!0}}},addOverlay:L(function(e,t){var r=e.token?e:i.getMode(this.options,e);if(r.startState){throw new Error("Overlays may not be stateful.")};Sl(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:(t&&t.priority)||0},function(e){return e.priority});this.state.modeGen++;M(this)}),removeOverlay:L(function(e){var n=this,i=this.state.overlays;for(var t=0;t<i.length;++t){var r=i[t].modeSpec;if(r==e||typeof e=="string"&&r.name==e){i.splice(t,1);n.state.modeGen++;M(n);return}}}),indentLine:L(function(e,t,i){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"} +else{t=t?"add":"subtract"}};if(ht(this.doc,e)){Pt(this,e,t,i)}}),indentSelection:L(function(e){var i=this,u=this.doc.sel.ranges,n=-1;for(var t=0;t<u.length;t++){var r=u[t];if(!r.empty()){var a=r.from(),f=r.to(),c=Math.max(n,a.line);n=Math.min(i.lastLine(),f.line-(f.ch?0:1))+1;for(var l=c;l<n;++l){Pt(i,l,e)};var o=i.doc.sel.ranges;if(a.ch==0&&u.length==o.length&&o[t].from().ch>0){kr(i.doc,t,new s(a,o[t].to()),G)}} +else if(r.head.line>n){Pt(i,r.head.line,e,!0);n=r.head.line;if(t==i.doc.sel.primIndex){Ie(i)}}}}),getTokenAt:function(e,t){return yn(this,e,t)},getLineTokens:function(t,i){return yn(this,e(t),i,!0)},getTokenTypeAt:function(e){e=o(this.doc,e);var n=vn(this,t(this.doc,e.line)),a=0,u=(n.length-1)/2,s=e.ch,r;if(s==0){r=n[2]} +else{for(;;){var i=(a+u)>>1;if((i?n[i*2-1]:0)>=s){u=i} +else if(n[i*2+1]<s){a=i+1} +else{r=n[i*2+2];break}}};var l=r?r.indexOf("overlay "):-1;return l<0?r:l==0?null:r.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;if(!t.innerMode){return t};return i.innerMode(t,this.getTokenAt(e).state).mode},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var f=this,o=[];if(!r.hasOwnProperty(t)){return o};var n=r[t],i=this.getModeAt(e);if(typeof i[t]=="string"){if(n[i[t]]){o.push(n[i[t]])}} +else if(i[t]){for(var a=0;a<i[t].length;a++){var u=n[i[t][a]];if(u){o.push(u)}}} +else if(i.helperType&&n[i.helperType]){o.push(n[i.helperType])} +else if(n[i.name]){o.push(n[i.name])};for(var s=0;s<n._global.length;s++){var l=n._global[s];if(l.pred(i,f)&&b(o,l.val)==-1){o.push(l.val)}};return o},getStateAfter:function(e,t){var i=this.doc;e=en(i,e==null?i.first+i.size-1:e);return mt(this,e+1,t).state},cursorCoords:function(e,t){var i,r=this.doc.sel.primary();if(e==null){i=r.head} +else if(typeof e=="object"){i=o(this.doc,e)} +else{i=e?r.from():r.to()};return z(this,i,t||"page")},charCoords:function(e,t){return rr(this,o(this.doc,e),t||"page")},coordsChar:function(e,t){e=zn(this,e,t||"page");return or(this,e.left,e.top)},lineAtHeight:function(e,t){e=zn(this,{top:e,left:0},t||"page").top;return ye(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,i,r){var o=!1,n;if(typeof e=="number"){var l=this.doc.first+this.doc.size-1;if(e<this.doc.first){e=this.doc.first} +else if(e>l){e=l;o=!0};n=t(this.doc,e)} +else{n=e};return oi(this,n,{top:0,left:0},i||"page",r||o).top+(o?this.doc.height-q(n):0)},defaultTextHeight:function(){return Ce(this.display)},defaultCharWidth:function(){return xt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,r,n){var a=this.display;e=z(this,o(this.doc,e));var s=e.bottom,l=e.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);a.sizer.appendChild(t);if(r=="over"){s=e.top} +else if(r=="above"||r=="near"){var u=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);if((r=="above"||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight){s=e.top-t.offsetHeight} +else if(e.bottom+t.offsetHeight<=u){s=e.bottom};if(l+t.offsetWidth>f){l=f-t.offsetWidth}};t.style.top=s+"px";t.style.left=t.style.right="";if(n=="right"){l=a.sizer.clientWidth-t.offsetWidth;t.style.right="0px"} +else{if(n=="left"){l=0} +else if(n=="middle"){l=(a.sizer.clientWidth-t.offsetWidth)/2};t.style.left=l+"px"};if(i){bs(this,{left:l,top:s,right:l+t.offsetWidth,bottom:s+t.offsetHeight})}},triggerOnKeyDown:L(Uo),triggerOnKeyPress:L(Ko),triggerOnKeyUp:Vo,triggerOnMouseDown:L(Xo),execCommand:function(e){if(Ze.hasOwnProperty(e)){return Ze[e].call(null,this)}},triggerElectric:L(function(e){Jo(this,e)}),findPosH:function(e,t,i,r){var a=this,s=1;if(t<0){s=-1;t=-t};var n=o(this.doc,e);for(var l=0;l<t;++l){n=Dr(a.doc,n,s,i,r);if(n.hitSide){break}};return n},moveH:L(function(e,t){var i=this;this.extendSelectionsBy(function(r){if(i.display.shift||i.doc.extend||r.empty()){return Dr(i.doc,r.head,e,t,i.options.rtlMoveVisually)} +else{return e<0?r.from():r.to()}},ot)}),deleteH:L(function(e,t){var r=this.doc.sel,i=this.doc;if(r.somethingSelected()){i.replaceSelection("",null,"+delete")} +else{Xe(this,function(r){var n=Dr(i,r.head,e,t,!1);return e<0?{from:n,to:r.head}:{from:r.head,to:n}})}}),findPosV:function(e,t,i,r){var u=this,f=1,s=r;if(t<0){f=-1;t=-t};var n=o(this.doc,e);for(var a=0;a<t;++a){var l=z(u,n,"div");if(s==null){s=l.left} +else{l.left=s};n=rl(u,l,f,i);if(n.hitSide){break}};return n},moveV:L(function(e,t){var n=this,i=this.doc,o=[],l=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy(function(r){if(l){return e<0?r.from():r.to()};var s=z(n,r.head,"div");if(r.goalColumn!=null){s.left=r.goalColumn};o.push(s.left);var a=rl(n,s,e,t);if(t=="page"&&r==i.sel.primary()){pr(n,rr(n,a,"div").top-s.top)};return a},ot);if(o.length){for(var r=0;r<i.sel.ranges.length;r++){i.sel.ranges[r].goalColumn=o[r]}}}),findWordAt:function(i){var f=this.doc,n=t(f,i.line).text,r=i.ch,o=i.ch;if(n){var u=this.getHelper(i,"wordChars");if((i.sticky=="before"||o==n.length)&&r){--r} +else{++o};var l=n.charAt(r),a=Yt(l,u)?function(e){return Yt(e,u)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return(!/\s/.test(e)&&!Yt(e))} +while(r>0&&a(n.charAt(r-1))){--r} +while(o<n.length&&a(n.charAt(o))){++o}};return new s(e(i.line,r),e(i.line,o))},toggleOverwrite:function(e){if(e!=null&&e==this.state.overwrite){return};if(this.state.overwrite=!this.state.overwrite){ge(this.display.cursorDiv,"CodeMirror-overwrite")} +else{de(this.display.cursorDiv,"CodeMirror-overwrite")};p(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==Y()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:L(function(e,t){Lt(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-K(this)-this.display.barHeight,width:e.scrollWidth-K(this)-this.display.barWidth,clientHeight:er(this),clientWidth:xe(this)}},scrollIntoView:L(function(t,i){if(t==null){t={from:this.doc.sel.primary().head,to:null};if(i==null){i=this.options.cursorScrollMargin}} +else if(typeof t=="number"){t={from:e(t,0),to:null}} +else if(t.from==null){t={from:t,to:null}};if(!t.to){t.to=t.from};t.margin=i||0;if(t.from.line!=null){ws(this,t)} +else{Qn(this,t.from,t.to,t.margin)}}),setSize:L(function(e,t){var n=this,r=function(e){return typeof e=="number"||/^\d+$/.test(String(e))?e+"px":e};if(e!=null){this.display.wrapper.style.width=r(e)};if(t!=null){this.display.wrapper.style.height=r(t)};if(this.options.lineWrapping){Pn(this)};var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++){if(e.widgets[t].noHScroll){oe(n,i,"widget");break}}};++i});this.curOp.forceUpdate=!0;p(this,"refresh",this)}),operation:function(e){return N(this,e)},startOperation:function(){return Te(this)},endOperation:function(){return Me(this)},refresh:L(function(){var e=this.display.cachedTextHeight;M(this);this.curOp.forceUpdate=!0;wt(this);Lt(this,this.doc.scrollLeft,this.doc.scrollTop);mr(this);if(e==null||Math.abs(e-Ce(this.display))>.5){ur(this)};p(this,"refresh",this)}),swapDoc:L(function(e){var t=this.doc;t.cm=null;fo(this,e);wt(this);this.display.input.reset();Lt(this,e.scrollLeft,e.scrollTop);this.curOp.forceScroll=!0;w(this,"swapDoc",this,t);return t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Pe(i);i.registerHelper=function(e,t,n){if(!r.hasOwnProperty(e)){r[e]=i[e]={_global:[]}};r[e][t]=n};i.registerGlobalHelper=function(e,t,n,o){i.registerHelper(e,t,o);r[e]._global.push({pred:n,val:o})}};function Dr(i,r,n,o,l){var g=r,m=n,a=t(i,r.line);function y(){var o=r.line+n;if(o<i.first||o>=i.first+i.size){return!1};r=new e(o,r.ch,r.sticky);return a=t(i,o)};function u(e){var t;if(l){t=ra(i.cm,a,r,n)} +else{t=Nr(a,r,n)};if(t==null){if(!e&&y()){r=Or(l,i.cm,a,r.line,n)} +else{return!1}} +else{r=t};return!0};if(o=="char"){u()} +else if(o=="column"){u(!0)} +else if(o=="word"||o=="group"){var d=null,p=o=="group",v=i.cm&&i.cm.getHelper(r,"wordChars");for(var f=!0;;f=!1){if(n<0&&!u(!f)){break};var h=a.text.charAt(r.ch)||"\n",s=Yt(h,v)?"w":p&&h=="\n"?"n":!p||/\s/.test(h)?null:"p";if(p&&!f&&!s){s="s"};if(d&&d!=s){if(n<0){n=1;u();r.sticky="after"};break};if(s){d=s};if(n>0&&!u(!f)){break}}};var c=Tr(i,r,g,m,!0);if(Ii(g,c)){c.hitSide=!0};return c};function rl(e,t,i,r){var a=e.doc,u=t.left,n;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*Ce(e.display),3);n=(i>0?t.bottom:t.top)+i*s} +else if(r=="line"){n=i>0?t.bottom+3:t.top-3};var o;for(;;){o=or(e,u,n);if(!o.outside){break};if(i<0?n<=0:n>=a.height){o.hitSide=!0;break};n+=i*5};return o};var f=function(e){this.cm=e;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new ce();this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};f.prototype.init=function(e){var i=this,o=this,t=o.cm,n=o.div=e.lineDiv;tl(n,t.options.spellcheck);r(n,"paste",function(e){if(v(t,e)||Qo(e,t)){return};if(c<=11){setTimeout(m(t,function(){return i.updateFromDOM()}),20)}});r(n,"compositionstart",function(e){i.composing={data:e.data,done:!1}});r(n,"compositionupdate",function(e){if(!i.composing){i.composing={data:e.data,done:!1}}});r(n,"compositionend",function(e){if(i.composing){if(e.data!=i.composing.data){i.readFromDOMSoon()};i.composing.done=!0}});r(n,"touchstart",function(){return o.forceCompositionEnd()});r(n,"input",function(){if(!i.composing){i.readFromDOMSoon()}});function l(e){if(v(t,e)){return};if(t.somethingSelected()){mi({lineWise:!1,text:t.getSelections()});if(e.type=="cut"){t.replaceSelection("",null,"cut")}} +else if(!t.options.lineWiseCopyCut){return} +else{var a=el(t);mi({lineWise:!0,text:a.text});if(e.type=="cut"){t.operation(function(){t.setSelections(a.ranges,0,G);t.replaceSelection("",null,"cut")})}};if(e.clipboardData){e.clipboardData.clearData();var s=P.text.join("\n");e.clipboardData.setData("Text",s);if(e.clipboardData.getData("Text")==s){e.preventDefault();return}};var i=il(),l=i.firstChild;t.display.lineSpace.insertBefore(i,t.display.lineSpace.firstChild);l.value=P.text.join("\n");var r=document.activeElement;lt(l);setTimeout(function(){t.display.lineSpace.removeChild(i);r.focus();if(r==n){o.showPrimarySelection()}},50)};r(n,"copy",l);r(n,"cut",l)};f.prototype.prepareSelection=function(){var e=Vn(this.cm,!1);e.focus=this.cm.state.focused;return e};f.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length){return};if(e.focus||t){this.showPrimarySelection()};this.showMultipleSelections(e)};f.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,g=t.doc.sel.primary(),c=g.from(),h=g.to();if(t.display.viewTo==t.display.viewFrom||c.line>=t.display.viewTo||h.line<t.display.viewFrom){e.removeAllRanges();return};var u=yi(t,e.anchorNode,e.anchorOffset),f=yi(t,e.focusNode,e.focusOffset);if(u&&!u.bad&&f&&!f.bad&&n(Zt(u,f),c)==0&&n(qt(u,f),h)==0){return};var d=t.display.view,s=(c.line>=t.display.viewFrom&&nl(t,c))||{node:d[0].measure.map[2],offset:0};var l=h.line<t.display.viewTo&&nl(t,h);if(!l){var a=d[d.length-1].measure,r=a.maps?a.maps[a.maps.length-1]:a.map;l={node:r[r.length-1],offset:r[r.length-2]-r[r.length-3]}};if(!s||!l){e.removeAllRanges();return};var p=e.rangeCount&&e.getRangeAt(0),o;try{o=he(s.node,s.offset,l.offset,l.node)}catch(i){};if(o){if(!ie&&t.state.focused){e.collapse(s.node,s.offset);if(!o.collapsed){e.removeAllRanges();e.addRange(o)}} +else{e.removeAllRanges();e.addRange(o)};if(p&&e.anchorNode==null){e.addRange(p)} +else if(ie){this.startGracePeriod()}};this.rememberSelection()};f.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){e.gracePeriod=!1;if(e.selectionChanged()){e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})}},20)};f.prototype.showMultipleSelections=function(e){W(this.cm.display.cursorDiv,e.cursors);W(this.cm.display.selectionDiv,e.selection)};f.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode;this.lastAnchorOffset=e.anchorOffset;this.lastFocusNode=e.focusNode;this.lastFocusOffset=e.focusOffset};f.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount){return!1};var t=e.getRangeAt(0).commonAncestorContainer;return ne(this.div,t)};f.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()){this.showSelection(this.prepareSelection(),!0)};this.div.focus()}};f.prototype.blur=function(){this.div.blur()};f.prototype.getField=function(){return this.div};f.prototype.supportsTouch=function(){return!0};f.prototype.receivedFocus=function(){var e=this;if(this.selectionInEditor()){this.pollSelection()} +else{N(this.cm,function(){return e.cm.curOp.selectionChanged=!0})};function t(){if(e.cm.state.focused){e.pollSelection();e.polling.set(e.cm.options.pollInterval,t)}};this.polling.set(this.cm.options.pollInterval,t)};f.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset};f.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return};var e=window.getSelection(),t=this.cm;if(Xt&&Kt&&this.cm.options.gutters.length&&xa(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return};if(this.composing){return};this.rememberSelection();var i=yi(t,e.anchorNode,e.anchorOffset),r=yi(t,e.focusNode,e.focusOffset);if(i&&r){N(t,function(){C(t.doc,se(i,r),G);if(i.bad||r.bad){t.curOp.selectionChanged=!0}})}};f.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null};var r=this.cm,o=r.display,k=r.doc.sel.primary(),f=k.from(),g=k.to();if(f.ch==0&&f.line>r.firstLine()){f=e(f.line-1,t(r.doc,f.line-1).length)};if(g.ch==t(r.doc,g.line).text.length&&g.line<r.lastLine()){g=e(g.line+1,0)};if(f.line<o.viewFrom||g.line>o.viewTo-1){return!1};var w,p,m;if(f.line==o.viewFrom||(w=Le(r,f.line))==0){p=u(o.view[0].line);m=o.view[0].node} +else{p=u(o.view[w].line);m=o.view[w-1].node.nextSibling};var y=Le(r,g.line),d,b;if(y==o.view.length-1){d=o.viewTo-1;b=o.lineDiv.lastChild} +else{d=u(o.view[y+1].line)-1;b=o.view[y+1].node.previousSibling};if(!m){return!1};var i=r.doc.splitLines(Ca(r,m,b,p,d)),s=me(r.doc,e(p,0),e(d,t(r.doc,d).text.length));while(i.length>1&&s.length>1){if(a(i)==a(s)){i.pop();s.pop();d--} +else if(i[0]==s[0]){i.shift();s.shift();p++} +else{break}};var l=0,c=0,S=i[0],L=s[0],M=Math.min(S.length,L.length);while(l<M&&S.charCodeAt(l)==L.charCodeAt(l)){++l};var h=a(i),v=a(s),T=Math.min(h.length-(i.length==1?l:0),v.length-(s.length==1?l:0));while(c<T&&h.charCodeAt(h.length-c-1)==v.charCodeAt(v.length-c-1)){++c};if(i.length==1&&s.length==1&&p==f.line){while(l&&l>f.ch&&h.charCodeAt(h.length-c-1)==v.charCodeAt(v.length-c-1)){l--;c++}};i[i.length-1]=h.slice(0,h.length-c).replace(/^\u200b+/,"");i[0]=i[0].slice(l).replace(/\u200b+$/,"");var x=e(p,l),C=e(d,s.length?a(s).length-c:0);if(i.length>1||i[0]||n(x,C)){Ue(r.doc,i,x,C,"+input");return!0}};f.prototype.ensurePolled=function(){this.forceCompositionEnd()};f.prototype.reset=function(){this.forceCompositionEnd()};f.prototype.forceCompositionEnd=function(){if(!this.composing){return};clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};f.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null){return};this.readDOMTimeout=setTimeout(function(){e.readDOMTimeout=null;if(e.composing){if(e.composing.done){e.composing=null} +else{return}};e.updateFromDOM()},80)};f.prototype.updateFromDOM=function(){var e=this;if(this.cm.isReadOnly()||!this.pollContent()){N(this.cm,function(){return M(e.cm)})}};f.prototype.setUneditable=function(e){e.contentEditable="false"};f.prototype.onKeyPress=function(e){if(e.charCode==0){return};e.preventDefault();if(!this.cm.isReadOnly()){m(this.cm,Wr)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)}};f.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")};f.prototype.onContextMenu=function(){};f.prototype.resetPosition=function(){};f.prototype.needsContentAttribute=!0;function nl(e,i){var n=tr(e,i.line);if(!n||n.hidden){return null};var o=t(e.doc,i.line),u=Wn(n,o,i.line),l=Z(o,e.doc.direction),s="left";if(l){var a=gt(l,i.ch);s=a%2?"right":"left"};var r=Hn(u.map,i.ch,s);r.offset=r.collapse=="right"?r.end:r.start;return r};function xa(e){for(var t=e;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return!0}};return!1};function je(e,t){if(t){e.bad=!0};return e};function Ca(t,i,r,n,o){var l="",s=!1,u=t.doc.lineSeparator();function h(e){return function(t){return t.id==e}};function f(){if(s){l+=u;s=!1}};function a(e){if(e){f();l+=e}};function c(i){if(i.nodeType==1){var v=i.getAttribute("cm-text");if(v!=null){a(v||i.textContent.replace(/\u200b/g,""));return};var g=i.getAttribute("cm-marker"),l;if(g){var p=t.findMarks(e(n,0),e(o+1,0),h(+g));if(p.length&&(l=p[0].find(0))){a(me(t.doc,l.from,l.to).join(u))};return};if(i.getAttribute("contenteditable")=="false"){return};var d=/^(pre|div|p)$/i.test(i.nodeName);if(d){f()};for(var r=0;r<i.childNodes.length;r++){c(i.childNodes[r])};if(d){s=!0}} +else if(i.nodeType==3){a(i.nodeValue)}};for(;;){c(i);if(i==r){break};i=i.nextSibling};return l};function yi(t,i,r){var n;if(i==t.display.lineDiv){n=t.display.lineDiv.childNodes[r];if(!n){return je(t.clipPos(e(t.display.viewTo-1)),!0)};i=null;r=0} +else{for(n=i;;n=n.parentNode){if(!n||n==t.display.lineDiv){return null};if(n.parentNode&&n.parentNode==t.display.lineDiv){break}}};for(var o=0;o<t.display.view.length;o++){var l=t.display.view[o];if(l.node==n){return Sa(l,i,r)}}};function Sa(t,i,r){var h=t.text.firstChild,c=!1;if(!i||!ne(h,i)){return je(e(u(t.line),0),!0)};if(i==h){c=!0;i=h.childNodes[r];r=0;if(!i){var y=t.rest?a(t.rest):t.line;return je(e(u(y),y.text.length),c)}};var s=i.nodeType==3?i:null,f=i;if(!s&&i.childNodes.length==1&&i.firstChild.nodeType==3){s=i.firstChild;if(r){r=s.nodeValue.length}} +while(f.parentNode!=h){f=f.parentNode};var m=t.measure,d=m.maps;function p(i,r,n){for(var o=-1;o<(d?d.length:0);o++){var s=o<0?m.map:d[o];for(var l=0;l<s.length;l+=3){var a=s[l+2];if(a==i||a==r){var c=u(o<0?t.line:t.rest[o]),f=s[l]+n;if(n<0||a!=i){f=s[l+(n?1:0)]};return e(c,f)}}}};var n=p(s,f,r);if(n){return je(n,c)};for(var l=f.nextSibling,v=s?s.nodeValue.length-r:0;l;l=l.nextSibling){n=p(l,l.firstChild,0);if(n){return je(e(n.line,n.ch-v),c)} +else{v+=l.textContent.length}};for(var o=f.previousSibling,g=r;o;o=o.previousSibling){n=p(o,o.firstChild,-1);if(n){return je(e(n.line,n.ch+g),c)} +else{g+=o.textContent.length}}};var g=function(e){this.cm=e;this.prevInput="";this.pollingFast=!1;this.polling=new ce();this.hasSelection=!1;this.composing=null};g.prototype.init=function(e){var o=this,i=this,t=this.cm,s=this.wrapper=il(),n=this.textarea=s.firstChild;e.wrapper.insertBefore(s,e.wrapper.firstChild);if(at){n.style.width="0px"};r(n,"input",function(){if(l&&c>=9&&o.hasSelection){o.hasSelection=null};i.poll()});r(n,"paste",function(e){if(v(t,e)||Qo(e,t)){return};t.state.pasteIncoming=!0;i.fastPoll()});function a(e){if(v(t,e)){return};if(t.somethingSelected()){mi({lineWise:!1,text:t.getSelections()})} +else if(!t.options.lineWiseCopyCut){return} +else{var r=el(t);mi({lineWise:!0,text:r.text});if(e.type=="cut"){t.setSelections(r.ranges,null,G)} +else{i.prevInput="";n.value=r.text.join("\n");lt(n)}};if(e.type=="cut"){t.state.cutIncoming=!0}};r(n,"cut",a);r(n,"copy",a);r(e.scroller,"paste",function(r){if(Q(e,r)||v(t,r)){return};t.state.pasteIncoming=!0;i.focus()});r(e.lineSpace,"selectstart",function(t){if(!Q(e,t)){T(t)}});r(n,"compositionstart",function(){var e=t.getCursor("from");if(i.composing){i.composing.range.clear()};i.composing={start:e,range:t.markText(e,t.getCursor("to"),{className:"CodeMirror-composing"})}});r(n,"compositionend",function(){if(i.composing){i.poll();i.composing.range.clear();i.composing=null}})};g.prototype.prepareSelection=function(){var e=this.cm,t=e.display,l=e.doc,i=Vn(e);if(e.options.moveInputWithCursor){var r=z(e,l.sel.primary().head,"div"),n=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+o.top-n.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+o.left-n.left))};return i};g.prototype.showSelection=function(e){var i=this.cm,t=i.display;W(t.cursorDiv,e.cursors);W(t.selectionDiv,e.selection);if(e.teTop!=null){this.wrapper.style.top=e.teTop+"px";this.wrapper.style.left=e.teLeft+"px"}};g.prototype.reset=function(e){if(this.contextMenuPending||this.composing){return};var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i;if(t.state.focused){lt(this.textarea)};if(l&&c>=9){this.hasSelection=i}} +else if(!e){this.prevInput=this.textarea.value="";if(l&&c>=9){this.hasSelection=null}}};g.prototype.getField=function(){return this.textarea};g.prototype.supportsTouch=function(){return!1};g.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ut||Y()!=this.textarea)){try{this.textarea.focus()}catch(e){}}};g.prototype.blur=function(){this.textarea.blur()};g.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};g.prototype.receivedFocus=function(){this.slowPoll()};g.prototype.slowPoll=function(){var e=this;if(this.pollingFast){return};this.polling.set(this.cm.options.pollInterval,function(){e.poll();if(e.cm.state.focused){e.slowPoll()}})};g.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0;function i(){var r=e.poll();if(!r&&!t){t=!0;e.polling.set(60,i)} +else{e.pollingFast=!1;e.slowPoll()}};e.polling.set(20,i)};g.prototype.poll=function(){var i=this,e=this.cm,o=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||(hl(o)&&!r&&!this.composing)||e.isReadOnly()||e.options.disableInput||e.state.keySeq){return!1};var t=o.value;if(t==r&&!e.somethingSelected()){return!1};if(l&&c>=9&&this.hasSelection===t||I&&/[\uf700-\uf7ff]/.test(t)){e.display.input.reset();return!1};if(e.doc.sel==e.display.selForContextMenu){var s=t.charCodeAt(0);if(s==0x200b&&!r){r="\u200b"};if(s==0x21da){this.reset();return this.cm.execCommand("undo")}};var n=0,a=Math.min(r.length,t.length);while(n<a&&r.charCodeAt(n)==t.charCodeAt(n)){++n};N(e,function(){Wr(e,t.slice(n),r.length-n,null,i.composing?"*compose":null);if(t.length>1000||t.indexOf("\n")>-1){o.value=i.prevInput=""} +else{i.prevInput=t};if(i.composing){i.composing.range.clear();i.composing.range=e.markText(i.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"})}});return!0};g.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=!1}};g.prototype.onKeyPress=function(){if(l&&c>=9){this.hasSelection=null};this.fastPoll()};g.prototype.onContextMenu=function(e){var o=this,t=o.cm,i=t.display,n=o.textarea,s=Se(t,e),y=i.scroller.scrollTop;if(!s||E){return};var v=t.options.resetSelectionOnContextMenu;if(v&&t.doc.sel.contains(s)==-1){m(t,C)(t.doc,se(s),G)};var p=n.style.cssText,g=o.wrapper.style.cssText;o.wrapper.style.cssText="position: absolute";var f=o.wrapper.getBoundingClientRect();n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var u;if(x){u=window.scrollY};i.input.focus();if(x){window.scrollTo(null,u)};i.input.reset();if(!t.somethingSelected()){n.value=o.prevInput=" "};o.contextMenuPending=!0;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);function h(){if(n.selectionStart!=null){var e=t.somethingSelected(),r="\u200b"+(e?n.value:"");n.value="\u21da";n.value=r;o.prevInput=e?"":"\u200b";n.selectionStart=1;n.selectionEnd=r.length;i.selForContextMenu=t.doc.sel}};function d(){o.contextMenuPending=!1;o.wrapper.style.cssText=g;n.style.cssText=p;if(l&&c<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=y)};if(n.selectionStart!=null){if(!l||(l&&c<9)){h()};var r=0,e=function(){if(i.selForContextMenu==t.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&o.prevInput=="\u200b"){m(t,Lo)(t)} +else if(r++<10){i.detectingSelectAll=setTimeout(e,500)} +else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(e,200)}};if(l&&c>=9){h()};if(Ni){vt(e);var a=function(){D(window,"mouseup",a);setTimeout(d,20)};r(window,"mouseup",a)} +else{setTimeout(d,50)}};g.prototype.readOnlyChanged=function(e){if(!e){this.reset()};this.textarea.disabled=e=="nocursor"};g.prototype.setUneditable=function(){};g.prototype.needsContentAttribute=!1;function La(e,t){t=t?ve(t):{};t.value=e.value;if(!t.tabindex&&e.tabIndex){t.tabindex=e.tabIndex};if(!t.placeholder&&e.placeholder){t.placeholder=e.placeholder};if(t.autofocus==null){var a=Y();t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body};function o(){e.value=s.getValue()};var l;if(e.form){r(e.form,"submit",o);if(!t.leaveSubmitMethodAlone){var n=e.form;l=n.submit;try{var u=n.submit=function(){o();n.submit=l;n.submit();n.submit=u}}catch(i){}}};t.finishInit=function(t){t.save=o;t.getTextArea=function(){return e};t.toTextArea=function(){t.toTextArea=isNaN;o();e.parentNode.removeChild(t.getWrapperElement());e.style.display="";if(e.form){D(e.form,"submit",o);if(typeof e.form.submit=="function"){e.form.submit=l}}}};e.style.display="none";var s=h(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s};function ka(t){t.off=D;t.on=r;t.wheelEventPixels=Hs;t.Doc=k;t.splitLines=Si;t.countColumn=H;t.findColumn=Wi;t.isWordChar=Hi;t.Pass=Vt;t.signal=p;t.Line=We;t.changeEnd=ae;t.scrollbarModel=Ir;t.Pos=e;t.cmpPos=n;t.modes=Ci;t.mimeModes=He;t.resolveMode=ii;t.getMode=ji;t.modeExtensions=De;t.extendMode=Gl;t.copyState=we;t.startState=pn;t.innerMode=Yi;t.commands=Ze;t.keyMap=j;t.keyName=Io;t.isModifierKey=Po;t.lookupKey=Ke;t.normalizeKeyMap=ia;t.StringStream=d;t.SharedTextMarker=et;t.TextMarker=ee;t.LineWidget=tt;t.e_preventDefault=T;t.e_stopPropagation=hn;t.e_stop=vt;t.addClass=ge;t.contains=ne;t.rmClass=de;t.keyNames=J};va(h);wa(h);var ol="iter insert remove copy getEditor constructor".split(" ");for(var Et in k.prototype){if(k.prototype.hasOwnProperty(Et)&&b(ol,Et)<0){h.prototype[Et]=(function(e){return function(){return e.apply(this.doc,arguments)}})(k.prototype[Et])}};Pe(k);h.inputStyles={"textarea":g,"contenteditable":f};h.defineMode=function(e){if(!h.defaults.mode&&e!="null"){h.defaults.mode=e};Rl.apply(this,arguments)};h.defineMIME=Bl;h.defineMode("null",function(){return({token:function(e){return e.skipToEnd()}})});h.defineMIME("text/plain","null");h.defineExtension=function(e,t){h.prototype[e]=t};h.defineDocExtension=function(e,t){k.prototype[e]=t};h.fromTextArea=La;ka(h);h.version="5.32.0";return h})));(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t():typeof define==="function"&&define.amd?define(t):(e.CodeMirror=t())}(this,(function(){"use strict";var S=navigator.userAgent,Kr=navigator.platform,ie=/gecko\/\d/i.test(S),Xr=/MSIE \d/.test(S),jr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(S),st=/Edge\/(\d+)/.exec(S),l=Xr||jr||st,c=l&&(Xr?document.documentMode||6:+(st||jr)[1]),x=!st&&/WebKit\//.test(S),yl=x&&/Qt\/\d+\.\d+/.test(S),Kt=!st&&/Chrome\//.test(S),E=/Opera\//.test(S),Yr=/Apple Computer/.test(navigator.vendor),bl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(S),wl=/PhantomJS/.test(S),at=!st&&/AppleWebKit/.test(S)&&/Mobile\/\w+/.test(S),Xt=/Android/.test(S),ut=at||Xt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(S),I=at||/Mac/.test(Kr),xl=/\bCrOS\b/.test(S),Cl=/win/i.test(Kr),pe=E&&S.match(/Version\/(\d*\.\d*)/);if(pe){pe=Number(pe[1])};if(pe&&pe>=15){E=!1;x=!0};var Vr=I&&(yl||E&&(pe==null||pe<12.11)),Ni=ie||(l&&c>=9);function ft(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")};var de=function(e,t){var r=e.className,i=ft(t).exec(r);if(i){var n=r.slice(i.index+i[0].length);e.className=r.slice(0,i.index)+(n?i[1]+n:"")}};function re(e){for(var t=e.childNodes.length;t>0;--t){e.removeChild(e.firstChild)};return e};function W(e,t){return re(e).appendChild(t)};function i(e,t,i,r){var n=document.createElement(e);if(i){n.className=i};if(r){n.style.cssText=r};if(typeof t=="string"){n.appendChild(document.createTextNode(t))} +else if(t){for(var o=0;o<t.length;++o){n.appendChild(t[o])}};return n};function Fe(e,t,r,n){var o=i(e,t,r,n);o.setAttribute("role","presentation");return o};var he;if(document.createRange){he=function(e,t,i,r){var n=document.createRange();n.setEnd(r||e,i);n.setStart(e,t);return n}} +else{he=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n};n.collapse(!0);n.moveEnd("character",i);n.moveStart("character",t);return n}};function ne(e,t){if(t.nodeType==3){t=t.parentNode};if(e.contains){return e.contains(t)};do{if(t.nodeType==11){t=t.host};if(t==e){return!0}} +while(t=t.parentNode)};function Y(){var t;try{t=document.activeElement}catch(e){t=document.body||null} +while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement};return t};function ge(e,t){var i=e.className;if(!ft(t).test(i)){e.className+=(i?" ":"")+t}};function Oi(e,t){var r=e.split(" ");for(var i=0;i<r.length;i++){if(r[i]&&!ft(r[i]).test(t)){t+=" "+r[i]}};return t};var lt=function(e){e.select()};if(at){lt=function(e){e.selectionStart=0;e.selectionEnd=e.value.length}} +else if(l){lt=function(e){try{e.select()}catch(t){}}};function Ai(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}};function ve(e,t,i){if(!t){t={}};for(var r in e){if(e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))){t[r]=e[r]}};return t};function H(e,t,i,r,n){if(t==null){t=e.search(/[^\s\u00a0]/);if(t==-1){t=e.length}};for(var l=r||0,s=n||0;;){var o=e.indexOf("\t",l);if(o<0||o>=t){return s+(t-l)};s+=o-l;s+=i-(s%i);l=o+1}};var ce=function(){this.id=null};ce.prototype.set=function(e,t){clearTimeout(this.id);this.id=setTimeout(t,e)};function b(e,t){for(var i=0;i<e.length;++i){if(e[i]==t){return i}};return-1};var Ur=30,Vt={toString:function(){return"CodeMirror.Pass"}};var G={scroll:!1};var Mi={origin:"*mouse"};var ot={origin:"+move"};function Wi(e,t,i){for(var n=0,o=0;;){var r=e.indexOf("\t",n);if(r==-1){r=e.length};var l=r-n;if(r==e.length||o+l>=t){return n+Math.min(l,t-o)};o+=r-n;o+=i-(o%i);n=r+1;if(o>=t){return n}}};var Ut=[""];function Di(e){while(Ut.length<=e){Ut.push(a(Ut)+" ")};return Ut[e]};function a(e){return e[e.length-1]};function jt(e,t){var r=[];for(var i=0;i<e.length;i++){r[i]=t(e[i],i)};return r};function Sl(e,t,i){var r=0,n=i(t);while(r<e.length&&i(e[r])<=n){r++};e.splice(r,0,t)};function qr(){};function Zr(e,t){var i;if(Object.create){i=Object.create(e)} +else{qr.prototype=e;i=new qr()};if(t){ve(t,i)};return i};var ml=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Hi(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ml.test(e))};function Yt(e,t){if(!t){return Hi(e)};if(t.source.indexOf("\\w")>-1&&Hi(e)){return!0};return t.test(e)};function Qr(e){for(var t in e){if(e.hasOwnProperty(t)&&e[t]){return!1}};return!0};var vl=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Fi(e){return e.charCodeAt(0)>=768&&vl.test(e)};function Jr(e,t,i){while((i<0?t>0:t<e.length)&&Fi(e.charAt(t))){t+=i};return t};function ct(e,t,i){var o=t>i?-1:1;for(;;){if(t==i){return t};var n=(t+i)/2,r=o<0?Math.ceil(n):Math.floor(n);if(r==t){return e(r)?t:i};if(e(r)){i=r} +else{t=r+o}}};function Ll(e,t,r){var n=this;this.input=r;n.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler");n.scrollbarFiller.setAttribute("cm-not-content","true");n.gutterFiller=i("div",null,"CodeMirror-gutter-filler");n.gutterFiller.setAttribute("cm-not-content","true");n.lineDiv=Fe("div",null,"CodeMirror-code");n.selectionDiv=i("div",null,null,"position: relative; z-index: 1");n.cursorDiv=i("div",null,"CodeMirror-cursors");n.measure=i("div",null,"CodeMirror-measure");n.lineMeasure=i("div",null,"CodeMirror-measure");n.lineSpace=Fe("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var o=Fe("div",[n.lineSpace],"CodeMirror-lines");n.mover=i("div",[o],null,"position: relative");n.sizer=i("div",[n.mover],"CodeMirror-sizer");n.sizerWidth=null;n.heightForcer=i("div",null,null,"position: absolute; height: "+Ur+"px; width: 1px;");n.gutters=i("div",null,"CodeMirror-gutters");n.lineGutter=null;n.scroller=i("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll");n.scroller.setAttribute("tabIndex","-1");n.wrapper=i("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror");if(l&&c<8){n.gutters.style.zIndex=-1;n.scroller.style.paddingRight=0};if(!x&&!(ie&&ut)){n.scroller.draggable=!0};if(e){if(e.appendChild){e.appendChild(n.wrapper)} +else{e(n.wrapper)}};n.viewFrom=n.viewTo=t.first;n.reportedViewFrom=n.reportedViewTo=t.first;n.view=[];n.renderedView=null;n.externalMeasured=null;n.viewOffset=0;n.lastWrapHeight=n.lastWrapWidth=0;n.updateLineNumbers=null;n.nativeBarWidth=n.barHeight=n.barWidth=0;n.scrollbarsClipped=!1;n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null;n.alignWidgets=!1;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null;n.maxLine=null;n.maxLineLength=0;n.maxLineChanged=!1;n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null;n.shift=!1;n.selForContextMenu=null;n.activeTouch=null;r.init(n)};function t(e,t){t-=e.first;if(t<0||t>=e.size){throw new Error("There is no line "+(t+e.first)+" in the document.")};var i=e;while(!i.lines){for(var o=0;;++o){var r=i.children[o],n=r.chunkSize();if(t<n){i=r;break};t-=n}};return i.lines[t]};function me(e,t,i){var n=[],r=t.line;e.iter(t.line,i.line+1,function(e){var o=e.text;if(r==i.line){o=o.slice(0,i.ch)};if(r==t.line){o=o.slice(t.ch)};n.push(o)++r});return n};function Pi(e,t,i){var r=[];e.iter(t,i,function(e){r.push(e.text)});return r};function U(e,t){var r=t-e.height;if(r){for(var i=e;i;i=i.parent){i.height+=r}}};function u(e){if(e.parent==null){return null};var i=e.parent,n=b(i.lines,e);for(var t=i.parent;t;i=t,t=t.parent){for(var r=0;;++r){if(t.children[r]==i){break};n+=t.children[r].chunkSize()}};return n+i.first};function ye(e,t){var o=e.first;outer:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue;outer};t-=s;o+=r.chunkSize()};return o} +while(!e.lines)var i=0;for(;i<e.lines.length;++i){var a=e.lines[i],l=a.height;if(t<l){break};t-=l};return o+i};function ht(e,t){return t>=e.first&&t<e.first+e.size};function Ei(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))};function e(t,i,r){if(r===void 0)r=null;if(!(this instanceof e)){return new e(t,i,r)};this.line=t;this.ch=i;this.sticky=r};function n(e,t){return e.line-t.line||e.ch-t.ch};function Ii(e,t){return e.sticky==t.sticky&&n(e,t)==0};function zi(t){return e(t.line,t.ch)};function qt(e,t){return n(e,t)<0?t:e};function Zt(e,t){return n(e,t)<0?e:t};function en(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))};function o(i,r){if(r.line<i.first){return e(i.first,0)};var n=i.first+i.size-1;if(r.line>n){return e(n,t(i,n).text.length)};return kl(r,t(i,r.line).text.length)};function kl(t,i){var r=t.ch;if(r==null||r>i){return e(t.line,i)} +else if(r<0){return e(t.line,0)} +else{return t}};function tn(e,t){var r=[];for(var i=0;i<t.length;i++){r[i]=o(e,t[i])};return r};var Gr=!1,te=!1;function Tl(){Gr=!0};function Ml(){te=!0};function Qt(e,t,i){this.marker=e;this.from=t;this.to=i};function dt(e,t){if(e){for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t){return r}}}};function Nl(e,t){var r;for(var i=0;i<e.length;++i){if(e[i]!=t){(r||(r=[])).push(e[i])}};return r};function Ol(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t];t.marker.attachLine(e)};function Al(e,t,i){var l;if(e){for(var o=0;o<e.length;++o){var r=e[o],n=r.marker,a=r.from==null||(n.inclusiveLeft?r.from<=t:r.from<t);if(a||r.from==t&&n.type=="bookmark"&&(!i||!r.marker.insertLeft)){var s=r.to==null||(n.inclusiveRight?r.to>=t:r.to>t);(l||(l=[])).push(new Qt(n,r.from,s?null:r.to))}}};return l};function Wl(e,t,i){var l;if(e){for(var o=0;o<e.length;++o){var r=e[o],n=r.marker,a=r.to==null||(n.inclusiveRight?r.to>=t:r.to>t);if(a||r.from==t&&n.type=="bookmark"&&(!i||r.marker.insertLeft)){var s=r.from==null||(n.inclusiveLeft?r.from<=t:r.from<t);(l||(l=[])).push(new Qt(n,s?null:r.from-t,r.to==null?null:r.to-t))}}};return l};function Ri(e,i){if(i.full){return null};var x=ht(e,i.from.line)&&t(e,i.from.line).markedSpans,C=ht(e,i.to.line)&&t(e,i.to.line).markedSpans;if(!x&&!C){return null};var m=i.from.ch,L=i.to.ch,w=n(i.from,i.to)==0,r=Al(x,m,w),o=Wl(C,L,w),s=i.text.length==1,c=a(i.text).length+(s?m:0);if(r){for(var v=0;v<r.length;++v){var f=r[v];if(f.to==null){var g=dt(o,f.marker);if(!g){f.to=m} +else if(s){f.to=g.to==null?null:g.to+c}}}};if(o){for(var p=0;p<o.length;++p){var l=o[p];if(l.to!=null){l.to+=c};if(l.from==null){var S=dt(r,l.marker);if(!S){l.from=c;if(s){(r||(r=[])).push(l)}}} +else{l.from+=c;if(s){(r||(r=[])).push(l)}}}};if(r){r=rn(r)};if(o&&o!=r){o=rn(o)};var d=[r];if(!s){var b=i.text.length-2,h;if(b>0&&r){for(var u=0;u<r.length;++u){if(r[u].to==null){(h||(h=[])).push(new Qt(r[u].marker,null,null))}}};for(var y=0;y<b;++y){d.push(h)};d.push(o)};return d};function rn(e){for(var i=0;i<e.length;++i){var t=e[i];if(t.from!=null&&t.from==t.to&&t.marker.clearWhenEmpty!==!1){e.splice(i--,1)}};if(!e.length){return null};return e};function Dl(e,t,i){var r=null;e.iter(t.line,i.line+1,function(e){if(e.markedSpans){for(var i=0;i<e.markedSpans.length;++i){var t=e.markedSpans[i].marker;if(t.readOnly&&(!r||b(r,t)==-1)){(r||(r=[])).push(t)}}}});if(!r){return null};var a=[{from:t,to:i}];for(var c=0;c<r.length;++c){var f=r[c],l=f.find(0);for(var s=0;s<a.length;++s){var o=a[s];if(n(o.to,l.from)<0||n(o.from,l.to)>0){continue};var u=[s,1],h=n(o.from,l.from),d=n(o.to,l.to);if(h<0||!f.inclusiveLeft&&!h){u.push({from:o.from,to:l.from})};if(d>0||!f.inclusiveRight&&!d){u.push({from:l.to,to:o.to})};a.splice.apply(a,u);s+=u.length-3}};return a};function nn(e){var i=e.markedSpans;if(!i){return};for(var t=0;t<i.length;++t){i[t].marker.detachLine(e)};e.markedSpans=null};function on(e,t){if(!t){return};for(var i=0;i<t.length;++i){t[i].marker.attachLine(e)};e.markedSpans=t};function Jt(e){return e.inclusiveLeft?-1:0};function ei(e){return e.inclusiveRight?1:0};function ln(e,t){var s=e.lines.length-t.lines.length;if(s!=0){return s};var r=e.find(),o=t.find(),l=n(r.from,o.from)||Jt(e)-Jt(t);if(l){return-l};var i=n(r.to,o.to)||ei(e)-ei(t);if(i){return i};return t.id-e.id};function sn(e,t){var o=te&&e.markedSpans,r;if(o){for(var i=(void 0),n=0;n<o.length;++n){i=o[n];if(i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||ln(r,i.marker)<0)){r=i.marker}}};return r};function an(e){return sn(e,!0)};function pt(e){return sn(e,!1)};function un(e,i,r,o,l){var d=t(e,i),c=te&&d.markedSpans;if(c){for(var f=0;f<c.length;++f){var a=c[f];if(!a.marker.collapsed){continue};var s=a.marker.find(0),u=n(s.from,r)||Jt(a.marker)-Jt(l),h=n(s.to,o)||ei(a.marker)-ei(l);if(u>=0&&h<=0||u<=0&&h>=0){continue};if(u<=0&&(a.marker.inclusiveRight&&l.inclusiveLeft?n(s.to,r)>=0:n(s.to,r)>0)||u>=0&&(a.marker.inclusiveRight&&l.inclusiveLeft?n(s.from,o)<=0:n(s.from,o)<0)){return!0}}}};function V(e){var t;while(t=an(e)){e=t.find(-1,!0).line};return e};function Hl(e){var t;while(t=pt(e)){e=t.find(1,!0).line};return e};function Fl(e){var i,t;while(i=pt(e)){e=i.find(1,!0).line;(t||(t=[])).push(e)};return t};function Bi(e,i){var r=t(e,i),n=V(r);if(r==n){return i};return u(n)};function fn(e,i){if(i>e.lastLine()){return i};var r=t(e,i),n;if(!be(e,r)){return i} +while(n=pt(r)){r=n.find(1,!0).line};return u(r)+1};function be(e,t){var n=te&&t.markedSpans;if(n){for(var i=(void 0),r=0;r<n.length;++r){i=n[r];if(!i.marker.collapsed){continue};if(i.from==null){return!0};if(i.marker.widgetNode){continue};if(i.from==0&&i.marker.inclusiveLeft&&Gi(e,t,i)){return!0}}}};function Gi(e,t,i){if(i.to==null){var o=i.marker.find(1,!0);return Gi(e,o.line,dt(o.line.markedSpans,i.marker))};if(i.marker.inclusiveRight&&i.to==t.text.length){return!0};for(var r=(void 0),n=0;n<t.markedSpans.length;++n){r=t.markedSpans[n];if(r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&Gi(e,t,r)){return!0}}};function q(e){e=V(e);var o=0,t=e.parent;for(var n=0;n<t.lines.length;++n){var s=t.lines[n];if(s==e){break} +else{o+=s.height}};for(var i=t.parent;i;t=i,i=t.parent){for(var r=0;r<i.children.length;++r){var l=i.children[r];if(l==t){break} +else{o+=l.height}}};return o};function ti(e){if(e.height==0){return 0};var i=e.text.length,r,t=e;while(r=an(t)){var o=r.find(0,!0);t=o.from.line;i+=o.from.ch-o.to.ch};t=e;while(r=pt(t)){var n=r.find(0,!0);i-=t.text.length-n.from.ch;t=n.to.line;i+=t.text.length-n.to.ch};return i};function Ui(e){var i=e.display,r=e.doc;i.maxLine=t(r,r.first);i.maxLineLength=ti(i.maxLine);i.maxLineChanged=!0;r.iter(function(e){var t=ti(e);if(t>i.maxLineLength){i.maxLineLength=t;i.maxLine=e}})};function Pl(e,t,i,r){if(!e){return r(t,i,"ltr",0)};var l=!1;for(var o=0;o<e.length;++o){var n=e[o];if(n.from<i&&n.to>t||t==i&&n.to==t){r(Math.max(n.from,t),Math.min(n.to,i),n.level==1?"rtl":"ltr",o);l=!0}};if(!l){r(t,i,"ltr")}};var nt=null;function gt(e,t,i){var o;nt=null;for(var n=0;n<e.length;++n){var r=e[n];if(r.from<t&&r.to>t){return n};if(r.to==t){if(r.from!=r.to&&i=="before"){o=n} +else{nt=n}};if(r.from==t){if(r.from!=r.to&&i!="before"){o=n} +else{nt=n}}};return o!=null?o:nt};var gl=(function(){var l="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",s="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function u(e){if(e<=0xf7){return l.charAt(e)} +else if(0x590<=e&&e<=0x5f4){return"R"} +else if(0x600<=e&&e<=0x6f9){return s.charAt(e-0x600)} +else if(0x6ee<=e&&e<=0x8ac){return"r"} +else if(0x2000<=e&&e<=0x200b){return"w"} +else if(e==0x200c){return"b"} +else{return"L"}};var o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,n=/[1n]/;function e(e,t,i){this.level=e;this.from=t;this.to=i};return function(l,s){var S=s=="ltr"?"L":"R";if(l.length==0||s=="ltr"&&!o.test(l)){return!1};var h=l.length,f=[];for(var H=0;H<h;++H){f.push(u(l.charCodeAt(H)))};for(var M=0,R=S;M<h;++M){var z=f[M];if(z=="m"){f[M]=R} +else{R=z}};for(var L=0,I=S;L<h;++L){var T=f[L];if(T=="1"&&I=="r"){f[L]="n"} +else if(i.test(T)){I=T;if(T=="r"){f[L]="R"}}};for(var b=1,C=f[0];b<h-1;++b){var D=f[b];if(D=="+"&&C=="1"&&f[b+1]=="1"){f[b]="1"} +else if(D==","&&C==f[b+1]&&(C=="1"||C=="n")){f[b]=C};C=D};for(var g=0;g<h;++g){var E=f[g];if(E==","){f[g]="N"} +else if(E=="%"){var y=(void 0);for(y=g+1;y<h&&f[y]=="%";++y){};var K=(g&&f[g-1]=="!")||(y<h&&f[y]=="1")?"1":"N";for(var W=g;W<y;++W){f[W]=K};g=y-1}};for(var k=0,P=S;k<h;++k){var A=f[k];if(P=="L"&&A=="1"){f[k]="L"} +else if(i.test(A)){P=A}};for(var m=0;m<h;++m){if(t.test(f[m])){var v=(void 0);for(v=m+1;v<h&&t.test(f[v]);++v){};var F=(m?f[m-1]:S)=="L",U=(v<h?f[v]:S)=="L",V=F==U?(F?"L":"R"):S;for(var O=m;O<v;++O){f[O]=V};m=v-1}};var d=[],x;for(var c=0;c<h;){if(r.test(f[c])){var G=c;for(++c;c<h&&r.test(f[c]);++c){};d.push(new e(0,G,c))} +else{var w=c,N=d.length;for(++c;c<h&&f[c]!="L";++c){};for(var p=w;p<c;){if(n.test(f[p])){if(w<p){d.splice(N,0,new e(1,w,p))};var B=p;for(++p;p<c&&n.test(f[p]);++p){};d.splice(N,0,new e(2,B,p));w=p} +else{++p}};if(w<c){d.splice(N,0,new e(1,w,c))}}};if(s=="ltr"){if(d[0].level==1&&(x=l.match(/^\s+/))){d[0].from=x[0].length;d.unshift(new e(0,0,x[0].length))};if(a(d).level==1&&(x=l.match(/\s+$/))){a(d).to-=x[0].length;d.push(new e(0,h-x[0].length,h))}};return s=="rtl"?d.reverse():d}})();function Z(e,t){var i=e.order;if(i==null){i=e.order=gl(e.text,t)};return i};var Br=[],r=function(e,t,i){if(e.addEventListener){e.addEventListener(t,i,!1)} +else if(e.attachEvent){e.attachEvent("on"+t,i)} +else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Br).concat(i)}};function Vi(e,t){return e._handlers&&e._handlers[t]||Br};function D(e,t,i){if(e.removeEventListener){e.removeEventListener(t,i,!1)} +else if(e.detachEvent){e.detachEvent("on"+t,i)} +else{var o=e._handlers,r=o&&o[t];if(r){var n=b(r,i);if(n>-1){o[t]=r.slice(0,n).concat(r.slice(n+1))}}}};function p(e,t){var r=Vi(e,t);if(!r.length){return};var n=Array.prototype.slice.call(arguments,2);for(var i=0;i<r.length;++i){r[i].apply(null,n)}};function v(e,t,i){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=!0}}};p(e,i||t.type,e,t);return Ki(t)||t.codemirrorIgnore};function cn(e){var i=e._handlers&&e._handlers.cursorActivity;if(!i){return};var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var t=0;t<i.length;++t){if(b(r,i[t])==-1){r.push(i[t])}}};function F(e,t){return Vi(e,t).length>0};function Pe(e){e.prototype.on=function(e,t){r(this,e,t)};e.prototype.off=function(e,t){D(this,e,t)}};function T(e){if(e.preventDefault){e.preventDefault()} +else{e.returnValue=!1}};function hn(e){if(e.stopPropagation){e.stopPropagation()} +else{e.cancelBubble=!0}};function Ki(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1};function vt(e){T(e);hn(e)};function Xi(e){return e.target||e.srcElement};function dn(e){var t=e.which;if(t==null){if(e.button&1){t=1} +else if(e.button&2){t=3} +else if(e.button&4){t=2}};if(I&&e.ctrlKey&&t==1){t=3};return t};var pl=function(){if(l&&c<9){return!1};var e=i("div");return"draggable" in e||"dragDrop" in e}(),Ti;function El(e){if(Ti==null){var t=i("span","\u200b");W(e,i("span",[t,document.createTextNode("x")]));if(e.firstChild.offsetHeight!=0){Ti=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&c<8)}};var r=Ti?i("span","\u200b"):i("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");r.setAttribute("cm-text","");return r};var ki;function Il(e){if(ki!=null){return ki};var i=W(e,document.createTextNode("A\u062eA")),t=he(i,0,1).getBoundingClientRect(),r=he(i,1,2).getBoundingClientRect();re(e);if(!t||t.left==t.right){return!1};return ki=(r.right-t.right<3)};var Si="\n\nb".split(/\n/).length!=3?function(e){var i=0,o=[],l=e.length;while(i<=l){var t=e.indexOf("\n",i);if(t==-1){t=e.length};var r=e.slice(i,e.charAt(t-1)=="\r"?t-1:t),n=r.indexOf("\r");if(n!=-1){o.push(r.slice(0,n));i+=n+1} +else{o.push(r);i=t+1}};return o}:function(e){return e.split(/\r\n?|\n/)},hl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var i;try{i=e.ownerDocument.selection.createRange()}catch(t){};if(!i||i.parentElement()!=e){return!1};return i.compareEndPoints("StartToEnd",i)!=0},dl=(function(){var e=i("div");if("oncopy" in e){return!0};e.setAttribute("oncopy","return;");return typeof e.oncopy=="function"})(),Li=null;function zl(e){if(Li!=null){return Li};var t=W(e,i("span","x")),r=t.getBoundingClientRect(),n=he(t,0,1).getBoundingClientRect();return Li=Math.abs(r.left-n.left)>1};var Ci={};var He={};function Rl(e,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)};Ci[e]=t};function Bl(e,t){He[e]=t};function ii(e){if(typeof e=="string"&&He.hasOwnProperty(e)){e=He[e]} +else if(e&&typeof e.name=="string"&&He.hasOwnProperty(e.name)){var t=He[e.name];if(typeof t=="string"){t={name:t}};e=Zr(t,e);e.name=t.name} +else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e)){return ii("application/xml")} +else if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e)){return ii("application/json")};if(typeof e=="string"){return{name:e}} +else{return e||{name:"null"}}};function ji(e,t){t=ii(t);var l=Ci[t.name];if(!l){return ji(e,"text/plain")};var i=l(e,t);if(De.hasOwnProperty(t.name)){var n=De[t.name];for(var r in n){if(!n.hasOwnProperty(r)){continue};if(i.hasOwnProperty(r)){i["_"+r]=i[r]};i[r]=n[r]}};i.name=t.name;if(t.helperType){i.helperType=t.helperType};if(t.modeProps){for(var o in t.modeProps){i[o]=t.modeProps[o]}};return i};var De={};function Gl(e,t){var i=De.hasOwnProperty(e)?De[e]:(De[e]={});ve(t,i)};function we(e,t){if(t===!0){return t};if(e.copyState){return e.copyState(t)};var n={};for(var r in t){var i=t[r];if(i instanceof Array){i=i.concat([])};n[r]=i};return n};function Yi(e,t){var i;while(e.innerMode){i=e.innerMode(t);if(!i||i.mode==e){break};t=i.state;e=i.mode};return i||{mode:e,state:t}};function pn(e,t,i){return e.startState?e.startState(t,i):!0};var d=function(e,t,i){this.pos=this.start=0;this.string=e;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=i};d.prototype.eol=function(){return this.pos>=this.string.length};d.prototype.sol=function(){return this.pos==this.lineStart};d.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};d.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};d.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"){i=t==e} +else{i=t&&(e.test?e.test(t):e(t))};if(i){++this.pos;return t}};d.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e)){};return this.pos>t};d.prototype.eatSpace=function(){var e=this,t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++e.pos};return this.pos>t};d.prototype.skipToEnd=function(){this.pos=this.string.length};d.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1){this.pos=t;return!0}};d.prototype.backUp=function(e){this.pos-=e};d.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start};return this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)};d.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)};d.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(e){return i?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(n(o)==n(e)){if(t!==!1){this.pos+=e.length};return!0}} +else{var r=this.string.slice(this.pos).match(e);if(r&&r.index>0){return null};if(r&&t!==!1){this.pos+=r[0].length};return r}};d.prototype.current=function(){return this.string.slice(this.start,this.pos)};d.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};d.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};d.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Gt=function(e,t){this.state=e;this.lookAhead=t},B=function(e,t,i,r){this.state=t;this.doc=e;this.line=i;this.maxLookAhead=r||0;this.baseTokens=null;this.baseTokenPos=1};B.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);if(t!=null&&e>this.maxLookAhead){this.maxLookAhead=e};return t};B.prototype.baseToken=function(e){var i=this;if(!this.baseTokens){return null} +while(this.baseTokens[this.baseTokenPos]<=e){i.baseTokenPos+=2};var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}};B.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};B.fromSaved=function(e,t,i){if(t instanceof Gt){return new B(e,we(e.mode,t.state),i,t.lookAhead)} +else{return new B(e,we(e.mode,t),i)}};B.prototype.save=function(e){var t=e!==!1?we(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Gt(t,this.maxLookAhead):t};function gn(e,t,i,r){var n=[e.state.modeGen],o={};wn(e,t.text,e.doc.mode,i,function(e,t){return n.push(e,t)},o,r);var s=i.state,a=function(r){i.baseTokens=n;var a=e.state.overlays[r],l=1,u=0;i.state=!0;wn(e,t.text,a.mode,i,function(e,t){var i=l;while(u<e){var r=n[l];if(r>e){n.splice(l,1,e,n[l+1],r)};l+=2;u=Math.min(e,r)};if(!t){return};if(a.opaque){n.splice(i,l-i,e,"overlay "+t);l=i+2} +else{for(;i<l;i+=2){var o=n[i+1];n[i+1]=(o?o+" ":"")+"overlay "+t}}},o);i.state=s;i.baseTokens=null;i.baseTokenPos=1};for(var l=0;l<e.state.overlays.length;++l)a(l);return{styles:n,classes:o.bgClass||o.textClass?o:null}};function vn(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mt(e,u(t)),n=t.text.length>e.options.maxHighlightLength&&we(e.doc.mode,r.state),o=gn(e,t,r);if(n){r.state=n};t.stateAfter=r.save(!n);t.styles=o.styles;if(o.classes){t.styleClasses=o.classes} +else if(t.styleClasses){t.styleClasses=null};if(i===e.doc.highlightFrontier){e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier)}};return t.styles};function mt(e,i,r){var n=e.doc,a=e.display;if(!n.mode.startState){return new B(n,!0,i)};var l=Ul(e,i,r),s=l>n.first&&t(n,l-1).stateAfter,o=s?B.fromSaved(n,s,l):new B(n,pn(n.mode),l);n.iter(l,i,function(t){qi(e,t.text,o);var r=o.line;t.stateAfter=r==i-1||r%5==0||r>=a.viewFrom&&r<a.viewTo?o.save():null;o.nextLine()});if(r){n.modeFrontier=o.line};return o};function qi(e,t,i,r){var o=e.doc.mode,n=new d(t,e.options.tabSize,i);n.start=n.pos=r||0;if(t==""){mn(o,i.state)} +while(!n.eol()){Zi(o,n,i.state);n.start=n.pos}};function mn(e,t){if(e.blankLine){return e.blankLine(t)};if(!e.innerMode){return};var i=Yi(e,t);if(i.mode.blankLine){return i.mode.blankLine(i.state)}};function Zi(e,t,i,r){for(var n=0;n<10;n++){if(r){r[0]=Yi(e,i).mode};var o=e.token(t,i);if(t.pos>t.start){return o}};throw new Error("Mode "+e.name+" failed to advance stream.")};var Rr=function(e,t,i){this.start=e.start;this.end=e.pos;this.string=e.current();this.type=t||null;this.state=i};function yn(e,i,r,n){var a=e.doc,h=a.mode,f;i=o(a,i);var c=t(a,i.line),s=mt(e,i.line,r),l=new d(c.text,e.options.tabSize,s),u;if(n){u=[]} +while((n||l.pos<i.ch)&&!l.eol()){l.start=l.pos;f=Zi(h,l,s.state);if(n){u.push(new Rr(l,f,we(a.mode,s.state)))}};return n?u:new Rr(l,f,s.state)};function bn(e,t){if(e){for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i){break};e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";if(t[r]==null){t[r]=i[2]} +else if(!(new RegExp("(?:^|\s)"+i[2]+"(?:$|\s)")).test(t[r])){t[r]+=" "+i[2]}}};return e};function wn(e,t,i,r,n,l,u){var c=i.flattenSpans;if(c==null){c=e.options.flattenSpans};var s=0,f=null,o=new d(t,e.options.tabSize,r),a,p=e.options.addModeClass&&[null];if(t==""){bn(mn(i,r.state),l)} +while(!o.eol()){if(o.pos>e.options.maxHighlightLength){c=!1;if(u){qi(e,t,r,o.pos)};o.pos=t.length;a=null} +else{a=bn(Zi(i,o,r.state,p),l)};if(p){var h=p[0].name;if(h){a="m-"+(a?h+" "+a:h)}};if(!c||f!=a){while(s<o.start){s=Math.min(o.start,s+5000);n(s,f)};f=a};o.start=o.pos} +while(s<o.pos){var g=Math.min(o.pos,s+5000);n(g,f);s=g}};function Ul(e,i,r){var f,s,o=e.doc,c=r?-1:i-(e.doc.mode.innerMode?1000:100);for(var n=i;n>c;--n){if(n<=o.first){return o.first};var u=t(o,n-1),l=u.stateAfter;if(l&&(!r||n+(l instanceof Gt?l.lookAhead:0)<=o.modeFrontier)){return n};var a=H(u.text,null,e.options.tabSize);if(s==null||f>a){s=n-1;f=a}};return s};function Vl(e,i){e.modeFrontier=Math.min(e.modeFrontier,i);if(e.highlightFrontier<i-10){return};var o=e.first;for(var r=i-1;r>o;r--){var n=t(e,r).stateAfter;if(n&&(!(n instanceof Gt)||r+n.lookAhead<i)){o=r+1;break}};e.highlightFrontier=Math.min(e.highlightFrontier,o)};var We=function(e,t,i){this.text=e;on(this,t);this.height=i?i(this):1};We.prototype.lineNo=function(){return u(this)};Pe(We);function Kl(e,t,i,r){e.text=t;if(e.stateAfter){e.stateAfter=null};if(e.styles){e.styles=null};if(e.order!=null){e.order=null};nn(e);on(e,i);var n=r?r(e):1;if(n!=e.height){U(e,n)}};function Xl(e){e.parent=null;nn(e)};var cl={};var fl={};function xn(e,t){if(!e||/^\s*$/.test(e)){return null};var i=t.addModeClass?fl:cl;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))};function Cn(e,t){var a=Fe("span",null,null,x?"padding-right: .1px":null),i={pre:Fe("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(l||x)&&e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var r=n?t.rest[n-1]:t.line,s=(void 0);i.pos=0;i.addToken=Yl;if(Il(e.display.measure)&&(s=Z(r,e.doc.direction))){i.addToken=Zl(i.addToken,s)};i.map=[];var f=t!=e.display.externalMeasured&&u(r);Ql(r,i,vn(e,r,f));if(r.styleClasses){if(r.styleClasses.bgClass){i.bgClass=Oi(r.styleClasses.bgClass,i.bgClass||"")};if(r.styleClasses.textClass){i.textClass=Oi(r.styleClasses.textClass,i.textClass||"")}};if(i.map.length==0){i.map.push(0,0,i.content.appendChild(El(e.display.measure)))};if(n==0){t.measure.map=i.map;t.measure.cache={}} +else{;(t.measure.maps||(t.measure.maps=[])).push(i.map);(t.measure.caches||(t.measure.caches=[])).push({})}};if(x){var o=i.content.lastChild;if(/\bcm-tab\b/.test(o.className)||(o.querySelector&&o.querySelector(".cm-tab"))){i.content.className="cm-tab-wrap-hack"}};p(e,"renderLine",e,t.line,i.pre);if(i.pre.className){i.textClass=Oi(i.pre.className,i.textClass||"")};return i};function jl(e){var t=i("span","\u2022","cm-invalidchar");t.title="\\u"+e.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t};function Yl(e,t,r,n,o,f,h){if(!t){return};var m=e.splitSpaces?ql(t,e.trailingSpace):t,y=e.cm.state.specialChars,C=!1,s;if(!y.test(t)){e.col+=t.length;s=document.createTextNode(m);e.map.push(e.pos,e.pos+t.length,s);if(l&&c<9){C=!0};e.pos+=t.length} +else{s=document.createDocumentFragment();var p=0;while(!0){y.lastIndex=p;var u=y.exec(t),d=u?u.index-p:t.length-p;if(d){var v=document.createTextNode(m.slice(p,p+d));if(l&&c<9){s.appendChild(i("span",[v]))} +else{s.appendChild(v)};e.map.push(e.pos,e.pos+d,v);e.col+=d;e.pos+=d};if(!u){break};p+=d+1;var a=(void 0);if(u[0]=="\t"){var w=e.cm.options.tabSize,x=w-e.col%w;a=s.appendChild(i("span",Di(x),"cm-tab"));a.setAttribute("role","presentation");a.setAttribute("cm-text","\t");e.col+=x} +else if(u[0]=="\r"||u[0]=="\n"){a=s.appendChild(i("span",u[0]=="\r"?"\u240d":"\u2424","cm-invalidchar"));a.setAttribute("cm-text",u[0]);e.col+=1} +else{a=e.cm.options.specialCharPlaceholder(u[0]);a.setAttribute("cm-text",u[0]);if(l&&c<9){s.appendChild(i("span",[a]))} +else{s.appendChild(a)};e.col+=1};e.map.push(e.pos,e.pos+1,a);e.pos++}};e.trailingSpace=m.charCodeAt(t.length-1)==32;if(r||n||o||C||h){var g=r||"";if(n){g+=n};if(o){g+=o};var b=i("span",[s],g,h);if(f){b.title=f};return e.content.appendChild(b)};e.content.appendChild(s)};function ql(e,t){if(e.length>1&&!/ /.test(e)){return e};var n=t,o="";for(var i=0;i<e.length;i++){var r=e.charAt(i);if(r==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)){r="\u00a0"};o+=r;n=r==" "};return o};function Zl(e,t){return function(i,r,n,o,l,s,u){n=n?n+" cm-force-border":"cm-force-border";var f=i.pos,h=f+r.length;for(;;){var a=(void 0);for(var c=0;c<t.length;c++){a=t[c];if(a.to>f&&a.from<=f){break}};if(a.to>=h){return e(i,r,n,o,l,s,u)};e(i,r.slice(0,a.to-f),n,o,null,s,u);o=null;r=r.slice(a.to-f);f=a.to}}};function Sn(e,t,i,r){var n=!r&&i.widgetNode;if(n){e.map.push(e.pos,e.pos+t,n)};if(!r&&e.cm.display.input.needsContentAttribute){if(!n){n=e.content.appendChild(document.createElement("span"))};n.setAttribute("cm-marker",i.id)};if(n){e.cm.display.input.setUneditable(n);e.content.appendChild(n)};e.pos+=t;e.trailingSpace=!1};function Ql(e,t,i){var k=e.markedSpans,T=e.text,y=0;if(!k){for(var m=1;m<i.length;m+=2){t.addToken(t,T.slice(y,y=i[m]),xn(i[m+1],t.cm.options))};return};var S=T.length,r=0,N=1,a="",L,c,s=0,d,p,g,v,l;for(;;){if(s==r){d=p=g=v=c="";l=null;s=Infinity;var C=[],u=(void 0);for(var x=0;x<k.length;++x){var n=k[x],o=n.marker;if(o.type=="bookmark"&&n.from==r&&o.widgetNode){C.push(o)} +else if(n.from<=r&&(n.to==null||n.to>r||o.collapsed&&n.to==r&&n.from==r)){if(n.to!=null&&n.to!=r&&s>n.to){s=n.to;p=""};if(o.className){d+=" "+o.className};if(o.css){c=(c?c+";":"")+o.css};if(o.startStyle&&n.from==r){g+=" "+o.startStyle};if(o.endStyle&&n.to==s){(u||(u=[])).push(o.endStyle,n.to)};if(o.title&&!v){v=o.title};if(o.collapsed&&(!l||ln(l.marker,o)<0)){l=n}} +else if(n.from>r&&s>n.from){s=n.from}};if(u){for(var h=0;h<u.length;h+=2){if(u[h+1]==s){p+=" "+u[h]}}};if(!l||l.from==r){for(var w=0;w<C.length;++w){Sn(t,0,C[w])}};if(l&&(l.from||0)==r){Sn(t,(l.to==null?S+1:l.to)-r,l.marker,l.from==null);if(l.to==null){return};if(l.to==r){l=!1}}};if(r>=S){break};var f=Math.min(S,s);while(!0){if(a){var b=r+a.length;if(!l){var M=b>f?a.slice(0,f-r):a;t.addToken(t,M,L?L+d:d,g,r+M.length==s?p:"",v,c)};if(b>=f){a=a.slice(f-r);r=f;break};r=b;g=""};a=T.slice(y,y=i[N++]);L=xn(i[N++],t.cm.options)}}};function Ln(e,t,i){this.line=t;this.rest=Fl(t);this.size=this.rest?u(a(this.rest))-i+1:1;this.node=this.text=null;this.hidden=be(e,t)};function ri(e,i,r){var l=[],s;for(var n=i;n<r;n=s){var o=new Ln(e.doc,t(e.doc,n),n);s=n+o.size;l.push(o)};return l};var Ae=null;function Jl(e){if(Ae){Ae.ops.push(e)} +else{e.ownsGroup=Ae={ops:[e],delayedCallbacks:[]}}};function es(e){var n=e.delayedCallbacks,i=0;do{for(;i<n.length;i++){n[i].call(null)};for(var r=0;r<e.ops.length;r++){var t=e.ops[r];if(t.cursorActivityHandlers){while(t.cursorActivityCalled<t.cursorActivityHandlers.length){t.cursorActivityHandlers[t.cursorActivityCalled++].call(null,t.cm)}}}} +while(i<n.length)};function ts(e,t){var i=e.ownsGroup;if(!i){return};try{es(i)}finally{Ae=null;t(i)}};var rt=null;function w(e,t){var n=Vi(e,t);if(!n.length){return};var l=Array.prototype.slice.call(arguments,2),i;if(Ae){i=Ae.delayedCallbacks} +else if(rt){i=rt} +else{i=rt=[];setTimeout(is,0)};var o=function(e){i.push(function(){return n[e].apply(null,l)})};for(var r=0;r<n.length;++r)o(r)};function is(){var t=rt;rt=null;for(var e=0;e<t.length;++e){t[e]()}};function kn(e,t,i,r){for(var o=0;o<t.changes.length;o++){var n=t.changes[o];if(n=="text"){ns(e,t)} +else if(n=="gutter"){Mn(e,t,i,r)} +else if(n=="class"){Qi(e,t)} +else if(n=="widget"){os(e,t,r)}};t.changes=null};function yt(e){if(e.node==e.text){e.node=i("div",null,null,"position: relative");if(e.text.parentNode){e.text.parentNode.replaceChild(e.node,e.text)};e.node.appendChild(e.text);if(l&&c<8){e.node.style.zIndex=2}};return e.node};function rs(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r){r+=" CodeMirror-linebackground"};if(t.background){if(r){t.background.className=r} +else{t.background.parentNode.removeChild(t.background);t.background=null}} +else if(r){var n=yt(t);t.background=n.insertBefore(i("div",null,r),n.firstChild);e.display.input.setUneditable(t.background)}};function Tn(e,t){var i=e.display.externalMeasured;if(i&&i.line==t.line){e.display.externalMeasured=null;t.measure=i.measure;return i.built};return Cn(e,t)};function ns(e,t){var r=t.text.className,i=Tn(e,t);if(t.text==t.node){t.node=i.pre};t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;if(i.bgClass!=t.bgClass||i.textClass!=t.textClass){t.bgClass=i.bgClass;t.textClass=i.textClass;Qi(e,t)} +else if(r){t.text.className=r}};function Qi(e,t){rs(e,t);if(t.line.wrapClass){yt(t).className=t.line.wrapClass} +else if(t.node!=t.text){t.node.className=""};var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""};function Mn(e,t,r,n){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null};if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null};if(t.line.gutterClass){var c=yt(t);t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,("left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+(n.gutterTotalWidth)+"px"));e.display.input.setUneditable(t.gutterBackground);c.insertBefore(t.gutterBackground,t.text)};var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var f=yt(t),l=t.gutter=i("div",null,"CodeMirror-gutter-wrapper",("left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px"));e.display.input.setUneditable(l);f.insertBefore(l,t.text);if(t.line.gutterClass){l.className+=" "+t.line.gutterClass};if(e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){t.lineNumber=l.appendChild(i("div",Ei(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt",("left: "+(n.gutterLeft["CodeMirror-linenumbers"])+"px; width: "+(e.display.lineNumInnerWidth)+"px")))};if(o){for(var a=0;a<e.options.gutters.length;++a){var s=e.options.gutters[a],u=o.hasOwnProperty(s)&&o[s];if(u){l.appendChild(i("div",[u],"CodeMirror-gutter-elt",("left: "+(n.gutterLeft[s])+"px; width: "+(n.gutterWidth[s])+"px")))}}}}};function os(e,t,i){if(t.alignable){t.alignable=null};for(var r=t.node.firstChild,n=(void 0);r;r=n){n=r.nextSibling;if(r.className=="CodeMirror-linewidget"){t.node.removeChild(r)}};Nn(e,t,i)};function ls(e,t,i,r){var n=Tn(e,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass};if(n.textClass){t.textClass=n.textClass};Qi(e,t);Mn(e,t,i,r);Nn(e,t,r);return t.node};function Nn(e,t,i){On(e,t.line,t,i,!0);if(t.rest){for(var r=0;r<t.rest.length;r++){On(e,t.rest[r],t,i,!1)}}};function On(e,t,r,n,o){if(!t.widgets){return};var f=yt(r);for(var a=0,u=t.widgets;a<u.length;++a){var l=u[a],s=i("div",[l.node],"CodeMirror-linewidget");if(!l.handleMouseEvents){s.setAttribute("cm-ignore-events","true")};ss(l,s,r,n);e.display.input.setUneditable(s);if(o&&l.above){f.insertBefore(s,r.gutter||r.text)} +else{f.appendChild(s)};w(l,"redraw")}};function ss(e,t,i,r){if(e.noHScroll){;(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px";if(!e.coverGutter){n-=r.gutterTotalWidth;t.style.paddingLeft=r.gutterTotalWidth+"px"};t.style.width=n+"px"};if(e.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!e.noHScroll){t.style.marginLeft=-r.gutterTotalWidth+"px"}}};function bt(e){if(e.height!=null){return e.height};var t=e.doc.cm;if(!t){return 0};if(!ne(document.body,e.node)){var r="position: relative;";if(e.coverGutter){r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"};if(e.noHScroll){r+="width: "+t.display.wrapper.clientWidth+"px;"};W(t.display.measure,i("div",[e.node],null,r))};return e.height=e.node.parentNode.offsetHeight};function Q(e,t){for(var i=Xi(t);i!=e.wrapper;i=i.parentNode){if(!i||(i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true")||(i.parentNode==e.sizer&&i!=e.mover)){return!0}}};function ni(e){return e.lineSpace.offsetTop};function Ji(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight};function An(e){if(e.cachedPaddingH){return e.cachedPaddingH};var r=W(e.measure,i("pre","x")),n=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,t={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};if(!isNaN(t.left)&&!isNaN(t.right)){e.cachedPaddingH=t};return t};function K(e){return Ur-e.display.nativeBarWidth};function xe(e){return e.display.scroller.clientWidth-K(e)-e.display.barWidth};function er(e){return e.display.scroller.clientHeight-K(e)-e.display.barHeight};function as(e,t,i){var o=e.options.lineWrapping,u=o&&xe(e);if(!t.measure.heights||o&&t.measure.width!=u){var a=t.measure.heights=[];if(o){t.measure.width=u;var n=t.text.firstChild.getClientRects();for(var r=0;r<n.length-1;r++){var l=n[r],s=n[r+1];if(Math.abs(l.bottom-s.bottom)>2){a.push((l.bottom+s.top)/2-i.top)}}};a.push(i.bottom-i.top)}};function Wn(e,t,i){if(e.line==t){return{map:e.measure.map,cache:e.measure.cache}};for(var n=0;n<e.rest.length;n++){if(e.rest[n]==t){return{map:e.measure.maps[n],cache:e.measure.caches[n]}}};for(var r=0;r<e.rest.length;r++){if(u(e.rest[r])>i){return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}}};function us(e,t){t=V(t);var n=u(t),i=e.display.externalMeasured=new Ln(e.doc,t,n);i.lineN=n;var r=i.built=Cn(e,i);i.text=r.pre;W(e.display.lineMeasure,r.pre);return i};function Dn(e,t,i,r){return X(e,Ee(e,t),i,r)};function tr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo){return e.display.view[Le(e,t)]};var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size){return i}};function Ee(e,t){var n=u(t),i=tr(e,n);if(i&&!i.text){i=null} +else if(i&&i.changes){kn(e,i,n,sr(e));e.curOp.forceUpdate=!0};if(!i){i=us(e,t)};var r=Wn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}};function X(e,t,i,r,n){if(t.before){i=-1};var l=i+(r||""),o;if(t.cache.hasOwnProperty(l)){o=t.cache[l]} +else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()};if(!t.hasHeights){as(e,t.view,t.rect);t.hasHeights=!0};o=cs(e,t,i,r);if(!o.bogus){t.cache[l]=o}};return{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}};var zr={left:0,right:0,top:0,bottom:0};function Hn(e,t,i){var a,n,u,s,l,o;for(var r=0;r<e.length;r+=3){l=e[r];o=e[r+1];if(t<l){n=0;u=1;s="left"} +else if(t<o){n=t-l;u=n+1} +else if(r==e.length-3||t==o&&e[r+3]>t){u=o-l;n=u-1;if(t>=o){s="right"}};if(n!=null){a=e[r+2];if(l==o&&i==(a.insertLeft?"left":"right")){s=i};if(i=="left"&&n==0){while(r&&e[r-2]==e[r-3]&&e[r-1].insertLeft){a=e[(r-=3)+2];s="left"}};if(i=="right"&&n==o-l){while(r<e.length-3&&e[r+3]==e[r+4]&&!e[r+5].insertLeft){a=e[(r+=3)+2];s="right"}};break}};return{node:a,start:n,end:u,collapse:s,coverStart:l,coverEnd:o}};function fs(e,t){var i=zr;if(t=="left"){for(var n=0;n<e.length;n++){if((i=e[n]).left!=i.right){break}}} +else{for(var r=e.length-1;r>=0;r--){if((i=e[r]).left!=i.right){break}}};return i};function cs(e,t,i,r){var s=Hn(t.map,i,r),u=s.node,o=s.start,f=s.end,g=s.collapse,n;if(u.nodeType==3){for(var b=0;b<4;b++){while(o&&Fi(t.line.text.charAt(s.coverStart+o))){--o} +while(s.coverStart+f<s.coverEnd&&Fi(t.line.text.charAt(s.coverStart+f))){++f};if(l&&c<9&&o==0&&f==s.coverEnd-s.coverStart){n=u.parentNode.getBoundingClientRect()} +else{n=fs(he(u,o,f).getClientRects(),r)};if(n.left||n.right||o==0){break};f=o;o=o-1;g="right"};if(l&&c<11){n=hs(e.display.measure,n)}} +else{if(o>0){g=r="right"};var v;if(e.options.lineWrapping&&(v=u.getClientRects()).length>1){n=v[r=="right"?v.length-1:0]} +else{n=u.getBoundingClientRect()}};if(l&&c<9&&!o&&(!n||!n.left&&!n.right)){var h=u.parentNode.getClientRects()[0];if(h){n={left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}} +else{n=zr}};var m=n.top-t.rect.top,y=n.bottom-t.rect.top,C=(m+y)/2,p=t.view.measure.heights,a=0;for(;a<p.length-1;a++){if(C<p[a]){break}};var w=a?p[a-1]:0,x=p[a],d={left:(g=="right"?n.right:n.left)-t.rect.left,right:(g=="left"?n.left:n.right)-t.rect.left,top:w,bottom:x};if(!n.left&&!n.right){d.bogus=!0};if(!e.options.singleCursorHeightPerLine){d.rtop=m;d.rbottom=y};return d};function hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!zl(e)){return t};var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}};function Fn(e){if(e.measure){e.measure.cache={};e.measure.heights=null;if(e.rest){for(var t=0;t<e.rest.length;t++){e.measure.caches[t]={}}}}};function Pn(e){e.display.externalMeasure=null;re(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++){Fn(e.display.view[t])}};function wt(e){Pn(e);e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null;if(!e.options.lineWrapping){e.display.maxLineChanged=!0};e.display.lineNumChars=null};function En(){if(Kt&&Xt){return-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft))};return window.pageXOffset||(document.documentElement||document.body).scrollLeft};function In(){if(Kt&&Xt){return-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop))};return window.pageYOffset||(document.documentElement||document.body).scrollTop};function ir(e){var i=0;if(e.widgets){for(var t=0;t<e.widgets.length;++t){if(e.widgets[t].above){i+=bt(e.widgets[t])}}};return i};function oi(e,t,i,r,n){if(!n){var a=ir(t);i.top+=a;i.bottom+=a};if(r=="line"){return i};if(!r){r="local"};var o=q(t);if(r=="local"){o+=ni(e.display)} +else{o-=e.display.viewOffset};if(r=="page"||r=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(r=="window"?0:In());var l=s.left+(r=="window"?0:En());i.left+=l;i.right+=l};i.top+=o;i.bottom+=o;return i};function zn(e,t,i){if(i=="div"){return t};var r=t.left,n=t.top;if(i=="page"){r-=En();n-=In()} +else if(i=="local"||!i){var l=e.display.sizer.getBoundingClientRect();r+=l.left;n+=l.top};var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:n-o.top}};function rr(e,i,r,n,o){if(!n){n=t(e.doc,i.line)};return oi(e,n,Dn(e,n,i.ch,o),r)};function z(e,i,r,n,o,a){n=n||t(e.doc,i.line);if(!o){o=Ee(e,n)};function h(t,i){var l=X(e,o,t,i?"right":"left",a);if(i){l.left=l.right} +else{l.right=l.left};return oi(e,n,l,r)};var u=Z(n,e.doc.direction),l=i.ch,s=i.sticky;if(l>=n.text.length){l=n.text.length;s="before"} +else if(l<=0){l=0;s="after"};if(!u){return h(s=="before"?l-1:l,s=="before")};function d(e,t,i){var r=u[t],n=r.level==1;return h(i?e-1:e,n!=i)};var p=gt(u,l,s),f=nt,c=d(l,p,s=="before");if(f!=null){c.other=d(l,f,s!="before")};return c};function Rn(e,i){var r=0;i=o(e.doc,i);if(!e.options.lineWrapping){r=xt(e.display)*i.ch};var n=t(e.doc,i.line),l=q(n)+ni(e.display);return{left:r,right:r,top:l,bottom:l+n.height}};function nr(t,i,r,n,o){var l=e(t,i,r);l.xRel=o;if(n){l.outside=!0};return l};function or(e,i,r){var n=e.doc;r+=e.display.viewOffset;if(r<0){return nr(n.first,0,null,!0,-1)};var l=ye(n,r),c=n.first+n.size-1;if(l>c){return nr(n.first+n.size-1,t(n,c).text.length,null,!0,1)};if(i<0){i=0};var f=t(n,l);for(;;){var o=ds(e,f,l,i,r),s=pt(f),a=s&&s.find(0,!0);if(s&&(o.ch>a.from.ch||o.ch==a.from.ch&&o.xRel>0)){l=u(f=a.to.line)} +else{return o}}};function Bn(e,t,i,r){r-=ir(t);var n=t.text.length,o=ct(function(t){return X(e,i,t-1).bottom<=r},n,0);n=ct(function(t){return X(e,i,t).top>r},o,n);return{begin:o,end:n}};function Gn(e,t,i,r){if(!i){i=Ee(e,t)};var n=oi(e,t,X(e,i,r),"line").top;return Bn(e,t,i,n)};function lr(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t};function ds(t,i,r,n,o){o-=q(i);var c=Ee(t,i),p=ir(i),g=0,v=i.text.length,s=!0,x=Z(i,t.doc.direction);if(x){var u=(t.options.lineWrapping?gs:ps)(t,i,r,c,x,n,o);s=u.level!=1;g=s?u.from:u.to-1;v=s?u.to:u.from-1};var b=null,a=null,l=ct(function(e){var i=X(t,c,e);i.top+=p;i.bottom+=p;if(!lr(i,n,o,!1)){return!1};if(i.top<=o&&i.left<=n){b=e;a=i};return!0},g,v),d,f,w=!1;if(a){var m=n-a.left<a.right-n,y=m==s;l=b+(y?0:1);f=y?"after":"before";d=m?a.left:a.right} +else{if(!s&&(l==v||l==g)){l++};f=l==0?"after":l==i.text.length?"before":(X(t,c,l-(s?1:0)).bottom+p<=o)==s?"after":"before";var h=z(t,e(r,l,f),"line",i,c);d=h.left;w=o<h.top||o>=h.bottom};l=Jr(i.text,l,1);return nr(r,l,f,w,n-d)};function ps(t,i,r,n,o,l,s){var u=ct(function(a){var u=o[a],f=u.level!=1;return lr(z(t,e(r,f?u.to:u.from,f?"before":"after"),"line",i,n),l,s,!0)},0,o.length-1),a=o[u];if(u>0){var f=a.level!=1,c=z(t,e(r,f?a.from:a.to,f?"after":"before"),"line",i,n);if(lr(c,l,s,!0)&&c.top>s){a=o[u-1]}};return a};function gs(e,t,i,r,n,l,u){var g=Bn(e,t,r,u),f=g.begin,a=g.end;if(/\s/.test(t.text.charAt(a-1))){a--};var o=null,p=null;for(var h=0;h<n.length;h++){var s=n[h];if(s.from>=a||s.to<=f){continue};var v=s.level!=1,c=X(e,r,v?Math.min(a,s.to)-1:Math.max(f,s.from)).right,d=c<l?l-c+1e9:c-l;if(!o||p>d){o=s;p=d}};if(!o){o=n[n.length-1]};if(o.from<f){o={from:f,to:o.to,level:o.level}};if(o.to>a){o={from:o.from,to:a,level:o.level}};return o};var fe;function Ce(e){if(e.cachedTextHeight!=null){return e.cachedTextHeight};if(fe==null){fe=i("pre");for(var r=0;r<49;++r){fe.appendChild(document.createTextNode("x"));fe.appendChild(i("br"))};fe.appendChild(document.createTextNode("x"))};W(e.measure,fe);var t=fe.offsetHeight/50;if(t>3){e.cachedTextHeight=t};re(e.measure);return t||1};function xt(e){if(e.cachedCharWidth!=null){return e.cachedCharWidth};var n=i("span","xxxxxxxxxx"),o=i("pre",[n]);W(e.measure,o);var r=n.getBoundingClientRect(),t=(r.right-r.left)/10;if(t>2){e.cachedCharWidth=t};return t||10};function sr(e){var i=e.display,n={},o={};var l=i.gutters.clientLeft;for(var t=i.gutters.firstChild,r=0;t;t=t.nextSibling,++r){n[e.options.gutters[r]]=t.offsetLeft+t.clientLeft+l;o[e.options.gutters[r]]=t.clientWidth};return{fixedPos:ar(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:n,gutterWidth:o,wrapperWidth:i.wrapper.clientWidth}};function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left};function Un(e){var t=Ce(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(n){if(be(e.doc,n)){return 0};var l=0;if(n.widgets){for(var o=0;o<n.widgets.length;o++){if(n.widgets[o].height){l+=n.widgets[o].height}}};if(i){return l+(Math.ceil(n.text.length/r)||1)*t} +else{return l+t}}};function ur(e){var t=e.doc,i=Un(e);t.iter(function(e){var t=i(e);if(t!=e.height){U(e,t)}})};function Se(i,r,n,o){var d=i.display;if(!n&&Xi(r).getAttribute("cm-not-content")=="true"){return null};var u,f,c=d.lineSpace.getBoundingClientRect();try{u=r.clientX-c.left;f=r.clientY-c.top}catch(l){return null};var s=or(i,u,f),a;if(o&&s.xRel==1&&(a=t(i.doc,s.line).text).length==s.ch){var h=H(a,a.length,i.options.tabSize)-a.length;s=e(s.line,Math.max(0,Math.round((u-An(i.display).left)/xt(i.display))-h))};return s};function Le(e,t){if(t>=e.display.viewTo){return null};t-=e.display.viewFrom;if(t<0){return null};var r=e.display.view;for(var i=0;i<r.length;i++){t-=r[i].size;if(t<0){return i}}};function Ct(e){e.display.input.showSelection(e.display.input.prepareSelection())};function Vn(e,t){if(t===void 0)t=!0;var n=e.doc,o={};var s=o.cursors=document.createDocumentFragment(),a=o.selection=document.createDocumentFragment();for(var r=0;r<n.sel.ranges.length;r++){if(!t&&r==n.sel.primIndex){continue};var i=n.sel.ranges[r];if(i.from().line>=e.display.viewTo||i.to().line<e.display.viewFrom){continue};var l=i.empty();if(l||e.options.showCursorWhenSelecting){Kn(e,i.head,s)};if(!l){vs(e,i,a)}};return o};function Kn(e,t,r){var n=z(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),l=r.appendChild(i("div","\u00a0","CodeMirror-cursor"));l.style.left=n.left+"px";l.style.top=n.top+"px";l.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px";if(n.other){var o=r.appendChild(i("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="";o.style.left=n.other.left+"px";o.style.top=n.other.top+"px";o.style.height=(n.other.bottom-n.other.top)*.85+"px"}};function li(e,t){return e.top-t.top||e.left-t.left};function vs(r,n,o){var y=r.display,p=r.doc,b=document.createDocumentFragment(),w=An(r.display),a=w.left,h=Math.max(y.sizerWidth,xe(r)-y.sizer.offsetLeft)-w.right,s=p.direction=="ltr";function u(e,t,r,n){if(t<0){t=0};t=Math.round(t);n=Math.round(n);b.appendChild(i("div",null,"CodeMirror-selected",("position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(r==null?h-e:r)+"px;\n height: "+(n-t)+"px")))};function v(i,n,o){var c=t(p,i),m=c.text.length,l,f;function v(t,n){return rr(r,e(i,t),"div",c,n)};function d(e,t,i){var n=Gn(r,c,null,e),o=(t=="ltr")==(i=="after")?"left":"right",l=i=="after"?n.begin:n.end-(/\s/.test(c.text.charAt(n.end-1))?2:1);return v(l,o)[o]};var g=Z(c,p.direction);Pl(g,n||0,o==null?m:o,function(e,t,i,r){var y=i=="ltr",c=v(e,y?"left":"right"),p=v(t-1,y?"right":"left"),x=n==null&&e==0,C=o==null&&t==m,k=r==0,T=!g||r==g.length-1;if(p.top-c.top<=3){var N=(s?x:C)&&k,O=(s?C:x)&&T,M=N?a:(y?c:p).left,A=O?h:(y?p:c).right;u(M,c.top,A-M,c.bottom)} +else{var b,S,w,L;if(y){b=s&&x&&k?a:c.left;S=s?h:d(e,i,"before");w=s?a:d(t,i,"after");L=s&&C&&T?h:p.right} +else{b=!s?a:d(e,i,"before");S=!s&&x&&k?h:c.right;w=!s&&C&&T?a:p.left;L=!s?h:d(t,i,"after")};u(b,c.top,S-b,c.bottom);if(c.bottom<p.top){u(a,c.bottom,null,p.top)};u(w,p.top,L-w,p.bottom)};if(!l||li(c,l)<0){l=c};if(li(p,l)<0){l=p};if(!f||li(c,f)<0){f=c};if(li(p,f)<0){f=p}});return{start:l,end:f}};var c=n.from(),d=n.to();if(c.line==d.line){v(c.line,c.ch,d.ch)} +else{var m=t(p,c.line),x=t(p,d.line),g=V(m)==V(x),l=v(c.line,c.ch,g?m.text.length+1:null).end,f=v(d.line,g?0:null,d.ch).start;if(g){if(l.top<f.top-2){u(l.right,l.top,null,l.bottom);u(a,f.top,f.left,f.bottom)} +else{u(l.right,l.top,f.left-l.right,l.bottom)}};if(l.bottom<f.top){u(a,l.bottom,null,f.top)}};o.appendChild(b)};function fr(e){if(!e.state.focused){return};var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="";if(e.options.cursorBlinkRate>0){t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate)} +else if(e.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}};function Xn(e){if(!e.state.focused){e.display.input.focus();cr(e)}};function jn(e){e.state.delayingBlurEvent=!0;setTimeout(function(){if(e.state.delayingBlurEvent){e.state.delayingBlurEvent=!1;St(e)}},100)};function cr(e,t){if(e.state.delayingBlurEvent){e.state.delayingBlurEvent=!1};if(e.options.readOnly=="nocursor"){return};if(!e.state.focused){p(e,"focus",e,t);e.state.focused=!0;ge(e.display.wrapper,"CodeMirror-focused");if(!e.curOp&&e.display.selForContextMenu!=e.doc.sel){e.display.input.reset();if(x){setTimeout(function(){return e.display.input.reset(!0)},20)}};e.display.input.receivedFocus()};fr(e)};function St(e,t){if(e.state.delayingBlurEvent){return};if(e.state.focused){p(e,"blur",e,t);e.state.focused=!1;de(e.display.wrapper,"CodeMirror-focused")};clearInterval(e.display.blinker);setTimeout(function(){if(!e.state.focused){e.display.shift=!1}},150)};function si(e){var r=e.display,f=r.lineDiv.offsetTop;for(var o=0;o<r.view.length;o++){var t=r.view[o],i=(void 0);if(t.hidden){continue};if(l&&c<8){var u=t.node.offsetTop+t.node.offsetHeight;i=u-f;f=u} +else{var a=t.node.getBoundingClientRect();i=a.bottom-a.top};var s=t.line.height-i;if(i<2){i=Ce(r)};if(s>.005||s<-.005){U(t.line,i);Yn(t.line);if(t.rest){for(var n=0;n<t.rest.length;n++){Yn(t.rest[n])}}}}};function Yn(e){if(e.widgets){for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;if(r){i.height=r.offsetHeight}}}};function hr(e,i,r){var l=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;l=Math.floor(l-ni(e));var u=r&&r.bottom!=null?r.bottom:l+e.wrapper.clientHeight,n=ye(i,l),o=ye(i,u);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;if(s<n){n=s;o=ye(i,q(t(i,s))+e.wrapper.clientHeight)} +else if(Math.min(a,i.lastLine())>=o){n=ye(i,q(t(i,a))-e.wrapper.clientHeight);o=a}};return{from:n,to:Math.max(o,n+1)}};function qn(e){var i=e.display,r=i.view;if(!i.alignWidgets&&(!i.gutters.firstChild||!e.options.fixedGutter)){return};var s=ar(i)-i.scroller.scrollLeft+e.doc.scrollLeft,a=i.gutters.offsetWidth,l=s+"px";for(var t=0;t<r.length;t++){if(!r[t].hidden){if(e.options.fixedGutter){if(r[t].gutter){r[t].gutter.style.left=l};if(r[t].gutterBackground){r[t].gutterBackground.style.left=l}};var o=r[t].alignable;if(o){for(var n=0;n<o.length;n++){o[n].style.left=l}}}};if(e.options.fixedGutter){i.gutters.style.left=(s+a)+"px"}};function Zn(e){if(!e.options.lineNumbers){return!1};var s=e.doc,r=Ei(e.options,s.first+s.size-1),t=e.display;if(r.length!=t.lineNumChars){var n=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,l=n.offsetWidth-o;t.lineGutter.style.width="";t.lineNumInnerWidth=Math.max(o,t.lineGutter.offsetWidth-l)+1;t.lineNumWidth=t.lineNumInnerWidth+l;t.lineNumChars=t.lineNumInnerWidth?r.length:-1;t.lineGutter.style.width=t.lineNumWidth+"px";mr(e);return!0};return!1};function ms(e,t){if(v(e,"scrollCursorIntoView")){return};var o=e.display,l=o.sizer.getBoundingClientRect(),r=null;if(t.top+l.top<0){r=!0} +else if(t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)){r=!1};if(r!=null&&!wl){var n=i("div","\u200b",null,("position: absolute;\n top: "+(t.top-o.viewOffset-ni(e.display))+"px;\n height: "+(t.bottom-t.top+K(e)+o.barHeight)+"px;\n left: "+(t.left)+"px; width: "+(Math.max(2,t.right-t.left))+"px;"));e.display.lineSpace.appendChild(n);n.scrollIntoView(r);e.display.lineSpace.removeChild(n)}};function ys(t,i,r,n){if(n==null){n=0};var u;if(!t.options.lineWrapping&&i==r){i=i.ch?e(i.line,i.sticky=="before"?i.ch-1:i.ch,"after"):i;r=i.sticky=="before"?e(i.line,i.ch+1,"before"):i};for(var f=0;f<5;f++){var a=!1,o=z(t,i),s=!r||r==i?o:z(t,r);u={left:Math.min(o.left,s.left),top:Math.min(o.top,s.top)-n,right:Math.max(o.left,s.left),bottom:Math.max(o.bottom,s.bottom)+n};var l=dr(t,u),c=t.doc.scrollTop,h=t.doc.scrollLeft;if(l.scrollTop!=null){kt(t,l.scrollTop);if(Math.abs(t.doc.scrollTop-c)>1){a=!0}};if(l.scrollLeft!=null){ke(t,l.scrollLeft);if(Math.abs(t.doc.scrollLeft-h)>1){a=!0}};if(!a){break}};return u};function bs(e,t){var i=dr(e,t);if(i.scrollTop!=null){kt(e,i.scrollTop)};if(i.scrollLeft!=null){ke(e,i.scrollLeft)}};function dr(e,t){var o=e.display,c=Ce(e.display);if(t.top<0){t.top=0};var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,n=er(e),i={};if(t.bottom-t.top>n){t.bottom=t.top+n};var f=e.doc.height+Ji(o),h=t.top<c,d=t.bottom>f-c;if(t.top<s){i.scrollTop=h?0:t.top} +else if(t.bottom>s+n){var u=Math.min(t.top,(d?f:t.bottom)-n);if(u!=s){i.scrollTop=u}};var a=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft,r=xe(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),l=t.right-t.left>r;if(l){t.right=t.left+r};if(t.left<10){i.scrollLeft=0} +else if(t.left<a){i.scrollLeft=Math.max(0,t.left-(l?0:10))} +else if(t.right>r+a-3){i.scrollLeft=t.right+(l?0:10)-r};return i};function pr(e,t){if(t==null){return};ai(e);e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t};function Ie(e){ai(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}};function Lt(e,t,i){if(t!=null||i!=null){ai(e)};if(t!=null){e.curOp.scrollLeft=t};if(i!=null){e.curOp.scrollTop=i}};function ws(e,t){ai(e);e.curOp.scrollToPos=t};function ai(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Rn(e,t.from),r=Rn(e,t.to);Qn(e,i,r,t.margin)}};function Qn(e,t,i,r){var n=dr(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Lt(e,n.scrollLeft,n.scrollTop)};function kt(e,t){if(Math.abs(e.doc.scrollTop-t)<2){return};if(!ie){vr(e,{top:t})};Jn(e,t,!0);if(ie){vr(e)};Mt(e,100)};function Jn(e,t,i){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t);if(e.display.scroller.scrollTop==t&&!i){return};e.doc.scrollTop=t;e.display.scrollbars.setScrollTop(t);if(e.display.scroller.scrollTop!=t){e.display.scroller.scrollTop=t}};function ke(e,t,i,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth);if((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r){return};e.doc.scrollLeft=t;qn(e);if(e.display.scroller.scrollLeft!=t){e.display.scroller.scrollLeft=t};e.display.scrollbars.setScrollLeft(t)};function Tt(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ji(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+K(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}};var ue=function(e,t,n){this.cm=n;var o=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(o);e(s);r(o,"scroll",function(){if(o.clientHeight){t(o.scrollTop,"vertical")}});r(s,"scroll",function(){if(s.clientWidth){t(s.scrollLeft,"horizontal")}});this.checkedZeroWidth=!1;if(l&&c<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};ue.prototype.update=function(e){var i=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,t=e.nativeBarWidth;if(r){this.vert.style.display="block";this.vert.style.bottom=i?t+"px":"0";var o=e.viewHeight-(i?t:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"} +else{this.vert.style.display="";this.vert.firstChild.style.height="0"};if(i){this.horiz.style.display="block";this.horiz.style.right=r?t+"px":"0";this.horiz.style.left=e.barLeft+"px";var n=e.viewWidth-e.barLeft-(r?t:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+n)+"px"} +else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"};if(!this.checkedZeroWidth&&e.clientHeight>0){if(t==0){this.zeroWidthHack()};this.checkedZeroWidth=!0};return{right:r?t:0,bottom:i?t:0}};ue.prototype.setScrollLeft=function(e){if(this.horiz.scrollLeft!=e){this.horiz.scrollLeft=e};if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};ue.prototype.setScrollTop=function(e){if(this.vert.scrollTop!=e){this.vert.scrollTop=e};if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};ue.prototype.zeroWidthHack=function(){var e=I&&!bl?"12px":"18px";this.horiz.style.height=this.vert.style.width=e;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new ce;this.disableVert=new ce};ue.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(o!=e){e.style.pointerEvents="none"} +else{t.set(1000,r)}};t.set(1000,r)};ue.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz);e.removeChild(this.vert)};var it=function(){};it.prototype.update=function(){return{bottom:0,right:0}};it.prototype.setScrollLeft=function(){};it.prototype.setScrollTop=function(){};it.prototype.clear=function(){};function ze(e,t){if(!t){t=Tt(e)};var i=e.display.barWidth,n=e.display.barHeight;eo(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++){if(i!=e.display.barWidth&&e.options.lineWrapping){si(e)};eo(e,Tt(e));i=e.display.barWidth;n=e.display.barHeight}};function eo(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px";i.heightForcer.style.borderBottom=r.bottom+"px solid transparent";if(r.right&&r.bottom){i.scrollbarFiller.style.display="block";i.scrollbarFiller.style.height=r.bottom+"px";i.scrollbarFiller.style.width=r.right+"px"} +else{i.scrollbarFiller.style.display=""};if(r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter){i.gutterFiller.style.display="block";i.gutterFiller.style.height=r.bottom+"px";i.gutterFiller.style.width=t.gutterWidth+"px"} +else{i.gutterFiller.style.display=""}};var Ir={"native":ue,"null":it};function to(e){if(e.display.scrollbars){e.display.scrollbars.clear();if(e.display.scrollbars.addClass){de(e.display.wrapper,e.display.scrollbars.addClass)}};e.display.scrollbars=new Ir[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller);r(t,"mousedown",function(){if(e.state.focused){setTimeout(function(){return e.display.input.focus()},0)}});t.setAttribute("cm-not-content","true")},function(t,i){if(i=="horizontal"){ke(e,t)} +else{kt(e,t)}},e);if(e.display.scrollbars.addClass){ge(e.display.wrapper,e.display.scrollbars.addClass)}};var ul=0;function Te(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ul};Jl(e.curOp)};function Me(e){var t=e.curOp;ts(t,function(e){for(var t=0;t<e.ops.length;t++){e.ops[t].cm.curOp=null};xs(e)})};function xs(e){var t=e.ops;for(var l=0;l<t.length;l++){Cs(t[l])};for(var o=0;o<t.length;o++){Ss(t[o])};for(var n=0;n<t.length;n++){Ls(t[n])};for(var r=0;r<t.length;r++){ks(t[r])};for(var i=0;i<t.length;i++){Ts(t[i])}};function Cs(e){var t=e.cm,i=t.display;Os(t);if(e.updateMaxLine){Ui(t)};e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;e.update=e.mustUpdate&&new Bt(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)};function Ss(e){e.updatedDisplay=e.mustUpdate&&gr(e.cm,e.update)};function Ls(e){var t=e.cm,i=t.display;if(e.updatedDisplay){si(t)};e.barMeasure=Tt(t);if(i.maxLineChanged&&!t.options.lineWrapping){e.adjustWidthTo=Dn(t,i.maxLine,i.maxLine.text.length).left+3;t.display.sizerWidth=e.adjustWidthTo;e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+K(t)+t.display.barWidth);e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-xe(t))};if(e.updatedDisplay||e.selectionChanged){e.preparedSelection=i.input.prepareSelection()}};function ks(e){var t=e.cm;if(e.adjustWidthTo!=null){t.display.sizer.style.minWidth=e.adjustWidthTo+"px";if(e.maxScrollLeft<t.doc.scrollLeft){ke(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0)};t.display.maxLineChanged=!1};var i=e.focus&&e.focus==Y();if(e.preparedSelection){t.display.input.showSelection(e.preparedSelection,i)};if(e.updatedDisplay||e.startHeight!=t.doc.height){ze(t,e.barMeasure)};if(e.updatedDisplay){yr(t,e.barMeasure)};if(e.selectionChanged){fr(t)};if(t.state.focused&&e.updateInput){t.display.input.reset(e.typing)};if(i){Xn(e.cm)}};function Ts(e){var t=e.cm,s=t.display,a=t.doc;if(e.updatedDisplay){ro(t,e.update)};if(s.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)){s.wheelStartX=s.wheelStartY=null};if(e.scrollTop!=null){Jn(t,e.scrollTop,e.forceScroll)};if(e.scrollLeft!=null){ke(t,e.scrollLeft,!0,!0)};if(e.scrollToPos){var u=ys(t,o(a,e.scrollToPos.from),o(a,e.scrollToPos.to),e.scrollToPos.margin);ms(t,u)};var n=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(n){for(var r=0;r<n.length;++r){if(!n[r].lines.length){p(n[r],"hide")}}};if(l){for(var i=0;i<l.length;++i){if(l[i].lines.length){p(l[i],"unhide")}}};if(s.wrapper.offsetHeight){a.scrollTop=t.display.scroller.scrollTop};if(e.changeObjs){p(t,"changes",t,e.changeObjs)};if(e.update){e.update.finish()}};function N(e,t){if(e.curOp){return t()};Te(e);try{return t()}finally{Me(e)}};function m(e,t){return function(){if(e.curOp){return t.apply(e,arguments)};Te(e);try{return t.apply(e,arguments)}finally{Me(e)}}};function L(e){return function(){if(this.curOp){return e.apply(this,arguments)};Te(this);try{return e.apply(this,arguments)}finally{Me(this)}}};function y(e){return function(){var t=this.cm;if(!t||t.curOp){return e.apply(this,arguments)};Te(t);try{return e.apply(this,arguments)}finally{Me(t)}}};function M(e,t,i,r){if(t==null){t=e.doc.first};if(i==null){i=e.doc.first+e.doc.size};if(!r){r=0};var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t};e.curOp.viewChanged=!0;if(t>=n.viewTo){if(te&&Bi(e.doc,t)<n.viewTo){le(e)}} +else if(i<=n.viewFrom){if(te&&fn(e.doc,i+r)>n.viewFrom){le(e)} +else{n.viewFrom+=r;n.viewTo+=r}} +else if(t<=n.viewFrom&&i>=n.viewTo){le(e)} +else if(t<=n.viewFrom){var u=ui(e,i,i+r,1);if(u){n.view=n.view.slice(u.index);n.viewFrom=u.lineN;n.viewTo+=r} +else{le(e)}} +else if(i>=n.viewTo){var a=ui(e,t,t,-1);if(a){n.view=n.view.slice(0,a.index);n.viewTo=a.lineN} +else{le(e)}} +else{var l=ui(e,t,t,-1),s=ui(e,i,i+r,1);if(l&&s){n.view=n.view.slice(0,l.index).concat(ri(e,l.lineN,s.lineN)).concat(n.view.slice(s.index));n.viewTo+=r} +else{le(e)}};var o=n.externalMeasured;if(o){if(i<o.lineN){o.lineN+=r} +else if(t<o.lineN+o.size){n.externalMeasured=null}}};function oe(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){r.externalMeasured=null};if(t<r.viewFrom||t>=r.viewTo){return};var o=r.view[Le(e,t)];if(o.node==null){return};var l=o.changes||(o.changes=[]);if(b(l,i)==-1){l.push(i)}};function le(e){e.display.viewFrom=e.display.viewTo=e.doc.first;e.display.view=[];e.display.viewOffset=0};function ui(e,t,i,r){var n=Le(e,t),s,o=e.display.view;if(!te||i==e.doc.first+e.doc.size){return{index:n,lineN:i}};var l=e.display.viewFrom;for(var a=0;a<n;a++){l+=o[a].size};if(l!=t){if(r>0){if(n==o.length-1){return null};s=(l+o[n].size)-t;n++} +else{s=l-t};t+=s;i+=s} +while(Bi(e.doc,i)!=i){if(n==(r<0?0:o.length-1)){return null};i+=r*o[n-(r<0?1:0)].size;n+=r};return{index:n,lineN:i}};function Ms(e,t,i){var r=e.display,n=r.view;if(n.length==0||t>=r.viewTo||i<=r.viewFrom){r.view=ri(e,t,i);r.viewFrom=t} +else{if(r.viewFrom>t){r.view=ri(e,t,r.viewFrom).concat(r.view)} +else if(r.viewFrom<t){r.view=r.view.slice(Le(e,t))};r.viewFrom=t;if(r.viewTo<i){r.view=r.view.concat(ri(e,r.viewTo,i))} +else if(r.viewTo>i){r.view=r.view.slice(0,Le(e,i))}};r.viewTo=i};function io(e){var r=e.display.view,n=0;for(var i=0;i<r.length;i++){var t=r[i];if(!t.hidden&&(!t.node||t.changes)){++n}};return n};function Mt(e,t){if(e.doc.highlightFrontier<e.display.viewTo){e.state.highlight.set(t,Ai(Ns,e))}};function Ns(e){var i=e.doc;if(i.highlightFrontier>=e.display.viewTo){return};var n=+new Date+e.options.workTime,t=mt(e,i.highlightFrontier),r=[];i.iter(t.line,Math.min(i.first+i.size,e.display.viewTo+500),function(o){if(t.line>=e.display.viewFrom){var u=o.styles,c=o.text.length>e.options.maxHighlightLength?we(i.mode,t.state):null,h=gn(e,o,t,!0);if(c){t.state=c};o.styles=h.styles;var s=o.styleClasses,l=h.classes;if(l){o.styleClasses=l} +else if(s){o.styleClasses=null};var f=!u||u.length!=o.styles.length||s!=l&&(!s||!l||s.bgClass!=l.bgClass||s.textClass!=l.textClass);for(var a=0;!f&&a<u.length;++a){f=u[a]!=o.styles[a]};if(f){r.push(t.line)};o.stateAfter=t.save();t.nextLine()} +else{if(o.text.length<=e.options.maxHighlightLength){qi(e,o.text,t)};o.stateAfter=t.line%5==0?t.save():null;t.nextLine()};if(+new Date>n){Mt(e,e.options.workDelay);return!0}});i.highlightFrontier=t.line;i.modeFrontier=Math.max(i.modeFrontier,t.line);if(r.length){N(e,function(){for(var t=0;t<r.length;t++){oe(e,r[t],"text")}})}};var Bt=function(e,t,i){var r=e.display;this.viewport=t;this.visible=hr(r,e.doc,t);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=xe(e);this.force=i;this.dims=sr(e);this.events=[]};Bt.prototype.signal=function(e,t){if(F(e,t)){this.events.push(arguments)}};Bt.prototype.finish=function(){var t=this;for(var e=0;e<this.events.length;e++){p.apply(null,t.events[e])}};function Os(e){var t=e.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=K(e)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=K(e)+"px";t.scrollbarsClipped=!0}};function As(e){if(e.hasFocus()){return null};var r=Y();if(!r||!ne(e.display.lineDiv,r)){return null};var i={activeElt:r};if(window.getSelection){var t=window.getSelection();if(t.anchorNode&&t.extend&&ne(e.display.lineDiv,t.anchorNode)){i.anchorNode=t.anchorNode;i.anchorOffset=t.anchorOffset;i.focusNode=t.focusNode;i.focusOffset=t.focusOffset}};return i};function Ws(e){if(!e||!e.activeElt||e.activeElt==Y()){return};e.activeElt.focus();if(e.anchorNode&&ne(document.body,e.anchorNode)&&ne(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset);i.collapse(!1);t.removeAllRanges();t.addRange(i);t.extend(e.focusNode,e.focusOffset)}};function gr(e,i){var r=e.display,l=e.doc;if(i.editorIsHidden){le(e);return!1};if(!i.force&&i.visible.from>=r.viewFrom&&i.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&io(e)==0){return!1};if(Zn(e)){le(e);i.dims=sr(e)};var u=l.first+l.size,n=Math.max(i.visible.from-e.options.viewportMargin,l.first),o=Math.min(u,i.visible.to+e.options.viewportMargin);if(r.viewFrom<n&&n-r.viewFrom<20){n=Math.max(l.first,r.viewFrom)};if(r.viewTo>o&&r.viewTo-o<20){o=Math.min(u,r.viewTo)};if(te){n=Bi(e.doc,n);o=fn(e.doc,o)};var a=n!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=i.wrapperHeight||r.lastWrapWidth!=i.wrapperWidth;Ms(e,n,o);r.viewOffset=q(t(e.doc,r.viewFrom));e.display.mover.style.top=r.viewOffset+"px";var s=io(e);if(!a&&s==0&&!i.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)){return!1};var f=As(e);if(s>4){r.lineDiv.style.display="none"};Ds(e,r.updateLineNumbers,i.dims);if(s>4){r.lineDiv.style.display=""};r.renderedView=r.view;Ws(f);re(r.cursorDiv);re(r.selectionDiv);r.gutters.style.height=r.sizer.style.minHeight=0;if(a){r.lastWrapHeight=i.wrapperHeight;r.lastWrapWidth=i.wrapperWidth;Mt(e,400)};r.updateLineNumbers=null;return!0};function ro(e,t){var i=t.viewport;for(var n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==xe(e)){if(i&&i.top!=null){i={top:Math.min(e.doc.height+Ji(e.display)-er(e),i.top)}};t.visible=hr(e.display,e.doc,i);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo){break}};if(!gr(e,t)){break};si(e);var r=Tt(e);Ct(e);ze(e,r);yr(e,r);t.force=!1};t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo){t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo);e.display.reportedViewFrom=e.display.viewFrom;e.display.reportedViewTo=e.display.viewTo}};function vr(e,t){var i=new Bt(e,t);if(gr(e,i)){si(e);ro(e,i);var r=Tt(e);Ct(e);ze(e,r);yr(e,r);i.finish()}};function Ds(e,t,i){var s=e.display,d=e.options.lineNumbers,a=s.lineDiv,n=a.firstChild;function c(t){var i=t.nextSibling;if(x&&I&&e.display.currentWheelTarget==t){t.style.display="none"} +else{t.parentNode.removeChild(t)};return i};var f=s.view,o=s.viewFrom;for(var l=0;l<f.length;l++){var r=f[l];if(r.hidden){} +else if(!r.node||r.node.parentNode!=a){var h=ls(e,r,o,i);a.insertBefore(h,n)} +else{while(n!=r.node){n=c(n)};var u=d&&t!=null&&t<=o&&r.lineNumber;if(r.changes){if(b(r.changes,"gutter")>-1){u=!1};kn(e,r,o,i)};if(u){re(r.lineNumber);r.lineNumber.appendChild(document.createTextNode(Ei(e.options,o)))};n=r.node.nextSibling};o+=r.size} +while(n){n=c(n)}};function mr(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"};function yr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";e.display.heightForcer.style.top=t.docHeight+"px";e.display.gutters.style.height=(t.docHeight+e.display.barHeight+K(e))+"px"};function no(e){var r=e.display.gutters,l=e.options.gutters;re(r);var t=0;for(;t<l.length;++t){var n=l[t],o=r.appendChild(i("div",null,"CodeMirror-gutter "+n));if(n=="CodeMirror-linenumbers"){e.display.lineGutter=o;o.style.width=(e.display.lineNumWidth||1)+"px"}};r.style.display=t?"":"none";mr(e)};function br(e){var t=b(e.gutters,"CodeMirror-linenumbers");if(t==-1&&e.lineNumbers){e.gutters=e.gutters.concat(["CodeMirror-linenumbers"])} +else if(t>-1&&!e.lineNumbers){e.gutters=e.gutters.slice(0);e.gutters.splice(t,1)}};var Rt=0,A=null;if(l){A=-.53} +else if(ie){A=15} +else if(Kt){A=-.7} +else if(Yr){A=-1/3};function oo(e){var i=e.wheelDeltaX,t=e.wheelDeltaY;if(i==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS){i=e.detail};if(t==null&&e.detail&&e.axis==e.VERTICAL_AXIS){t=e.detail} +else if(t==null){t=e.wheelDelta};return{x:i,y:t}};function Hs(e){var t=oo(e);t.x*=A;t.y*=A;return t};function lo(e,t){var d=oo(t),l=d.x,n=d.y,i=e.display,r=i.scroller,p=r.scrollWidth>r.clientWidth,c=r.scrollHeight>r.clientHeight;if(!(l&&p||n&&c)){return};if(n&&I&&x){outer:for(var o=t.target,h=i.view;o!=r;o=o.parentNode){for(var f=0;f<h.length;f++){if(h[f].node==o){e.display.currentWheelTarget=o;break outer}}}};if(l&&!ie&&!E&&A!=null){if(n&&c){kt(e,Math.max(0,r.scrollTop+n*A))};ke(e,Math.max(0,r.scrollLeft+l*A));if(!n||(n&&c)){T(t)};i.wheelStartX=null;return};if(n&&A!=null){var a=n*A,s=e.doc.scrollTop,u=s+i.wrapper.clientHeight;if(a<0){s=Math.max(0,s+a-50)} +else{u=Math.min(e.doc.height,u+a+50)};vr(e,{top:s,bottom:u})};if(Rt<20){if(i.wheelStartX==null){i.wheelStartX=r.scrollLeft;i.wheelStartY=r.scrollTop;i.wheelDX=l;i.wheelDY=n;setTimeout(function(){if(i.wheelStartX==null){return};var e=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,n=(t&&i.wheelDY&&t/i.wheelDY)||(e&&i.wheelDX&&e/i.wheelDX);i.wheelStartX=i.wheelStartY=null;if(!n){return};A=(A*Rt+n)/(Rt+1)++Rt},200)} +else{i.wheelDX+=l;i.wheelDY+=n}}};var O=function(e,t){this.ranges=e;this.primIndex=t};O.prototype.primary=function(){return this.ranges[this.primIndex]};O.prototype.equals=function(e){var n=this;if(e==this){return!0};if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length){return!1};for(var t=0;t<this.ranges.length;t++){var i=n.ranges[t],r=e.ranges[t];if(!Ii(i.anchor,r.anchor)||!Ii(i.head,r.head)){return!1}};return!0};O.prototype.deepCopy=function(){var t=this,i=[];for(var e=0;e<this.ranges.length;e++){i[e]=new s(zi(t.ranges[e].anchor),zi(t.ranges[e].head))};return new O(i,this.primIndex)};O.prototype.somethingSelected=function(){var t=this;for(var e=0;e<this.ranges.length;e++){if(!t.ranges[e].empty()){return!0}};return!1};O.prototype.contains=function(e,t){var o=this;if(!t){t=e};for(var i=0;i<this.ranges.length;i++){var r=o.ranges[i];if(n(t,r.from())>=0&&n(e,r.to())<=0){return i}};return-1};var s=function(e,t){this.anchor=e;this.head=t};s.prototype.from=function(){return Zt(this.anchor,this.head)};s.prototype.to=function(){return qt(this.anchor,this.head)};s.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function R(e,t){var f=e[t];e.sort(function(e,t){return n(e.from(),t.from())});t=b(e,f);for(var r=1;r<e.length;r++){var o=e[r],i=e[r-1];if(n(i.to(),o.from())>=0){var l=Zt(i.from(),o.from()),a=qt(i.to(),o.to()),u=i.empty()?o.from()==o.head:i.from()==i.head;if(r<=t){--t};e.splice(--r,2,new s(u?a:l,u?l:a))}};return new O(e,t)};function se(e,t){return new O([new s(e,t||e)],0)};function ae(t){if(!t.text){return t.to};return e(t.from.line+t.text.length-1,a(t.text).length+(t.text.length==1?t.from.ch:0))};function so(t,i){if(n(t,i.from)<0){return t};if(n(t,i.to)<=0){return ae(i)};var o=t.line+i.text.length-(i.to.line-i.from.line)-1,r=t.ch;if(t.line==i.to.line){r+=ae(i).ch-i.to.ch};return e(o,r)};function wr(e,t){var n=[];for(var i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new s(so(r.anchor,t),so(r.head,t)))};return R(n,e.sel.primIndex)};function ao(t,i,r){if(t.line==i.line){return e(r.line,t.ch-i.ch+r.ch)} +else{return e(r.line+(t.line-i.line),t.ch)}};function Fs(t,i,r){var c=[],a=e(t.first,0),h=a;for(var o=0;o<i.length;o++){var u=i[o],l=ao(u.from,a,h),f=ao(ae(u),a,h);a=u.to;h=f;if(r=="around"){var d=t.sel.ranges[o],p=n(d.head,d.anchor)<0;c[o]=new s(p?f:l,p?l:f)} +else{c[o]=new s(l,l)}};return new O(c,t.sel.primIndex)};function xr(e){e.doc.mode=ji(e.options,e.doc.modeOption);Nt(e)};function Nt(e){e.doc.iter(function(e){if(e.stateAfter){e.stateAfter=null};if(e.styles){e.styles=null}});e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first;Mt(e,100);e.state.modeGen++;if(e.curOp){M(e)}};function uo(e,t){return t.from.ch==0&&t.to.ch==0&&a(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)};function Cr(e,i,r,n){function d(e){return r?r[e]:null};function c(e,t,r){Kl(e,t,r,n);w(e,"change",e,i)};function g(e,t){var r=[];for(var i=e;i<t;++i){r.push(new We(o[i],d(i),n))};return r};var l=i.from,u=i.to,o=i.text,s=t(e,l.line),f=t(e,u.line),v=a(o),p=d(o.length-1),h=u.line-l.line;if(i.full){e.insert(0,g(0,o.length));e.remove(o.length,e.size-o.length)} +else if(uo(e,i)){var y=g(0,o.length-1);c(f,f.text,p);if(h){e.remove(l.line,h)};if(y.length){e.insert(l.line,y)}} +else if(s==f){if(o.length==1){c(s,s.text.slice(0,l.ch)+v+s.text.slice(u.ch),p)} +else{var m=g(1,o.length-1);m.push(new We(v+s.text.slice(u.ch),p,n));c(s,s.text.slice(0,l.ch)+o[0],d(0));e.insert(l.line+1,m)}} +else if(o.length==1){c(s,s.text.slice(0,l.ch)+o[0]+f.text.slice(u.ch),d(0));e.remove(l.line+1,h)} +else{c(s,s.text.slice(0,l.ch)+o[0],d(0));c(f,v+f.text.slice(u.ch),p);var b=g(1,o.length-1);if(h>1){e.remove(l.line+1,h-1)};e.insert(l.line+1,b)};w(e,"change",e,i)};function Ne(e,t,i){function r(e,n,o){if(e.linked){for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc==n){continue};var s=o&&l.sharedHist;if(i&&!s){continue};t(l.doc,s);r(l.doc,e,s)}}};r(e,null,!0)};function fo(e,t){if(t.cm){throw new Error("This document is already in use.")};e.doc=t;t.cm=e;ur(e);xr(e);co(e);if(!e.options.lineWrapping){Ui(e)};e.options.mode=t.modeOption;M(e)};function co(e){;(e.doc.direction=="rtl"?ge:de)(e.display.lineDiv,"CodeMirror-rtl")};function Ps(e){N(e,function(){co(e);M(e)})};function fi(e){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=e||1};function Sr(e,t){var i={from:zi(t.from),to:ae(t),text:me(e,t.from,t.to)};go(e,i,t.from.line,t.to.line+1);Ne(e,function(e){return go(e,i,t.from.line,t.to.line+1)},!0);return i};function ho(e){while(e.length){var t=a(e);if(t.ranges){e.pop()} +else{break}}};function Es(e,t){if(t){ho(e.done);return a(e.done)} +else if(e.done.length&&!a(e.done).ranges){return a(e.done)} +else if(e.done.length>1&&!e.done[e.done.length-2].ranges){e.done.pop();return a(e.done)}};function po(e,t,i,r){var o=e.history;o.undone.length=0;var f=+new Date,l,s;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&((t.origin.charAt(0)=="+"&&e.cm&&o.lastModTime>f-e.cm.options.historyEventDelay)||t.origin.charAt(0)=="*"))&&(l=Es(o,o.lastOp==r))){s=a(l.changes);if(n(t.from,t.to)==0&&n(t.from,s.to)==0){s.to=ae(t)} +else{l.changes.push(Sr(e,t))}} +else{var u=a(o.done);if(!u||!u.ranges){ci(e.sel,o.done)};l={changes:[Sr(e,t)],generation:o.generation};o.done.push(l);while(o.done.length>o.undoDepth){o.done.shift();if(!o.done[0].ranges){o.done.shift()}}};o.done.push(i);o.generation=++o.maxGeneration;o.lastModTime=o.lastSelTime=f;o.lastOp=o.lastSelOp=r;o.lastOrigin=o.lastSelOrigin=t.origin;if(!s){p(e,"historyAdded")}};function Is(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)};function zs(e,t,i,r){var n=e.history,o=r&&r.origin;if(i==n.lastSelOp||(o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Is(e,o,a(n.done),t)))){n.done[n.done.length-1]=t} +else{ci(t,n.done)};n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=i;if(r&&r.clearRedo!==!1){ho(n.undone)}};function ci(e,t){var i=a(t);if(!(i&&i.ranges&&i.equals(e))){t.push(e)}};function go(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(i){if(i.markedSpans){(n||(n=t["spans_"+e.id]={}))[o]=i.markedSpans};++o})};function Rs(e){if(!e){return null};var t;for(var i=0;i<e.length;++i){if(e[i].marker.explicitlyCleared){if(!t){t=e.slice(0,i)}} +else if(t){t.push(e[i])}};return!t?e:t.length?t:null};function Bs(e,t){var n=t["spans_"+e.id];if(!n){return null};var r=[];for(var i=0;i<t.text.length;++i){r.push(Rs(n[i]))};return r};function vo(e,t){var i=Bs(e,t),a=Ri(e,t);if(!i){return a};if(!a){return i};for(var n=0;n<i.length;++n){var o=i[n],r=a[n];if(o&&r){spans:for(var s=0;s<r.length;++s){var u=r[s];for(var l=0;l<o.length;++l){if(o[l].marker==u.marker){continue;spans}};o.push(u)}} +else if(r){i[n]=r}};return i};function Re(e,t,i){var f=[];for(var u=0;u<e.length;++u){var o=e[u];if(o.ranges){f.push(i?O.prototype.deepCopy.call(o):o);continue};var h=o.changes,s=[];f.push({changes:s});for(var l=0;l<h.length;++l){var r=h[l],c=(void 0);s.push({from:r.from,to:r.to,text:r.text});if(t){for(var n in r){if(c=n.match(/^spans_(\d+)$/)){if(b(t,Number(c[1]))>-1){a(s)[n]=r[n];delete r[n]}}}}}};return f};function Lr(e,t,i,r){if(r){var o=e.anchor;if(i){var l=n(t,o)<0;if(l!=(n(i,o)<0)){o=t;t=i} +else if(l!=(n(t,i)<0)){t=i}};return new s(o,t)} +else{return new s(i||t,t)}};function hi(e,t,i,r,n){if(n==null){n=e.cm&&(e.cm.display.shift||e.extend)};C(e,new O([Lr(e.sel.primary(),t,i,n)],0),r)};function mo(e,t,i){var n=[],l=e.cm&&(e.cm.display.shift||e.extend);for(var r=0;r<e.sel.ranges.length;r++){n[r]=Lr(e.sel.ranges[r],t[r],null,l)};var o=R(n,e.sel.primIndex);C(e,o,i)};function kr(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i;C(e,R(n,e.sel.primIndex),r)};function yo(e,t,i,r){C(e,se(t,i),r)};function Gs(e,t,i){var r={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var i=0;i<t.length;i++){r.ranges[i]=new s(o(e,t[i].anchor),o(e,t[i].head))}},origin:i&&i.origin};p(e,"beforeSelectionChange",e,r);if(e.cm){p(e.cm,"beforeSelectionChange",e.cm,r)};if(r.ranges!=t.ranges){return R(r.ranges,r.ranges.length-1)} +else{return t}};function bo(e,t,i){var r=e.history.done,n=a(r);if(n&&n.ranges){r[r.length-1]=t;di(e,t,i)} +else{C(e,t,i)}};function C(e,t,i){di(e,t,i);zs(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)};function di(e,t,i){if(F(e,"beforeSelectionChange")||e.cm&&F(e.cm,"beforeSelectionChange")){t=Gs(e,t,i)};var r=i&&i.bias||(n(t.primary().head,e.sel.primary().head)<0?-1:1);wo(e,Co(e,t,r,!0));if(!(i&&i.scroll===!1)&&e.cm){Ie(e.cm)}};function wo(e,t){if(t.equals(e.sel)){return};e.sel=t;if(e.cm){e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0;cn(e.cm)};w(e,"cursorActivity",e)};function xo(e){wo(e,Co(e,e.sel,null,!1))};function Co(e,t,i,r){var o;for(var n=0;n<t.ranges.length;n++){var l=t.ranges[n],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[n],u=Tr(e,l.anchor,a&&a.anchor,i,r),f=Tr(e,l.head,a&&a.head,i,r);if(o||u!=l.anchor||f!=l.head){if(!o){o=t.ranges.slice(0,n)};o[n]=new s(u,f)}};return o?R(o,t.primIndex):t};function Be(e,i,r,o,l){var f=t(e,i.line);if(f.markedSpans){for(var h=0;h<f.markedSpans.length;++h){var u=f.markedSpans[h],s=u.marker;if((u.from==null||(s.inclusiveLeft?u.from<=i.ch:u.from<i.ch))&&(u.to==null||(s.inclusiveRight?u.to>=i.ch:u.to>i.ch))){if(l){p(s,"beforeCursorEnter");if(s.explicitlyCleared){if(!f.markedSpans){break} +else{--h;continue}}};if(!s.atomic){continue};if(r){var a=s.find(o<0?1:-1),d=(void 0);if(o<0?s.inclusiveRight:s.inclusiveLeft){a=So(e,a,-o,a&&a.line==i.line?f:null)};if(a&&a.line==i.line&&(d=n(a,r))&&(o<0?d<0:d>0)){return Be(e,a,i,o,l)}};var c=s.find(o<0?-1:1);if(o<0?s.inclusiveLeft:s.inclusiveRight){c=So(e,c,o,c.line==i.line?f:null)};return c?Be(e,c,i,o,l):null}}};return i};function Tr(t,i,r,n,o){var l=n||1,s=Be(t,i,r,l,o)||(!o&&Be(t,i,r,l,!0))||Be(t,i,r,-l,o)||(!o&&Be(t,i,r,-l,!0));if(!s){t.cantEdit=!0;return e(t.first,0)};return s};function So(i,r,n,l){if(n<0&&r.ch==0){if(r.line>i.first){return o(i,e(r.line-1))} +else{return null}} +else if(n>0&&r.ch==(l||t(i,r.line)).text.length){if(r.line<i.first+i.size-1){return e(r.line+1,0)} +else{return null}} +else{return new e(r.line,r.ch+n)}};function Lo(t){t.setSelection(e(t.firstLine(),0),e(t.lastLine()),G)};function ko(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};if(i){r.update=function(t,i,n,l){if(t){r.from=o(e,t)};if(i){r.to=o(e,i)};if(n){r.text=n};if(l!==undefined){r.origin=l}}};p(e,"beforeChange",e,r);if(e.cm){p(e.cm,"beforeChange",e.cm,r)};if(r.canceled){return null};return{from:r.from,to:r.to,text:r.text,origin:r.origin}};function Ge(e,t,i){if(e.cm){if(!e.cm.curOp){return m(e.cm,Ge)(e,t,i)};if(e.cm.state.suppressEdits){return}};if(F(e,"beforeChange")||e.cm&&F(e.cm,"beforeChange")){t=ko(e,t,!0);if(!t){return}};var n=Gr&&!i&&Dl(e,t.from,t.to);if(n){for(var r=n.length-1;r>=0;--r){To(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin})}} +else{To(e,t)}};function To(e,t){if(t.text.length==1&&t.text[0]==""&&n(t.from,t.to)==0){return};var r=wr(e,t);po(e,t,r,e.cm?e.cm.curOp.id:NaN);Ot(e,t,r,Ri(e,t));var i=[];Ne(e,function(e,r){if(!r&&b(i,e.history)==-1){Ao(e.history,t);i.push(e.history)};Ot(e,t,null,Ri(e,t))})};function pi(e,t,i){if(e.cm&&e.cm.state.suppressEdits&&!i){return};var n=e.history,r,h=e.sel,o=t=="undo"?n.done:n.undone,u=t=="undo"?n.undone:n.done,l=0;for(;l<o.length;l++){r=o[l];if(i?r.ranges&&!r.equals(e.sel):!r.ranges){break}};if(l==o.length){return};n.lastOrigin=n.lastSelOrigin=null;for(;;){r=o.pop();if(r.ranges){ci(r,u);if(i&&!r.equals(e.sel)){C(e,r,{clearRedo:!1});return};h=r} +else{break}};var c=[];ci(h,u);u.push({changes:c,generation:n.generation});n.generation=r.generation||++n.maxGeneration;var d=F(e,"beforeChange")||e.cm&&F(e.cm,"beforeChange"),p=function(i){var n=r.changes[i];n.origin=t;if(d&&!ko(e,n,!1)){o.length=0;return{}};c.push(Sr(e,n));var s=i?wr(e,n):a(o);Ot(e,n,s,vo(e,n));if(!i&&e.cm){e.cm.scrollIntoView({from:n.from,to:ae(n)})};var l=[];Ne(e,function(e,t){if(!t&&b(l,e.history)==-1){Ao(e.history,n);l.push(e.history)};Ot(e,n,null,vo(e,n))})};for(var s=r.changes.length-1;s>=0;--s){var f=p(s);if(f)return f.v}};function Mo(t,i){if(i==0){return};t.first+=i;t.sel=new O(jt(t.sel.ranges,function(t){return new s(e(t.anchor.line+i,t.anchor.ch),e(t.head.line+i,t.head.ch))}),t.sel.primIndex);if(t.cm){M(t.cm,t.first,t.first-i,i);for(var n=t.cm.display,r=n.viewFrom;r<n.viewTo;r++){oe(t.cm,r,"gutter")}}};function Ot(i,r,n,o){if(i.cm&&!i.cm.curOp){return m(i.cm,Ot)(i,r,n,o)};if(r.to.line<i.first){Mo(i,r.text.length-1-(r.to.line-r.from.line));return};if(r.from.line>i.lastLine()){return};if(r.from.line<i.first){var s=r.text.length-1-(i.first-r.from.line);Mo(i,s);r={from:e(i.first,0),to:e(r.to.line+s,r.to.ch),text:[a(r.text)],origin:r.origin}};var l=i.lastLine();if(r.to.line>l){r={from:r.from,to:e(l,t(i,l).text.length),text:[r.text[0]],origin:r.origin}};r.removed=me(i,r.from,r.to);if(!n){n=wr(i,r)};if(i.cm){Us(i.cm,r,o)} +else{Cr(i,r,o)};di(i,n,G)};function Us(e,i,r){var o=e.doc,l=e.display,n=i.from,s=i.to,a=!1,f=n.line;if(!e.options.lineWrapping){f=u(V(t(o,n.line)));o.iter(f,s.line+1,function(e){if(e==l.maxLine){a=!0;return!0}})};if(o.sel.contains(i.from,i.to)>-1){cn(e)};Cr(o,i,r,Un(e));if(!e.options.lineWrapping){o.iter(f,n.line+i.text.length,function(e){var t=ti(e);if(t>l.maxLineLength){l.maxLine=e;l.maxLineLength=t;l.maxLineChanged=!0;a=!1}});if(a){e.curOp.updateMaxLine=!0}};Vl(o,n.line);Mt(e,400);var p=i.text.length-(s.line-n.line)-1;if(i.full){M(e)} +else if(n.line==s.line&&i.text.length==1&&!uo(e.doc,i)){oe(e,n.line,"text")} +else{M(e,n.line,s.line+1,p)};var h=F(e,"changes"),d=F(e,"change");if(d||h){var c={from:n,to:s,text:i.text,removed:i.removed,origin:i.origin};if(d){w(e,"change",e,c)};if(h){(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(c)}};e.display.selForContextMenu=null};function Ue(e,t,i,r,o){if(!r){r=i};if(n(r,i)<0){var l;(l=[r,i],i=l[0],r=l[1],l)};if(typeof t=="string"){t=e.splitLines(t)};Ge(e,{from:i,to:r,text:t,origin:o})};function No(e,t,i,r){if(i<e.line){e.line+=r} +else if(t<e.line){e.line=t;e.ch=0}};function Oo(t,i,r,n){for(var s=0;s<t.length;++s){var o=t[s],f=!0;if(o.ranges){if(!o.copied){o=t[s]=o.deepCopy();o.copied=!0};for(var a=0;a<o.ranges.length;a++){No(o.ranges[a].anchor,i,r,n);No(o.ranges[a].head,i,r,n)};continue};for(var u=0;u<o.changes.length;++u){var l=o.changes[u];if(r<l.from.line){l.from=e(l.from.line+n,l.from.ch);l.to=e(l.to.line+n,l.to.ch)} +else if(i<=l.to.line){f=!1;break}};if(!f){t.splice(0,s+1);s=0}}};function Ao(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;Oo(e.done,i,r,n);Oo(e.undone,i,r,n)};function At(e,i,r,n){var o=i,l=i;if(typeof i=="number"){l=t(e,en(e,i))} +else{o=u(i)};if(o==null){return null};if(n(l,o)&&e.cm){oe(e.cm,o,r)};return l};function Wt(e){var r=this;this.lines=e;this.parent=null;var i=0;for(var t=0;t<e.length;++t){e[t].parent=r;i+=e[t].height};this.height=i};Wt.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){var n=this;for(var r=e,o=e+t;r<o;++r){var i=n.lines[r];n.height-=i.height;Xl(i);w(i,"delete")};this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){var n=this;this.height+=i;this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r){t[r].parent=n}},iterN:function(e,t,i){var n=this;for(var r=e+t;e<r;++e){if(i(n.lines[e])){return!0}}}};function Dt(e){var o=this;this.children=e;var r=0,n=0;for(var i=0;i<e.length;++i){var t=e[i];r+=t.chunkSize();n+=t.height;t.parent=o};this.size=r;this.height=n;this.parent=null};Dt.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var l=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=l.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),a=i.height;i.removeInner(e,o);l.height-=a-i.height;if(r==o){l.children.splice(n--,1);i.parent=null};if((t-=o)==0){break};e=0} +else{e-=r}};if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Wt))){var s=[];this.collapse(s);this.children=[new Wt(s)];this.children[0].parent=this}},collapse:function(e){var i=this;for(var t=0;t<this.children.length;++t){i.children[t].collapse(e)}},insertInner:function(e,t,i){var o=this;this.size+=t.length;this.height+=i;for(var n=0;n<this.children.length;++n){var r=o.children[n],u=r.chunkSize();if(e<=u){r.insertInner(e,t,i);if(r.lines&&r.lines.length>50){var a=r.lines.length%25+25;for(var s=a;s<r.lines.length;){var l=new Wt(r.lines.slice(s,s+=25));r.height-=l.height;o.children.splice(++n,0,l);l.parent=o};r.lines=r.lines.slice(0,a);o.maybeSpill()};break};e-=u}},maybeSpill:function(){if(this.children.length<=10){return};var e=this;do{var n=e.children.splice(e.children.length-5,5),t=new Dt(n);if(!e.parent){var i=new Dt(e.children);i.parent=e;e.children=[i,t];e=i} +else{e.size-=t.size;e.height-=t.height;var r=b(e.parent.children,e);e.parent.children.splice(r+1,0,t)};t.parent=e.parent} +while(e.children.length>10)e.parent.maybeSpill()},iterN:function(e,t,i){var s=this;for(var n=0;n<this.children.length;++n){var l=s.children[n],r=l.chunkSize();if(e<r){var o=Math.min(t,r-e);if(l.iterN(e,o,i)){return!0};if((t-=o)==0){break};e=0} +else{e-=r}}}};var tt=function(e,t,i){var n=this;if(i){for(var r in i){if(i.hasOwnProperty(r)){n[r]=i[r]}}};this.doc=e;this.node=t};tt.prototype.clear=function(){var l=this,e=this.doc.cm,t=this.line.widgets,i=this.line,n=u(i);if(n==null||!t){return};for(var r=0;r<t.length;++r){if(t[r]==l){t.splice(r--,1)}};if(!t.length){i.widgets=null};var o=bt(this);U(i,Math.max(0,i.height-o));if(e){N(e,function(){Wo(e,i,-o);oe(e,n,"widget")});w(e,"lineWidgetCleared",e,this,n)}};tt.prototype.changed=function(){var r=this,n=this.height,e=this.doc.cm,t=this.line;this.height=null;var i=bt(this)-n;if(!i){return};U(t,t.height+i);if(e){N(e,function(){e.curOp.forceUpdate=!0;Wo(e,t,i);w(e,"lineWidgetChanged",e,r,u(t))})}};Pe(tt);function Wo(e,t,i){if(q(t)<((e.curOp&&e.curOp.scrollTop)||e.doc.scrollTop)){pr(e,i)}};function Vs(e,t,i,r){var n=new tt(e,i,r),o=e.cm;if(o&&n.noHScroll){o.display.alignWidgets=!0};At(e,t,"widget",function(t){var i=t.widgets||(t.widgets=[]);if(n.insertAt==null){i.push(n)} +else{i.splice(Math.min(i.length-1,Math.max(0,n.insertAt)),0,n)};n.line=t;if(o&&!be(e,t)){var r=q(t)<e.scrollTop;U(t,t.height+bt(n));if(r){pr(o,n.height)};o.curOp.forceUpdate=!0};return!0});w(o,"lineWidgetAdded",o,n,typeof t=="number"?t:u(t));return n};var Er=0,ee=function(e,t){this.lines=[];this.type=t;this.doc=e;this.id=++Er};ee.prototype.clear=function(){var i=this;if(this.explicitlyCleared){return};var e=this.doc.cm,h=e&&!e.curOp;if(h){Te(e)};if(F(this,"clear")){var a=this.find();if(a){w(this,"clear",a.from,a.to)}};var n=null,s=null;for(var l=0;l<this.lines.length;++l){var t=i.lines[l],r=dt(t.markedSpans,i);if(e&&!i.collapsed){oe(e,u(t),"text")} +else if(e){if(r.to!=null){s=u(t)};if(r.from!=null){n=u(t)}};t.markedSpans=Nl(t.markedSpans,r);if(r.from==null&&i.collapsed&&!be(i.doc,t)&&e){U(t,Ce(e.display))}};if(e&&this.collapsed&&!e.options.lineWrapping){for(var o=0;o<this.lines.length;++o){var f=V(i.lines[o]),c=ti(f);if(c>e.display.maxLineLength){e.display.maxLine=f;e.display.maxLineLength=c;e.display.maxLineChanged=!0}}};if(n!=null&&e&&this.collapsed){M(e,n,s+1)};this.lines.length=0;this.explicitlyCleared=!0;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=!1;if(e){xo(e.doc)}};if(e){w(e,"markerCleared",e,this,n,s)};if(h){Me(e)};if(this.parent){this.parent.clear()}};ee.prototype.find=function(t,i){var a=this;if(t==null&&this.type=="bookmark"){t=1};var o,s;for(var l=0;l<this.lines.length;++l){var r=a.lines[l],n=dt(r.markedSpans,a);if(n.from!=null){o=e(i?r:u(r),n.from);if(t==-1){return o}};if(n.to!=null){s=e(i?r:u(r),n.to);if(t==1){return s}}};return o&&{from:o,to:s}};ee.prototype.changed=function(){var r=this,i=this.find(-1,!0),t=this,e=this.doc.cm;if(!i||!e){return};N(e,function(){var n=i.line,a=u(i.line),l=tr(e,a);if(l){Fn(l);e.curOp.selectionChanged=e.curOp.forceUpdate=!0};e.curOp.updateMaxLine=!0;if(!be(t.doc,n)&&t.height!=null){var s=t.height;t.height=null;var o=bt(t)-s;if(o){U(n,n.height+o)}};w(e,"markerChanged",e,r)})};ee.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||b(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}};this.lines.push(e)};ee.prototype.detachLine=function(e){this.lines.splice(b(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};Pe(ee);function Ve(e,t,i,o,s){if(o&&o.shared){return Ks(e,t,i,o,s)};if(e.cm&&!e.cm.curOp){return m(e.cm,Ve)(e,t,i,o,s)};var l=new ee(e,s),h=n(t,i);if(o){ve(o,l,!1)};if(h>0||h==0&&l.clearWhenEmpty!==!1){return l};if(l.replacedWith){l.collapsed=!0;l.widgetNode=Fe("span",[l.replacedWith],"CodeMirror-widget");if(!o.handleMouseEvents){l.widgetNode.setAttribute("cm-ignore-events","true")};if(o.insertLeft){l.widgetNode.insertLeft=!0}};if(l.collapsed){if(un(e,t.line,t,i,l)||t.line!=i.line&&un(e,i.line,t,i,l)){throw new Error("Inserting collapsed marker partially overlapping an existing one")};Ml()};if(l.addToHistory){po(e,{from:t,to:i,origin:"markText"},e.sel,NaN)};var u=t.line,a=e.cm,c;e.iter(u,i.line+1,function(e){if(a&&l.collapsed&&!a.options.lineWrapping&&V(e)==a.display.maxLine){c=!0};if(l.collapsed&&u!=t.line){U(e,0)};Ol(e,new Qt(l,u==t.line?t.ch:null,u==i.line?i.ch:null))++u});if(l.collapsed){e.iter(t.line,i.line+1,function(t){if(be(e,t)){U(t,0)}})};if(l.clearOnEnter){r(l,"beforeCursorEnter",function(){return l.clear()})};if(l.readOnly){Tl();if(e.history.done.length||e.history.undone.length){e.clearHistory()}};if(l.collapsed){l.id=++Er;l.atomic=!0};if(a){if(c){a.curOp.updateMaxLine=!0};if(l.collapsed){M(a,t.line,i.line+1)} +else if(l.className||l.title||l.startStyle||l.endStyle||l.css){for(var f=t.line;f<=i.line;f++){oe(a,f,"text")}};if(l.atomic){xo(a.doc)};w(a,"markerAdded",a,l)};return l};var et=function(e,t){var r=this;this.markers=e;this.primary=t;for(var i=0;i<e.length;++i){e[i].parent=r}};et.prototype.clear=function(){var t=this;if(this.explicitlyCleared){return};this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e){t.markers[e].clear()};w(this,"clear")};et.prototype.find=function(e,t){return this.primary.find(e,t)};Pe(et);function Ks(e,t,i,r,n){r=ve(r);r.shared=!1;var l=[Ve(e,t,i,r,n)],s=l[0],u=r.widgetNode;Ne(e,function(e){if(u){r.widgetNode=u.cloneNode(!0)};l.push(Ve(e,o(e,t),o(e,i),r,n));for(var f=0;f<e.linked.length;++f){if(e.linked[f].isParent){return}};s=a(l)});return new et(l,s)};function Do(t){return t.findMarks(e(t.first,0),t.clipPos(e(t.lastLine())),function(e){return e.parent})};function Xs(e,t){for(var r=0;r<t.length;r++){var i=t[r],l=i.find(),s=e.clipPos(l.from),a=e.clipPos(l.to);if(n(s,a)){var o=Ve(e,s,a,i.primary,i.primary.type);i.markers.push(o);o.parent=i}}};function js(e){var i=function(t){var i=e[t],o=[i.primary.doc];Ne(i.primary.doc,function(e){return o.push(e)});for(var r=0;r<i.markers.length;r++){var n=i.markers[r];if(b(o,n.doc)==-1){n.parent=null;i.markers.splice(r--,1)}}};for(var t=0;t<e.length;t++)i(t)};var al=0,k=function(t,i,r,n,o){if(!(this instanceof k)){return new k(t,i,r,n,o)};if(r==null){r=0};Dt.call(this,[new Wt([new We("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=r;var l=e(r,0);this.sel=se(l);this.history=new fi(null);this.id=++al;this.modeOption=i;this.lineSep=n;this.direction=(o=="rtl")?"rtl":"ltr";this.extend=!1;if(typeof t=="string"){t=this.splitLines(t)};Cr(this,{from:l,to:l,text:t});C(this,se(l),G)};k.prototype=Zr(Dt.prototype,{constructor:k,iter:function(e,t,i){if(i){this.iterN(e-this.first,t-e,i)} +else{this.iterN(this.first,this.first+this.size,e)}},insert:function(e,t){var r=0;for(var i=0;i<t.length;++i){r+=t[i].height};this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Pi(this,this.first,this.first+this.size);if(e===!1){return t};return t.join(e||this.lineSeparator())},setValue:y(function(i){var r=e(this.first,0),n=this.first+this.size-1;Ge(this,{from:r,to:e(n,t(this,n).text.length),text:this.splitLines(i),origin:"setValue",full:!0},!0);if(this.cm){Lt(this.cm,0,0)};C(this,se(r),G)}),replaceRange:function(e,t,i,r){t=o(this,t);i=i?o(this,i):t;Ue(this,e,t,i,r)},getRange:function(e,t,i){var r=me(this,o(this,e),o(this,t));if(i===!1){return r};return r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ht(this,e)){return t(this,e)}},getLineNumber:function(e){return u(e)},getLineHandleVisualStart:function(e){if(typeof e=="number"){e=t(this,e)};return V(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var i=this.sel.primary(),t;if(e==null||e=="head"){t=i.head} +else if(e=="anchor"){t=i.anchor} +else if(e=="end"||e=="to"||e===!1){t=i.to()} +else{t=i.from()};return t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:y(function(t,i,r){yo(this,o(this,typeof t=="number"?e(t,i||0):t),null,r)}),setSelection:y(function(e,t,i){yo(this,o(this,e),o(this,t||e),i)}),extendSelection:y(function(e,t,i){hi(this,o(this,e),t&&o(this,t),i)}),extendSelections:y(function(e,t){mo(this,tn(this,e),t)}),extendSelectionsBy:y(function(e,t){var i=jt(this.sel.ranges,e);mo(this,tn(this,i),t)}),setSelections:y(function(e,t,i){var l=this;if(!e.length){return};var n=[];for(var r=0;r<e.length;r++){n[r]=new s(o(l,e[r].anchor),o(l,e[r].head))};if(t==null){t=Math.min(e.length-1,this.sel.primIndex)};C(this,R(n,t),i)}),addSelection:y(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new s(o(this,e),o(this,t||e)));C(this,R(r,r.length-1),i)}),getSelection:function(e){var o=this,r=this.sel.ranges,t;for(var i=0;i<r.length;i++){var n=me(o,r[i].from(),r[i].to());t=t?t.concat(n):n};if(e===!1){return t} +else{return t.join(e||this.lineSeparator())}},getSelections:function(e){var n=this,o=[],r=this.sel.ranges;for(var t=0;t<r.length;t++){var i=me(n,r[t].from(),r[t].to());if(e!==!1){i=i.join(e||n.lineSeparator())};o[t]=i};return o},replaceSelection:function(e,t,i){var n=[];for(var r=0;r<this.sel.ranges.length;r++){n[r]=e};this.replaceSelections(n,t,i||"+input")},replaceSelections:y(function(e,t,i){var a=this,n=[],u=this.sel;for(var r=0;r<u.ranges.length;r++){var s=u.ranges[r];n[r]={from:s.from(),to:s.to(),text:a.splitLines(e[r]),origin:i}};var l=t&&t!="end"&&Fs(this,n,t);for(var o=n.length-1;o>=0;o--){Ge(a,n[o])};if(l){bo(this,l)} +else if(this.cm){Ie(this.cm)}}),undo:y(function(){pi(this,"undo")}),redo:y(function(){pi(this,"redo")}),undoSelection:y(function(){pi(this,"undo",!0)}),redoSelection:y(function(){pi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,r=0,n=0;for(var i=0;i<e.done.length;i++){if(!e.done[i].ranges){++r}};for(var t=0;t<e.undone.length;t++){if(!e.undone[t].ranges){++n}};return{undo:r,redo:n}},clearHistory:function(){this.history=new fi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){if(e){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null};return this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Re(this.history.done),undone:Re(this.history.undone)}},setHistory:function(e){var t=this.history=new fi(this.history.maxGeneration);t.done=Re(e.done.slice(0),null,!0);t.undone=Re(e.undone.slice(0),null,!0)},setGutterMarker:y(function(e,t,i){return At(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});r[t]=i;if(!i&&Qr(r)){e.gutterMarkers=null};return!0})}),clearGutter:y(function(e){var t=this;this.iter(function(i){if(i.gutterMarkers&&i.gutterMarkers[e]){At(t,i,"gutter",function(){i.gutterMarkers[e]=null;if(Qr(i.gutterMarkers)){i.gutterMarkers=null};return!0})}})}),lineInfo:function(e){var i;if(typeof e=="number"){if(!ht(this,e)){return null};i=e;e=t(this,e);if(!e){return null}} +else{i=u(e);if(i==null){return null}};return{line:i,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:y(function(e,t,i){return At(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!e[r]){e[r]=i} +else if(ft(i).test(e[r])){return!1} +else{e[r]+=" "+i};return!0})}),removeLineClass:y(function(e,t,i){return At(this,e,t=="gutter"?"gutter":"class",function(e){var o=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",n=e[o];if(!n){return!1} +else if(i==null){e[o]=null} +else{var r=n.match(ft(i));if(!r){return!1};var l=r.index+r[0].length;e[o]=n.slice(0,r.index)+(!r.index||l==n.length?"":" ")+n.slice(l)||null};return!0})}),addLineWidget:y(function(e,t,i){return Vs(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ve(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};e=o(this,e);return Ve(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var l=[],n=t(this,e.line).markedSpans;if(n){for(var r=0;r<n.length;++r){var i=n[r];if((i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)){l.push(i.marker.parent||i.marker)}}};return l},findMarks:function(e,t,i){e=o(this,e);t=o(this,t);var n=[],r=e.line;this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a){for(var s=0;s<a.length;s++){var l=a[s];if(!(l.to!=null&&r==e.line&&e.ch>=l.to||l.from==null&&r!=e.line||l.from!=null&&r==t.line&&l.from>=t.ch)&&(!i||i(l.marker))){n.push(l.marker.parent||l.marker)}}};++r});return n},getAllMarks:function(){var e=[];this.iter(function(t){var r=t.markedSpans;if(r){for(var i=0;i<r.length;++i){if(r[i].from!=null){e.push(r[i].marker)}}}});return e},posFromIndex:function(t){var i,r=this.first,n=this.lineSeparator().length;this.iter(function(e){var o=e.text.length+n;if(o>t){i=t;return!0};t-=o++r});return o(this,e(r,i))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0){return 0};var i=this.lineSeparator().length;this.iter(this.first,e.line,function(e){t+=e.text.length+i});return t},copy:function(e){var t=new k(Pi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=!1;if(e){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())};return t},linkedDoc:function(e){if(!e){e={}};var i=this.first,r=this.first+this.size;if(e.from!=null&&e.from>i){i=e.from};if(e.to!=null&&e.to<r){r=e.to};var t=new k(Pi(this,i,r),e.mode||this.modeOption,i,this.lineSep,this.direction);if(e.sharedHist){t.history=this.history}(this.linked||(this.linked=[])).push({doc:t,sharedHist:e.sharedHist});t.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}];Xs(t,Do(this));return t},unlinkDoc:function(e){var i=this;if(e instanceof h){e=e.doc};if(this.linked){for(var t=0;t<this.linked.length;++t){var n=i.linked[t];if(n.doc!=e){continue};i.linked.splice(t,1);e.unlinkDoc(i);js(Do(i));break}};if(e.history==this.history){var r=[e.id];Ne(e,function(e){return r.push(e.id)},!0);e.history=new fi(null);e.history.done=Re(this.history.done,r);e.history.undone=Re(this.history.undone,r)}},iterLinkedDocs:function(e){Ne(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){if(this.lineSep){return e.split(this.lineSep)};return Si(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:y(function(e){if(e!="rtl"){e="ltr"};if(e==this.direction){return};this.direction=e;this.iter(function(e){return e.order=null});if(this.cm){Ps(this.cm)}})});k.prototype.eachLine=k.prototype.iter;var Pr=0;function Ys(e){var t=this;Ho(t);if(v(t,e)||Q(t.display,e)){return};T(e);if(l){Pr=+new Date};var r=Se(t,e,!0),u=e.dataTransfer.files;if(!r||t.isReadOnly()){return};if(u&&u.length&&window.FileReader&&window.File){var f=u.length,h=Array(f),d=0,p=function(e,i){if(t.options.allowDropFileTypes&&b(t.options.allowDropFileTypes,e.type)==-1){return};var n=new FileReader;n.onload=m(t,function(){var e=n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){e=""};h[i]=e;if(++d==f){r=o(t.doc,r);var l={from:r,to:r,text:t.doc.splitLines(h.join(t.doc.lineSeparator())),origin:"paste"};Ge(t.doc,l);bo(t.doc,se(r,ae(l)))}});n.readAsText(e)};for(var a=0;a<f;++a){p(u[a],a)}} +else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e);setTimeout(function(){return t.display.input.focus()},20);return};try{var c=e.dataTransfer.getData("Text");if(c){var n;if(t.state.draggingText&&!t.state.draggingText.copy){n=t.listSelections()};di(t.doc,se(r,r));if(n){for(var s=0;s<n.length;++s){Ue(t.doc,"",n[s].anchor,n[s].head,"drag")}};t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(i){}}};function qs(e,t){if(l&&(!e.state.draggingText||+new Date-Pr<100)){vt(t);return};if(v(e,t)||Q(e.display,t)){return};t.dataTransfer.setData("Text",e.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!Yr){var r=i("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(E){r.width=r.height=1;e.display.wrapper.appendChild(r);r._top=r.offsetTop};t.dataTransfer.setDragImage(r,0,0);if(E){r.parentNode.removeChild(r)}}};function Zs(e,t){var n=Se(e,t);if(!n){return};var r=document.createDocumentFragment();Kn(e,n,r);if(!e.display.dragCursor){e.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors");e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)};W(e.display.dragCursor,r)};function Ho(e){if(e.display.dragCursor){e.display.lineSpace.removeChild(e.display.dragCursor);e.display.dragCursor=null}};function Fo(e){if(!document.getElementsByClassName){return};var r=document.getElementsByClassName("CodeMirror");for(var t=0;t<r.length;t++){var i=r[t].CodeMirror;if(i){e(i)}}};var Fr=!1;function Qs(){if(Fr){return};Js();Fr=!0};function Js(){var e;r(window,"resize",function(){if(e==null){e=setTimeout(function(){e=null;Fo(ea)},100)}});r(window,"blur",function(){return Fo(St)})};function ea(e){var t=e.display;if(t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth){return};t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=!1;e.setSize()};var J={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var Je=0;Je<10;Je++){J[Je+48]=J[Je+96]=String(Je)};for(var zt=65;zt<=90;zt++){J[zt]=String.fromCharCode(zt)};for(var Qe=1;Qe<=12;Qe++){J[Qe+111]=J[Qe+63235]="F"+Qe};var j={};j.basic={"Left":"goCharLeft","Right":"goCharRight","Up":"goLineUp","Down":"goLineDown","End":"goLineEnd","Home":"goLineStartSmart","PageUp":"goPageUp","PageDown":"goPageDown","Delete":"delCharAfter","Backspace":"delCharBefore","Shift-Backspace":"delCharBefore","Tab":"defaultTab","Shift-Tab":"indentAuto","Enter":"newlineAndIndent","Insert":"toggleOverwrite","Esc":"singleSelection"};j.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};j.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};j.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};j["default"]=I?j.macDefault:j.pcDefault;function ta(e){var i=e.split(/-(?!$)/);e=i[i.length-1];var n,o,l,s;for(var r=0;r<i.length-1;r++){var t=i[r];if(/^(cmd|meta|m)$/i.test(t)){s=!0} +else if(/^a(lt)?$/i.test(t)){n=!0} +else if(/^(c|ctrl|control)$/i.test(t)){o=!0} +else if(/^s(hift)?$/i.test(t)){l=!0} +else{throw new Error("Unrecognized modifier name: "+t)}};if(n){e="Alt-"+e};if(o){e="Ctrl-"+e};if(s){e="Cmd-"+e};if(l){e="Shift-"+e};return e};function ia(e){var l={};for(var t in e){if(e.hasOwnProperty(t)){var u=e[t];if(/^(name|fallthrough|(de|at)tach)$/.test(t)){continue};if(u=="..."){delete e[t];continue};var o=jt(t.split(" "),ta);for(var n=0;n<o.length;n++){var r=(void 0),i=(void 0);if(n==o.length-1){i=o.join(" ");r=u} +else{i=o.slice(0,n+1).join(" ");r="..."};var a=l[i];if(!a){l[i]=r} +else if(a!=r){throw new Error("Inconsistent bindings for "+i)}};delete e[t]}};for(var s in l){e[s]=l[s]};return e};function Ke(e,t,i,r){t=gi(t);var n=t.call?t.call(e,r):t[e];if(n===!1){return"nothing"};if(n==="..."){return"multi"};if(n!=null&&i(n)){return"handled"};if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Ke(e,t.fallthrough,i,r)};for(var o=0;o<t.fallthrough.length;o++){var l=Ke(e,t.fallthrough[o],i,r);if(l){return l}}}};function Po(e){var t=typeof e=="string"?e:J[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"};function Eo(e,t,i){var r=e;if(t.altKey&&r!="Alt"){e="Alt-"+e};if((Vr?t.metaKey:t.ctrlKey)&&r!="Ctrl"){e="Ctrl-"+e};if((Vr?t.ctrlKey:t.metaKey)&&r!="Cmd"){e="Cmd-"+e};if(!i&&t.shiftKey&&r!="Shift"){e="Shift-"+e};return e};function Io(e,t){if(E&&e.keyCode==34&&e["char"]){return!1};var i=J[e.keyCode];if(i==null||e.altGraphKey){return!1};return Eo(i,e,t)};function gi(e){return typeof e=="string"?j[e]:e};function Xe(e,t){var s=e.doc.sel.ranges,i=[];for(var o=0;o<s.length;o++){var r=t(s[o]);while(i.length&&n(r.from,a(i).to)<=0){var l=i.pop();if(n(l.from,r.from)<0){r.from=l.from;break}};i.push(r)};N(e,function(){for(var t=i.length-1;t>=0;t--){Ue(e.doc,"",i[t].from,i[t].to,"+delete")};Ie(e)})};function Mr(e,t,i){var r=Jr(e.text,t+i,i);return r<0||r>e.text.length?null:r};function Nr(t,i,r){var n=Mr(t,i.ch,r);return n==null?null:new e(i.line,n,r<0?"after":"before")};function Or(t,i,r,n,o){if(t){var u=Z(r,i.doc.direction);if(u){var s=o<0?a(u):u[0],d=(o<0)==(s.level==1),c=d?"after":"before",l;if(s.level>0||i.doc.direction=="rtl"){var f=Ee(i,r);l=o<0?r.text.length-1:0;var h=X(i,f,l).top;l=ct(function(e){return X(i,f,e).top==h},(o<0)==(s.level==1)?s.from:s.to-1,l);if(c=="before"){l=Mr(r,l,1)}} +else{l=o<0?s.to:s.from};return new e(n,l,c)}};return new e(n,o<0?r.text.length:0,o<0?"before":"after")};function ra(t,i,r,n){var a=Z(i,t.doc.direction);if(!a){return Nr(i,r,n)};if(r.ch>=i.text.length){r.ch=i.text.length;r.sticky="before"} +else if(r.ch<=0){r.ch=0;r.sticky="after"};var v=gt(a,r.ch,r.sticky),o=a[v];if(t.doc.direction=="ltr"&&o.level%2==0&&(n>0?o.to>r.ch:o.from<r.ch)){return Nr(i,r,n)};var s=function(t,r){return Mr(i,t instanceof e?t.ch:t,r)},d,g=function(e){if(!t.options.lineWrapping){return{begin:0,end:i.text.length}};d=d||Ee(t,i);return Gn(t,i,d,e)},f=g(r.sticky=="before"?s(r,-1):r.ch);if(t.doc.direction=="rtl"||o.level==1){var h=(o.level==1)==(n<0),l=s(r,h?1:-1);if(l!=null&&(!h?l>=o.from&&l>=f.begin:l<=o.to&&l<=f.end)){var m=h?"before":"after";return new e(r.line,l,m)}};var p=function(t,i,n){var f=function(t,i){return i?new e(r.line,s(t,1),"before"):new e(r.line,t,"after")};for(;t>=0&&t<a.length;t+=i){var l=a[t],u=(i>0)==(l.level!=1),o=u?n.begin:s(n.end,-1);if(l.from<=o&&o<l.to){return f(o,u)};o=u?l.from:s(l.to,-1);if(n.begin<=o&&o<n.end){return f(o,u)}}},u=p(v+n,n,f);if(u){return u};var c=n>0?f.end:s(f.begin,-1);if(c!=null&&!(n>0&&c==i.text.length)){u=p(n>0?0:a.length-1,n,g(c));if(u){return u}};return null};var Ze={selectAll:Lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(i){return Xe(i,function(r){if(r.empty()){var n=t(i.doc,r.head.line).text.length;if(r.head.ch==n&&r.head.line<i.lastLine()){return{from:r.head,to:e(r.head.line+1,0)}} +else{return{from:r.head,to:e(r.head.line,n)}}} +else{return{from:r.from(),to:r.to()}}})},deleteLine:function(t){return Xe(t,function(i){return({from:e(i.from().line,0),to:o(t.doc,e(i.to().line+1,0))})})},delLineLeft:function(t){return Xe(t,function(t){return({from:e(t.from().line,0),to:t.from()})})},delWrappedLineLeft:function(e){return Xe(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Xe(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(t){return t.extendSelection(e(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(e(t.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return zo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ro(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return na(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},ot)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},ot)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");if(i.ch<e.getLine(i.line).search(/\S/)){return Ro(e,t.head)};return i},ot)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){var n=[],o=e.listSelections(),i=e.options.tabSize;for(var t=0;t<o.length;t++){var r=o[t].from(),l=H(e.getLine(r.line),r.ch,i);n.push(Di(i-l%i))};e.replaceSelections(n)},defaultTab:function(e){if(e.somethingSelected()){e.indentSelection("add")} +else{e.execCommand("insertTab")}},transposeChars:function(i){return N(i,function(){var a=i.listSelections(),u=[];for(var l=0;l<a.length;l++){if(!a[l].empty()){continue};var r=a[l].head,n=t(i.doc,r.line).text;if(n){if(r.ch==n.length){r=new e(r.line,r.ch-1)};if(r.ch>0){r=new e(r.line,r.ch+1);i.replaceRange(n.charAt(r.ch-1)+n.charAt(r.ch-2),e(r.line,r.ch-2),r,"+transpose")} +else if(r.line>i.doc.first){var o=t(i.doc,r.line-1).text;if(o){r=new e(r.line,1);i.replaceRange(n.charAt(0)+i.doc.lineSeparator()+o.charAt(o.length-1),e(r.line-1,o.length-1),r,"+transpose")}}};u.push(new s(r,r))};i.setSelections(u)})},newlineAndIndent:function(e){return N(e,function(){var t=e.listSelections();for(var i=t.length-1;i>=0;i--){e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input")};t=e.listSelections();for(var r=0;r<t.length;r++){e.indentLine(t[r].from().line,null,!0)};Ie(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function zo(e,i){var n=t(e.doc,i),r=V(n);if(r!=n){i=u(r)};return Or(!0,e,r,i,1)};function na(e,i){var r=t(e.doc,i),n=Hl(r);if(n!=r){i=u(n)};return Or(!0,e,r,i,-1)};function Ro(i,r){var n=zo(i,r.line),l=t(i.doc,n.line),s=Z(l,i.doc.direction);if(!s||s[0].level==0){var o=Math.max(0,l.text.search(/\S/)),a=r.line==n.line&&r.ch<=o&&r.ch;return e(n.line,a?0:o,n.sticky)};return n};function vi(e,t,i){if(typeof t=="string"){t=Ze[t];if(!t){return!1}};e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{if(e.isReadOnly()){e.state.suppressEdits=!0};if(i){e.display.shift=!1};r=t(e)!=Vt}finally{e.display.shift=n;e.state.suppressEdits=!1};return r};function oa(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Ke(t,e.state.keyMaps[r],i,e);if(n){return n}};return(e.options.extraKeys&&Ke(t,e.options.extraKeys,i,e))||Ke(t,e.options.keyMap,i,e)};var sl=new ce;function Ht(e,t,i,r){var n=e.state.keySeq;if(n){if(Po(t)){return"handled"};if(/'$/.test(t)){e.state.keySeq=null} +else{sl.set(50,function(){if(e.state.keySeq==n){e.state.keySeq=null;e.display.input.reset()}})};if(Bo(e,n+" "+t,i,r)){return!0}};return Bo(e,t,i,r)};function Bo(e,t,i,r){var n=oa(e,t,r);if(n=="multi"){e.state.keySeq=t};if(n=="handled"){w(e,"keyHandled",e,t,i)};if(n=="handled"||n=="multi"){T(i);fr(e)};return!!n};function Go(e,t){var i=Io(t,!0);if(!i){return!1};if(t.shiftKey&&!e.state.keySeq){return Ht(e,"Shift-"+i,t,function(t){return vi(e,t,!0)})||Ht(e,i,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return vi(e,t)}})} +else{return Ht(e,i,t,function(t){return vi(e,t)})}};function la(e,t,i){return Ht(e,"'"+i+"'",t,function(t){return vi(e,t,!0)})};var xi=null;function Uo(e){var t=this;t.curOp.focus=Y();if(v(t,e)){return};if(l&&c<11&&e.keyCode==27){e.returnValue=!1};var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Go(t,e);if(E){xi=r?i:null;if(!r&&i==88&&!dl&&(I?e.metaKey:e.ctrlKey)){t.replaceSelection("",null,"cut")}};if(i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){sa(t)}};function sa(e){var i=e.display.lineDiv;ge(i,"CodeMirror-crosshair");function t(e){if(e.keyCode==18||!e.altKey){de(i,"CodeMirror-crosshair");D(document,"keyup",t);D(document,"mouseover",t)}};r(document,"keyup",t);r(document,"mouseover",t)};function Vo(e){if(e.keyCode==16){this.doc.sel.shift=!1};v(this,e)};function Ko(e){var t=this;if(Q(t.display,e)||v(t,e)||e.ctrlKey&&!e.altKey||I&&e.metaKey){return};var r=e.keyCode,n=e.charCode;if(E&&r==xi){xi=null;T(e);return};if((E&&(!e.which||e.which<10))&&Go(t,e)){return};var i=String.fromCharCode(n==null?r:n);if(i=="\x08"){return};if(la(t,e,i)){return};t.display.input.onKeyPress(e)};var ll=400,wi=function(e,t,i){this.time=e;this.pos=t;this.button=i};wi.prototype.compare=function(e,t,i){return this.time+ll>e&&n(t,this.pos)==0&&i==this.button};var Ye,qe;function aa(e,t){var i=+new Date;if(qe&&qe.compare(i,e,t)){Ye=qe=null;return"triple"} +else if(Ye&&Ye.compare(i,e,t)){qe=new wi(i,e,t);Ye=null;return"double"} +else{Ye=new wi(i,e,t);qe=null;return"single"}};function Xo(e){var t=this,i=t.display;if(v(t,e)||i.activeTouch&&i.input.supportsTouch()){return};i.input.ensurePolled();i.shift=e.shiftKey;if(Q(i,e)){if(!x){i.scroller.draggable=!1;setTimeout(function(){return i.scroller.draggable=!0},100)};return};if(Ar(t,e)){return};var r=Se(t,e),n=dn(e),o=r?aa(r,n):"single";window.focus();if(n==1&&t.state.selectingText){t.state.selectingText(e)};if(r&&ua(t,n,r,o,e)){return};if(n==1){if(r){ca(t,r,o,e)} +else if(Xi(e)==i.scroller){T(e)}} +else if(n==2){if(r){hi(t.doc,r)};setTimeout(function(){return i.input.focus()},20)} +else if(n==3){if(Ni){qo(t,e)} +else{jn(t)}}};function ua(e,t,i,r,n){var o="Click";if(r=="double"){o="Double"+o} +else if(r=="triple"){o="Triple"+o};o=(t==1?"Left":t==2?"Middle":"Right")+o;return Ht(e,Eo(o,n),n,function(t){if(typeof t=="string"){t=Ze[t]};if(!t){return!1};var r=!1;try{if(e.isReadOnly()){e.state.suppressEdits=!0};r=t(e,i)!=Vt}finally{e.state.suppressEdits=!1};return r})};function fa(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var o=xl?i.shiftKey&&i.metaKey:i.altKey;r.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"};if(r.extend==null||e.doc.extend){r.extend=e.doc.extend||i.shiftKey};if(r.addNew==null){r.addNew=I?i.metaKey:i.ctrlKey};if(r.moveOnDrag==null){r.moveOnDrag=!(I?i.altKey:i.ctrlKey)};return r};function ca(e,t,i,r){if(l){setTimeout(Ai(Xn,e),0)} +else{e.curOp.focus=Y()};var s=fa(e,i,r),a=e.doc.sel,o;if(e.options.dragDrop&&pl&&!e.isReadOnly()&&i=="single"&&(o=a.contains(t))>-1&&(n((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(n(o.to(),t)>0||t.xRel<0)){ha(e,r,t,s)} +else{da(e,r,t,s)}};function ha(e,t,i,n){var o=e.display,a=!1,s=m(e,function(t){if(x){o.scroller.draggable=!1};e.state.draggingText=!1;D(document,"mouseup",s);D(document,"mousemove",u);D(o.scroller,"dragstart",f);D(o.scroller,"drop",s);if(!a){T(t);if(!n.addNew){hi(e.doc,i,null,null,n.extend)};if(x||l&&c==9){setTimeout(function(){document.body.focus();o.input.focus()},20)} +else{o.input.focus()}}}),u=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return a=!0};if(x){o.scroller.draggable=!0};e.state.draggingText=s;s.copy=!n.moveOnDrag;if(o.scroller.dragDrop){o.scroller.dragDrop()};r(document,"mouseup",s);r(document,"mousemove",u);r(o.scroller,"dragstart",f);r(o.scroller,"drop",s);jn(e);setTimeout(function(){return o.input.focus()},20)};function jo(t,i,r){if(r=="char"){return new s(i,i)};if(r=="word"){return t.findWordAt(i)};if(r=="line"){return new s(e(i.line,0),o(t.doc,e(i.line+1,0)))};var n=r(t,i);return new s(n.from,n.to)};function da(i,l,a,u){var v=i.display,f=i.doc;T(l);var h,c,p=f.sel,d=p.ranges;if(u.addNew&&!u.extend){c=f.sel.contains(a);if(c>-1){h=d[c]} +else{h=new s(a,a)}} +else{h=f.sel.primary();c=f.sel.primIndex};if(u.unit=="rectangle"){if(!u.addNew){h=new s(a,a)};a=Se(i,l,!0,!0);c=-1} +else{var w=jo(i,a,u.unit);if(u.extend){h=Lr(h,w.anchor,w.head,u.extend)} +else{h=w}};if(!u.addNew){c=0;C(f,new O([h],0),Mi);p=f.sel} +else if(c==-1){c=d.length;C(f,R(d.concat([h]),c),{scroll:!1,origin:"*mouse"})} +else if(d.length>1&&d[c].empty()&&u.unit=="char"&&!u.extend){C(f,R(d.slice(0,c).concat(d.slice(c+1)),0),{scroll:!1,origin:"*mouse"});p=f.sel} +else{kr(f,c,h,Mi)};var b=a;function M(r){if(n(b,r)==0){return};b=r;if(u.unit=="rectangle"){var g=[],y=i.options.tabSize,k=H(t(f,a.line).text,a.ch,y),T=H(t(f,r.line).text,r.ch,y),M=Math.min(k,T),N=Math.max(k,T);for(var l=Math.min(a.line,r.line),O=Math.min(i.lastLine(),Math.max(a.line,r.line));l<=O;l++){var S=t(f,l).text,m=Wi(S,M,y);if(M==N){g.push(new s(e(l,m),e(l,m)))} +else if(S.length>m){g.push(new s(e(l,m),e(l,Wi(S,N,y))))}};if(!g.length){g.push(new s(a,a))};C(f,R(p.ranges.slice(0,c).concat(g),c),{origin:"*mouse",scroll:!1});i.scrollIntoView(r)} +else{var w=h,d=jo(i,r,u.unit),v=w.anchor,x;if(n(d.anchor,v)>0){x=d.head;v=Zt(w.from(),d.anchor)} +else{x=d.anchor;v=qt(w.to(),d.head)};var L=p.ranges.slice(0);L[c]=pa(i,new s(o(f,v),x));C(f,R(L,c),Mi)}};var L=v.wrapper.getBoundingClientRect(),g=0;function x(e){var l=++g,t=Se(i,e,!0,u.unit=="rectangle");if(!t){return};if(n(t,b)!=0){i.curOp.focus=Y();M(t);var o=hr(v,f);if(t.line>=o.to||t.line<o.from){setTimeout(m(i,function(){if(g==l){x(e)}}),150)}} +else{var r=e.clientY<L.top?-20:e.clientY>L.bottom?20:0;if(r){setTimeout(m(i,function(){if(g!=l){return};v.scroller.scrollTop+=r;x(e)}),50)}}};function k(e){i.state.selectingText=!1;g=Infinity;T(e);v.input.focus();D(document,"mousemove",S);D(document,"mouseup",y);f.history.lastSelOrigin=null};var S=m(i,function(e){if(!dn(e)){k(e)} +else{x(e)}}),y=m(i,k);i.state.selectingText=y;r(document,"mousemove",S);r(document,"mouseup",y)};function pa(i,r){var o=r.anchor,l=r.head,b=t(i.doc,o.line);if(n(o,l)==0&&o.sticky==l.sticky){return r};var a=Z(b);if(!a){return r};var p=gt(a,o.ch,o.sticky),c=a[p];if(c.from!=o.ch&&c.to!=o.ch){return r};var f=p+((c.from==o.ch)==(c.level!=1)?0:1);if(f==0||f==a.length){return r};var u;if(l.line!=o.line){u=(l.line-o.line)*(i.doc.direction=="ltr"?1:-1)>0} +else{var d=gt(a,l.ch,l.sticky),y=d-p||(l.ch-o.ch)*(c.level==1?-1:1);if(d==f-1||d==f){u=y<0} +else{u=y>0}};var h=a[f+(u?-1:0)],g=u==(h.level==1),v=g?h.from:h.to,m=g?"after":"before";return o.ch==v&&o.sticky==m?r:new s(new e(o.line,v,m),l)};function Yo(e,t,i,r){var s,o;if(t.touches){s=t.touches[0].clientX;o=t.touches[0].clientY} +else{try{s=t.clientX;o=t.clientY}catch(n){return!1}};if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right)){return!1};if(r){T(t)};var a=e.display,f=a.lineDiv.getBoundingClientRect();if(o>f.bottom||!F(e,i)){return Ki(t)};o-=f.top-a.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=s){var c=ye(e.doc,o),h=e.options.gutters[l];p(e,i,e,c,h,t);return Ki(t)}}};function Ar(e,t){return Yo(e,t,"gutterClick",!0)};function qo(e,t){if(Q(e.display,t)||ga(e,t)){return};if(v(e,t,"contextmenu")){return};e.display.input.onContextMenu(t)};function ga(e,t){if(!F(e,"gutterContextMenu")){return!1};return Yo(e,t,"gutterContextMenu",!1)};function Zo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-");wt(e)};var Oe={toString:function(){return"CodeMirror.Init"}};var Hr={};var It={};function va(t){var r=t.optionHandlers;function i(e,i,n,o){t.defaults[e]=i;if(n){r[e]=o?function(e,t,i){if(i!=Oe){n(e,t,i)}}:n}};t.defineOption=i;t.Init=Oe;i("value","",function(e,t){return e.setValue(t)},!0);i("mode",null,function(e,t){e.doc.modeOption=t;xr(e)},!0);i("indentUnit",2,xr,!0);i("indentWithTabs",!1);i("smartIndent",!0);i("tabSize",4,function(e){Nt(e);wt(e);M(e)},!0);i("lineSeparator",null,function(t,i){t.doc.lineSep=i;if(!i){return};var n=[],o=t.doc.first;t.doc.iter(function(t){for(var l=0;;){var r=t.text.indexOf(i,l);if(r==-1){break};l=r+i.length;n.push(e(o,r))};o++});for(var r=n.length-1;r>=0;r--){Ue(t.doc,i,n[r],e(n[r].line,n[r].ch+i.length))}});i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,i){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(i!=Oe){e.refresh()}});i("specialCharPlaceholder",jl,function(e){return e.refresh()},!0);i("electricChars",!0);i("inputStyle",ut?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0);i("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0);i("rtlMoveVisually",!Cl);i("wholeLineUpdateBefore",!0);i("theme","default",function(e){Zo(e);Ft(e)},!0);i("keyMap","default",function(e,t,i){var n=gi(t),r=i!=Oe&&gi(i);if(r&&r.detach){r.detach(e,n)};if(n.attach){n.attach(e,r||null)}});i("extraKeys",null);i("configureMouse",null);i("lineWrapping",!1,ya,!0);i("gutters",[],function(e){br(e.options);Ft(e)},!0);i("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0";e.refresh()},!0);i("coverGutterNextToScrollbar",!1,function(e){return ze(e)},!0);i("scrollbarStyle","native",function(e){to(e);ze(e);e.display.scrollbars.setScrollTop(e.doc.scrollTop);e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0);i("lineNumbers",!1,function(e){br(e.options);Ft(e)},!0);i("firstLineNumber",1,Ft,!0);i("lineNumberFormatter",function(e){return e},Ft,!0);i("showCursorWhenSelecting",!1,Ct,!0);i("resetSelectionOnContextMenu",!0);i("lineWiseCopyCut",!0);i("pasteLinesPerSelection",!0);i("readOnly",!1,function(e,t){if(t=="nocursor"){St(e);e.display.input.blur()};e.display.input.readOnlyChanged(t)});i("disableInput",!1,function(e,t){if(!t){e.display.input.reset()}},!0);i("dragDrop",!0,ma);i("allowDropFileTypes",null);i("cursorBlinkRate",530);i("cursorScrollMargin",0);i("cursorHeight",1,Ct,!0);i("singleCursorHeightPerLine",!0,Ct,!0);i("workTime",100);i("workDelay",100);i("flattenSpans",!0,Nt,!0);i("addModeClass",!1,Nt,!0);i("pollInterval",100);i("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t});i("historyEventDelay",1250);i("viewportMargin",10,function(e){return e.refresh()},!0);i("maxHighlightLength",10000,Nt,!0);i("moveInputWithCursor",!0,function(e,t){if(!t){e.display.input.resetPosition()}});i("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""});i("autofocus",null);i("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)};function Ft(e){no(e);M(e);qn(e)};function ma(e,t,i){var l=i&&i!=Oe;if(!t!=!l){var n=e.display.dragFunctions,o=t?r:D;o(e.display.scroller,"dragstart",n.start);o(e.display.scroller,"dragenter",n.enter);o(e.display.scroller,"dragover",n.over);o(e.display.scroller,"dragleave",n.leave);o(e.display.scroller,"drop",n.drop)}};function ya(e){if(e.options.lineWrapping){ge(e.display.wrapper,"CodeMirror-wrap");e.display.sizer.style.minWidth="";e.display.sizerWidth=null} +else{de(e.display.wrapper,"CodeMirror-wrap");Ui(e)};ur(e);M(e);wt(e);setTimeout(function(){return ze(e)},100)};function h(e,t){var s=this;if(!(this instanceof h)){return new h(e,t)};this.options=t=t?ve(t):{};ve(Hr,t,!1);br(t);var i=t.value;if(typeof i=="string"){i=new k(i,t.mode,null,t.lineSeparator,t.direction)};this.doc=i;var a=new h.inputStyles[t.inputStyle](this),r=this.display=new Ll(e,i,a);r.wrapper.CodeMirror=this;no(this);Zo(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"};to(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new ce(),keySeq:null,specialChars:null};if(t.autofocus&&!ut){r.input.focus()};if(l&&c<11){setTimeout(function(){return s.display.input.reset(!0)},20)};ba(this);Qs();Te(this);this.curOp.forceUpdate=!0;fo(this,i);if((t.autofocus&&!ut)||this.hasFocus()){setTimeout(Ai(cr,this),20)} +else{St(this)};for(var o in It){if(It.hasOwnProperty(o)){It[o](s,t[o],Oe)}};Zn(this);if(t.finishInit){t.finishInit(this)};for(var n=0;n<bi.length;++n){bi[n](s)};Me(this);if(x&&t.lineWrapping&&getComputedStyle(r.lineDiv).textRendering=="optimizelegibility"){r.lineDiv.style.textRendering="auto"}};h.defaults=Hr;h.optionHandlers=It;function ba(t){var i=t.display;r(i.scroller,"mousedown",m(t,Xo));if(l&&c<11){r(i.scroller,"dblclick",m(t,function(e){if(v(t,e)){return};var r=Se(t,e);if(!r||Ar(t,e)||Q(t.display,e)){return};T(e);var i=t.findWordAt(r);hi(t.doc,i.anchor,i.head)}))} +else{r(i.scroller,"dblclick",function(e){return v(t,e)||T(e)})};if(!Ni){r(i.scroller,"contextmenu",function(e){return qo(t,e)})};var u,a={end:0};function f(){if(i.activeTouch){u=setTimeout(function(){return i.activeTouch=null},1000);a=i.activeTouch;a.end=+new Date}};function d(e){if(e.touches.length!=1){return!1};var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1};function h(e,t){if(t.left==null){return!0};var i=t.left-e.left,r=t.top-e.top;return i*i+r*r>20*20};r(i.scroller,"touchstart",function(e){if(!v(t,e)&&!d(e)&&!Ar(t,e)){i.input.ensurePolled();clearTimeout(u);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null};if(e.touches.length==1){i.activeTouch.left=e.touches[0].pageX;i.activeTouch.top=e.touches[0].pageY}}});r(i.scroller,"touchmove",function(){if(i.activeTouch){i.activeTouch.moved=!0}});r(i.scroller,"touchend",function(r){var n=i.activeTouch;if(n&&!Q(i,r)&&n.left!=null&&!n.moved&&new Date-n.start<300){var l=t.coordsChar(i.activeTouch,"page"),a;if(!n.prev||h(n,n.prev)){a=new s(l,l)} +else if(!n.prev.prev||h(n,n.prev.prev)){a=t.findWordAt(l)} +else{a=new s(e(l.line,0),o(t.doc,e(l.line+1,0)))};t.setSelection(a.anchor,a.head);t.focus();T(r)};f()});r(i.scroller,"touchcancel",f);r(i.scroller,"scroll",function(){if(i.scroller.clientHeight){kt(t,i.scroller.scrollTop);ke(t,i.scroller.scrollLeft,!0);p(t,"scroll",t)}});r(i.scroller,"mousewheel",function(e){return lo(t,e)});r(i.scroller,"DOMMouseScroll",function(e){return lo(t,e)});r(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0});i.dragFunctions={enter:function(e){if(!v(t,e)){vt(e)}},over:function(e){if(!v(t,e)){Zs(t,e);vt(e)}},start:function(e){return qs(t,e)},drop:m(t,Ys),leave:function(e){if(!v(t,e)){Ho(t)}}};var n=i.input.getField();r(n,"keyup",function(e){return Vo.call(t,e)});r(n,"keydown",m(t,Uo));r(n,"keypress",m(t,Ko));r(n,"focus",function(e){return cr(t,e)});r(n,"blur",function(e){return St(t,e)})};var bi=[];h.defineInitHook=function(e){return bi.push(e)};function Pt(i,r,n,o){var a=i.doc,b;if(n==null){n="add"};if(n=="smart"){if(!a.mode.indent){n="prev"} +else{b=mt(i,r).state}};var d=i.options.tabSize,u=t(a,r),g=H(u.text,null,d);if(u.stateAfter){u.stateAfter=null};var f=u.text.match(/^\s*/)[0],l;if(!o&&!/\S/.test(u.text)){l=0;n="not"} +else if(n=="smart"){l=a.mode.indent(b,u.text.slice(f.length),u.text);if(l==Vt||l>150){if(!o){return};n="prev"}};if(n=="prev"){if(r>a.first){l=H(t(a,r-1).text,null,d)} +else{l=0}} +else if(n=="add"){l=g+i.options.indentUnit} +else if(n=="subtract"){l=g-i.options.indentUnit} +else if(typeof n=="number"){l=g+n};l=Math.max(0,l);var h="",p=0;if(i.options.indentWithTabs){for(var y=Math.floor(l/d);y;--y){p+=d;h+="\t"}};if(p<l){h+=Di(l-p)};if(h!=f){Ue(a,h,e(r,0),e(r,f.length),"+input");u.stateAfter=null;return!0} +else{for(var c=0;c<a.sel.ranges.length;c++){var m=a.sel.ranges[c];if(m.head.line==r&&m.head.ch<f.length){var v=e(r,f.length);kr(a,c,new s(v,v));break}}}};var P=null;function mi(e){P=e};function Wr(i,r,n,o,l){var v=i.doc;i.display.shift=!1;if(!o){o=v.sel};var h=i.state.pasteIncoming||l=="paste",d=Si(r),f=null;if(h&&o.ranges.length>1){if(P&&P.text.join("\n")==r){if(o.ranges.length%P.text.length==0){f=[];for(var g=0;g<P.text.length;g++){f.push(v.splitLines(P.text[g]))}}} +else if(d.length==o.ranges.length&&i.options.pasteLinesPerSelection){f=jt(d,function(e){return[e]})}};var y;for(var c=o.ranges.length-1;c>=0;c--){var p=o.ranges[c],s=p.from(),u=p.to();if(p.empty()){if(n&&n>0){s=e(s.line,s.ch-n)} +else if(i.state.overwrite&&!h){u=e(u.line,Math.min(t(v,u.line).text.length,u.ch+a(d).length))} +else if(P&&P.lineWise&&P.text.join("\n")==r){s=u=e(s.line,0)}};y=i.curOp.updateInput;var m={from:s,to:u,text:f?f[c%f.length]:d,origin:l||(h?"paste":i.state.cutIncoming?"cut":"+input")};Ge(i.doc,m);w(i,"inputRead",i,m)};if(r&&!h){Jo(i,r)};Ie(i);i.curOp.updateInput=y;i.curOp.typing=!0;i.state.pasteIncoming=i.state.cutIncoming=!1};function Qo(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i){e.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput){N(t,function(){return Wr(t,i,0,null,"paste")})};return!0}};function Jo(e,i){if(!e.options.electricChars||!e.options.smartIndent){return};var a=e.doc.sel;for(var o=a.ranges.length-1;o>=0;o--){var r=a.ranges[o];if(r.head.ch>100||(o&&a.ranges[o-1].head.line==r.head.line)){continue};var n=e.getModeAt(r.head),s=!1;if(n.electricChars){for(var l=0;l<n.electricChars.length;l++){if(i.indexOf(n.electricChars.charAt(l))>-1){s=Pt(e,r.head.line,"smart");break}}} +else if(n.electricInput){if(n.electricInput.test(t(e.doc,r.head.line).text.slice(0,r.head.ch))){s=Pt(e,r.head.line,"smart")}};if(s){w(e,"electricInput",e,r.head.line)}}};function el(t){var o=[],l=[];for(var r=0;r<t.doc.sel.ranges.length;r++){var n=t.doc.sel.ranges[r].head.line,i={anchor:e(n,0),head:e(n+1,0)};l.push(i);o.push(t.getRange(i.anchor,i.head))};return{text:o,ranges:l}};function tl(e,t){e.setAttribute("autocorrect","off");e.setAttribute("autocapitalize","off");e.setAttribute("spellcheck",!!t)};function il(){var e=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(x){e.style.width="1000px"} +else{e.setAttribute("wrap","off")};if(at){e.style.border="1px solid black"};tl(e);return t};function wa(i){var n=i.optionHandlers,r=i.helpers={};i.prototype={constructor:i,focus:function(){window.focus();this.display.input.focus()},setOption:function(e,t){var i=this.options,r=i[e];if(i[e]==t&&e!="mode"){return};i[e]=t;if(n.hasOwnProperty(e)){m(this,n[e])(this,t,r)};p(this,"optionChange",this,e)},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](gi(e))},removeKeyMap:function(e){var i=this.state.keyMaps;for(var t=0;t<i.length;++t){if(i[t]==e||i[t].name==e){i.splice(t,1);return!0}}},addOverlay:L(function(e,t){var r=e.token?e:i.getMode(this.options,e);if(r.startState){throw new Error("Overlays may not be stateful.")};Sl(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:(t&&t.priority)||0},function(e){return e.priority});this.state.modeGen++;M(this)}),removeOverlay:L(function(e){var n=this,i=this.state.overlays;for(var t=0;t<i.length;++t){var r=i[t].modeSpec;if(r==e||typeof e=="string"&&r.name==e){i.splice(t,1);n.state.modeGen++;M(n);return}}}),indentLine:L(function(e,t,i){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"} +else{t=t?"add":"subtract"}};if(ht(this.doc,e)){Pt(this,e,t,i)}}),indentSelection:L(function(e){var i=this,u=this.doc.sel.ranges,n=-1;for(var t=0;t<u.length;t++){var r=u[t];if(!r.empty()){var a=r.from(),f=r.to(),c=Math.max(n,a.line);n=Math.min(i.lastLine(),f.line-(f.ch?0:1))+1;for(var l=c;l<n;++l){Pt(i,l,e)};var o=i.doc.sel.ranges;if(a.ch==0&&u.length==o.length&&o[t].from().ch>0){kr(i.doc,t,new s(a,o[t].to()),G)}} +else if(r.head.line>n){Pt(i,r.head.line,e,!0);n=r.head.line;if(t==i.doc.sel.primIndex){Ie(i)}}}}),getTokenAt:function(e,t){return yn(this,e,t)},getLineTokens:function(t,i){return yn(this,e(t),i,!0)},getTokenTypeAt:function(e){e=o(this.doc,e);var n=vn(this,t(this.doc,e.line)),a=0,u=(n.length-1)/2,s=e.ch,r;if(s==0){r=n[2]} +else{for(;;){var i=(a+u)>>1;if((i?n[i*2-1]:0)>=s){u=i} +else if(n[i*2+1]<s){a=i+1} +else{r=n[i*2+2];break}}};var l=r?r.indexOf("overlay "):-1;return l<0?r:l==0?null:r.slice(0,l-1)},getModeAt:function(e){var t=this.doc.mode;if(!t.innerMode){return t};return i.innerMode(t,this.getTokenAt(e).state).mode},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var f=this,o=[];if(!r.hasOwnProperty(t)){return o};var n=r[t],i=this.getModeAt(e);if(typeof i[t]=="string"){if(n[i[t]]){o.push(n[i[t]])}} +else if(i[t]){for(var a=0;a<i[t].length;a++){var u=n[i[t][a]];if(u){o.push(u)}}} +else if(i.helperType&&n[i.helperType]){o.push(n[i.helperType])} +else if(n[i.name]){o.push(n[i.name])};for(var s=0;s<n._global.length;s++){var l=n._global[s];if(l.pred(i,f)&&b(o,l.val)==-1){o.push(l.val)}};return o},getStateAfter:function(e,t){var i=this.doc;e=en(i,e==null?i.first+i.size-1:e);return mt(this,e+1,t).state},cursorCoords:function(e,t){var i,r=this.doc.sel.primary();if(e==null){i=r.head} +else if(typeof e=="object"){i=o(this.doc,e)} +else{i=e?r.from():r.to()};return z(this,i,t||"page")},charCoords:function(e,t){return rr(this,o(this.doc,e),t||"page")},coordsChar:function(e,t){e=zn(this,e,t||"page");return or(this,e.left,e.top)},lineAtHeight:function(e,t){e=zn(this,{top:e,left:0},t||"page").top;return ye(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,i,r){var o=!1,n;if(typeof e=="number"){var l=this.doc.first+this.doc.size-1;if(e<this.doc.first){e=this.doc.first} +else if(e>l){e=l;o=!0};n=t(this.doc,e)} +else{n=e};return oi(this,n,{top:0,left:0},i||"page",r||o).top+(o?this.doc.height-q(n):0)},defaultTextHeight:function(){return Ce(this.display)},defaultCharWidth:function(){return xt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,r,n){var a=this.display;e=z(this,o(this.doc,e));var s=e.bottom,l=e.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);a.sizer.appendChild(t);if(r=="over"){s=e.top} +else if(r=="above"||r=="near"){var u=Math.max(a.wrapper.clientHeight,this.doc.height),f=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);if((r=="above"||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight){s=e.top-t.offsetHeight} +else if(e.bottom+t.offsetHeight<=u){s=e.bottom};if(l+t.offsetWidth>f){l=f-t.offsetWidth}};t.style.top=s+"px";t.style.left=t.style.right="";if(n=="right"){l=a.sizer.clientWidth-t.offsetWidth;t.style.right="0px"} +else{if(n=="left"){l=0} +else if(n=="middle"){l=(a.sizer.clientWidth-t.offsetWidth)/2};t.style.left=l+"px"};if(i){bs(this,{left:l,top:s,right:l+t.offsetWidth,bottom:s+t.offsetHeight})}},triggerOnKeyDown:L(Uo),triggerOnKeyPress:L(Ko),triggerOnKeyUp:Vo,triggerOnMouseDown:L(Xo),execCommand:function(e){if(Ze.hasOwnProperty(e)){return Ze[e].call(null,this)}},triggerElectric:L(function(e){Jo(this,e)}),findPosH:function(e,t,i,r){var a=this,s=1;if(t<0){s=-1;t=-t};var n=o(this.doc,e);for(var l=0;l<t;++l){n=Dr(a.doc,n,s,i,r);if(n.hitSide){break}};return n},moveH:L(function(e,t){var i=this;this.extendSelectionsBy(function(r){if(i.display.shift||i.doc.extend||r.empty()){return Dr(i.doc,r.head,e,t,i.options.rtlMoveVisually)} +else{return e<0?r.from():r.to()}},ot)}),deleteH:L(function(e,t){var r=this.doc.sel,i=this.doc;if(r.somethingSelected()){i.replaceSelection("",null,"+delete")} +else{Xe(this,function(r){var n=Dr(i,r.head,e,t,!1);return e<0?{from:n,to:r.head}:{from:r.head,to:n}})}}),findPosV:function(e,t,i,r){var u=this,f=1,s=r;if(t<0){f=-1;t=-t};var n=o(this.doc,e);for(var a=0;a<t;++a){var l=z(u,n,"div");if(s==null){s=l.left} +else{l.left=s};n=rl(u,l,f,i);if(n.hitSide){break}};return n},moveV:L(function(e,t){var n=this,i=this.doc,o=[],l=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy(function(r){if(l){return e<0?r.from():r.to()};var s=z(n,r.head,"div");if(r.goalColumn!=null){s.left=r.goalColumn};o.push(s.left);var a=rl(n,s,e,t);if(t=="page"&&r==i.sel.primary()){pr(n,rr(n,a,"div").top-s.top)};return a},ot);if(o.length){for(var r=0;r<i.sel.ranges.length;r++){i.sel.ranges[r].goalColumn=o[r]}}}),findWordAt:function(i){var f=this.doc,n=t(f,i.line).text,r=i.ch,o=i.ch;if(n){var u=this.getHelper(i,"wordChars");if((i.sticky=="before"||o==n.length)&&r){--r} +else{++o};var l=n.charAt(r),a=Yt(l,u)?function(e){return Yt(e,u)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return(!/\s/.test(e)&&!Yt(e))} +while(r>0&&a(n.charAt(r-1))){--r} +while(o<n.length&&a(n.charAt(o))){++o}};return new s(e(i.line,r),e(i.line,o))},toggleOverwrite:function(e){if(e!=null&&e==this.state.overwrite){return};if(this.state.overwrite=!this.state.overwrite){ge(this.display.cursorDiv,"CodeMirror-overwrite")} +else{de(this.display.cursorDiv,"CodeMirror-overwrite")};p(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==Y()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:L(function(e,t){Lt(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-K(this)-this.display.barHeight,width:e.scrollWidth-K(this)-this.display.barWidth,clientHeight:er(this),clientWidth:xe(this)}},scrollIntoView:L(function(t,i){if(t==null){t={from:this.doc.sel.primary().head,to:null};if(i==null){i=this.options.cursorScrollMargin}} +else if(typeof t=="number"){t={from:e(t,0),to:null}} +else if(t.from==null){t={from:t,to:null}};if(!t.to){t.to=t.from};t.margin=i||0;if(t.from.line!=null){ws(this,t)} +else{Qn(this,t.from,t.to,t.margin)}}),setSize:L(function(e,t){var n=this,r=function(e){return typeof e=="number"||/^\d+$/.test(String(e))?e+"px":e};if(e!=null){this.display.wrapper.style.width=r(e)};if(t!=null){this.display.wrapper.style.height=r(t)};if(this.options.lineWrapping){Pn(this)};var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++){if(e.widgets[t].noHScroll){oe(n,i,"widget");break}}};++i});this.curOp.forceUpdate=!0;p(this,"refresh",this)}),operation:function(e){return N(this,e)},startOperation:function(){return Te(this)},endOperation:function(){return Me(this)},refresh:L(function(){var e=this.display.cachedTextHeight;M(this);this.curOp.forceUpdate=!0;wt(this);Lt(this,this.doc.scrollLeft,this.doc.scrollTop);mr(this);if(e==null||Math.abs(e-Ce(this.display))>.5){ur(this)};p(this,"refresh",this)}),swapDoc:L(function(e){var t=this.doc;t.cm=null;fo(this,e);wt(this);this.display.input.reset();Lt(this,e.scrollLeft,e.scrollTop);this.curOp.forceScroll=!0;w(this,"swapDoc",this,t);return t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Pe(i);i.registerHelper=function(e,t,n){if(!r.hasOwnProperty(e)){r[e]=i[e]={_global:[]}};r[e][t]=n};i.registerGlobalHelper=function(e,t,n,o){i.registerHelper(e,t,o);r[e]._global.push({pred:n,val:o})}};function Dr(i,r,n,o,l){var g=r,m=n,a=t(i,r.line);function y(){var o=r.line+n;if(o<i.first||o>=i.first+i.size){return!1};r=new e(o,r.ch,r.sticky);return a=t(i,o)};function u(e){var t;if(l){t=ra(i.cm,a,r,n)} +else{t=Nr(a,r,n)};if(t==null){if(!e&&y()){r=Or(l,i.cm,a,r.line,n)} +else{return!1}} +else{r=t};return!0};if(o=="char"){u()} +else if(o=="column"){u(!0)} +else if(o=="word"||o=="group"){var d=null,p=o=="group",v=i.cm&&i.cm.getHelper(r,"wordChars");for(var f=!0;;f=!1){if(n<0&&!u(!f)){break};var h=a.text.charAt(r.ch)||"\n",s=Yt(h,v)?"w":p&&h=="\n"?"n":!p||/\s/.test(h)?null:"p";if(p&&!f&&!s){s="s"};if(d&&d!=s){if(n<0){n=1;u();r.sticky="after"};break};if(s){d=s};if(n>0&&!u(!f)){break}}};var c=Tr(i,r,g,m,!0);if(Ii(g,c)){c.hitSide=!0};return c};function rl(e,t,i,r){var a=e.doc,u=t.left,n;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*Ce(e.display),3);n=(i>0?t.bottom:t.top)+i*s} +else if(r=="line"){n=i>0?t.bottom+3:t.top-3};var o;for(;;){o=or(e,u,n);if(!o.outside){break};if(i<0?n<=0:n>=a.height){o.hitSide=!0;break};n+=i*5};return o};var f=function(e){this.cm=e;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new ce();this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};f.prototype.init=function(e){var i=this,o=this,t=o.cm,n=o.div=e.lineDiv;tl(n,t.options.spellcheck);r(n,"paste",function(e){if(v(t,e)||Qo(e,t)){return};if(c<=11){setTimeout(m(t,function(){return i.updateFromDOM()}),20)}});r(n,"compositionstart",function(e){i.composing={data:e.data,done:!1}});r(n,"compositionupdate",function(e){if(!i.composing){i.composing={data:e.data,done:!1}}});r(n,"compositionend",function(e){if(i.composing){if(e.data!=i.composing.data){i.readFromDOMSoon()};i.composing.done=!0}});r(n,"touchstart",function(){return o.forceCompositionEnd()});r(n,"input",function(){if(!i.composing){i.readFromDOMSoon()}});function l(e){if(v(t,e)){return};if(t.somethingSelected()){mi({lineWise:!1,text:t.getSelections()});if(e.type=="cut"){t.replaceSelection("",null,"cut")}} +else if(!t.options.lineWiseCopyCut){return} +else{var a=el(t);mi({lineWise:!0,text:a.text});if(e.type=="cut"){t.operation(function(){t.setSelections(a.ranges,0,G);t.replaceSelection("",null,"cut")})}};if(e.clipboardData){e.clipboardData.clearData();var s=P.text.join("\n");e.clipboardData.setData("Text",s);if(e.clipboardData.getData("Text")==s){e.preventDefault();return}};var i=il(),l=i.firstChild;t.display.lineSpace.insertBefore(i,t.display.lineSpace.firstChild);l.value=P.text.join("\n");var r=document.activeElement;lt(l);setTimeout(function(){t.display.lineSpace.removeChild(i);r.focus();if(r==n){o.showPrimarySelection()}},50)};r(n,"copy",l);r(n,"cut",l)};f.prototype.prepareSelection=function(){var e=Vn(this.cm,!1);e.focus=this.cm.state.focused;return e};f.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length){return};if(e.focus||t){this.showPrimarySelection()};this.showMultipleSelections(e)};f.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,g=t.doc.sel.primary(),c=g.from(),h=g.to();if(t.display.viewTo==t.display.viewFrom||c.line>=t.display.viewTo||h.line<t.display.viewFrom){e.removeAllRanges();return};var u=yi(t,e.anchorNode,e.anchorOffset),f=yi(t,e.focusNode,e.focusOffset);if(u&&!u.bad&&f&&!f.bad&&n(Zt(u,f),c)==0&&n(qt(u,f),h)==0){return};var d=t.display.view,s=(c.line>=t.display.viewFrom&&nl(t,c))||{node:d[0].measure.map[2],offset:0};var l=h.line<t.display.viewTo&&nl(t,h);if(!l){var a=d[d.length-1].measure,r=a.maps?a.maps[a.maps.length-1]:a.map;l={node:r[r.length-1],offset:r[r.length-2]-r[r.length-3]}};if(!s||!l){e.removeAllRanges();return};var p=e.rangeCount&&e.getRangeAt(0),o;try{o=he(s.node,s.offset,l.offset,l.node)}catch(i){};if(o){if(!ie&&t.state.focused){e.collapse(s.node,s.offset);if(!o.collapsed){e.removeAllRanges();e.addRange(o)}} +else{e.removeAllRanges();e.addRange(o)};if(p&&e.anchorNode==null){e.addRange(p)} +else if(ie){this.startGracePeriod()}};this.rememberSelection()};f.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){e.gracePeriod=!1;if(e.selectionChanged()){e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})}},20)};f.prototype.showMultipleSelections=function(e){W(this.cm.display.cursorDiv,e.cursors);W(this.cm.display.selectionDiv,e.selection)};f.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode;this.lastAnchorOffset=e.anchorOffset;this.lastFocusNode=e.focusNode;this.lastFocusOffset=e.focusOffset};f.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount){return!1};var t=e.getRangeAt(0).commonAncestorContainer;return ne(this.div,t)};f.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()){this.showSelection(this.prepareSelection(),!0)};this.div.focus()}};f.prototype.blur=function(){this.div.blur()};f.prototype.getField=function(){return this.div};f.prototype.supportsTouch=function(){return!0};f.prototype.receivedFocus=function(){var e=this;if(this.selectionInEditor()){this.pollSelection()} +else{N(this.cm,function(){return e.cm.curOp.selectionChanged=!0})};function t(){if(e.cm.state.focused){e.pollSelection();e.polling.set(e.cm.options.pollInterval,t)}};this.polling.set(this.cm.options.pollInterval,t)};f.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset};f.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return};var e=window.getSelection(),t=this.cm;if(Xt&&Kt&&this.cm.options.gutters.length&&xa(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return};if(this.composing){return};this.rememberSelection();var i=yi(t,e.anchorNode,e.anchorOffset),r=yi(t,e.focusNode,e.focusOffset);if(i&&r){N(t,function(){C(t.doc,se(i,r),G);if(i.bad||r.bad){t.curOp.selectionChanged=!0}})}};f.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null};var r=this.cm,o=r.display,k=r.doc.sel.primary(),f=k.from(),g=k.to();if(f.ch==0&&f.line>r.firstLine()){f=e(f.line-1,t(r.doc,f.line-1).length)};if(g.ch==t(r.doc,g.line).text.length&&g.line<r.lastLine()){g=e(g.line+1,0)};if(f.line<o.viewFrom||g.line>o.viewTo-1){return!1};var w,p,m;if(f.line==o.viewFrom||(w=Le(r,f.line))==0){p=u(o.view[0].line);m=o.view[0].node} +else{p=u(o.view[w].line);m=o.view[w-1].node.nextSibling};var y=Le(r,g.line),d,b;if(y==o.view.length-1){d=o.viewTo-1;b=o.lineDiv.lastChild} +else{d=u(o.view[y+1].line)-1;b=o.view[y+1].node.previousSibling};if(!m){return!1};var i=r.doc.splitLines(Ca(r,m,b,p,d)),s=me(r.doc,e(p,0),e(d,t(r.doc,d).text.length));while(i.length>1&&s.length>1){if(a(i)==a(s)){i.pop();s.pop();d--} +else if(i[0]==s[0]){i.shift();s.shift();p++} +else{break}};var l=0,c=0,S=i[0],L=s[0],M=Math.min(S.length,L.length);while(l<M&&S.charCodeAt(l)==L.charCodeAt(l)){++l};var h=a(i),v=a(s),T=Math.min(h.length-(i.length==1?l:0),v.length-(s.length==1?l:0));while(c<T&&h.charCodeAt(h.length-c-1)==v.charCodeAt(v.length-c-1)){++c};if(i.length==1&&s.length==1&&p==f.line){while(l&&l>f.ch&&h.charCodeAt(h.length-c-1)==v.charCodeAt(v.length-c-1)){l--;c++}};i[i.length-1]=h.slice(0,h.length-c).replace(/^\u200b+/,"");i[0]=i[0].slice(l).replace(/\u200b+$/,"");var x=e(p,l),C=e(d,s.length?a(s).length-c:0);if(i.length>1||i[0]||n(x,C)){Ue(r.doc,i,x,C,"+input");return!0}};f.prototype.ensurePolled=function(){this.forceCompositionEnd()};f.prototype.reset=function(){this.forceCompositionEnd()};f.prototype.forceCompositionEnd=function(){if(!this.composing){return};clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};f.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null){return};this.readDOMTimeout=setTimeout(function(){e.readDOMTimeout=null;if(e.composing){if(e.composing.done){e.composing=null} +else{return}};e.updateFromDOM()},80)};f.prototype.updateFromDOM=function(){var e=this;if(this.cm.isReadOnly()||!this.pollContent()){N(this.cm,function(){return M(e.cm)})}};f.prototype.setUneditable=function(e){e.contentEditable="false"};f.prototype.onKeyPress=function(e){if(e.charCode==0){return};e.preventDefault();if(!this.cm.isReadOnly()){m(this.cm,Wr)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)}};f.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")};f.prototype.onContextMenu=function(){};f.prototype.resetPosition=function(){};f.prototype.needsContentAttribute=!0;function nl(e,i){var n=tr(e,i.line);if(!n||n.hidden){return null};var o=t(e.doc,i.line),u=Wn(n,o,i.line),l=Z(o,e.doc.direction),s="left";if(l){var a=gt(l,i.ch);s=a%2?"right":"left"};var r=Hn(u.map,i.ch,s);r.offset=r.collapse=="right"?r.end:r.start;return r};function xa(e){for(var t=e;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return!0}};return!1};function je(e,t){if(t){e.bad=!0};return e};function Ca(t,i,r,n,o){var l="",s=!1,u=t.doc.lineSeparator();function h(e){return function(t){return t.id==e}};function f(){if(s){l+=u;s=!1}};function a(e){if(e){f();l+=e}};function c(i){if(i.nodeType==1){var v=i.getAttribute("cm-text");if(v!=null){a(v||i.textContent.replace(/\u200b/g,""));return};var g=i.getAttribute("cm-marker"),l;if(g){var p=t.findMarks(e(n,0),e(o+1,0),h(+g));if(p.length&&(l=p[0].find(0))){a(me(t.doc,l.from,l.to).join(u))};return};if(i.getAttribute("contenteditable")=="false"){return};var d=/^(pre|div|p)$/i.test(i.nodeName);if(d){f()};for(var r=0;r<i.childNodes.length;r++){c(i.childNodes[r])};if(d){s=!0}} +else if(i.nodeType==3){a(i.nodeValue)}};for(;;){c(i);if(i==r){break};i=i.nextSibling};return l};function yi(t,i,r){var n;if(i==t.display.lineDiv){n=t.display.lineDiv.childNodes[r];if(!n){return je(t.clipPos(e(t.display.viewTo-1)),!0)};i=null;r=0} +else{for(n=i;;n=n.parentNode){if(!n||n==t.display.lineDiv){return null};if(n.parentNode&&n.parentNode==t.display.lineDiv){break}}};for(var o=0;o<t.display.view.length;o++){var l=t.display.view[o];if(l.node==n){return Sa(l,i,r)}}};function Sa(t,i,r){var h=t.text.firstChild,c=!1;if(!i||!ne(h,i)){return je(e(u(t.line),0),!0)};if(i==h){c=!0;i=h.childNodes[r];r=0;if(!i){var y=t.rest?a(t.rest):t.line;return je(e(u(y),y.text.length),c)}};var s=i.nodeType==3?i:null,f=i;if(!s&&i.childNodes.length==1&&i.firstChild.nodeType==3){s=i.firstChild;if(r){r=s.nodeValue.length}} +while(f.parentNode!=h){f=f.parentNode};var m=t.measure,d=m.maps;function p(i,r,n){for(var o=-1;o<(d?d.length:0);o++){var s=o<0?m.map:d[o];for(var l=0;l<s.length;l+=3){var a=s[l+2];if(a==i||a==r){var c=u(o<0?t.line:t.rest[o]),f=s[l]+n;if(n<0||a!=i){f=s[l+(n?1:0)]};return e(c,f)}}}};var n=p(s,f,r);if(n){return je(n,c)};for(var l=f.nextSibling,v=s?s.nodeValue.length-r:0;l;l=l.nextSibling){n=p(l,l.firstChild,0);if(n){return je(e(n.line,n.ch-v),c)} +else{v+=l.textContent.length}};for(var o=f.previousSibling,g=r;o;o=o.previousSibling){n=p(o,o.firstChild,-1);if(n){return je(e(n.line,n.ch+g),c)} +else{g+=o.textContent.length}}};var g=function(e){this.cm=e;this.prevInput="";this.pollingFast=!1;this.polling=new ce();this.hasSelection=!1;this.composing=null};g.prototype.init=function(e){var o=this,i=this,t=this.cm,s=this.wrapper=il(),n=this.textarea=s.firstChild;e.wrapper.insertBefore(s,e.wrapper.firstChild);if(at){n.style.width="0px"};r(n,"input",function(){if(l&&c>=9&&o.hasSelection){o.hasSelection=null};i.poll()});r(n,"paste",function(e){if(v(t,e)||Qo(e,t)){return};t.state.pasteIncoming=!0;i.fastPoll()});function a(e){if(v(t,e)){return};if(t.somethingSelected()){mi({lineWise:!1,text:t.getSelections()})} +else if(!t.options.lineWiseCopyCut){return} +else{var r=el(t);mi({lineWise:!0,text:r.text});if(e.type=="cut"){t.setSelections(r.ranges,null,G)} +else{i.prevInput="";n.value=r.text.join("\n");lt(n)}};if(e.type=="cut"){t.state.cutIncoming=!0}};r(n,"cut",a);r(n,"copy",a);r(e.scroller,"paste",function(r){if(Q(e,r)||v(t,r)){return};t.state.pasteIncoming=!0;i.focus()});r(e.lineSpace,"selectstart",function(t){if(!Q(e,t)){T(t)}});r(n,"compositionstart",function(){var e=t.getCursor("from");if(i.composing){i.composing.range.clear()};i.composing={start:e,range:t.markText(e,t.getCursor("to"),{className:"CodeMirror-composing"})}});r(n,"compositionend",function(){if(i.composing){i.poll();i.composing.range.clear();i.composing=null}})};g.prototype.prepareSelection=function(){var e=this.cm,t=e.display,l=e.doc,i=Vn(e);if(e.options.moveInputWithCursor){var r=z(e,l.sel.primary().head,"div"),n=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+o.top-n.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+o.left-n.left))};return i};g.prototype.showSelection=function(e){var i=this.cm,t=i.display;W(t.cursorDiv,e.cursors);W(t.selectionDiv,e.selection);if(e.teTop!=null){this.wrapper.style.top=e.teTop+"px";this.wrapper.style.left=e.teLeft+"px"}};g.prototype.reset=function(e){if(this.contextMenuPending||this.composing){return};var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i;if(t.state.focused){lt(this.textarea)};if(l&&c>=9){this.hasSelection=i}} +else if(!e){this.prevInput=this.textarea.value="";if(l&&c>=9){this.hasSelection=null}}};g.prototype.getField=function(){return this.textarea};g.prototype.supportsTouch=function(){return!1};g.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ut||Y()!=this.textarea)){try{this.textarea.focus()}catch(e){}}};g.prototype.blur=function(){this.textarea.blur()};g.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};g.prototype.receivedFocus=function(){this.slowPoll()};g.prototype.slowPoll=function(){var e=this;if(this.pollingFast){return};this.polling.set(this.cm.options.pollInterval,function(){e.poll();if(e.cm.state.focused){e.slowPoll()}})};g.prototype.fastPoll=function(){var t=!1,e=this;e.pollingFast=!0;function i(){var r=e.poll();if(!r&&!t){t=!0;e.polling.set(60,i)} +else{e.pollingFast=!1;e.slowPoll()}};e.polling.set(20,i)};g.prototype.poll=function(){var i=this,e=this.cm,o=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||(hl(o)&&!r&&!this.composing)||e.isReadOnly()||e.options.disableInput||e.state.keySeq){return!1};var t=o.value;if(t==r&&!e.somethingSelected()){return!1};if(l&&c>=9&&this.hasSelection===t||I&&/[\uf700-\uf7ff]/.test(t)){e.display.input.reset();return!1};if(e.doc.sel==e.display.selForContextMenu){var s=t.charCodeAt(0);if(s==0x200b&&!r){r="\u200b"};if(s==0x21da){this.reset();return this.cm.execCommand("undo")}};var n=0,a=Math.min(r.length,t.length);while(n<a&&r.charCodeAt(n)==t.charCodeAt(n)){++n};N(e,function(){Wr(e,t.slice(n),r.length-n,null,i.composing?"*compose":null);if(t.length>1000||t.indexOf("\n")>-1){o.value=i.prevInput=""} +else{i.prevInput=t};if(i.composing){i.composing.range.clear();i.composing.range=e.markText(i.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"})}});return!0};g.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=!1}};g.prototype.onKeyPress=function(){if(l&&c>=9){this.hasSelection=null};this.fastPoll()};g.prototype.onContextMenu=function(e){var o=this,t=o.cm,i=t.display,n=o.textarea,s=Se(t,e),y=i.scroller.scrollTop;if(!s||E){return};var v=t.options.resetSelectionOnContextMenu;if(v&&t.doc.sel.contains(s)==-1){m(t,C)(t.doc,se(s),G)};var p=n.style.cssText,g=o.wrapper.style.cssText;o.wrapper.style.cssText="position: absolute";var f=o.wrapper.getBoundingClientRect();n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var u;if(x){u=window.scrollY};i.input.focus();if(x){window.scrollTo(null,u)};i.input.reset();if(!t.somethingSelected()){n.value=o.prevInput=" "};o.contextMenuPending=!0;i.selForContextMenu=t.doc.sel;clearTimeout(i.detectingSelectAll);function h(){if(n.selectionStart!=null){var e=t.somethingSelected(),r="\u200b"+(e?n.value:"");n.value="\u21da";n.value=r;o.prevInput=e?"":"\u200b";n.selectionStart=1;n.selectionEnd=r.length;i.selForContextMenu=t.doc.sel}};function d(){o.contextMenuPending=!1;o.wrapper.style.cssText=g;n.style.cssText=p;if(l&&c<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=y)};if(n.selectionStart!=null){if(!l||(l&&c<9)){h()};var r=0,e=function(){if(i.selForContextMenu==t.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&o.prevInput=="\u200b"){m(t,Lo)(t)} +else if(r++<10){i.detectingSelectAll=setTimeout(e,500)} +else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(e,200)}};if(l&&c>=9){h()};if(Ni){vt(e);var a=function(){D(window,"mouseup",a);setTimeout(d,20)};r(window,"mouseup",a)} +else{setTimeout(d,50)}};g.prototype.readOnlyChanged=function(e){if(!e){this.reset()};this.textarea.disabled=e=="nocursor"};g.prototype.setUneditable=function(){};g.prototype.needsContentAttribute=!1;function La(e,t){t=t?ve(t):{};t.value=e.value;if(!t.tabindex&&e.tabIndex){t.tabindex=e.tabIndex};if(!t.placeholder&&e.placeholder){t.placeholder=e.placeholder};if(t.autofocus==null){var a=Y();t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body};function o(){e.value=s.getValue()};var l;if(e.form){r(e.form,"submit",o);if(!t.leaveSubmitMethodAlone){var n=e.form;l=n.submit;try{var u=n.submit=function(){o();n.submit=l;n.submit();n.submit=u}}catch(i){}}};t.finishInit=function(t){t.save=o;t.getTextArea=function(){return e};t.toTextArea=function(){t.toTextArea=isNaN;o();e.parentNode.removeChild(t.getWrapperElement());e.style.display="";if(e.form){D(e.form,"submit",o);if(typeof e.form.submit=="function"){e.form.submit=l}}}};e.style.display="none";var s=h(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s};function ka(t){t.off=D;t.on=r;t.wheelEventPixels=Hs;t.Doc=k;t.splitLines=Si;t.countColumn=H;t.findColumn=Wi;t.isWordChar=Hi;t.Pass=Vt;t.signal=p;t.Line=We;t.changeEnd=ae;t.scrollbarModel=Ir;t.Pos=e;t.cmpPos=n;t.modes=Ci;t.mimeModes=He;t.resolveMode=ii;t.getMode=ji;t.modeExtensions=De;t.extendMode=Gl;t.copyState=we;t.startState=pn;t.innerMode=Yi;t.commands=Ze;t.keyMap=j;t.keyName=Io;t.isModifierKey=Po;t.lookupKey=Ke;t.normalizeKeyMap=ia;t.StringStream=d;t.SharedTextMarker=et;t.TextMarker=ee;t.LineWidget=tt;t.e_preventDefault=T;t.e_stopPropagation=hn;t.e_stop=vt;t.addClass=ge;t.contains=ne;t.rmClass=de;t.keyNames=J};va(h);wa(h);var ol="iter insert remove copy getEditor constructor".split(" ");for(var Et in k.prototype){if(k.prototype.hasOwnProperty(Et)&&b(ol,Et)<0){h.prototype[Et]=(function(e){return function(){return e.apply(this.doc,arguments)}})(k.prototype[Et])}};Pe(k);h.inputStyles={"textarea":g,"contenteditable":f};h.defineMode=function(e){if(!h.defaults.mode&&e!="null"){h.defaults.mode=e};Rl.apply(this,arguments)};h.defineMIME=Bl;h.defineMode("null",function(){return({token:function(e){return e.skipToEnd()}})});h.defineMIME("text/plain","null");h.defineExtension=function(e,t){h.prototype[e]=t};h.defineDocExtension=function(e,t){k.prototype[e]=t};h.fromTextArea=La;ka(h);h.version="5.32.0";return h})));(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("smalltalk",function(e){var s=/[+\-\/\\*~<>=@%|&?!.,:;^]/,u=/true|false|nil|self|super|thisContext/,t=function(e,t){this.next=e;this.parent=t},n=function(e,t,n){this.name=e;this.context=t;this.eos=n},l=function(){this.context=new t(i,null);this.expectVariable=!0;this.indentation=0;this.userIndentationDelta=0};l.prototype.userIndent=function(t){this.userIndentationDelta=t>0?(t/e.indentUnit-this.indentation):0};var i=function(e,l,d){var i=new n(null,l,!1),c=e.next();if(c==="\""){i=a(e,new t(a,l))} +else if(c==="'"){i=r(e,new t(r,l))} +else if(c==="#"){if(e.peek()==="'"){e.next();i=o(e,new t(o,l))} +else{if(e.eatWhile(/[^\s.{}\[\]()]/))i.name="string-2";else i.name="meta"}} +else if(c==="$"){if(e.next()==="<"){e.eatWhile(/[^\s>]/);e.next()};i.name="string-2"} +else if(c==="|"&&d.expectVariable){i.context=new t(f,l)} +else if(/[\[\]{}()]/.test(c)){i.name="bracket";i.eos=/[\[{(]/.test(c);if(c==="["){d.indentation++} +else if(c==="]"){d.indentation=Math.max(0,d.indentation-1)}} +else if(s.test(c)){e.eatWhile(s);i.name="operator";i.eos=c!==";"} +else if(/\d/.test(c)){e.eatWhile(/[\w\d]/);i.name="number"} +else if(/[\w_]/.test(c)){e.eatWhile(/[\w\d_]/);i.name=d.expectVariable?(u.test(e.current())?"keyword":"variable"):null} +else{i.eos=d.expectVariable};return i},a=function(e,t){e.eatWhile(/[^"]/);return new n("comment",e.eat("\"")?t.parent:t,!0)},r=function(e,t){e.eatWhile(/[^']/);return new n("string",e.eat("'")?t.parent:t,!1)},o=function(e,t){e.eatWhile(/[^']/);return new n("string-2",e.eat("'")?t.parent:t,!1)},f=function(e,t){var i=new n(null,t,!1),a=e.next();if(a==="|"){i.context=t.parent;i.eos=!0} +else{e.eatWhile(/[^|]/);i.name="variable"};return i};return{startState:function(){return new l},token:function(e,t){t.userIndent(e.indentation());if(e.eatSpace()){return null};var n=t.context.next(e,t.context,t);t.context=n.context;t.expectVariable=n.eos;return n.name},blankLine:function(e){e.userIndent(0)},indent:function(t,n){var a=t.context.next===i&&n&&n.charAt(0)==="]"?-1:t.userIndentationDelta;return(t.indentation+a)*e.indentUnit},electricChars:"]"}});e.defineMIME("text/x-stsrc",{name:"smalltalk"})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../clike/clike'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../clike/clike'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){var r={},s=e.split(' ');for(var t=0;t<s.length;++t)r[s[t]]=!0;return r};function s(e,t,i){if(e.length==0)return r(t);return function(l,n){var o=e[0];for(var a=0;a<o.length;a++)if(l.match(o[a][0])){n.tokenize=s(e.slice(1),t);return o[a][1]};n.tokenize=r(t,i);return'string'}};function r(e,t){return function(r,s){return o(r,s,e,t)}};function o(e,t,i,r){if(r!==!1&&e.match('${',!1)||e.match('{$',!1)){t.tokenize=null;return'string'};if(r!==!1&&e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)){if(e.match('[',!1)){t.tokenize=s([[['[',null]],[[/\d[\w\.]*/,'number'],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,'variable-2'],[/[\w\$]+/,'variable']],[[']',null]]],i,r)};if(e.match(/\-\>\w/,!1)){t.tokenize=s([[['->',null]],[[/[\w]+/,'variable']]],i,r)};return'variable-2'};var l=!1;while(!e.eol()&&(l||r===!1||(!e.match('{$',!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1)))){if(!l&&e.match(i)){t.tokenize=null;t.tokStack.pop();t.tokStack.pop();break};l=e.next()=='\\'&&!l};return'string'};var l='abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally',n='true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__',a='func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count';e.registerHelper('hintWords','php',[l,n,a].join(' ').split(' '));e.registerHelper('wordChars','php',/[\w$]/);var i={name:'clike',helperType:'php',keywords:t(l),blockKeywords:t('catch do else elseif for foreach if switch try while finally'),defKeywords:t('class function interface namespace trait'),atoms:t(n),builtin:t(a),multiLineStrings:!0,hooks:{'$':function(e){e.eatWhile(/[\w\$_]/);return'variable-2'},'<':function(e,t){var l;if(l=e.match(/<<\s*/)){var s=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var i=e.current().slice(l[0].length+(s?2:1));if(s)e.eat(s);if(i){(t.tokStack||(t.tokStack=[])).push(i,0);t.tokenize=r(i,s!='\'');return'string'}};return!1},'#':function(e){while(!e.eol()&&!e.match('?>',!1))e.next();return'comment'},'/':function(e){if(e.eat('/')){while(!e.eol()&&!e.match('?>',!1))e.next();return'comment'};return!1},'"':function(e,t){(t.tokStack||(t.tokStack=[])).push('"',0);t.tokenize=r('"');return'string'},'{':function(e,t){if(t.tokStack&&t.tokStack.length)t.tokStack[t.tokStack.length-1]++;return!1},'}':function(e,t){if(t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]){t.tokenize=r(t.tokStack[t.tokStack.length-2])};return!1}}};e.defineMode('php',function(t,r){var l=e.getMode(t,(r&&r.htmlMode)||'text/html'),s=e.getMode(t,i);function n(r,t){var c=t.curMode==s;if(r.sol()&&t.pending&&t.pending!='"'&&t.pending!='\'')t.pending=null;if(!c){if(r.match(/^<\?\w*/)){t.curMode=s;if(!t.php)t.php=e.startState(s,l.indent(t.html,''));t.curState=t.php;return'meta'};if(t.pending=='"'||t.pending=='\''){while(!r.eol()&&r.next()!=t.pending){};var i='string'} +else if(t.pending&&r.pos<t.pending.end){r.pos=t.pending.end;var i=t.pending.style} +else{var i=l.token(r,t.curState)};if(t.pending)t.pending=null;var n=r.current(),a=n.search(/<\?/),o;if(a!=-1){if(i=='string'&&(o=n.match(/['"]$/))&&!/\?>/.test(n))t.pending=o[0];else t.pending={end:r.pos,style:i};r.backUp(n.length-a)};return i} +else if(c&&t.php.tokenize==null&&r.match('?>')){t.curMode=l;t.curState=t.html;if(!t.php.context.prev)t.php=null;return'meta'} +else{return s.token(r,t.curState)}};return{startState:function(){var t=e.startState(l),i=r.startOpen?e.startState(s):null;return{html:t,php:i,curMode:r.startOpen?s:l,curState:r.startOpen?i:t,pending:null}},copyState:function(t){var o=t.html,i=e.copyState(l,o),n=t.php,a=n&&e.copyState(s,n),r;if(t.curMode==l)r=i;else r=a;return{html:i,php:a,curMode:t.curMode,curState:r,pending:t.pending}},token:n,indent:function(e,t){if((e.curMode!=s&&/^\s*<\//.test(t))||(e.curMode==s&&/^\?>/.test(t)))return l.indent(e.html,t);return e.curMode.indent(e.curState,t)},blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:'//',innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},'htmlmixed','clike');e.defineMIME('application/x-httpd-php','php');e.defineMIME('application/x-httpd-php-open',{name:'php',startOpen:!0});e.defineMIME('text/x-php',i)});(function(E){if(typeof exports=="object"&&typeof module=="object")E(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],E);else E(CodeMirror)})(function(E){"use strict";E.defineMode("cobol",function(){var C="builtin",L="comment",A="string",O="atom",D="number",S="keyword",U="header",e="def",P="link";function T(E){var I={},N=E.split(" ");for(var T=0;T<N.length;++T)I[N[T]]=!0;return I};var I=T("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES "),N=T("ACCEPT ACCESS ACQUIRE ADD ADDRESS ADVANCING AFTER ALIAS ALL ALPHABET ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALSO ALTER ALTERNATE AND ANY ARE AREA AREAS ARITHMETIC ASCENDING ASSIGN AT ATTRIBUTE AUTHOR AUTO AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP BEFORE BELL BINARY BIT BITS BLANK BLINK BLOCK BOOLEAN BOTTOM BY CALL CANCEL CD CF CH CHARACTER CHARACTERS CLASS CLOCK-UNITS CLOSE COBOL CODE CODE-SET COL COLLATING COLUMN COMMA COMMIT COMMITMENT COMMON COMMUNICATION COMP COMP-0 COMP-1 COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS CONVERTING COPY CORR CORRESPONDING COUNT CRT CRT-UNDER CURRENCY CURRENT CURSOR DATA DATE DATE-COMPILED DATE-WRITTEN DAY DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION DOWN DROP DUPLICATE DUPLICATES DYNAMIC EBCDIC EGI EJECT ELSE EMI EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT END-UNSTRING END-WRITE END-XML ENTER ENTRY ENVIRONMENT EOP EQUAL EQUALS ERASE ERROR ESI EVALUATE EVERY EXCEEDS EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL FILE-STREAM FILES FILLER FINAL FIND FINISH FIRST FOOTING FOR FOREGROUND-COLOR FOREGROUND-COLOUR FORMAT FREE FROM FULL FUNCTION GENERATE GET GIVING GLOBAL GO GOBACK GREATER GROUP HEADING HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL ID IDENTIFICATION IF IN INDEX INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED INDIC INDICATE INDICATOR INDICATORS INITIAL INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT INSTALLATION INTO INVALID INVOKE IS JUST JUSTIFIED KANJI KEEP KEY LABEL LAST LD LEADING LEFT LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE LOCALE LOCALLY LOCK MEMBER MEMORY MERGE MESSAGE METACLASS MODE MODIFIED MODIFY MODULES MOVE MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE NEXT NO NO-ECHO NONE NOT NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS OF OFF OMITTED ON ONLY OPEN OPTIONAL OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL PADDING PAGE PAGE-COUNTER PARSE PERFORM PF PH PIC PICTURE PLUS POINTER POSITION POSITIVE PREFIX PRESENT PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID PROMPT PROTECTED PURGE QUEUE QUOTE QUOTES RANDOM RD READ READY REALM RECEIVE RECONNECT RECORD RECORD-NAME RECORDS RECURSIVE REDEFINES REEL REFERENCE REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE REMAINDER REMOVAL RENAMES REPEATED REPLACE REPLACING REPORT REPORTING REPORTS REPOSITORY REQUIRED RERUN RESERVE RESET RETAINING RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO REVERSED REWIND REWRITE RF RH RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED RUN SAME SCREEN SD SEARCH SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT SELECT SEND SENTENCE SEPARATE SEQUENCE SEQUENTIAL SET SHARED SIGN SIZE SKIP1 SKIP2 SKIP3 SORT SORT-MERGE SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 START STARTING STATUS STOP STORE STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT TABLE TALLYING TAPE TENANT TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TITLE TO TOP TRAILING TRAILING-SIGN TRANSACTION TYPE TYPEDEF UNDERLINE UNEQUAL UNIT UNSTRING UNTIL UP UPDATE UPON USAGE USAGE-MODE USE USING VALID VALIDATE VALUE VALUES VARYING VLR WAIT WHEN WHEN-COMPILED WITH WITHIN WORDS WORKING-STORAGE WRITE XML XML-CODE XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL "),R=T("- * ** / + < <= = > >= "),E={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};function M(I,T){if(I==="0"&&T.eat(/x/i)){T.eatWhile(E.hex);return!0};if((I=="+"||I=="-")&&(E.digit.test(T.peek()))){T.eat(E.sign);I=T.next()};if(E.digit.test(I)){T.eat(I);T.eatWhile(E.digit);if("."==T.peek()){T.eat(".");T.eatWhile(E.digit)};if(T.eat(E.exponent)){T.eat(E.sign);T.eatWhile(E.digit)};return!0};return!1};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(T,n){if(n.indentStack==null&&T.sol()){n.indentation=6};if(T.eatSpace()){return null};var t=null;switch(n.mode){case"string":var r=!1;while((r=T.next())!=null){if(r=="\""||r=="'"){n.mode=!1;break}};t=A;break;default:var G=T.next();var i=T.column();if(i>=0&&i<=5){t=e} +else if(i>=72&&i<=79){T.skipToEnd();t=U} +else if(G=="*"&&i==6){T.skipToEnd();t=L} +else if(G=="\""||G=="'"){n.mode="string";t=A} +else if(G=="'"&&!(E.digit_or_colon.test(T.peek()))){t=O} +else if(G=="."){t=P} +else if(M(G,T)){t=D} +else{if(T.current().match(E.symbol)){while(i<71){if(T.eat(E.symbol)===undefined){break} +else{i++}}};if(N&&N.propertyIsEnumerable(T.current().toUpperCase())){t=S} +else if(R&&R.propertyIsEnumerable(T.current().toUpperCase())){t=C} +else if(I&&I.propertyIsEnumerable(T.current().toUpperCase())){t=O} +else t=null}};return t},indent:function(E){if(E.indentStack==null)return E.indentation;return E.indentStack.indent}}});E.defineMIME("text/x-cobol","cobol")});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("haskell",function(e,r){function a(e,r,t){r(t);return t(e,r)};var c=/[a-z_]/,d=/[A-Z]/,n=/\d/,m=/[0-9A-Fa-f]/,h=/[0-7]/,l=/[a-z_A-Z0-9'\xa1-\uffff]/,i=/[-!#$%&*+.\/<=>?@\\^|~:]/,p=/[(),;[\]`{}]/,u=/[ \t\v\f]/;function t(e,t){if(e.eatWhile(u)){return null};var r=e.next();if(p.test(r)){if(r=="{"&&e.eat("-")){var o="comment";if(e.eat("#")){o="meta"};return a(e,t,f(o,1))};return null};if(r=="'"){if(e.eat("\\")){e.next()} +else{e.next()};if(e.eat("'")){return"string"};return"string error"};if(r=="\""){return a(e,t,s)};if(d.test(r)){e.eatWhile(l);if(e.eat(".")){return"qualifier"};return"variable-2"};if(c.test(r)){e.eatWhile(l);return"variable"};if(n.test(r)){if(r=="0"){if(e.eat(/[xX]/)){e.eatWhile(m);return"integer"};if(e.eat(/[oO]/)){e.eatWhile(h);return"number"}};e.eatWhile(n);var o="number";if(e.match(/^\.\d+/)){o="number"};if(e.eat(/[eE]/)){o="number";e.eat(/[-+]/);e.eatWhile(n)};return o};if(r=="."&&e.eat("."))return"keyword";if(i.test(r)){if(r=="-"&&e.eat(/-/)){e.eatWhile(/-/);if(!e.eat(i)){e.skipToEnd();return"comment"}};var o="variable";if(r==":"){o="variable-2"};e.eatWhile(i);return o};return"error"};function f(e,r){if(r==0){return t};return function(n,i){var a=r;while(!n.eol()){var o=n.next();if(o=="{"&&n.eat("-")){++a} +else if(o=="-"&&n.eat("}")){--a;if(a==0){i(t);return e}}};i(f(e,a));return e}};function s(e,r){while(!e.eol()){var n=e.next();if(n=="\""){r(t);return"string"};if(n=="\\"){if(e.eol()||e.eat(u)){r(g);return"string"};if(e.eat("&")){} +else{e.next()}}};r(t);return"string error"};function g(e,r){if(e.eat("\\")){return a(e,r,s)};e.next();r(t);return"error"};var o=(function(){var i={};function e(e){return function(){for(var r=0;r<arguments.length;r++)i[arguments[r]]=e}};e("keyword")("case","class","data","default","deriving","do","else","foreign","if","import","in","infix","infixl","infixr","instance","let","module","newtype","of","then","type","where","_");e("keyword")("\.\.",":","::","=","\\","<-","->","@","~","=>");e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<=","=<<","==",">",">=",">>",">>=","^","^^","||","*","**");e("builtin")("Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True");e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var t=r.overrideKeywords;if(t)for(var n in t)if(t.hasOwnProperty(n))i[n]=t[n];return i})();return{startState:function(){return{f:t}},copyState:function(e){return{f:e.f}},token:function(e,r){var n=r.f(e,function(e){r.f=e}),t=e.current();return o.hasOwnProperty(t)?o[t]:n},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}});e.defineMIME("text/x-haskell","haskell")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('mathematica',function(e,t){var n='[a-zA-Z\\$][a-zA-Z0-9\\$]*',o='(?:\\d+)',a='(?:\\.\\d+|\\d+\\.\\d*|\\d+)',m='(?:\\.\\w+|\\w+\\.\\w*|\\w+)',i='(?:`(?:`?'+a+')?)',c=new RegExp('(?:'+o+'(?:\\^\\^'+m+i+'?(?:\\*\\^[+-]?\\d+)?))'),f=new RegExp('(?:'+a+i+'?(?:\\*\\^[+-]?\\d+)?)'),u=new RegExp('(?:`?)(?:'+n+')(?:`(?:'+n+'))*(?:`?)');function r(e,t){var r;r=e.next();if(r==='"'){t.tokenize=z;return t.tokenize(e,t)};if(r==='('){if(e.eat('*')){t.commentLevel++;t.tokenize=l;return t.tokenize(e,t)}};e.backUp(1);if(e.match(c,!0,!1)){return'number'};if(e.match(f,!0,!1)){return'number'};if(e.match(/(?:In|Out)\[[0-9]*\]/,!0,!1)){return'atom'};if(e.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/,!0,!1)){return'meta'};if(e.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/,!0,!1)){return'string-2'};if(e.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/,!0,!1)){return'variable-2'};if(e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)){return'variable-2'};if(e.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/,!0,!1)){return'variable-2'};if(e.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/,!0,!1)){return'variable-2'};if(e.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/,!0,!1)){return'variable-3'};if(e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)){return'bracket'};if(e.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/,!0,!1)){return'variable-2'};if(e.match(u,!0,!1)){return'keyword'};if(e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/,!0,!1)){return'operator'};e.next();return'error'};function z(e,t){var a,i=!1,n=!1;while((a=e.next())!=null){if(a==='"'&&!n){i=!0;break};n=!n&&a==='\\'};if(i&&!n){t.tokenize=r};return'string'};function l(t,e){var a,n;while(e.commentLevel>0&&(n=t.next())!=null){if(a==='('&&n==='*')e.commentLevel++;if(a==='*'&&n===')')e.commentLevel--;a=n};if(e.commentLevel<=0){e.tokenize=r};return'comment'};return{startState:function(){return{tokenize:r,commentLevel:0}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)},blockCommentStart:'(*',blockCommentEnd:'*)'}});e.defineMIME('text/x-mathematica',{name:'mathematica'})});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../javascript/javascript'),require('../css/css'),require('../htmlmixed/htmlmixed'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../javascript/javascript','../css/css','../htmlmixed/htmlmixed'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('pug',function(e){var i='keyword',p='meta',l='builtin',h='qualifier',s={'{':'}','(':')','[':']'};var n=t.getMode(e,'javascript');function r(){this.javaScriptLine=!1;this.javaScriptLineExcludesColon=!1;this.javaScriptArguments=!1;this.javaScriptArgumentsDepth=0;this.isInterpolating=!1;this.interpolationNesting=0;this.jsState=t.startState(n);this.restOfLine='';this.isIncludeFiltered=!1;this.isEach=!1;this.lastTag='';this.scriptType='';this.isAttrs=!1;this.attrsNest=[];this.inAttributeName=!0;this.attributeIsType=!1;this.attrValue='';this.indentOf=Infinity;this.indentToken='';this.innerMode=null;this.innerState=null;this.innerModeForLine=!1};r.prototype.copy=function(){var e=new r();e.javaScriptLine=this.javaScriptLine;e.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon;e.javaScriptArguments=this.javaScriptArguments;e.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth;e.isInterpolating=this.isInterpolating;e.interpolationNesting=this.interpolationNesting;e.jsState=t.copyState(n,this.jsState);e.innerMode=this.innerMode;if(this.innerMode&&this.innerState){e.innerState=t.copyState(this.innerMode,this.innerState)};e.restOfLine=this.restOfLine;e.isIncludeFiltered=this.isIncludeFiltered;e.isEach=this.isEach;e.lastTag=this.lastTag;e.scriptType=this.scriptType;e.isAttrs=this.isAttrs;e.attrsNest=this.attrsNest.slice();e.inAttributeName=this.inAttributeName;e.attributeIsType=this.attributeIsType;e.attrValue=this.attrValue;e.indentOf=this.indentOf;e.indentToken=this.indentToken;e.innerModeForLine=this.innerModeForLine;return e};function d(t,e){if(t.sol()){e.javaScriptLine=!1;e.javaScriptLineExcludesColon=!1};if(e.javaScriptLine){if(e.javaScriptLineExcludesColon&&t.peek()===':'){e.javaScriptLine=!1;e.javaScriptLineExcludesColon=!1;return};var i=n.token(t,e.jsState);if(t.eol())e.javaScriptLine=!1;return i||!0}};function m(t,e){if(e.javaScriptArguments){if(e.javaScriptArgumentsDepth===0&&t.peek()!=='('){e.javaScriptArguments=!1;return};if(t.peek()==='('){e.javaScriptArgumentsDepth++} +else if(t.peek()===')'){e.javaScriptArgumentsDepth--};if(e.javaScriptArgumentsDepth===0){e.javaScriptArguments=!1;return};var i=n.token(t,e.jsState);return i||!0}};function v(t){if(t.match(/^yield\b/)){return'keyword'}};function S(t){if(t.match(/^(?:doctype) *([^\n]+)?/)){return p}};function c(t,e){if(t.match('#{')){e.isInterpolating=!0;e.interpolationNesting=0;return'punctuation'}};function g(t,e){if(e.isInterpolating){if(t.peek()==='}'){e.interpolationNesting--;if(e.interpolationNesting<0){t.next();e.isInterpolating=!1;return'punctuation'}} +else if(t.peek()==='{'){e.interpolationNesting++};return n.token(t,e.jsState)||!0}};function j(t,e){if(t.match(/^case\b/)){e.javaScriptLine=!0;return i}};function b(t,e){if(t.match(/^when\b/)){e.javaScriptLine=!0;e.javaScriptLineExcludesColon=!0;return i}};function L(t){if(t.match(/^default\b/)){return i}};function A(t,e){if(t.match(/^extends?\b/)){e.restOfLine='string';return i}};function y(t,e){if(t.match(/^append\b/)){e.restOfLine='variable';return i}};function k(t,e){if(t.match(/^prepend\b/)){e.restOfLine='variable';return i}};function M(t,e){if(t.match(/^block\b *(?:(prepend|append)\b)?/)){e.restOfLine='variable';return i}};function T(t,e){if(t.match(/^include\b/)){e.restOfLine='string';return i}};function x(t,e){if(t.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&t.match('include')){e.isIncludeFiltered=!0;return i}};function I(t,e){if(e.isIncludeFiltered){var i=u(t,e);e.isIncludeFiltered=!1;e.restOfLine='string';return i}};function N(t,e){if(t.match(/^mixin\b/)){e.javaScriptLine=!0;return i}};function O(t,e){if(t.match(/^\+([-\w]+)/)){if(!t.match(/^\( *[-\w]+ *=/,!1)){e.javaScriptArguments=!0;e.javaScriptArgumentsDepth=0};return'variable'};if(t.match(/^\+#{/,!1)){t.next();e.mixinCallAfter=!0;return c(t,e)}};function w(t,e){if(e.mixinCallAfter){e.mixinCallAfter=!1;if(!t.match(/^\( *[-\w]+ *=/,!1)){e.javaScriptArguments=!0;e.javaScriptArgumentsDepth=0};return!0}};function E(t,e){if(t.match(/^(if|unless|else if|else)\b/)){e.javaScriptLine=!0;return i}};function C(t,e){if(t.match(/^(- *)?(each|for)\b/)){e.isEach=!0;return i}};function F(t,e){if(e.isEach){if(t.match(/^ in\b/)){e.javaScriptLine=!0;e.isEach=!1;return i} +else if(t.sol()||t.eol()){e.isEach=!1} +else if(t.next()){while(!t.match(/^ in\b/,!1)&&t.next());return'variable'}}};function D(t,e){if(t.match(/^while\b/)){e.javaScriptLine=!0;return i}};function V(t,e){var i;if(i=t.match(/^(\w(?:[-:\w]*\w)?)\/?/)){e.lastTag=i[1].toLowerCase();if(e.lastTag==='script'){e.scriptType='application/javascript'};return'tag'}};function u(i,n){if(i.match(/^:([\w\-]+)/)){var r;if(e&&e.innerModes){r=e.innerModes(i.current().substring(1))};if(!r){r=i.current().substring(1)};if(typeof r==='string'){r=t.getMode(e,r)};a(i,n,r);return'atom'}};function q(t,e){if(t.match(/^(!?=|-)/)){e.javaScriptLine=!0;return'punctuation'}};function U(t){if(t.match(/^#([\w-]+)/)){return l}};function Z(t){if(t.match(/^\.([\w-]+)/)){return h}};function z(t,e){if(t.peek()=='('){t.next();e.isAttrs=!0;e.attrsNest=[];e.inAttributeName=!0;e.attrValue='';e.attributeIsType=!1;return'punctuation'}};function o(e,i){if(i.isAttrs){if(s[e.peek()]){i.attrsNest.push(s[e.peek()])};if(i.attrsNest[i.attrsNest.length-1]===e.peek()){i.attrsNest.pop()} +else if(e.eat(')')){i.isAttrs=!1;return'punctuation'};if(i.inAttributeName&&e.match(/^[^=,\)!]+/)){if(e.peek()==='='||e.peek()==='!'){i.inAttributeName=!1;i.jsState=t.startState(n);if(i.lastTag==='script'&&e.current().trim().toLowerCase()==='type'){i.attributeIsType=!0} +else{i.attributeIsType=!1}};return'attribute'};var r=n.token(e,i.jsState);if(i.attributeIsType&&r==='string'){i.scriptType=e.current().toString()};if(i.attrsNest.length===0&&(r==='string'||r==='variable'||r==='keyword')){try{Function('','var x '+i.attrValue.replace(/,\s*$/,'').replace(/^!/,''));i.inAttributeName=!0;i.attrValue='';e.backUp(e.current().length);return o(e,i)}catch(a){}};i.attrValue+=e.current();return r||!0}};function tt(t,e){if(t.match(/^&attributes\b/)){e.javaScriptArguments=!0;e.javaScriptArgumentsDepth=0;return'keyword'}};function et(t){if(t.sol()&&t.eatSpace()){return'indent'}};function it(t,e){if(t.match(/^ *\/\/(-)?([^\n]*)/)){e.indentOf=t.indentation();e.indentToken='comment';return'comment'}};function nt(t){if(t.match(/^: */)){return'colon'}};function rt(t,e){if(t.match(/^(?:\| ?| )([^\n]+)/)){return'string'};if(t.match(/^(<[^\n]*)/,!1)){a(t,e,'htmlmixed');e.innerModeForLine=!0;return f(t,e,!0)}};function at(t,e){if(t.eat('.')){var i=null;if(e.lastTag==='script'&&e.scriptType.toLowerCase().indexOf('javascript')!=-1){i=e.scriptType.toLowerCase().replace(/"|'/g,'')} +else if(e.lastTag==='style'){i='css'};a(t,e,i);return'dot'}};function st(t){t.next();return null};function a(i,n,r){r=t.mimeModes[r]||r;r=e.innerModes?e.innerModes(r)||r:r;r=t.mimeModes[r]||r;r=t.getMode(e,r);n.indentOf=i.indentation();if(r&&r.name!=='null'){n.innerMode=r} +else{n.indentToken='string'}};function f(e,i,n){if(e.indentation()>i.indentOf||(i.innerModeForLine&&!e.sol())||n){if(i.innerMode){if(!i.innerState){i.innerState=i.innerMode.startState?t.startState(i.innerMode,e.indentation()):{}};return e.hideFirstChars(i.indentOf+2,function(){return i.innerMode.token(e,i.innerState)||!0})} +else{e.skipToEnd();return i.indentToken}} +else if(e.sol()){i.indentOf=Infinity;i.indentToken=null;i.innerMode=null;i.innerState=null}};function ct(t,e){if(t.sol()){e.restOfLine=''};if(e.restOfLine){t.skipToEnd();var i=e.restOfLine;e.restOfLine='';return i}};function ut(){return new r()};function ot(t){return t.copy()};function ft(t,e){var i=f(t,e)||ct(t,e)||g(t,e)||I(t,e)||F(t,e)||o(t,e)||d(t,e)||m(t,e)||w(t,e)||v(t,e)||S(t,e)||c(t,e)||j(t,e)||b(t,e)||L(t,e)||A(t,e)||y(t,e)||k(t,e)||M(t,e)||T(t,e)||x(t,e)||N(t,e)||O(t,e)||E(t,e)||C(t,e)||D(t,e)||V(t,e)||u(t,e)||q(t,e)||U(t,e)||Z(t,e)||z(t,e)||tt(t,e)||et(t,e)||rt(t,e)||it(t,e)||nt(t,e)||at(t,e)||st(t,e);return i===!0?null:i};return{startState:ut,copyState:ot,token:ft}},'javascript','css','htmlmixed');t.defineMIME('text/x-pug','pug');t.defineMIME('text/x-jade','pug')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('livescript',function(){var e=function(e,n){var g=n.next||'start';if(g){n.next=n.next;var i=t[g];if(i.splice){for(var o=0;o<i.length;++o){var r=i[o];if(r.regex&&e.match(r.regex)){n.next=r.next||n.next;return r.token}};e.next();return'error'};if(e.match(r=t[g])){if(r.regex&&e.match(r.regex)){n.next=r.next;return r.token} +else{e.next();return'error'}}};e.next();return'error'},r={startState:function(){return{next:'start',lastToken:{style:null,indent:0,content:''}}},token:function(t,r){while(t.pos==t.start)var n=e(t,r);r.lastToken={style:n,indent:t.indentation(),content:t.current()};return n.replace(/\./g,' ')},indent:function(e){var t=e.lastToken.indent;if(e.lastToken.content.match(l)){t+=2};return t}};return r});var g='(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*',l=RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*'+g+')?))\\s*$'),r='(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))',n={token:'string',regex:'.+'};var t={start:[{token:'comment.doc',regex:'/\\*',next:'comment'},{token:'comment',regex:'#.*'},{token:'keyword',regex:'(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)'+r},{token:'constant.language',regex:'(?:true|false|yes|no|on|off|null|void|undefined)'+r},{token:'invalid.illegal',regex:'(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)'+r},{token:'language.support.class',regex:'(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)'+r},{token:'language.support.function',regex:'(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)'+r},{token:'variable.language',regex:'(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)'+r},{token:'identifier',regex:g+'\\s*:(?![:=])'},{token:'variable',regex:g},{token:'keyword.operator',regex:'(?:\\.{3}|\\s+\\?)'},{token:'keyword.variable',regex:'(?:@+|::|\\.\\.)',next:'key'},{token:'keyword.operator',regex:'\\.\\s*',next:'key'},{token:'string',regex:'\\\\\\S[^\\s,;)}\\]]*'},{token:'string.doc',regex:'\'\'\'',next:'qdoc'},{token:'string.doc',regex:'"""',next:'qqdoc'},{token:'string',regex:'\'',next:'qstring'},{token:'string',regex:'"',next:'qqstring'},{token:'string',regex:'`',next:'js'},{token:'string',regex:'<\\[',next:'words'},{token:'string.regex',regex:'//',next:'heregex'},{token:'string.regex',regex:'\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',next:'key'},{token:'constant.numeric',regex:'(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'},{token:'lparen',regex:'[({[]'},{token:'rparen',regex:'[)}\\]]',next:'key'},{token:'keyword.operator',regex:'\\S+'},{token:'text',regex:'\\s+'}],heregex:[{token:'string.regex',regex:'.*?//[gimy$?]{0,4}',next:'start'},{token:'string.regex',regex:'\\s*#{'},{token:'comment.regex',regex:'\\s+(?:#.*)?'},{token:'string.regex',regex:'\\S+'}],key:[{token:'keyword.operator',regex:'[.?@!]+'},{token:'identifier',regex:g,next:'start'},{token:'text',regex:'',next:'start'}],comment:[{token:'comment.doc',regex:'.*?\\*/',next:'start'},{token:'comment.doc',regex:'.+'}],qdoc:[{token:'string',regex:'.*?\'\'\'',next:'key'},n],qqdoc:[{token:'string',regex:'.*?"""',next:'key'},n],qstring:[{token:'string',regex:'[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',next:'key'},n],qqstring:[{token:'string',regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:'key'},n],js:[{token:'string',regex:'[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',next:'key'},n],words:[{token:'string',regex:'.*?\\]>',next:'key'},n]};for(var s in t){var i=t[s];if(i.splice){for(var o=0,a=i.length;o<a;++o){var x=i[o];if(typeof x.regex==='string'){t[s][o].regex=new RegExp('^'+x.regex)}}} +else if(typeof x.regex==='string'){t[s].regex=new RegExp('^'+i.regex)}};e.defineMIME('text/x-livescript','livescript')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../yaml/yaml'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../yaml/yaml'],e);else e(CodeMirror)})(function(e){var n=0,r=1,t=2;e.defineMode('yaml-frontmatter',function(i,f){var o=e.getMode(i,'yaml'),a=e.getMode(i,f&&f.base||'gfm');function u(e){return e.state==t?a:o};return{startState:function(){return{state:n,inner:e.startState(o)}},copyState:function(t){return{state:t.state,inner:e.copyState(u(t),t.inner)}},token:function(i,f){if(f.state==n){if(i.match(/---/,!1)){f.state=r;return o.token(i,f.inner)} +else{f.state=t;f.inner=e.startState(a);return a.token(i,f.inner)}} +else if(f.state==r){var u=i.sol()&&i.match(/---/,!1),s=o.token(i,f.inner);if(u){f.state=t;f.inner=e.startState(a)};return s} +else{return a.token(i,f.inner)}},innerMode:function(e){return{mode:u(e),state:e.inner}},blankLine:function(e){var t=u(e);if(t.blankLine)return t.blankLine(e.inner)}}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('stylus',function(b){var z=b.indentUnit,E='',H=t(i),N=/^(a|b|i|s|col|em)$/i,I=t(o),T=t(l),ee=t(d),te=t(c),re=t(r),ie=f(r),ae=t(n),ne=t(a),oe=t(s),le=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,se=f(u),ce=t(m),A=new RegExp(/^\-(moz|ms|o|webkit)-/i),de=t(p),W='',w={},v,q,M,h;while(E.length<z)E+=' ';function ue(e,t){W=e.string.match(/(^[\w-]+\s*=\s*$)|(^\s*[\w-]+\s*=\s*[\w-])|(^\s*(\.|#|@|\$|\&|\[|\d|\+|::?|\{|\>|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/);t.context.line.firstWord=W?W[0].replace(/^\s*/,''):'';t.context.line.indent=e.indentation();v=e.peek();if(e.match('//')){e.skipToEnd();return['comment','comment']};if(e.match('/*')){t.tokenize=O;return O(e,t)};if(v=='"'||v=='\''){e.next();t.tokenize=R(v);return t.tokenize(e,t)};if(v=='@'){e.next();e.eatWhile(/[\w\\-]/);return['def',e.current()]};if(v=='#'){e.next();if(e.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)){return['atom','atom']};if(e.match(/^[a-z][\w-]*/i)){return['builtin','hash']}};if(e.match(A)){return['meta','vendor-prefixes']};if(e.match(/^-?[0-9]?\.?[0-9]/)){e.eatWhile(/[a-z%]/i);return['number','unit']};if(v=='!'){e.next();return[e.match(/^(important|optional)/i)?'keyword':'operator','important']};if(v=='.'&&e.match(/^\.[a-z][\w-]*/i)){return['qualifier','qualifier']};if(e.match(ie)){if(e.peek()=='(')t.tokenize=me;return['property','word']};if(e.match(/^[a-z][\w-]*\(/i)){e.backUp(1);return['keyword','mixin']};if(e.match(/^(\+|-)[a-z][\w-]*\(/i)){e.backUp(1);return['keyword','block-mixin']};if(e.string.match(/^\s*&/)&&e.match(/^[-_]+[a-z][\w-]*/)){return['qualifier','qualifier']};if(e.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)){e.backUp(1);return['variable-3','reference']};if(e.match(/^&{1}\s*$/)){return['variable-3','reference']};if(e.match(se)){return['operator','operator']};if(e.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)){if(e.match(/^(\.|\[)[\w-'"\]]+/i,!1)){if(!x(e.current())){e.match(/\./);return['variable-2','variable-name']}};return['variable-2','word']};if(e.match(le)){return['operator',e.current()]};if(/[:;,{}\[\]\(\)]/.test(v)){e.next();return[null,v]};e.next();return[null,null]};function O(e,t){var i=!1,r;while((r=e.next())!=null){if(i&&r=='/'){t.tokenize=null;break};i=(r=='*')};return['comment','comment']};function R(e){return function(t,r){var i=!1,a;while((a=t.next())!=null){if(a==e&&!i){if(e==')')t.backUp(1);break};i=!i&&a=='\\'};if(a==e||!i&&e!=')')r.tokenize=null;return['string','string']}};function me(e,t){e.next();if(!e.match(/\s*["')]/,!1))t.tokenize=R(')');else t.tokenize=null;return[null,'(']};function S(e,t,r,i){this.type=e;this.indent=t;this.prev=r;this.line=i||{firstWord:'',indent:0}};function e(e,t,r,i){i=i>=0?i:z;e.context=new S(r,t.indentation()+i,e.context);return r};function j(e,t){var r=e.context.indent-z;t=t||!1;e.context=e.context.prev;if(t)e.context.indent=r;return e.context.type};function pe(e,t,r){return w[r.context.type](e,t,r)};function U(e,t,r,i){for(var a=i||1;a>0;a--)r.context=r.context.prev;return pe(e,t,r)};function x(e){return e.toLowerCase()in H};function C(e){e=e.toLowerCase();return e in I||e in oe};function B(e){return e.toLowerCase()in ce};function X(e){return e.toLowerCase().match(A)};function L(e){var r=e.toLowerCase(),t='variable-2';if(x(e))t='tag';else if(B(e))t='block-keyword';else if(C(e))t='property';else if(r in ee||r in de)t='atom';else if(r=='return'||r in te)t='keyword';else if(e.match(/^[A-Z]/))t='string';return t};function Y(e,t){return((k(t)&&(e=='{'||e==']'||e=='hash'||e=='qualifier'))||e=='block-mixin')};function Z(e,t){return e=='{'&&t.match(/^\s*\$?[\w-]+/i,!1)};function F(e,t){return e==':'&&t.match(/^[a-z-]+/,!1)};function P(e){return e.sol()||e.string.match(new RegExp('^\\s*'+g(e.current())))};function k(e){return e.eol()||e.match(/^\s*$/,!1)};function y(e){var t=/^\s*[-_]*[a-z0-9]+[\w-]*/i,r=typeof e=='string'?e.match(t):e.string.match(t);return r?r[0].replace(/^\s*/,''):''};w.block=function(r,t,i){if((r=='comment'&&P(t))||(r==','&&k(t))||r=='mixin'){return e(i,t,'block',0)};if(Z(r,t)){return e(i,t,'interpolation')};if(k(t)&&r==']'){if(!/^\s*(\.|#|:|\[|\*|&)/.test(t.string)&&!x(y(t))){return e(i,t,'block',0)}};if(Y(r,t)){return e(i,t,'block')};if(r=='}'&&k(t)){return e(i,t,'block',0)};if(r=='variable-name'){if(t.string.match(/^\s?\$[\w-\.\[\]'"]+$/)||B(y(t))){return e(i,t,'variableName')} +else{return e(i,t,'variableName',0)}};if(r=='='){if(!k(t)&&!B(y(t))){return e(i,t,'block',0)};return e(i,t,'block')};if(r=='*'){if(k(t)||t.match(/\s*(,|\.|#|\[|:|{)/,!1)){h='tag';return e(i,t,'block')}};if(F(r,t)){return e(i,t,'pseudo')};if(/@(font-face|media|supports|(-moz-)?document)/.test(r)){return e(i,t,k(t)?'block':'atBlock')};if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(r)){return e(i,t,'keyframes')};if(/@extends?/.test(r)){return e(i,t,'extend',0)};if(r&&r.charAt(0)=='@'){if(t.indentation()>0&&C(t.current().slice(1))){h='variable-2';return'block'};if(/(@import|@require|@charset)/.test(r)){return e(i,t,'block',0)};return e(i,t,'block')};if(r=='reference'&&k(t)){return e(i,t,'block')};if(r=='('){return e(i,t,'parens')};if(r=='vendor-prefixes'){return e(i,t,'vendorPrefixes')};if(r=='word'){var a=t.current();h=L(a);if(h=='property'){if(P(t)){return e(i,t,'block',0)} +else{h='atom';return'block'}};if(h=='tag'){if(/embed|menu|pre|progress|sub|table/.test(a)){if(C(y(t))){h='atom';return'block'}};if(t.string.match(new RegExp('\\[\\s*'+a+'|'+a+'\\s*\\]'))){h='atom';return'block'};if(N.test(a)){if((P(t)&&t.string.match(/=/))||(!P(t)&&!t.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!x(y(t)))){h='variable-2';if(B(y(t)))return'block';return e(i,t,'block',0)}};if(k(t))return e(i,t,'block')};if(h=='block-keyword'){h='keyword';if(t.current(/(if|unless)/)&&!P(t)){return'block'};return e(i,t,'block')};if(a=='return')return e(i,t,'block',0);if(h=='variable-2'&&t.string.match(/^\s?\$[\w-\.\[\]'"]+$/)){return e(i,t,'block')}};return i.context.type};w.parens=function(t,r,i){if(t=='(')return e(i,r,'parens');if(t==')'){if(i.context.prev.type=='parens'){return j(i)};if((r.string.match(/^[a-z][\w-]*\(/i)&&k(r))||B(y(r))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(y(r))||(!r.string.match(/^-?[a-z][\w-\.\[\]'"]*\s*=/)&&x(y(r)))){return e(i,r,'block')};if(r.string.match(/^[\$-]?[a-z][\w-\.\[\]'"]*\s*=/)||r.string.match(/^\s*(\(|\)|[0-9])/)||r.string.match(/^\s+[a-z][\w-]*\(/i)||r.string.match(/^\s+[\$-]?[a-z]/i)){return e(i,r,'block',0)};if(k(r))return e(i,r,'block');else return e(i,r,'block',0)};if(t&&t.charAt(0)=='@'&&C(r.current().slice(1))){h='variable-2'};if(t=='word'){var a=r.current();h=L(a);if(h=='tag'&&N.test(a)){h='variable-2'};if(h=='property'||a=='to')h='atom'};if(t=='variable-name'){return e(i,r,'variableName')};if(F(t,r)){return e(i,r,'pseudo')};return i.context.type};w.vendorPrefixes=function(t,r,i){if(t=='word'){h='property';return e(i,r,'block',0)};return j(i)};w.pseudo=function(t,r,i){if(!C(y(r.string))){r.match(/^[a-z-]+/);h='variable-3';if(k(r))return e(i,r,'block');return j(i)};return U(t,r,i)};w.atBlock=function(t,r,i){if(t=='(')return e(i,r,'atBlock_parens');if(Y(t,r)){return e(i,r,'block')};if(Z(t,r)){return e(i,r,'interpolation')};if(t=='word'){var a=r.current().toLowerCase();if(/^(only|not|and|or)$/.test(a))h='keyword';else if(re.hasOwnProperty(a))h='tag';else if(ne.hasOwnProperty(a))h='attribute';else if(ae.hasOwnProperty(a))h='property';else if(T.hasOwnProperty(a))h='string-2';else h=L(r.current());if(h=='tag'&&k(r)){return e(i,r,'block')}};if(t=='operator'&&/^(not|and|or)$/.test(r.current())){h='keyword'};return i.context.type};w.atBlock_parens=function(t,r,i){if(t=='{'||t=='}')return i.context.type;if(t==')'){if(k(r))return e(i,r,'block');else return e(i,r,'atBlock')};if(t=='word'){var a=r.current().toLowerCase();h=L(a);if(/^(max|min)/.test(a))h='property';if(h=='tag'){N.test(a)?h='variable-2':h='atom'};return i.context.type};return w.atBlock(t,r,i)};w.keyframes=function(t,r,i){if(r.indentation()=='0'&&((t=='}'&&P(r))||t==']'||t=='hash'||t=='qualifier'||x(r.current()))){return U(t,r,i)};if(t=='{')return e(i,r,'keyframes');if(t=='}'){if(P(r))return j(i,!0);else return e(i,r,'keyframes')};if(t=='unit'&&/^[0-9]+\%$/.test(r.current())){return e(i,r,'keyframes')};if(t=='word'){h=L(r.current());if(h=='block-keyword'){h='keyword';return e(i,r,'keyframes')}};if(/@(font-face|media|supports|(-moz-)?document)/.test(t)){return e(i,r,k(r)?'block':'atBlock')};if(t=='mixin'){return e(i,r,'block',0)};return i.context.type};w.interpolation=function(t,r,i){if(t=='{')j(i)&&e(i,r,'block');if(t=='}'){if(r.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||(r.string.match(/^\s*[a-z]/i)&&x(y(r)))){return e(i,r,'block')};if(!r.string.match(/^(\{|\s*\&)/)||r.match(/\s*[\w-]/,!1)){return e(i,r,'block',0)};return e(i,r,'block')};if(t=='variable-name'){return e(i,r,'variableName',0)};if(t=='word'){h=L(r.current());if(h=='tag')h='atom'};return i.context.type};w.extend=function(e,t,r){if(e=='['||e=='=')return'extend';if(e==']')return j(r);if(e=='word'){h=L(t.current());return'extend'};return j(r)};w.variableName=function(e,t,r){if(e=='string'||e=='['||e==']'||t.current().match(/^(\.|\$)/)){if(t.current().match(/^\.[\w-]+/i))h='variable-2';return'variableName'};return U(e,t,r)};return{startState:function(e){return{tokenize:null,state:'block',context:new S('block',e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;q=(t.tokenize||ue)(e,t);if(q&&typeof q=='object'){M=q[1];q=q[0]};h=q;t.state=w[t.state](M,e,t);return h},indent:function(e,t,r){var l=e.context,s=t&&t.charAt(0),n=l.indent,c=y(t),o=r.match(/^\s*/)[0].replace(/\t/g,E).length,i=e.context.prev?e.context.prev.line.firstWord:'',a=e.context.prev?e.context.prev.line.indent:o;if(l.prev&&(s=='}'&&(l.type=='block'||l.type=='atBlock'||l.type=='keyframes')||s==')'&&(l.type=='parens'||l.type=='atBlock_parens')||s=='{'&&(l.type=='at'))){n=l.indent-z} +else if(!(/(\})/.test(s))){if(/@|\$|\d/.test(s)||/^\{/.test(t)||/^\s*\/(\/|\*)/.test(t)||/^\s*\/\*/.test(i)||/^\s*[\w-\.\[\]'"]+\s*(\?|:|\+)?=/i.test(t)||/^(\+|-)?[a-z][\w-]*\(/i.test(t)||/^return/.test(t)||B(c)){n=o} +else if(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(s)||x(c)){if(/\,\s*$/.test(i)){n=a} +else if(/^\s+/.test(r)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(i)||x(i))){n=o<=a?a:a+z} +else{n=o}} +else if(!/,\s*$/.test(r)&&(X(c)||C(c))){if(B(i)){n=o<=a?a:a+z} +else if(/^\{/.test(i)){n=o<=a?o:a+z} +else if(X(i)||C(i)){n=o>=a?a:o} +else if(/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(i)||/=\s*$/.test(i)||x(i)||/^\$[\w-\.\[\]'"]/.test(i)){n=a+z} +else{n=o}}};return n},electricChars:'}',lineComment:'//',fold:'indent'}});var i=['a','abbr','address','area','article','aside','audio','b','base','bdi','bdo','bgsound','blockquote','body','br','button','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','keygen','label','legend','li','link','main','map','mark','marquee','menu','menuitem','meta','meter','nav','nobr','noframes','noscript','object','ol','optgroup','option','output','p','param','pre','progress','q','rp','rt','ruby','s','samp','script','section','select','small','source','span','strong','style','sub','summary','sup','table','tbody','td','textarea','tfoot','th','thead','time','tr','track','u','ul','var','video'],r=['domain','regexp','url','url-prefix'],a=['all','aural','braille','handheld','print','projection','screen','tty','tv','embossed'],n=['width','min-width','max-width','height','min-height','max-height','device-width','min-device-width','max-device-width','device-height','min-device-height','max-device-height','aspect-ratio','min-aspect-ratio','max-aspect-ratio','device-aspect-ratio','min-device-aspect-ratio','max-device-aspect-ratio','color','min-color','max-color','color-index','min-color-index','max-color-index','monochrome','min-monochrome','max-monochrome','resolution','min-resolution','max-resolution','scan','grid'],o=['align-content','align-items','align-self','alignment-adjust','alignment-baseline','anchor-point','animation','animation-delay','animation-direction','animation-duration','animation-fill-mode','animation-iteration-count','animation-name','animation-play-state','animation-timing-function','appearance','azimuth','backface-visibility','background','background-attachment','background-clip','background-color','background-image','background-origin','background-position','background-repeat','background-size','baseline-shift','binding','bleed','bookmark-label','bookmark-level','bookmark-state','bookmark-target','border','border-bottom','border-bottom-color','border-bottom-left-radius','border-bottom-right-radius','border-bottom-style','border-bottom-width','border-collapse','border-color','border-image','border-image-outset','border-image-repeat','border-image-slice','border-image-source','border-image-width','border-left','border-left-color','border-left-style','border-left-width','border-radius','border-right','border-right-color','border-right-style','border-right-width','border-spacing','border-style','border-top','border-top-color','border-top-left-radius','border-top-right-radius','border-top-style','border-top-width','border-width','bottom','box-decoration-break','box-shadow','box-sizing','break-after','break-before','break-inside','caption-side','clear','clip','color','color-profile','column-count','column-fill','column-gap','column-rule','column-rule-color','column-rule-style','column-rule-width','column-span','column-width','columns','content','counter-increment','counter-reset','crop','cue','cue-after','cue-before','cursor','direction','display','dominant-baseline','drop-initial-after-adjust','drop-initial-after-align','drop-initial-before-adjust','drop-initial-before-align','drop-initial-size','drop-initial-value','elevation','empty-cells','fit','fit-position','flex','flex-basis','flex-direction','flex-flow','flex-grow','flex-shrink','flex-wrap','float','float-offset','flow-from','flow-into','font','font-feature-settings','font-family','font-kerning','font-language-override','font-size','font-size-adjust','font-stretch','font-style','font-synthesis','font-variant','font-variant-alternates','font-variant-caps','font-variant-east-asian','font-variant-ligatures','font-variant-numeric','font-variant-position','font-weight','grid','grid-area','grid-auto-columns','grid-auto-flow','grid-auto-position','grid-auto-rows','grid-column','grid-column-end','grid-column-start','grid-row','grid-row-end','grid-row-start','grid-template','grid-template-areas','grid-template-columns','grid-template-rows','hanging-punctuation','height','hyphens','icon','image-orientation','image-rendering','image-resolution','inline-box-align','justify-content','left','letter-spacing','line-break','line-height','line-stacking','line-stacking-ruby','line-stacking-shift','line-stacking-strategy','list-style','list-style-image','list-style-position','list-style-type','margin','margin-bottom','margin-left','margin-right','margin-top','marker-offset','marks','marquee-direction','marquee-loop','marquee-play-count','marquee-speed','marquee-style','max-height','max-width','min-height','min-width','move-to','nav-down','nav-index','nav-left','nav-right','nav-up','object-fit','object-position','opacity','order','orphans','outline','outline-color','outline-offset','outline-style','outline-width','overflow','overflow-style','overflow-wrap','overflow-x','overflow-y','padding','padding-bottom','padding-left','padding-right','padding-top','page','page-break-after','page-break-before','page-break-inside','page-policy','pause','pause-after','pause-before','perspective','perspective-origin','pitch','pitch-range','play-during','position','presentation-level','punctuation-trim','quotes','region-break-after','region-break-before','region-break-inside','region-fragment','rendering-intent','resize','rest','rest-after','rest-before','richness','right','rotation','rotation-point','ruby-align','ruby-overhang','ruby-position','ruby-span','shape-image-threshold','shape-inside','shape-margin','shape-outside','size','speak','speak-as','speak-header','speak-numeral','speak-punctuation','speech-rate','stress','string-set','tab-size','table-layout','target','target-name','target-new','target-position','text-align','text-align-last','text-decoration','text-decoration-color','text-decoration-line','text-decoration-skip','text-decoration-style','text-emphasis','text-emphasis-color','text-emphasis-position','text-emphasis-style','text-height','text-indent','text-justify','text-outline','text-overflow','text-shadow','text-size-adjust','text-space-collapse','text-transform','text-underline-position','text-wrap','top','transform','transform-origin','transform-style','transition','transition-delay','transition-duration','transition-property','transition-timing-function','unicode-bidi','vertical-align','visibility','voice-balance','voice-duration','voice-family','voice-pitch','voice-range','voice-rate','voice-stress','voice-volume','volume','white-space','widows','width','will-change','word-break','word-spacing','word-wrap','z-index','clip-path','clip-rule','mask','enable-background','filter','flood-color','flood-opacity','lighting-color','stop-color','stop-opacity','pointer-events','color-interpolation','color-interpolation-filters','color-rendering','fill','fill-opacity','fill-rule','image-rendering','marker','marker-end','marker-mid','marker-start','shape-rendering','stroke','stroke-dasharray','stroke-dashoffset','stroke-linecap','stroke-linejoin','stroke-miterlimit','stroke-opacity','stroke-width','text-rendering','baseline-shift','dominant-baseline','glyph-orientation-horizontal','glyph-orientation-vertical','text-anchor','writing-mode','font-smoothing','osx-font-smoothing'],l=['scrollbar-arrow-color','scrollbar-base-color','scrollbar-dark-shadow-color','scrollbar-face-color','scrollbar-highlight-color','scrollbar-shadow-color','scrollbar-3d-light-color','scrollbar-track-color','shape-inside','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','zoom'],s=['font-family','src','unicode-range','font-variant','font-feature-settings','font-stretch','font-weight','font-style'],c=['aliceblue','antiquewhite','aqua','aquamarine','azure','beige','bisque','black','blanchedalmond','blue','blueviolet','brown','burlywood','cadetblue','chartreuse','chocolate','coral','cornflowerblue','cornsilk','crimson','cyan','darkblue','darkcyan','darkgoldenrod','darkgray','darkgreen','darkkhaki','darkmagenta','darkolivegreen','darkorange','darkorchid','darkred','darksalmon','darkseagreen','darkslateblue','darkslategray','darkturquoise','darkviolet','deeppink','deepskyblue','dimgray','dodgerblue','firebrick','floralwhite','forestgreen','fuchsia','gainsboro','ghostwhite','gold','goldenrod','gray','grey','green','greenyellow','honeydew','hotpink','indianred','indigo','ivory','khaki','lavender','lavenderblush','lawngreen','lemonchiffon','lightblue','lightcoral','lightcyan','lightgoldenrodyellow','lightgray','lightgreen','lightpink','lightsalmon','lightseagreen','lightskyblue','lightslategray','lightsteelblue','lightyellow','lime','limegreen','linen','magenta','maroon','mediumaquamarine','mediumblue','mediumorchid','mediumpurple','mediumseagreen','mediumslateblue','mediumspringgreen','mediumturquoise','mediumvioletred','midnightblue','mintcream','mistyrose','moccasin','navajowhite','navy','oldlace','olive','olivedrab','orange','orangered','orchid','palegoldenrod','palegreen','paleturquoise','palevioletred','papayawhip','peachpuff','peru','pink','plum','powderblue','purple','rebeccapurple','red','rosybrown','royalblue','saddlebrown','salmon','sandybrown','seagreen','seashell','sienna','silver','skyblue','slateblue','slategray','snow','springgreen','steelblue','tan','teal','thistle','tomato','turquoise','violet','wheat','white','whitesmoke','yellow','yellowgreen'],d=['above','absolute','activeborder','additive','activecaption','afar','after-white-space','ahead','alias','all','all-scroll','alphabetic','alternate','always','amharic','amharic-abegede','antialiased','appworkspace','arabic-indic','armenian','asterisks','attr','auto','avoid','avoid-column','avoid-page','avoid-region','background','backwards','baseline','below','bidi-override','binary','bengali','blink','block','block-axis','bold','bolder','border','border-box','both','bottom','break','break-all','break-word','bullets','button','button-bevel','buttonface','buttonhighlight','buttonshadow','buttontext','calc','cambodian','capitalize','caps-lock-indicator','caption','captiontext','caret','cell','center','checkbox','circle','cjk-decimal','cjk-earthly-branch','cjk-heavenly-stem','cjk-ideographic','clear','clip','close-quote','col-resize','collapse','column','compact','condensed','contain','content','contents','content-box','context-menu','continuous','copy','counter','counters','cover','crop','cross','crosshair','currentcolor','cursive','cyclic','dashed','decimal','decimal-leading-zero','default','default-button','destination-atop','destination-in','destination-out','destination-over','devanagari','disc','discard','disclosure-closed','disclosure-open','document','dot-dash','dot-dot-dash','dotted','double','down','e-resize','ease','ease-in','ease-in-out','ease-out','element','ellipse','ellipsis','embed','end','ethiopic','ethiopic-abegede','ethiopic-abegede-am-et','ethiopic-abegede-gez','ethiopic-abegede-ti-er','ethiopic-abegede-ti-et','ethiopic-halehame-aa-er','ethiopic-halehame-aa-et','ethiopic-halehame-am-et','ethiopic-halehame-gez','ethiopic-halehame-om-et','ethiopic-halehame-sid-et','ethiopic-halehame-so-et','ethiopic-halehame-ti-er','ethiopic-halehame-ti-et','ethiopic-halehame-tig','ethiopic-numeric','ew-resize','expanded','extends','extra-condensed','extra-expanded','fantasy','fast','fill','fixed','flat','flex','footnotes','forwards','from','geometricPrecision','georgian','graytext','groove','gujarati','gurmukhi','hand','hangul','hangul-consonant','hebrew','help','hidden','hide','higher','highlight','highlighttext','hiragana','hiragana-iroha','horizontal','hsl','hsla','icon','ignore','inactiveborder','inactivecaption','inactivecaptiontext','infinite','infobackground','infotext','inherit','initial','inline','inline-axis','inline-block','inline-flex','inline-table','inset','inside','intrinsic','invert','italic','japanese-formal','japanese-informal','justify','kannada','katakana','katakana-iroha','keep-all','khmer','korean-hangul-formal','korean-hanja-formal','korean-hanja-informal','landscape','lao','large','larger','left','level','lighter','line-through','linear','linear-gradient','lines','list-item','listbox','listitem','local','logical','loud','lower','lower-alpha','lower-armenian','lower-greek','lower-hexadecimal','lower-latin','lower-norwegian','lower-roman','lowercase','ltr','malayalam','match','matrix','matrix3d','media-controls-background','media-current-time-display','media-fullscreen-button','media-mute-button','media-play-button','media-return-to-realtime-button','media-rewind-button','media-seek-back-button','media-seek-forward-button','media-slider','media-sliderthumb','media-time-remaining-display','media-volume-slider','media-volume-slider-container','media-volume-sliderthumb','medium','menu','menulist','menulist-button','menulist-text','menulist-textfield','menutext','message-box','middle','min-intrinsic','mix','mongolian','monospace','move','multiple','myanmar','n-resize','narrower','ne-resize','nesw-resize','no-close-quote','no-drop','no-open-quote','no-repeat','none','normal','not-allowed','nowrap','ns-resize','numbers','numeric','nw-resize','nwse-resize','oblique','octal','open-quote','optimizeLegibility','optimizeSpeed','oriya','oromo','outset','outside','outside-shape','overlay','overline','padding','padding-box','painted','page','paused','persian','perspective','plus-darker','plus-lighter','pointer','polygon','portrait','pre','pre-line','pre-wrap','preserve-3d','progress','push-button','radial-gradient','radio','read-only','read-write','read-write-plaintext-only','rectangle','region','relative','repeat','repeating-linear-gradient','repeating-radial-gradient','repeat-x','repeat-y','reset','reverse','rgb','rgba','ridge','right','rotate','rotate3d','rotateX','rotateY','rotateZ','round','row-resize','rtl','run-in','running','s-resize','sans-serif','scale','scale3d','scaleX','scaleY','scaleZ','scroll','scrollbar','scroll-position','se-resize','searchfield','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','semi-condensed','semi-expanded','separate','serif','show','sidama','simp-chinese-formal','simp-chinese-informal','single','skew','skewX','skewY','skip-white-space','slide','slider-horizontal','slider-vertical','sliderthumb-horizontal','sliderthumb-vertical','slow','small','small-caps','small-caption','smaller','solid','somali','source-atop','source-in','source-out','source-over','space','spell-out','square','square-button','start','static','status-bar','stretch','stroke','sub','subpixel-antialiased','super','sw-resize','symbolic','symbols','table','table-caption','table-cell','table-column','table-column-group','table-footer-group','table-header-group','table-row','table-row-group','tamil','telugu','text','text-bottom','text-top','textarea','textfield','thai','thick','thin','threeddarkshadow','threedface','threedhighlight','threedlightshadow','threedshadow','tibetan','tigre','tigrinya-er','tigrinya-er-abegede','tigrinya-et','tigrinya-et-abegede','to','top','trad-chinese-formal','trad-chinese-informal','translate','translate3d','translateX','translateY','translateZ','transparent','ultra-condensed','ultra-expanded','underline','up','upper-alpha','upper-armenian','upper-greek','upper-hexadecimal','upper-latin','upper-norwegian','upper-roman','uppercase','urdu','url','var','vertical','vertical-text','visible','visibleFill','visiblePainted','visibleStroke','visual','w-resize','wait','wave','wider','window','windowframe','windowtext','words','x-large','x-small','xor','xx-large','xx-small','bicubic','optimizespeed','grayscale','row','row-reverse','wrap','wrap-reverse','column-reverse','flex-start','flex-end','space-between','space-around','unset'],u=['in','and','or','not','is not','is a','is','isnt','defined','if unless'],m=['for','if','else','unless','from','to'],p=['null','true','false','href','title','type','not-allowed','readonly','disabled'],h=['@font-face','@keyframes','@media','@viewport','@page','@host','@supports','@block','@css'],b=i.concat(r,a,n,o,l,c,d,s,u,m,p,h);function f(e){e=e.sort(function(e,t){return t>e});return new RegExp('^(('+e.join(')|(')+'))\\b')};function t(e){var r={};for(var t=0;t<e.length;++t)r[e[t]]=!0;return r};function g(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,'\\$&')};e.registerHelper('hintWords','stylus',b);e.defineMIME('text/x-styl','stylus')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../xml/xml'),require('../meta'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../xml/xml','../meta'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('markdown',function(r,e){var o=t.getMode(r,'text/html'),E=o.name=='null';function w(e){if(t.findModeByName){var i=t.findModeByName(e);if(i)e=i.mime||i.mimes[0]};var n=t.getMode(r,e);return n.name=='null'?null:n};if(e.highlightFormatting===undefined)e.highlightFormatting=!1;if(e.maxBlockquoteDepth===undefined)e.maxBlockquoteDepth=0;if(e.taskLists===undefined)e.taskLists=!1;if(e.strikethrough===undefined)e.strikethrough=!1;if(e.emoji===undefined)e.emoji=!1;if(e.fencedCodeBlockHighlighting===undefined)e.fencedCodeBlockHighlighting=!0;if(e.xml===undefined)e.xml=!0;if(e.tokenTypeOverrides===undefined)e.tokenTypeOverrides={};var i={header:'header',code:'comment',quote:'quote',list1:'variable-2',list2:'variable-3',list3:'keyword',hr:'hr',image:'image',imageAltText:'image-alt-text',imageMarker:'image-marker',formatting:'formatting',linkInline:'link',linkEmail:'link',linkText:'link',linkHref:'string',em:'em',strong:'strong',strikethrough:'strikethrough',emoji:'builtin'};for(var h in i){if(i.hasOwnProperty(h)&&e.tokenTypeOverrides[h]){i[h]=e.tokenTypeOverrides[h]}};var x=/^([*\-_])(?:\s*\1){2,}\s*$/,v=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,L=e.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ *(?:\={1,}|-{1,})\s*$/,q=/^[^#!\[\]*_\\<>` "'(~:]+/,M=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,F=/^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/,l=/[!"#$%&'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/,b=' ';function g(t,e,i){e.f=e.inline=i;return i(t,e)};function d(t,e,i){e.f=e.block=i;return i(t,e)};function y(t){return!t||!/\S/.test(t.string)};function c(t){t.linkTitle=!1;t.em=!1;t.strong=!1;t.strikethrough=!1;t.quote=0;t.indentedCode=!1;if(t.f==s){t.f=a;t.block=f};t.trailingSpace=0;t.trailingSpaceNewLine=!1;t.prevLine=t.thisLine;t.thisLine={stream:null};return null};function f(a,r){var f=a.column()===r.indentation,u=y(r.prevLine.stream),c=r.indentedCode,k=r.prevLine.hr,d=r.list!==!1,o=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var h=r.indentation;if(r.indentationDiff===null){r.indentationDiff=r.indentation;if(d){r.list=null;while(h<r.listStack[r.listStack.length-1]){r.listStack.pop();if(r.listStack.length){r.indentation=r.listStack[r.listStack.length-1]} +else{r.list=!1}};if(r.list!==!1){r.indentationDiff=h-r.listStack[r.listStack.length-1]}}};var S=(!u&&!k&&!r.prevLine.header&&(!d||!c)&&!r.prevLine.fencedCodeEnd),s=(r.list===!1||k||u)&&r.indentation<=o&&a.match(x),l=null;if(r.indentationDiff>=4&&(c||r.prevLine.fencedCodeEnd||r.prevLine.header||u)){a.skipToEnd();r.indentedCode=!0;return i.code} +else if(a.eatSpace()){return null} +else if(f&&r.indentation<=o&&(l=a.match(L))&&l[1].length<=6){r.quote=0;r.header=l[1].length;r.thisLine.header=!0;if(e.highlightFormatting)r.formatting='header';r.f=r.inline;return n(r)} +else if(r.indentation<=o&&a.eat('>')){r.quote=f?1:r.quote+1;if(e.highlightFormatting)r.formatting='quote';a.eatSpace();return n(r)} +else if(!s&&!r.setext&&f&&r.indentation<=o&&(l=a.match(v))){var p=l[1]?'ol':'ul';r.indentation=h+a.current().length;r.list=!0;r.quote=0;r.listStack.push(r.indentation);if(e.taskLists&&a.match(m,!1)){r.taskList=!0};r.f=r.inline;if(e.highlightFormatting)r.formatting=['list','list-'+p];return n(r)} +else if(f&&r.indentation<=o&&(l=a.match(M,!0))){r.quote=0;r.fencedEndRE=new RegExp(l[1]+'+ *$');r.localMode=e.fencedCodeBlockHighlighting&&w(l[2]);if(r.localMode)r.localState=t.startState(r.localMode);r.f=r.block=j;if(e.highlightFormatting)r.formatting='code-block';r.code=-1;return n(r)} +else if(r.setext||((!S||!d)&&!r.quote&&r.list===!1&&!r.code&&!s&&!F.test(a.string)&&(l=a.lookAhead(1))&&(l=l.match(T)))){if(!r.setext){r.header=l[0].charAt(0)=='='?1:2;r.setext=r.header} +else{r.header=r.setext;r.setext=0;a.skipToEnd();if(e.highlightFormatting)r.formatting='header'};r.thisLine.header=!0;r.f=r.inline;return n(r)} +else if(s){a.skipToEnd();r.hr=!0;r.thisLine.hr=!0;return i.hr} +else if(a.peek()==='['){return g(a,r,H)};return g(a,r,r.inline)};function s(e,i){var r=o.token(e,i.htmlState);if(!E){var n=t.innerMode(o,i.htmlState);if((n.mode.name=='xml'&&n.state.tagStart===null&&(!n.state.context&&n.state.tokenize.isInText))||(i.md_inside&&e.current().indexOf('>')>-1)){i.f=a;i.block=f;i.htmlState=null}};return r};function j(r,t){var s=t.listStack[t.listStack.length-1]||0,l=t.indentation<s,h=s+3;if(t.fencedEndRE&&t.indentation<=h&&(l||r.match(t.fencedEndRE))){if(e.highlightFormatting)t.formatting='code-block';var o;if(!l)o=n(t);t.localMode=t.localState=null;t.block=f;t.f=a;t.fencedEndRE=null;t.code=0;t.thisLine.fencedCodeEnd=!0;if(l)return d(r,t,t.block);return o} +else if(t.localMode){return t.localMode.token(r,t.localState)} +else{r.skipToEnd();return i.code}};function n(t){var n=[];if(t.formatting){n.push(i.formatting);if(typeof t.formatting==='string')t.formatting=[t.formatting];for(var r=0;r<t.formatting.length;r++){n.push(i.formatting+'-'+t.formatting[r]);if(t.formatting[r]==='header'){n.push(i.formatting+'-'+t.formatting[r]+'-'+t.header)};if(t.formatting[r]==='quote'){if(!e.maxBlockquoteDepth||e.maxBlockquoteDepth>=t.quote){n.push(i.formatting+'-'+t.formatting[r]+'-'+t.quote)} +else{n.push('error')}}}};if(t.taskOpen){n.push('meta');return n.length?n.join(' '):null};if(t.taskClosed){n.push('property');return n.length?n.join(' '):null};if(t.linkHref){n.push(i.linkHref,'url')} +else{if(t.strong){n.push(i.strong)};if(t.em){n.push(i.em)};if(t.strikethrough){n.push(i.strikethrough)};if(t.emoji){n.push(i.emoji)};if(t.linkText){n.push(i.linkText)};if(t.code){n.push(i.code)};if(t.image){n.push(i.image)};if(t.imageAltText){n.push(i.imageAltText,'link')};if(t.imageMarker){n.push(i.imageMarker)}};if(t.header){n.push(i.header,i.header+'-'+t.header)};if(t.quote){n.push(i.quote);if(!e.maxBlockquoteDepth||e.maxBlockquoteDepth>=t.quote){n.push(i.quote+'-'+t.quote)} +else{n.push(i.quote+'-'+e.maxBlockquoteDepth)}};if(t.list!==!1){var a=(t.listStack.length-1)%3;if(!a){n.push(i.list1)} +else if(a===1){n.push(i.list2)} +else{n.push(i.list3)}};if(t.trailingSpaceNewLine){n.push('trailing-space-new-line')} +else if(t.trailingSpace){n.push('trailing-space-'+(t.trailingSpace%2?'a':'b'))};return n.length?n.join(' '):null};function C(t,e){if(t.match(q,!0)){return n(e)};return undefined};function a(f,r){var w=r.text(f,r);if(typeof w!=='undefined')return w;if(r.list){r.list=null;return n(r)};if(r.taskList){var H=f.match(m,!0)[1]===' ';if(H)r.taskOpen=!0;else r.taskClosed=!0;if(e.highlightFormatting)r.formatting='task';r.taskList=!1;return n(r)};r.taskOpen=!1;r.taskClosed=!1;if(r.header&&f.match(/^#+$/,!0)){if(e.highlightFormatting)r.formatting='header';return n(r)};var h=f.next();if(r.linkTitle){r.linkTitle=!1;var L=h;if(h==='('){L=')'};L=(L+'').replace(/([.?*+^\[\]\\(){}|-])/g,'\\$1');var B='^\\s*(?:[^'+L+'\\\\]+|\\\\\\\\|\\\\.)'+L;if(f.match(new RegExp(B),!0)){return i.linkHref}};if(h==='`'){var C=r.formatting;if(e.highlightFormatting)r.formatting='code';f.eatWhile('`');var F=f.current().length;if(r.code==0&&(!r.quote||F==1)){r.code=F;return n(r)} +else if(F==r.code){var v=n(r);r.code=0;return v} +else{r.formatting=C;return n(r)}} +else if(r.code){return n(r)};if(h==='\\'){f.next();if(e.highlightFormatting){var g=n(r),E=i.formatting+'-escape';return g?g+' '+E:E}};if(h==='!'&&f.match(/\[[^\]]*\] ?(?:\(|\[)/,!1)){r.imageMarker=!0;r.image=!0;if(e.highlightFormatting)r.formatting='image';return n(r)};if(h==='['&&r.imageMarker&&f.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1)){r.imageMarker=!1;r.imageAltText=!0;if(e.highlightFormatting)r.formatting='image';return n(r)};if(h===']'&&r.imageAltText){if(e.highlightFormatting)r.formatting='image';var g=n(r);r.imageAltText=!1;r.image=!1;r.inline=r.f=p;return g};if(h==='['&&!r.image){r.linkText=!0;if(e.highlightFormatting)r.formatting='link';return n(r)};if(h===']'&&r.linkText){if(e.highlightFormatting)r.formatting='link';var g=n(r);r.linkText=!1;r.inline=r.f=f.match(/\(.*?\)| ?\[.*?\]/,!1)?p:a;return g};if(h==='<'&&f.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=k;if(e.highlightFormatting)r.formatting='link';var g=n(r);if(g){g+=' '} +else{g=''};return g+i.linkInline};if(h==='<'&&f.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=k;if(e.highlightFormatting)r.formatting='link';var g=n(r);if(g){g+=' '} +else{g=''};return g+i.linkEmail};if(e.xml&&h==='<'&&f.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i,!1)){var b=f.string.indexOf('>',f.pos);if(b!=-1){var j=f.string.substring(f.start,b);if(/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(j))r.md_inside=!0};f.backUp(1);r.htmlState=t.startState(o);return d(f,r,s)};if(e.xml&&h==='<'&&f.match(/^\/\w*?>/)){r.md_inside=!1;return'tag'} +else if(h==='*'||h==='_'){var M=1,x=f.pos==1?' ':f.string.charAt(f.pos-2);while(M<3&&f.eat(h))M++;var u=f.peek()||' ',T=!/\s/.test(u)&&(!l.test(u)||/\s/.test(x)||l.test(x)),q=!/\s/.test(x)&&(!l.test(x)||/\s/.test(u)||l.test(u)),c=null,S=null;if(M%2){if(!r.em&&T&&(h==='*'||!q||l.test(x)))c=!0;else if(r.em==h&&q&&(h==='*'||!T||l.test(u)))c=!1};if(M>1){if(!r.strong&&T&&(h==='*'||!q||l.test(x)))S=!0;else if(r.strong==h&&q&&(h==='*'||!T||l.test(u)))S=!1};if(S!=null||c!=null){if(e.highlightFormatting)r.formatting=c==null?'strong':S==null?'em':'strong em';if(c===!0)r.em=h;if(S===!0)r.strong=h;var v=n(r);if(c===!1)r.em=!1;if(S===!1)r.strong=!1;return v}} +else if(h===' '){if(f.eat('*')||f.eat('_')){if(f.peek()===' '){return n(r)} +else{f.backUp(1)}}};if(e.strikethrough){if(h==='~'&&f.eatWhile(h)){if(r.strikethrough){if(e.highlightFormatting)r.formatting='strikethrough';var v=n(r);r.strikethrough=!1;return v} +else if(f.match(/^[^\s]/,!1)){r.strikethrough=!0;if(e.highlightFormatting)r.formatting='strikethrough';return n(r)}} +else if(h===' '){if(f.match(/^~~/,!0)){if(f.peek()===' '){return n(r)} +else{f.backUp(2)}}}};if(e.emoji&&h===':'&&f.match(/^[a-z_\d+-]+:/)){r.emoji=!0;if(e.highlightFormatting)r.formatting='emoji';var y=n(r);r.emoji=!1;return y};if(h===' '){if(f.match(/ +$/,!1)){r.trailingSpace++} +else if(r.trailingSpace){r.trailingSpaceNewLine=!0}};return n(r)};function k(t,r){var o=t.next();if(o==='>'){r.f=r.inline=a;if(e.highlightFormatting)r.formatting='link';var l=n(r);if(l){l+=' '} +else{l=''};return l+i.linkInline};t.match(/^[^>]+/,!0);return i.linkInline};function p(t,i){if(t.eatSpace()){return null};var r=t.next();if(r==='('||r==='['){i.f=i.inline=B(r==='('?')':']');if(e.highlightFormatting)i.formatting='link-string';i.linkHref=!0;return n(i)};return'error'};var S={')':/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,']':/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function B(t){return function(i,r){var o=i.next();if(o===t){r.f=r.inline=a;if(e.highlightFormatting)r.formatting='link-string';var l=n(r);r.linkHref=!1;return l};i.match(S[t]);r.linkHref=!0;return n(r)}};function H(t,i){if(t.match(/^([^\]\\]|\\.)*\]:/,!1)){i.f=D;t.next();if(e.highlightFormatting)i.formatting='link';i.linkText=!0;return n(i)};return g(t,i,a)};function D(t,r){if(t.match(/^\]:/,!0)){r.f=r.inline=A;if(e.highlightFormatting)r.formatting='link';var a=n(r);r.linkText=!1;return a};t.match(/^([^\]\\]|\\.)+/,!0);return i.linkText};function A(t,e){if(t.eatSpace()){return null};t.match(/^[^\s]+/,!0);if(t.peek()===undefined){e.linkTitle=!0} +else{t.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0)};e.f=e.inline=a;return i.linkHref+' url'};var u={startState:function(){return{f:f,prevLine:{stream:null},thisLine:{stream:null},block:f,htmlState:null,indentation:0,inline:a,text:C,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&t.copyState(o,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?t.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){t.formatting=!1;if(e!=t.thisLine.stream){t.header=0;t.hr=!1;if(e.match(/^\s*$/,!0)){c(t);return null};t.prevLine=t.thisLine;t.thisLine={stream:e};t.taskList=!1;t.trailingSpace=0;t.trailingSpaceNewLine=!1;if(!t.localState){t.f=t.block;if(t.f!=s){var i=e.match(/^\s*/,!0)[0].replace(/\t/g,b).length;t.indentation=i;t.indentationDiff=null;if(i>0)return null}}};return t.f(e,t)},innerMode:function(t){if(t.block==s)return{state:t.htmlState,mode:o};if(t.localState)return{state:t.localState,mode:t.localMode};return{state:t,mode:u}},indent:function(e,i,n){if(e.block==s&&o.indent)return o.indent(e.htmlState,i,n);if(e.localState&&e.localMode.indent)return e.localMode.indent(e.localState,i,n);return t.Pass},blankLine:c,getType:n,closeBrackets:'()[]{}\'\'""``',fold:'markdown'};return u},'xml');t.defineMIME('text/x-markdown','markdown')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../xml/xml'),require('../javascript/javascript'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../xml/xml','../javascript/javascript'],t);else t(CodeMirror)})(function(t){'use strict';function e(t,e,n,i){this.state=t;this.mode=e;this.depth=n;this.prev=i};function n(i){return new e(t.copyState(i.mode,i.state),i.mode,i.depth,i.prev&&n(i.prev))};t.defineMode('jsx',function(i,s){var r=t.getMode(i,{name:'xml',allowMissing:!0,multilineTagIndentPastTag:!1});var a=t.getMode(i,s&&s.base||'javascript');function o(t){var n=t.tagName;t.tagName=null;var e=r.indent(t,'');t.tagName=n;return e};function c(t,e){if(e.context.mode==r)return f(t,e,e.context);else return p(t,e,e.context)};function f(n,f,s){if(s.depth==2){if(n.match(/^.*?\*\//))s.depth=1;else n.skipToEnd();return'comment'};if(n.peek()=='{'){r.skipAttribute(s.state);var d=o(s.state),p=s.state.context;if(p&&n.match(/^[^>]*>\s*$/,!1)){while(p.prev&&!p.startOfLine)p=p.prev;if(p.startOfLine)d-=i.indentUnit;else if(s.prev.state.lexical)d=s.prev.state.lexical.indented} +else if(s.depth==1){d+=i.indentUnit};f.context=new e(t.startState(a,d),a,0,f.context);return null};if(s.depth==1){if(n.peek()=='<'){r.skipAttribute(s.state);f.context=new e(t.startState(r,o(s.state)),r,0,f.context);return null} +else if(n.match('//')){n.skipToEnd();return'comment'} +else if(n.match('/*')){s.depth=2;return c(n,f)}};var l=r.token(n,s.state),u=n.current(),x;if(/\btag\b/.test(l)){if(/>$/.test(u)){if(s.state.context)s.depth=0;else f.context=f.context.prev} +else if(/^</.test(u)){s.depth=1}} +else if(!l&&(x=u.indexOf('{'))>-1){n.backUp(u.length-x)};return l};function p(n,s,i){if(n.peek()=='<'&&a.expressionAllowed(n,i.state)){a.skipExpression(i.state);s.context=new e(t.startState(r,a.indent(i.state,'')),r,0,s.context);return null};var c=a.token(n,i.state);if(!c&&i.depth!=null){var o=n.current();if(o=='{'){i.depth++} +else if(o=='}'){if(--i.depth==0)s.context=s.context.prev}};return c};return{startState:function(){return{context:new e(t.startState(a),a)}},copyState:function(t){return{context:n(t.context)}},token:c,indent:function(t,e,n){return t.context.mode.indent(t.context.state,e,n)},innerMode:function(t){return t.context}}},'xml','javascript');t.defineMIME('text/jsx','jsx');t.defineMIME('text/typescript-jsx',{name:'jsx',base:{name:'javascript',typescript:!0}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('velocity',function(){function r(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var i=r('#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}'),e=r('#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}'),a=r('$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent'),o=/[+\-*&%=<>!?:\/|]/;function t(e,t,n){t.tokenize=n;return n(e,t)};function n(r,n){var k=n.beforeParams;n.beforeParams=!1;var f=r.next();if((f=='\'')&&!n.inString&&n.inParams){n.lastTokenWasBuiltin=!1;return t(r,n,l(f))} +else if((f=='"')){n.lastTokenWasBuiltin=!1;if(n.inString){n.inString=!1;return'string'} +else if(n.inParams)return t(r,n,l(f))} +else if(/[\[\]{}\(\),;\.]/.test(f)){if(f=='('&&k)n.inParams=!0;else if(f==')'){n.inParams=!1;n.lastTokenWasBuiltin=!0};return null} +else if(/\d/.test(f)){n.lastTokenWasBuiltin=!1;r.eatWhile(/[\w\.]/);return'number'} +else if(f=='#'&&r.eat('*')){n.lastTokenWasBuiltin=!1;return t(r,n,s)} +else if(f=='#'&&r.match(/ *\[ *\[/)){n.lastTokenWasBuiltin=!1;return t(r,n,u)} +else if(f=='#'&&r.eat('#')){n.lastTokenWasBuiltin=!1;r.skipToEnd();return'comment'} +else if(f=='$'){r.eatWhile(/[\w\d\$_\.{}]/);if(a&&a.propertyIsEnumerable(r.current())){return'keyword'} +else{n.lastTokenWasBuiltin=!0;n.beforeParams=!0;return'builtin'}} +else if(o.test(f)){n.lastTokenWasBuiltin=!1;r.eatWhile(o);return'operator'} +else{r.eatWhile(/[\w\$_{}@]/);var c=r.current();if(i&&i.propertyIsEnumerable(c))return'keyword';if(e&&e.propertyIsEnumerable(c)||(r.current().match(/^#@?[a-z0-9_]+ *$/i)&&r.peek()=='(')&&!(e&&e.propertyIsEnumerable(c.toLowerCase()))){n.beforeParams=!0;n.lastTokenWasBuiltin=!1;return'keyword'};if(n.inString){n.lastTokenWasBuiltin=!1;return'string'};if(r.pos>c.length&&r.string.charAt(r.pos-c.length-1)=='.'&&n.lastTokenWasBuiltin)return'builtin';n.lastTokenWasBuiltin=!1;return null}};function l(e){return function(t,r){var i=!1,a,o=!1;while((a=t.next())!=null){if((a==e)&&!i){o=!0;break};if(e=='"'&&t.peek()=='$'&&!i){r.inString=!0;o=!0;break};i=!i&&a=='\\'};if(o)r.tokenize=n;return'string'}};function s(e,t){var i=!1,r;while(r=e.next()){if(r=='#'&&i){t.tokenize=n;break};i=(r=='*')};return'comment'};function u(e,t){var i=0,r;while(r=e.next()){if(r=='#'&&i==2){t.tokenize=n;break};if(r==']')i++;else if(r!=' ')i=0};return'meta'};return{startState:function(){return{tokenize:n,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)},blockCommentStart:'#*',blockCommentEnd:'*#',lineComment:'##',fold:'velocity'}});e.defineMIME('text/velocity','velocity')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('fortran',function(){function e(e){var n={};for(var t=0;t<e.length;++t){n[e[t]]=!0};return n};var n=e(['abstract','accept','allocatable','allocate','array','assign','asynchronous','backspace','bind','block','byte','call','case','class','close','common','contains','continue','cycle','data','deallocate','decode','deferred','dimension','do','elemental','else','encode','end','endif','entry','enumerator','equivalence','exit','external','extrinsic','final','forall','format','function','generic','go','goto','if','implicit','import','include','inquire','intent','interface','intrinsic','module','namelist','non_intrinsic','non_overridable','none','nopass','nullify','open','optional','options','parameter','pass','pause','pointer','print','private','program','protected','public','pure','read','recursive','result','return','rewind','save','select','sequence','stop','subroutine','target','then','to','type','use','value','volatile','where','while','write']),i=e(['abort','abs','access','achar','acos','adjustl','adjustr','aimag','aint','alarm','all','allocated','alog','amax','amin','amod','and','anint','any','asin','associated','atan','besj','besjn','besy','besyn','bit_size','btest','cabs','ccos','ceiling','cexp','char','chdir','chmod','clog','cmplx','command_argument_count','complex','conjg','cos','cosh','count','cpu_time','cshift','csin','csqrt','ctime','c_funloc','c_loc','c_associated','c_null_ptr','c_null_funptr','c_f_pointer','c_null_char','c_alert','c_backspace','c_form_feed','c_new_line','c_carriage_return','c_horizontal_tab','c_vertical_tab','dabs','dacos','dasin','datan','date_and_time','dbesj','dbesj','dbesjn','dbesy','dbesy','dbesyn','dble','dcos','dcosh','ddim','derf','derfc','dexp','digits','dim','dint','dlog','dlog','dmax','dmin','dmod','dnint','dot_product','dprod','dsign','dsinh','dsin','dsqrt','dtanh','dtan','dtime','eoshift','epsilon','erf','erfc','etime','exit','exp','exponent','extends_type_of','fdate','fget','fgetc','float','floor','flush','fnum','fputc','fput','fraction','fseek','fstat','ftell','gerror','getarg','get_command','get_command_argument','get_environment_variable','getcwd','getenv','getgid','getlog','getpid','getuid','gmtime','hostnm','huge','iabs','iachar','iand','iargc','ibclr','ibits','ibset','ichar','idate','idim','idint','idnint','ieor','ierrno','ifix','imag','imagpart','index','int','ior','irand','isatty','ishft','ishftc','isign','iso_c_binding','is_iostat_end','is_iostat_eor','itime','kill','kind','lbound','len','len_trim','lge','lgt','link','lle','llt','lnblnk','loc','log','logical','long','lshift','lstat','ltime','matmul','max','maxexponent','maxloc','maxval','mclock','merge','move_alloc','min','minexponent','minloc','minval','mod','modulo','mvbits','nearest','new_line','nint','not','or','pack','perror','precision','present','product','radix','rand','random_number','random_seed','range','real','realpart','rename','repeat','reshape','rrspacing','rshift','same_type_as','scale','scan','second','selected_int_kind','selected_real_kind','set_exponent','shape','short','sign','signal','sinh','sin','sleep','sngl','spacing','spread','sqrt','srand','stat','sum','symlnk','system','system_clock','tan','tanh','time','tiny','transfer','transpose','trim','ttynam','ubound','umask','unlink','unpack','verify','xor','zabs','zcos','zexp','zlog','zsin','zsqrt']),r=e(['c_bool','c_char','c_double','c_double_complex','c_float','c_float_complex','c_funptr','c_int','c_int16_t','c_int32_t','c_int64_t','c_int8_t','c_int_fast16_t','c_int_fast32_t','c_int_fast64_t','c_int_fast8_t','c_int_least16_t','c_int_least32_t','c_int_least64_t','c_int_least8_t','c_intmax_t','c_intptr_t','c_long','c_long_double','c_long_double_complex','c_long_long','c_ptr','c_short','c_signed_char','c_size_t','character','complex','double','integer','logical','real']),t=/[+\-*&=<>\/\:]/,a=new RegExp('(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)','i');function o(e,l){if(e.match(a)){return'operator'};var o=e.next();if(o=='!'){e.skipToEnd();return'comment'};if(o=='"'||o=='\''){l.tokenize=c(o);return l.tokenize(e,l)};if(/[\[\]\(\),]/.test(o)){return null};if(/\d/.test(o)){e.eatWhile(/[\w\.]/);return'number'};if(t.test(o)){e.eatWhile(t);return'operator'};e.eatWhile(/[\w\$_]/);var s=e.current().toLowerCase();if(n.hasOwnProperty(s)){return'keyword'};if(i.hasOwnProperty(s)||r.hasOwnProperty(s)){return'builtin'};return'variable'};function c(e){return function(t,i){var n=!1,r,a=!1;while((r=t.next())!=null){if(r==e&&!n){a=!0;break};n=!n&&r=='\\'};if(a||!n)i.tokenize=null;return'string'}};return{startState:function(){return{tokenize:null}},token:function(e,t){if(e.eatSpace())return null;var n=(t.tokenize||o)(e,t);if(n=='comment'||n=='meta')return n;return n}}});e.defineMIME('text/x-fortran','fortran')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMIME('text/mirc','mirc');e.defineMode('mirc',function(){function e(e){var r={},t=e.split(' ');for(var i=0;i<t.length;++i)r[t[i]]=!0;return r};var r=e('$! $$ $& $? $+ $abook $abs $active $activecid $activewid $address $addtok $agent $agentname $agentstat $agentver $alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime $asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind $binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes $chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color $com $comcall $comchan $comerr $compact $compress $comval $cos $count $cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight $dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress $deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll $dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error $eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir $finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve $fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt $group $halted $hash $height $hfind $hget $highlight $hnick $hotline $hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil $inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect $insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile $isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive $lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock $lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer $maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext $menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode $modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile $nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly $opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree $pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo $readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex $reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline $sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin $site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname $sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped $syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp $timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel $ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver $version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor'),t=e('abook ajinvite alias aline ame amsg anick aop auser autojoin avoice away background ban bcopy beep bread break breplace bset btrunc bunset bwrite channel clear clearall cline clipboard close cnick color comclose comopen comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver debug dec describe dialog did didtok disable disconnect dlevel dline dll dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable events exit fclose filter findtext finger firewall flash flist flood flush flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear ialmark identd if ignore iline inc invite iuser join kick linesep links list load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice qme qmsg query queryn quit raw reload remini remote remove rename renwin reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini say scid scon server set showmirc signam sline sockaccept sockclose socklist socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs elseif else goto menu nicklist status title icon size option text edit button check radio box scroll list combo link tab item'),n=e('if elseif else and not or eq ne in ni for foreach while switch'),o=/[+\-*&%=<>!?^\/\|]/;function a(e,i,r){i.tokenize=r;return r(e,i)};function i(e,i){var m=i.beforeParams;i.beforeParams=!1;var c=e.next();if(/[\[\]{}\(\),\.]/.test(c)){if(c=='('&&m)i.inParams=!0;else if(c==')')i.inParams=!1;return null} +else if(/\d/.test(c)){e.eatWhile(/[\w\.]/);return'number'} +else if(c=='\\'){e.eat('\\');e.eat(/./);return'number'} +else if(c=='/'&&e.eat('*')){return a(e,i,s)} +else if(c==';'&&e.match(/ *\( *\(/)){return a(e,i,l)} +else if(c==';'&&!i.inParams){e.skipToEnd();return'comment'} +else if(c=='"'){e.eat(/"/);return'keyword'} +else if(c=='$'){e.eatWhile(/[$_a-z0-9A-Z\.:]/);if(r&&r.propertyIsEnumerable(e.current().toLowerCase())){return'keyword'} +else{i.beforeParams=!0;return'builtin'}} +else if(c=='%'){e.eatWhile(/[^,\s()]/);i.beforeParams=!0;return'string'} +else if(o.test(c)){e.eatWhile(o);return'operator'} +else{e.eatWhile(/[\w\$_{}]/);var d=e.current().toLowerCase();if(t&&t.propertyIsEnumerable(d))return'keyword';if(n&&n.propertyIsEnumerable(d)){i.beforeParams=!0;return'keyword'};return null}};function s(e,r){var n=!1,t;while(t=e.next()){if(t=='/'&&n){r.tokenize=i;break};n=(t=='*')};return'comment'};function l(e,r){var n=0,t;while(t=e.next()){if(t==';'&&n==2){r.tokenize=i;break};if(t==')')n++;else if(t!=' ')n=0};return'meta'};return{startState:function(){return{tokenize:i,beforeParams:!1,inParams:!1}},token:function(e,i){if(e.eatSpace())return null;return i.tokenize(e,i)}}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('xquery',function(){var a=function(){function o(e){return{type:e,style:'keyword'}};var u=o('operator'),c={type:'atom',style:'atom'},l={type:'punctuation',style:null},f={type:'axis_specifier',style:'qualifier'};var n={',':l};var r=['after','all','allowing','ancestor','ancestor-or-self','any','array','as','ascending','at','attribute','base-uri','before','boundary-space','by','case','cast','castable','catch','child','collation','comment','construction','contains','content','context','copy','copy-namespaces','count','decimal-format','declare','default','delete','descendant','descendant-or-self','descending','diacritics','different','distance','document','document-node','element','else','empty','empty-sequence','encoding','end','entire','every','exactly','except','external','first','following','following-sibling','for','from','ftand','ftnot','ft-option','ftor','function','fuzzy','greatest','group','if','import','in','inherit','insensitive','insert','instance','intersect','into','invoke','is','item','language','last','lax','least','let','levels','lowercase','map','modify','module','most','namespace','next','no','node','nodes','no-inherit','no-preserve','not','occurs','of','only','option','order','ordered','ordering','paragraph','paragraphs','parent','phrase','preceding','preceding-sibling','preserve','previous','processing-instruction','relationship','rename','replace','return','revalidation','same','satisfies','schema','schema-attribute','schema-element','score','self','sensitive','sentence','sentences','sequence','skip','sliding','some','stable','start','stemming','stop','strict','strip','switch','text','then','thesaurus','times','to','transform','treat','try','tumbling','type','typeswitch','union','unordered','update','updating','uppercase','using','validate','value','variable','version','weight','when','where','wildcards','window','with','without','word','words','xquery'];for(var e=0,t=r.length;e<t;e++){n[r[e]]=o(r[e])};var s=['xs:anyAtomicType','xs:anySimpleType','xs:anyType','xs:anyURI','xs:base64Binary','xs:boolean','xs:byte','xs:date','xs:dateTime','xs:dateTimeStamp','xs:dayTimeDuration','xs:decimal','xs:double','xs:duration','xs:ENTITIES','xs:ENTITY','xs:float','xs:gDay','xs:gMonth','xs:gMonthDay','xs:gYear','xs:gYearMonth','xs:hexBinary','xs:ID','xs:IDREF','xs:IDREFS','xs:int','xs:integer','xs:item','xs:java','xs:language','xs:long','xs:Name','xs:NCName','xs:negativeInteger','xs:NMTOKEN','xs:NMTOKENS','xs:nonNegativeInteger','xs:nonPositiveInteger','xs:normalizedString','xs:NOTATION','xs:numeric','xs:positiveInteger','xs:precisionDecimal','xs:QName','xs:short','xs:string','xs:time','xs:token','xs:unsignedByte','xs:unsignedInt','xs:unsignedLong','xs:unsignedShort','xs:untyped','xs:untypedAtomic','xs:yearMonthDuration'];for(var e=0,t=s.length;e<t;e++){n[s[e]]=c};var a=['eq','ne','lt','le','gt','ge',':=','=','>','>=','<','<=','.','|','?','and','or','div','idiv','mod','*','/','+','-'];for(var e=0,t=a.length;e<t;e++){n[a[e]]=u};var i=['self::','attribute::','child::','descendant::','descendant-or-self::','parent::','ancestor::','ancestor-or-self::','following::','preceding::','following-sibling::','preceding-sibling::'];for(var e=0,t=i.length;e<t;e++){n[i[e]]=f};return n}();function r(e,t,n){t.tokenize=n;return n(e,t)};function t(t,i){var s=t.next(),w=!1,v=y(t);if(s=='<'){if(t.match('!--',!0))return r(t,i,d);if(t.match('![CDATA',!1)){i.tokenize=p;return'tag'};if(t.match('?',!1)){return r(t,i,x)};var I=t.eat('/');t.eatSpace();var k='',b;while((b=t.eat(/[^\s\u00a0=<>"'\/?]/)))k+=b;return r(t,i,m(k,I))} +else if(s=='{'){n(i,{type:'codeblock'});return null} +else if(s=='}'){e(i);return null} +else if(c(i)){if(s=='>')return'tag';else if(s=='/'&&t.eat('>')){e(i);return'tag'} +else return'variable'} +else if(/\d/.test(s)){t.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/);return'atom'} +else if(s==='('&&t.eat(':')){n(i,{type:'comment'});return r(t,i,l)} +else if(!v&&(s==='"'||s==='\''))return r(t,i,o(s));else if(s==='$'){return r(t,i,f)} +else if(s===':'&&t.eat('=')){return'keyword'} +else if(s==='('){n(i,{type:'paren'});return null} +else if(s===')'){e(i);return null} +else if(s==='['){n(i,{type:'bracket'});return null} +else if(s===']'){e(i);return null} +else{var u=a.propertyIsEnumerable(s)&&a[s];if(v&&s==='"')while(t.next()!=='"'){};if(v&&s==='\'')while(t.next()!=='\''){};if(!u)t.eatWhile(/[\w\$_-]/);var z=t.eat(':');if(!t.eat(':')&&z){t.eatWhile(/[\w\$_-]/)};if(t.match(/^[ \t]*\(/,!1)){w=!0};var h=t.current();u=a.propertyIsEnumerable(h)&&a[h];if(w&&!u)u={type:'function_call',style:'variable def'};if(g(i)){e(i);return'variable'};if(h=='element'||h=='attribute'||u.type=='axis_specifier')n(i,{type:'xmlconstructor'});return u?u.style:'variable'}};function l(t,n){var a=!1,s=!1,i=0,r;while(r=t.next()){if(r==')'&&a){if(i>0)i--;else{e(n);break}} +else if(r==':'&&s){i++};a=(r==':');s=(r=='(')};return'comment'};function o(r,a){return function(s,u){var c;if(h(u)&&s.current()==r){e(u);if(a)u.tokenize=a;return'string'};n(u,{type:'string',name:r,tokenize:o(r,a)});if(s.match('{',!1)&&i(u)){u.tokenize=t;return'string'} +while(c=s.next()){if(c==r){e(u);if(a)u.tokenize=a;break} +else{if(s.match('{',!1)&&i(u)){u.tokenize=t;return'string'}}};return'string'}};function f(e,n){var r=/[\w\$_-]/;if(e.eat('"')){while(e.next()!=='"'){};e.eat(':')} +else{e.eatWhile(r);if(!e.match(':=',!1))e.eat(':')};e.eatWhile(r);n.tokenize=t;return'variable'};function m(r,i){return function(a,s){a.eatSpace();if(i&&a.eat('>')){e(s);s.tokenize=t;return'tag'};if(!a.eat('/'))n(s,{type:'tag',name:r,tokenize:t});if(!a.eat('>')){s.tokenize=u;return'tag'} +else{s.tokenize=t};return'tag'}};function u(a,s){var l=a.next();if(l=='/'&&a.eat('>')){if(i(s))e(s);if(c(s))e(s);return'tag'};if(l=='>'){if(i(s))e(s);return'tag'};if(l=='=')return null;if(l=='"'||l=='\'')return r(a,s,o(l,u));if(!i(s))n(s,{type:'attribute',tokenize:u});a.eat(/[a-zA-Z_:]/);a.eatWhile(/[-a-zA-Z0-9_:.]/);a.eatSpace();if(a.match('>',!1)||a.match('/',!1)){e(s);s.tokenize=t};return'attribute'};function d(e,n){var r;while(r=e.next()){if(r=='-'&&e.match('->',!0)){n.tokenize=t;return'comment'}}};function p(e,n){var r;while(r=e.next()){if(r==']'&&e.match(']',!0)){n.tokenize=t;return'comment'}}};function x(e,n){var r;while(r=e.next()){if(r=='?'&&e.match('>',!0)){n.tokenize=t;return'comment meta'}}};function c(e){return s(e,'tag')};function i(e){return s(e,'attribute')};function g(e){return s(e,'xmlconstructor')};function h(e){return s(e,'string')};function y(e){if(e.current()==='"')return e.match(/^[^"]+"\:/,!1);else if(e.current()==='\'')return e.match(/^[^"]+'\:/,!1);else return!1};function s(e,t){return(e.stack.length&&e.stack[e.stack.length-1].type==t)};function n(e,t){e.stack.push(t)};function e(e){e.stack.pop();var n=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=n||t};return{startState:function(){return{tokenize:t,cc:[],stack:[]}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n},blockCommentStart:'(:',blockCommentEnd:':)'}});e.defineMIME('application/xquery','xquery')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('elm',function(){function n(e,t,r){t(r);return r(e,t)};var l=/[a-z_]/,c=/[A-Z]/,t=/[0-9]/,s=/[0-9A-Fa-f]/,m=/[0-7]/,f=/[a-z_A-Z0-9']/,r=/[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/,h=/[(),;[\]`{}]/,u=/[ \t\v\f]/;function e(){return function(e,v){if(e.eatWhile(u)){return null};var i=e.next();if(h.test(i)){if(i=='{'&&e.eat('-')){var p='comment';if(e.eat('#'))p='meta';return n(e,v,a(p,1))};return null};if(i=='\''){if(e.eat('\\'))e.next();else e.next();if(e.eat('\''))return'string';return'error'};if(i=='"'){return n(e,v,o)};if(c.test(i)){e.eatWhile(f);if(e.eat('.'))return'qualifier';return'variable-2'};if(l.test(i)){var x=e.pos===1;e.eatWhile(f);return x?'type':'variable'};if(t.test(i)){if(i=='0'){if(e.eat(/[xX]/)){e.eatWhile(s);return'integer'};if(e.eat(/[oO]/)){e.eatWhile(m);return'number'}};e.eatWhile(t);var p='number';if(e.eat('.')){p='number';e.eatWhile(t)};if(e.eat(/[eE]/)){p='number';e.eat(/[-+]/);e.eatWhile(t)};return p};if(r.test(i)){if(i=='-'&&e.eat(/-/)){e.eatWhile(/-/);if(!e.eat(r)){e.skipToEnd();return'comment'}};e.eatWhile(r);return'builtin'};return'error'}};function a(t,r){if(r==0){return e()};return function(n,i){var f=r;while(!n.eol()){var u=n.next();if(u=='{'&&n.eat('-')){++f} +else if(u=='-'&&n.eat('}')){--f;if(f==0){i(e());return t}}};i(a(t,f));return t}};function o(t,r){while(!t.eol()){var n=t.next();if(n=='"'){r(e());return'string'};if(n=='\\'){if(t.eol()||t.eat(u)){r(v);return'string'};if(!t.eat('&'))t.next()}};r(e());return'error'};function v(t,r){if(t.eat('\\')){return n(t,r,o)};t.next();r(e());return'error'};var i=(function(){var r={};var t=['case','of','as','if','then','else','let','in','infix','infixl','infixr','type','alias','input','output','foreign','loopback','module','where','import','exposing','_','..','|',':','=','\\','"','->','<-'];for(var e=t.length;e--;)r[t[e]]='keyword';return r})();return{startState:function(){return{f:e()}},copyState:function(e){return{f:e.f}},token:function(e,t){var n=t.f(e,function(e){t.f=e}),r=e.current();return(i.hasOwnProperty(r))?i[r]:n}}});e.defineMIME('text/x-elm','elm')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";function t(e){var r={},n=e.split(",");for(var t=0;t<n.length;++t){var i=n[t].toUpperCase(),o=n[t].charAt(0).toUpperCase()+n[t].slice(1);r[n[t]]=!0;r[i]=!0;r[o]=!0};return r};function n(e){e.eatWhile(/[\w\$_]/);return"meta"};e.defineMode("vhdl",function(e,i){var u=e.indentUnit,h=i.atoms||t("null"),f=i.hooks||{"`":n,"$":n},c=i.multiLineStrings;var p=t("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block,body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case,end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for,function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage,literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map,postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal,sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"),m=t("architecture,entity,begin,case,port,else,elsif,end,for,function,if"),s=/[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/,r;function a(e,t){var n=e.next();if(f[n]){var o=f[n](e,t);if(o!==!1)return o};if(n=="\""){t.tokenize=b(n);return t.tokenize(e,t)};if(n=="'"){t.tokenize=y(n);return t.tokenize(e,t)};if(/[\[\]{}\(\),;\:\.]/.test(n)){r=n;return null};if(/[\d']/.test(n)){e.eatWhile(/[\w\.']/);return"number"};if(n=="-"){if(e.eat("-")){e.skipToEnd();return"comment"}};if(s.test(n)){e.eatWhile(s);return"operator"};e.eatWhile(/[\w\$_]/);var i=e.current();if(p.propertyIsEnumerable(i.toLowerCase())){if(m.propertyIsEnumerable(i))r="newstatement";return"keyword"};if(h.propertyIsEnumerable(i))return"atom";return"variable"};function y(e){return function(t,n){var r=!1,i,o=!1;while((i=t.next())!=null){if(i==e&&!r){o=!0;break};r=!r&&i=="--"};if(o||!(r||c))n.tokenize=a;return"string"}};function b(e){return function(t,n){var r=!1,i,o=!1;while((i=t.next())!=null){if(i==e&&!r){o=!0;break};r=!r&&i=="--"};if(o||!(r||c))n.tokenize=a;return"string-2"}};function d(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function l(e,t,n){return e.context=new d(e.indented,t,n,null,e.context)};function o(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new d((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()){if(n.align==null)n.align=!1;t.indented=e.indentation();t.startOfLine=!0};if(e.eatSpace())return null;r=null;var i=(t.tokenize||a)(e,t);if(i=="comment"||i=="meta")return i;if(n.align==null)n.align=!0;if((r==";"||r==":")&&n.type=="statement")o(t);else if(r=="{")l(t,e.column(),"}");else if(r=="[")l(t,e.column(),"]");else if(r=="(")l(t,e.column(),")");else if(r=="}"){while(n.type=="statement")n=o(t);if(n.type=="}")n=o(t);while(n.type=="statement")n=o(t)} +else if(r==n.type)o(t);else if(n.type=="}"||n.type=="top"||(n.type=="statement"&&r=="newstatement"))l(t,e.column(),"statement");t.startOfLine=!1;return i},indent:function(e,t){if(e.tokenize!=a&&e.tokenize!=null)return 0;var r=t&&t.charAt(0),n=e.context,i=r==n.type;if(n.type=="statement")return n.indented+(r=="{"?0:u);else if(n.align)return n.column+(i?0:1);else return n.indented+(i?0:u)},electricChars:"{}"}});e.defineMIME("text/x-vhdl","vhdl")});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("verilog",function(t,n){var f=t.indentUnit,p=n.statementIndentUnit||f,q=n.dontAlignCalls,v=n.noIndentKeywords||[],L=n.multiLineStrings,a=n.hooks||{};function d(e){var n={},i=e.split(" ");for(var t=0;t<i.length;++t)n[i[t]]=!0;return n};var w=d("accept_on alias always always_comb always_ff always_latch and assert assign assume automatic before begin bind bins binsof bit break buf bufif0 bufif1 byte case casex casez cell chandle checker class clocking cmos config const constraint context continue cover covergroup coverpoint cross deassign default defparam design disable dist do edge else end endcase endchecker endclass endclocking endconfig endfunction endgenerate endgroup endinterface endmodule endpackage endprimitive endprogram endproperty endspecify endsequence endtable endtask enum event eventually expect export extends extern final first_match for force foreach forever fork forkjoin function generate genvar global highz0 highz1 if iff ifnone ignore_bins illegal_bins implements implies import incdir include initial inout input inside instance int integer interconnect interface intersect join join_any join_none large let liblist library local localparam logic longint macromodule matches medium modport module nand negedge nettype new nexttime nmos nor noshowcancelled not notif0 notif1 null or output package packed parameter pmos posedge primitive priority program property protected pull0 pull1 pulldown pullup pulsestyle_ondetect pulsestyle_onevent pure rand randc randcase randsequence rcmos real realtime ref reg reject_on release repeat restrict return rnmos rpmos rtran rtranif0 rtranif1 s_always s_eventually s_nexttime s_until s_until_with scalared sequence shortint shortreal showcancelled signed small soft solve specify specparam static string strong strong0 strong1 struct super supply0 supply1 sync_accept_on sync_reject_on table tagged task this throughout time timeprecision timeunit tran tranif0 tranif1 tri tri0 tri1 triand trior trireg type typedef union unique unique0 unsigned until until_with untyped use uwire var vectored virtual void wait wait_order wand weak weak0 weak1 while wildcard wire with within wor xnor xor"),x=/[\+\-\*\/!~&|^%=?:]/,I=/[\[\]{}()]/,C=/\d[0-9_]*/,z=/\d*\s*'s?d\s*\d[0-9_]*/i,S=/\d*\s*'s?b\s*[xz01][xz01_]*/i,j=/\d*\s*'s?o\s*[xz0-7][xz0-7_]*/i,E=/\d*\s*'s?h\s*[0-9a-fxz?][0-9a-fxz?_]*/i,m=/(\d[\d_]*(\.\d[\d_]*)?E-?[\d_]+)|(\d[\d_]*\.\d[\d_]*)/i,M=/^((\w+)|[)}\]])/,A=/[)}\]]/,r,l,B=d("case checker class clocking config function generate interface module package primitive program property specify sequence table task"),i={};for(var s in B){i[s]="end"+s};i["begin"]="end";i["casex"]="endcase";i["casez"]="endcase";i["do"]="while";i["fork"]="join;join_any;join_none";i["covergroup"]="endgroup";for(var b in v){var s=v[b];if(i[s]){i[s]=undefined}};var k=d("always always_comb always_ff always_latch assert assign assume else export for foreach forever if import initial repeat while");function c(e,t){var n=e.peek(),s;if(a[n]&&(s=a[n](e,t))!=!1)return s;if(a.tokenBase&&(s=a.tokenBase(e,t))!=!1)return s;if(/[,;:\.]/.test(n)){r=e.next();return null};if(I.test(n)){r=e.next();return"bracket"};if(n=="`"){e.next();if(e.eatWhile(/[\w\$_]/)){return"def"} +else{return null}};if(n=="$"){e.next();if(e.eatWhile(/[\w\$_]/)){return"meta"} +else{return null}};if(n=="#"){e.next();e.eatWhile(/[\d_.]/);return"def"};if(n=="\""){e.next();t.tokenize=T(n);return t.tokenize(e,t)};if(n=="/"){e.next();if(e.eat("*")){t.tokenize=h;return h(e,t)};if(e.eat("/")){e.skipToEnd();return"comment"};e.backUp(1)};if(e.match(m)||e.match(z)||e.match(S)||e.match(j)||e.match(E)||e.match(C)||e.match(m)){return"number"};if(e.eatWhile(x)){return"meta"};if(e.eatWhile(/[\w\$_]/)){var o=e.current();if(w[o]){if(i[o]){r="newblock"};if(k[o]){r="newstatement"};l=o;return"keyword"};return"variable"};e.next();return null};function T(e){return function(t,n){var i=!1,r,a=!1;while((r=t.next())!=null){if(r==e&&!i){a=!0;break};i=!i&&r=="\\"};if(a||!(i||L))n.tokenize=c;return"string"}};function h(e,t){var i=!1,n;while(n=e.next()){if(n=="/"&&i){t.tokenize=c;break};i=(n=="*")};return"comment"};function g(e,t,n,i,r){this.indented=e;this.column=t;this.type=n;this.align=i;this.prev=r};function o(e,t,n){var i=e.indented,r=new g(i,t,n,null,e.context);return e.context=r};function u(e){var t=e.context.type;if(t==")"||t=="]"||t=="}"){e.indented=e.context.indented};return e.context=e.context.prev};function y(e,t){if(e==t){return!0} +else{var n=t.split(";");for(var i in n){if(e==n[i]){return!0}};return!1}};function W(){var n=[];for(var t in i){if(i[t]){var e=i[t].split(";");for(var a in e){n.push(e[a])}}};var r=new RegExp("[{}()\\[\\]]|("+n.join("|")+")$");return r};return{electricInput:W(),startState:function(e){var t={tokenize:null,context:new g((e||0)-f,0,"top",!1),indented:0,startOfLine:!0};if(a.startState)a.startState(t);return t},token:function(e,t){var n=t.context;if(e.sol()){if(n.align==null)n.align=!1;t.indented=e.indentation();t.startOfLine=!0};if(a.token){var s=a.token(e,t);if(s!==undefined){return s}};if(e.eatSpace())return null;r=null;l=null;var s=(t.tokenize||c)(e,t);if(s=="comment"||s=="meta"||s=="variable")return s;if(n.align==null)n.align=!0;if(r==n.type){u(t)} +else if((r==";"&&n.type=="statement")||(n.type&&y(l,n.type))){n=u(t);while(n&&n.type=="statement")n=u(t)} +else if(r=="{"){o(t,e.column(),"}")} +else if(r=="["){o(t,e.column(),"]")} +else if(r=="("){o(t,e.column(),")")} +else if(n&&n.type=="endcase"&&r==":"){o(t,e.column(),"statement")} +else if(r=="newstatement"){o(t,e.column(),"statement")} +else if(r=="newblock"){if(l=="function"&&n&&(n.type=="statement"||n.type=="endgroup")){} +else if(l=="task"&&n&&n.type=="statement"){} +else{var f=i[l];o(t,e.column(),f)}};t.startOfLine=!1;return s},indent:function(t,n){if(t.tokenize!=c&&t.tokenize!=null)return e.Pass;if(a.indent){var s=a.indent(t);if(s>=0)return s};var i=t.context,o=n&&n.charAt(0);if(i.type=="statement"&&o=="}")i=i.prev;var r=!1,l=n.match(M);if(l)r=y(l[0],i.type);if(i.type=="statement")return i.indented+(o=="{"?0:p);else if(A.test(i.type)&&i.align&&!q)return i.column+(r?0:1);else if(i.type==")"&&!r)return i.indented+p;else return i.indented+(r?0:f)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});e.defineMIME("text/x-verilog",{name:"verilog"});e.defineMIME("text/x-systemverilog",{name:"verilog"});var a={"|":"link",">":"property","$":"variable","$$":"variable","?$":"qualifier","?*":"qualifier","-":"hr","/":"property","/-":"property","@":"variable-3","@-":"variable-3","@++":"variable-3","@+=":"variable-3","@+=-":"variable-3","@--":"variable-3","@-=":"variable-3","%+":"tag","%-":"tag","%":"tag",">>":"tag","<<":"tag","<>":"tag","#":"tag","^":"attribute","^^":"attribute","^!":"attribute","*":"variable-2","**":"variable-2","\\":"keyword","\"":"comment"};var o={"/":"beh-hier",">":"beh-hier","-":"phys-hier","|":"pipe","?":"when","@":"stage","\\":"keyword"};var t=3,n=!1,r=/^([~!@#\$%\^&\*-\+=\?\/\\\|'"<>]+)([\d\w_]*)/,s=/^[! ] /,c=/^[! ] */,l=/^\/[\/\*]/;function i(e,n,i){var r=n/t;return"tlv-"+e.tlvIndentationStyle[r]+"-"+i};function f(e){var t;return(t=e.match(r,!1))&&t[2].length>0};e.defineMIME("text/x-tlv",{name:"verilog",hooks:{electricInput:!1,token:function(e,d){var u=undefined,m;if(e.sol()&&!d.tlvInBlockComment){if(e.peek()=="\\"){u="def";e.skipToEnd();if(e.string.match(/\\SV/)){d.tlvCodeActive=!1} +else if(e.string.match(/\\TLV/)){d.tlvCodeActive=!0}};if(d.tlvCodeActive&&e.pos==0&&(d.indented==0)&&(m=e.match(c,!1))){d.indented=m[0].length};var h=d.indented,p=h/t;if(p<=d.tlvIndentationStyle.length){var x=e.string.length==h,y=p*t;if(y<e.string.length){var b=e.string.slice(y),g=b[0];if(o[g]&&((m=b.match(r))&&a[m[1]])){h+=t;if(!(g=="\\"&&y>0)){d.tlvIndentationStyle[p]=o[g];if(n){d.statementComment=!1};p++}}};if(!x){while(d.tlvIndentationStyle.length>p){d.tlvIndentationStyle.pop()}}};d.tlvNextIndent=h};if(d.tlvCodeActive){var v=!1;if(n){v=(e.peek()!=" ")&&(u===undefined)&&!d.tlvInBlockComment&&(e.column()==d.tlvIndentationStyle.length*t);if(v){if(d.statementComment){v=!1};d.statementComment=e.match(l,!1)}};var m;if(u!==undefined){u+=" "+i(d,0,"scope-ident")} +else if(((e.pos/t)<d.tlvIndentationStyle.length)&&(m=e.match(e.sol()?s:/^ /))){u="tlv-indent-"+(((e.pos%2)==0)?"even":"odd")+" "+i(d,e.pos-t,"indent");if(m[0].charAt(0)=="!"){u+=" tlv-alert-line-prefix"};if(f(e)){u+=" "+i(d,e.pos,"before-scope-ident")}} +else if(d.tlvInBlockComment){if(e.match(/^.*?\*\//)){d.tlvInBlockComment=!1;if(n&&!e.eol()){d.statementComment=!1}} +else{e.skipToEnd()};u="comment"} +else if((m=e.match(l))&&!d.tlvInBlockComment){if(m[0]=="//"){e.skipToEnd()} +else{d.tlvInBlockComment=!0};u="comment"} +else if(m=e.match(r)){var k=m[1],w=m[2];if(a.hasOwnProperty(k)&&(w.length>0||e.eol())){u=a[k];if(e.column()==d.indented){u+=" "+i(d,e.column(),"scope-ident")}} +else{e.backUp(e.current().length-1);u="tlv-default"}} +else if(e.match(/^\t+/)){u="tlv-tab"} +else if(e.match(/^[\[\]{}\(\);\:]+/)){u="meta"} +else if(m=e.match(/^[mM]4([\+_])?[\w\d_]*/)){u=(m[1]=="+")?"tlv-m4-plus":"tlv-m4"} +else if(e.match(/^ +/)){if(e.eol()){u="error"} +else{u="tlv-default"}} +else if(e.match(/^[\w\d_]+/)){u="number"} +else{e.next();u="tlv-default"};if(v){u+=" tlv-statement"}} +else{if(e.match(/^[mM]4([\w\d_]*)/)){u="tlv-m4"}};return u},indent:function(e){return(e.tlvCodeActive==!0)?e.tlvNextIndent:-1},startState:function(e){e.tlvIndentationStyle=[];e.tlvCodeActive=!0;e.tlvNextIndent=-1;e.tlvInBlockComment=!1;if(n){e.statementComment=!1}}}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('spreadsheet',function(){return{startState:function(){return{stringType:null,stack:[]}},token:function(e,t){if(!e)return;if(t.stack.length===0){if((e.peek()=='"')||(e.peek()=='\'')){t.stringType=e.peek();e.next();t.stack.unshift('string')}};switch(t.stack[0]){case'string':while(t.stack[0]==='string'&&!e.eol()){if(e.peek()===t.stringType){e.next();t.stack.shift()} +else if(e.peek()==='\\'){e.next();e.next()} +else{e.match(/^.[^\\"']*/)}};return'string';case'characterClass':while(t.stack[0]==='characterClass'&&!e.eol()){if(!(e.match(/^[^\]\\]+/)||e.match(/^\\./)))t.stack.shift()};return'operator'};var r=e.peek();switch(r){case'[':e.next();t.stack.unshift('characterClass');return'bracket';case':':e.next();return'operator';case'\\':if(e.match(/\\[a-z]+/))return'string-2';else{e.next();return'atom'};case'.':case',':case';':case'*':case'-':case'+':case'^':case'<':case'/':case'=':e.next();return'atom';case'$':e.next();return'builtin'};if(e.match(/\d+/)){if(e.match(/^\w+/))return'error';return'number'} +else if(e.match(/^[a-zA-Z_]\w*/)){if(e.match(/(?=[\(.])/,!1))return'keyword';return'variable-2'} +else if(['[',']','(',')','{','}'].indexOf(r)!=-1){e.next();return'bracket'} +else if(!e.eatSpace()){e.next()};return null}}});e.defineMIME('text/x-spreadsheet','spreadsheet')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('coffeescript',function(e,t){var f='error';function i(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var m=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,v=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,a=/^[_A-Za-z$][_A-Za-z$0-9]*/,k=/^@[_A-Za-z$][_A-Za-z$0-9]*/,y=i(['and','or','not','is','isnt','in','instanceof','typeof']),r=['for','while','loop','if','unless','else','switch','try','catch','finally','class'],g=['break','by','continue','debugger','delete','do','in','of','new','return','then','this','@','throw','when','until','extends'],b=i(r.concat(g));r=i(r);var u=/^('{3}|"{3}|['"])/,l=/^(\/{3}|\/)/,d=['Infinity','NaN','undefined','null','true','false','on','off','yes','no'],h=i(d);function n(e,t){if(e.sol()){if(t.scope.align===null)t.scope.align=!1;var i=t.scope.offset;if(e.eatSpace()){var o=e.indentation();if(o>i&&t.scope.type=='coffee'){return'indent'} +else if(o<i){return'dedent'};return null} +else{if(i>0){c(e,t)}}};if(e.eatSpace()){return null};var s=e.peek();if(e.match('####')){e.skipToEnd();return'comment'};if(e.match('###')){t.tokenize=z;return t.tokenize(e,t)};if(s==='#'){e.skipToEnd();return'comment'};if(e.match(/^-?[0-9\.]/,!1)){var r=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)){r=!0};if(e.match(/^-?\d+\.\d*/)){r=!0};if(e.match(/^-?\.\d+/)){r=!0};if(r){if(e.peek()=='.'){e.backUp(1)};return'number'};var n=!1;if(e.match(/^-?0x[0-9a-f]+/i)){n=!0};if(e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)){n=!0};if(e.match(/^-?0(?![\dx])/i)){n=!0};if(n){return'number'}};if(e.match(u)){t.tokenize=p(e.current(),!1,'string');return t.tokenize(e,t)};if(e.match(l)){if(e.current()!='/'||e.match(/^.*\//,!1)){t.tokenize=p(e.current(),!0,'string-2');return t.tokenize(e,t)} +else{e.backUp(1)}};if(e.match(m)||e.match(y)){return'operator'};if(e.match(v)){return'punctuation'};if(e.match(h)){return'atom'};if(e.match(k)||t.prop&&e.match(a)){return'property'};if(e.match(b)){return'keyword'};if(e.match(a)){return'variable'};e.next();return f};function p(e,r,i){return function(o,c){while(!o.eol()){o.eatWhile(/[^'"\/\\]/);if(o.eat('\\')){o.next();if(r&&o.eol()){return i}} +else if(o.match(e)){c.tokenize=n;return i} +else{o.eat(/['"\/]/)}};if(r){if(t.singleLineStringErrors){i=f} +else{c.tokenize=n}};return i}};function z(e,t){while(!e.eol()){e.eatWhile(/[^#]/);if(e.match('###')){t.tokenize=n;break};e.eatWhile('#')};return'comment'};function o(t,n,i){i=i||'coffee';var f=0,o=!1,c=null;for(var r=n.scope;r;r=r.prev){if(r.type==='coffee'||r.type=='}'){f=r.offset+e.indentUnit;break}};if(i!=='coffee'){o=null;c=t.column()+t.current().length} +else if(n.scope.align){n.scope.align=!1};n.scope={offset:f,type:i,prev:n.scope,align:o,alignOffset:c}};function c(t,e){if(!e.scope.prev)return;if(e.scope.type==='coffee'){var r=t.indentation(),i=!1;for(var n=e.scope;n;n=n.prev){if(r===n.offset){i=!0;break}};if(!i){return!0} +while(e.scope.prev&&e.scope.offset!==r){e.scope=e.scope.prev};return!1} +else{e.scope=e.scope.prev;return!1}};function x(t,e){var a=e.tokenize(t,e),n=t.current();if(n==='return'){e.dedent=!0};if(((n==='->'||n==='=>')&&t.eol())||a==='indent'){o(t,e)};var i='[({'.indexOf(n);if(i!==-1){o(t,e,'])}'.slice(i,i+1))};if(r.exec(n)){o(t,e)};if(n=='then'){c(t,e)};if(a==='dedent'){if(c(t,e)){return f}};i='])}'.indexOf(n);if(i!==-1){while(e.scope.type=='coffee'&&e.scope.prev)e.scope=e.scope.prev;if(e.scope.type==n)e.scope=e.scope.prev};if(e.dedent&&t.eol()){if(e.scope.type=='coffee'&&e.scope.prev)e.scope=e.scope.prev;e.dedent=!1};return a};var s={startState:function(e){return{tokenize:n,scope:{offset:e||0,type:'coffee',prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var r=t.scope.align===null&&t.scope;if(r&&e.sol())r.align=!1;var n=x(e,t);if(n&&n!='comment'){if(r)r.align=!0;t.prop=n=='punctuation'&&e.current()=='.'};return n},indent:function(e,t){if(e.tokenize!=n)return 0;var r=e.scope,f=t&&'])}'.indexOf(t.charAt(0))>-1;if(f)while(r.type=='coffee'&&r.prev)r=r.prev;var i=f&&r.type===t.charAt(0);if(r.align)return r.alignOffset-(i?1:0);else return(i?r.prev:r).offset},lineComment:'#',fold:'indent'};return s});e.defineMIME('application/vnd.coffeescript','coffeescript');e.defineMIME('text/x-coffeescript','coffeescript');e.defineMIME('text/coffeescript','coffeescript')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("tiddlywiki",function(){var b={};var s={"allTags":!0,"closeAll":!0,"list":!0,"newJournal":!0,"newTiddler":!0,"permaview":!0,"saveChanges":!0,"search":!0,"slider":!0,"tabs":!0,"tag":!0,"tagging":!0,"tags":!0,"tiddler":!0,"timeline":!0,"today":!0,"version":!0,"option":!0,"with":!0,"filter":!0};var n=/[\w_\-]/i,i=/^\-\-\-\-+$/,u=/^\/\*\*\*$/,o=/^\*\*\*\/$/,a=/^<<<$/,f=/^\/\/\{\{\{$/,c=/^\/\/\}\}\}$/,l=/^<!--\{\{\{-->$/,m=/^<!--\}\}\}-->$/,h=/^\{\{\{$/,k=/^\}\}\}$/,d=/.*?\}\}\}/;function t(e,t,r){t.tokenize=r;return r(e,t)};function e(e,d){var s=e.sol(),k=e.peek();d.block=!1;if(s&&/[<\/\*{}\-]/.test(k)){if(e.match(h)){d.block=!0;return t(e,d,r)};if(e.match(a))return"quote";if(e.match(u)||e.match(o))return"comment";if(e.match(f)||e.match(c)||e.match(l)||e.match(m))return"comment";if(e.match(i))return"hr"};e.next();if(s&&/[\/\*!#;:>|]/.test(k)){if(k=="!"){e.skipToEnd();return"header"};if(k=="*"){e.eatWhile("*");return"comment"};if(k=="#"){e.eatWhile("#");return"comment"};if(k==";"){e.eatWhile(";");return"comment"};if(k==":"){e.eatWhile(":");return"comment"};if(k==">"){e.eatWhile(">");return"quote"};if(k=="|")return"header"};if(k=="{"&&e.match(/\{\{/))return t(e,d,r);if(/[hf]/i.test(k)&&/[ti]/i.test(e.peek())&&e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if(k=="\"")return"string";if(k=="~")return"brace";if(/[\[\]]/.test(k)&&e.match(k))return"brace";if(k=="@"){e.eatWhile(n);return"link"};if(/\d/.test(k)){e.eatWhile(/\d/);return"number"};if(k=="/"){if(e.eat("%")){return t(e,d,p)} +else if(e.eat("/")){return t(e,d,v)}};if(k=="_"&&e.eat("_"))return t(e,d,x);if(k=="-"&&e.eat("-")){if(e.peek()!=" ")return t(e,d,z);if(e.peek()==" ")return"brace"};if(k=="'"&&e.eat("'"))return t(e,d,w);if(k=="<"&&e.eat("<"))return t(e,d,y);e.eatWhile(/[\w\$_]/);return b.propertyIsEnumerable(e.current())?"keyword":null};function p(t,r){var i=!1,n;while(n=t.next()){if(n=="/"&&i){r.tokenize=e;break};i=(n=="%")};return"comment"};function w(t,r){var i=!1,n;while(n=t.next()){if(n=="'"&&i){r.tokenize=e;break};i=(n=="'")};return"strong"};function r(t,r){var n=r.block;if(n&&t.current()){return"comment"};if(!n&&t.match(d)){r.tokenize=e;return"comment"};if(n&&t.sol()&&t.match(k)){r.tokenize=e;return"comment"};t.next();return"comment"};function v(t,r){var i=!1,n;while(n=t.next()){if(n=="/"&&i){r.tokenize=e;break};i=(n=="/")};return"em"};function x(t,r){var i=!1,n;while(n=t.next()){if(n=="_"&&i){r.tokenize=e;break};i=(n=="_")};return"underlined"};function z(t,r){var i=!1,n;while(n=t.next()){if(n=="-"&&i){r.tokenize=e;break};i=(n=="-")};return"strikethrough"};function y(t,r){if(t.current()=="<<"){return"macro"};var n=t.next();if(!n){r.tokenize=e;return null};if(n==">"){if(t.peek()==">"){t.next();r.tokenize=e;return"macro"}};t.eatWhile(/[\w\$_]/);return s.propertyIsEnumerable(t.current())?"keyword":null};return{startState:function(){return{tokenize:e}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r}}});e.defineMIME("text/x-tiddlywiki","tiddlywiki")});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("mumps",function(){function e(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")};var t=new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]"),r=new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))"),n=new RegExp("^[\\.,:]"),i=new RegExp("[()]"),o=new RegExp("^[%A-Za-z][A-Za-z0-9]*"),a=["break","close","do","else","for","goto","halt","hang","if","job","kill","lock","merge","new","open","quit","read","set","tcommit","trollback","tstart","use","view","write","xecute","b","c","d","e","f","g","h","i","j","k","l","m","n","o","q","r","s","tc","tro","ts","u","v","w","x"],c=["\\$ascii","\\$char","\\$data","\\$ecode","\\$estack","\\$etrap","\\$extract","\\$find","\\$fnumber","\\$get","\\$horolog","\\$io","\\$increment","\\$job","\\$justify","\\$length","\\$name","\\$next","\\$order","\\$piece","\\$qlength","\\$qsubscript","\\$query","\\$quit","\\$random","\\$reverse","\\$select","\\$stack","\\$test","\\$text","\\$translate","\\$view","\\$x","\\$y","\\$a","\\$c","\\$d","\\$e","\\$ec","\\$es","\\$et","\\$f","\\$fn","\\$g","\\$h","\\$i","\\$j","\\$l","\\$n","\\$na","\\$o","\\$p","\\$q","\\$ql","\\$qs","\\$r","\\$re","\\$s","\\$st","\\$t","\\$tr","\\$v","\\$z"],m=e(c),d=e(a);function f(e,a){if(e.sol()){a.label=!0;a.commandMode=0};var c=e.peek();if(c==" "||c=="\t"){a.label=!1;if(a.commandMode==0)a.commandMode=1;else if((a.commandMode<0)||(a.commandMode==2))a.commandMode=0} +else if((c!=".")&&(a.commandMode>0)){if(c==":")a.commandMode=-1;else a.commandMode=2};if((c==="(")||(c==="\u0009"))a.label=!1;if(c===";"){e.skipToEnd();return"comment"};if(e.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/))return"number";if(c=="\""){if(e.skipTo("\"")){e.next();return"string"} +else{e.skipToEnd();return"error"}};if(e.match(r)||e.match(t))return"operator";if(e.match(n))return null;if(i.test(c)){e.next();return"bracket"};if(a.commandMode>0&&e.match(d))return"variable-2";if(e.match(m))return"builtin";if(e.match(o))return"variable";if(c==="$"||c==="^"){e.next();return"builtin"};if(c==="@"){e.next();return"string-2"};if(/[\w%]/.test(c)){e.eatWhile(/[\w%]/);return"variable"};e.next();return"error"};return{startState:function(){return{label:!1,commandMode:0}},token:function(e,t){var r=f(e,t);if(t.label)return"tag";return r}}});e.defineMIME("text/x-mumps","mumps")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('eiffel',function(){function e(e){var r={};for(var t=0,n=e.length;t<n;++t)r[e[t]]=!0;return r};var t=e(['note','across','when','variant','until','unique','undefine','then','strip','select','retry','rescue','require','rename','reference','redefine','prefix','once','old','obsolete','loop','local','like','is','inspect','infix','include','if','frozen','from','external','export','ensure','end','elseif','else','do','creation','create','check','alias','agent','separate','invariant','inherit','indexing','feature','expanded','deferred','class','Void','True','Result','Precursor','False','Current','create','attached','detachable','as','and','implies','not','or']),r=e([':=','and then','and','or','<<','>>']);function n(e,t,r){r.tokenize.push(e);return e(t,r)};function i(e,r){if(e.eatSpace())return null;var t=e.next();if(t=='"'||t=='\''){return n(o(t,'string'),e,r)} +else if(t=='-'&&e.eat('-')){e.skipToEnd();return'comment'} +else if(t==':'&&e.eat('=')){return'operator'} +else if(/[0-9]/.test(t)){e.eatWhile(/[xXbBCc0-9\.]/);e.eat(/[\?\!]/);return'ident'} +else if(/[a-zA-Z_0-9]/.test(t)){e.eatWhile(/[a-zA-Z_0-9]/);e.eat(/[\?\!]/);return'ident'} +else if(/[=+\-\/*^%<>~]/.test(t)){e.eatWhile(/[=+\-\/*^%<>~]/);return'operator'} +else{return null}};function o(e,t,r){return function(n,i){var o=!1,a;while((a=n.next())!=null){if(a==e&&(r||!o)){i.tokenize.pop();break};o=!o&&a=='%'};return t}};return{startState:function(){return{tokenize:[i]}},token:function(e,n){var o=n.tokenize[n.tokenize.length-1](e,n);if(o=='ident'){var i=e.current();o=t.propertyIsEnumerable(e.current())?'keyword':r.propertyIsEnumerable(e.current())?'operator':/^[A-Z][A-Z_0-9]*$/g.test(i)?'tag':/^0[bB][0-1]+$/g.test(i)?'number':/^0[cC][0-7]+$/g.test(i)?'number':/^0[xX][a-fA-F0-9]+$/g.test(i)?'number':/^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(i)?'number':/^[0-9]+$/g.test(i)?'number':'variable'};return o},lineComment:'--'}});e.defineMIME('text/x-eiffel','eiffel')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var n=['Clamp','Constructor','EnforceRange','Exposed','ImplicitThis','Global','PrimaryGlobal','LegacyArrayClass','LegacyUnenumerableNamedProperties','LenientThis','NamedConstructor','NewObject','NoInterfaceObject','OverrideBuiltins','PutForwards','Replaceable','SameObject','TreatNonObjectAsNull','TreatNullAs','EmptyString','Unforgeable','Unscopeable'],g=t(n),i=['unsigned','short','long','unrestricted','float','double','boolean','byte','octet','Promise','ArrayBuffer','DataView','Int8Array','Int16Array','Int32Array','Uint8Array','Uint16Array','Uint32Array','Uint8ClampedArray','Float32Array','Float64Array','ByteString','DOMString','USVString','sequence','object','RegExp','Error','DOMException','FrozenArray','any','void'],D=t(i),a=['attribute','callback','const','deleter','dictionary','enum','getter','implements','inherit','interface','iterable','legacycaller','maplike','partial','required','serializer','setlike','setter','static','stringifier','typedef','optional','readonly','or'],E=t(a),o=['true','false','Infinity','NaN','null'],k=t(o);e.registerHelper('hintWords','webidl',n.concat(i).concat(a).concat(o));var c=['callback','dictionary','enum','interface'],l=t(c),f=['typedef'],m=t(f),u=/^[:<=>?]/,s=/^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/,d=/^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/,r=/^_?[A-Za-z][0-9A-Z_a-z-]*/,b=/^_?[A-Za-z][0-9A-Z_a-z-]*(?=\s*;)/,y=/^"[^"]*"/,p=/^\/\*.*?\*\//,h=/^\/\*.*/,A=/^.*?\*\//;function C(e,t){if(e.eatSpace())return null;if(t.inComment){if(e.match(A)){t.inComment=!1;return'comment'};e.skipToEnd();return'comment'};if(e.match('//')){e.skipToEnd();return'comment'};if(e.match(p))return'comment';if(e.match(h)){t.inComment=!0;return'comment'};if(e.match(/^-?[0-9\.]/,!1)){if(e.match(s)||e.match(d))return'number'};if(e.match(y))return'string';if(t.startDef&&e.match(r))return'def';if(t.endDef&&e.match(b)){t.endDef=!1;return'def'};if(e.match(E))return'keyword';if(e.match(D)){var n=t.lastToken,i=(e.match(/^\s*(.+?)\b/,!1)||[])[1];if(n===':'||n==='implements'||i==='implements'||i==='='){return'builtin'} +else{return'variable-3'}};if(e.match(g))return'builtin';if(e.match(k))return'atom';if(e.match(r))return'variable';if(e.match(u))return'operator';e.next();return null};e.defineMode('webidl',function(){return{startState:function(){return{inComment:!1,lastToken:'',startDef:!1,endDef:!1}},token:function(t,e){var n=C(t,e);if(n){var r=t.current();e.lastToken=r;if(n==='keyword'){e.startDef=l.test(r);e.endDef=e.endDef||m.test(r)} +else{e.startDef=!1}};return n}}});e.defineMIME('text/x-webidl','webidl')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ebnf',function(a){var c={slash:0,parenthesis:1};var t={comment:0,_string:1,characterClass:2};var r=null;if(a.bracesMode)r=e.getMode(a,a.bracesMode);return{startState:function(){return{stringType:null,commentType:null,braced:0,lhs:!0,localState:null,stack:[],inDefinition:!1}},token:function(a,n){if(!a)return;if(n.stack.length===0){if((a.peek()=='"')||(a.peek()=='\'')){n.stringType=a.peek();a.next();n.stack.unshift(t._string)} +else if(a.match(/^\/\*/)){n.stack.unshift(t.comment);n.commentType=c.slash} +else if(a.match(/^\(\*/)){n.stack.unshift(t.comment);n.commentType=c.parenthesis}};switch(n.stack[0]){case t._string:while(n.stack[0]===t._string&&!a.eol()){if(a.peek()===n.stringType){a.next();n.stack.shift()} +else if(a.peek()==='\\'){a.next();a.next()} +else{a.match(/^.[^\\"']*/)}};return n.lhs?'property string':'string';case t.comment:while(n.stack[0]===t.comment&&!a.eol()){if(n.commentType===c.slash&&a.match(/\*\//)){n.stack.shift();n.commentType=null} +else if(n.commentType===c.parenthesis&&a.match(/\*\)/)){n.stack.shift();n.commentType=null} +else{a.match(/^.[^\*]*/)}};return'comment';case t.characterClass:while(n.stack[0]===t.characterClass&&!a.eol()){if(!(a.match(/^[^\]\\]+/)||a.match(/^\\./))){n.stack.shift()}};return'operator'};var f=a.peek();if(r!==null&&(n.braced||f==='{')){if(n.localState===null)n.localState=e.startState(r);var i=r.token(a,n.localState),l=a.current();if(!i){for(var s=0;s<l.length;s++){if(l[s]==='{'){if(n.braced===0){i='matchingbracket'};n.braced++} +else if(l[s]==='}'){n.braced--;if(n.braced===0){i='matchingbracket'}}}};return i};switch(f){case'[':a.next();n.stack.unshift(t.characterClass);return'bracket';case':':case'|':case';':a.next();return'operator';case'%':if(a.match('%%')){return'header'} +else if(a.match(/[%][A-Za-z]+/)){return'keyword'} +else if(a.match(/[%][}]/)){return'matchingbracket'};break;case'/':if(a.match(/[\/][A-Za-z]+/)){return'keyword'};case'\\':if(a.match(/[\][a-z]+/)){return'string-2'};case'.':if(a.match('.')){return'atom'};case'*':case'-':case'+':case'^':if(a.match(f)){return'atom'};case'$':if(a.match('$$')){return'builtin'} +else if(a.match(/[$][0-9]+/)){return'variable-3'};case'<':if(a.match(/<<[a-zA-Z_]+>>/)){return'builtin'}};if(a.match(/^\/\//)){a.skipToEnd();return'comment'} +else if(a.match(/return/)){return'operator'} +else if(a.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)){if(a.match(/(?=[\(.])/)){return'variable'} +else if(a.match(/(?=[\s\n]*[:=])/)){return'def'};return'variable-2'} +else if(['[',']','(',')'].indexOf(a.peek())!=-1){a.next();return'bracket'} +else if(!a.eatSpace()){a.next()};return null}}});e.defineMIME('text/x-ebnf','ebnf')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('http',function(){function r(r,t){r.skipToEnd();t.cur=e;return'error'};function n(e,t){if(e.match(/^HTTP\/\d\.\d/)){t.cur=i;return'keyword'} +else if(e.match(/^[A-Z]+/)&&/[ \t]/.test(e.peek())){t.cur=o;return'keyword'} +else{return r(e,t)}};function i(e,n){var i=e.match(/^\d+/);if(!i)return r(e,n);n.cur=u;var t=Number(i[0]);if(t>=100&&t<200){return'positive informational'} +else if(t>=200&&t<300){return'positive success'} +else if(t>=300&&t<400){return'positive redirect'} +else if(t>=400&&t<500){return'negative client-error'} +else if(t>=500&&t<600){return'negative server-error'} +else{return'error'}};function u(r,t){r.skipToEnd();t.cur=e;return null};function o(e,r){e.eatWhile(/\S/);r.cur=c;return'string-2'};function c(t,n){if(t.match(/^HTTP\/\d\.\d$/)){n.cur=e;return'keyword'} +else{return r(t,n)}};function e(e){if(e.sol()&&!e.eat(/[ \t]/)){if(e.match(/^.*?:/)){return'atom'} +else{e.skipToEnd();return'error'}} +else{e.skipToEnd();return'string'}};function t(e){e.skipToEnd();return null};return{token:function(r,n){var i=n.cur;if(i!=e&&i!=t&&r.eatSpace())return null;return i(r,n)},blankLine:function(e){e.cur=t},startState:function(){return{cur:n}}}});e.defineMIME('message/http','http')});(function(e){if(typeof exports=='object'&&typeof module=='object'){e(require('../../lib/codemirror'))} +else if(typeof define=='function'&&define.amd){define(['../../lib/codemirror'],e)} +else{e(CodeMirror)}})(function(i){'use strict';var r={addition:'positive',attributes:'attribute',bold:'strong',cite:'keyword',code:'atom',definitionList:'number',deletion:'negative',div:'punctuation',em:'em',footnote:'variable',footCite:'qualifier',header:'header',html:'comment',image:'string',italic:'em',link:'link',linkDefinition:'link',list1:'variable-2',list2:'variable-3',list3:'keyword',notextile:'string-2',pre:'operator',p:'property',quote:'bracket',span:'quote',specialChar:'tag',strong:'strong',sub:'builtin',sup:'builtin',table:'variable-3',tableHeading:'operator'};function f(e,i){i.mode=n.newLayout;i.tableHeading=!1;if(i.layoutType==='definitionList'&&i.spanningLayout&&e.match(t('definitionListEnd'),!1))i.spanningLayout=!1};function s(e,t,i){if(i==='_'){if(e.eat('_'))return l(e,t,'italic',/__/,2);else return l(e,t,'em',/_/,1)};if(i==='*'){if(e.eat('*')){return l(e,t,'bold',/\*\*/,2)};return l(e,t,'strong',/\*/,1)};if(i==='['){if(e.match(/\d+\]/))t.footCite=!0;return a(t)};if(i==='('){var u=e.match(/^(r|tm|c)\)/);if(u)return o(t,r.specialChar)};if(i==='<'&&e.match(/(\w+)[^>]+>[^<]+<\/\1>/))return o(t,r.html);if(i==='?'&&e.eat('?'))return l(e,t,'cite',/\?\?/,2);if(i==='='&&e.eat('='))return l(e,t,'notextile',/==/,2);if(i==='-'&&!e.eat('-'))return l(e,t,'deletion',/-/,1);if(i==='+')return l(e,t,'addition',/\+/,1);if(i==='~')return l(e,t,'sub',/~/,1);if(i==='^')return l(e,t,'sup',/\^/,1);if(i==='%')return l(e,t,'span',/%/,1);if(i==='@')return l(e,t,'code',/@/,1);if(i==='!'){var n=l(e,t,'image',/(?:\([^\)]+\))?!/,1);e.match(/^:\S+/);return n};return a(t)};function l(e,t,i,u,o){var r=e.pos>o?e.string.charAt(e.pos-o-1):null,l=e.peek();if(t[i]){if((!l||/\W/.test(l))&&r&&/\S/.test(r)){var s=a(t);t[i]=!1;return s}} +else if((!r||/\W/.test(r))&&l&&/\S/.test(l)&&e.match(new RegExp('^.*\\S'+u.source+'(?:\\W|$)'),!1)){t[i]=!0;t.mode=n.attributes};return a(t)};function a(e){var i=u(e);if(i)return i;var t=[];if(e.layoutType)t.push(r[e.layoutType]);t=t.concat(c(e,'addition','bold','cite','code','deletion','em','footCite','image','italic','link','span','strong','sub','sup','table','tableHeading'));if(e.layoutType==='header')t.push(r.header+'-'+e.header);return t.length?t.join(' '):null};function u(e){var t=e.layoutType;switch(t){case'notextile':case'code':case'pre':return r[t];default:if(e.notextile)return r.notextile+(t?(' '+r[t]):'');return null}};function o(e,t){var n=u(e);if(n)return n;var i=a(e);if(t)return i?(i+' '+t):t;else return i};function c(e){var i=[];for(var t=1;t<arguments.length;++t){if(e[arguments[t]])i.push(r[arguments[t]])};return i};function d(e){var i=e.spanningLayout,a=e.layoutType;for(var t in e)if(e.hasOwnProperty(t))delete e[t];e.mode=n.newLayout;if(i){e.layoutType=a;e.spanningLayout=!0}};var e={cache:{},single:{bc:'bc',bq:'bq',definitionList:/- .*?:=+/,definitionListEnd:/.*=:\s*$/,div:'div',drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:'notextile',para:'p',pre:'pre',table:'table',tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(i){switch(i){case'drawTable':return e.makeRe('^',e.single.drawTable,'$');case'html':return e.makeRe('^',e.single.html,'(?:',e.single.html,')*','$');case'linkDefinition':return e.makeRe('^',e.single.linkDefinition,'$');case'listLayout':return e.makeRe('^',e.single.list,t('allAttributes'),'*\\s+');case'tableCellAttributes':return e.makeRe('^',e.choiceRe(e.single.tableCellAttributes,t('allAttributes')),'+\\.');case'type':return e.makeRe('^',t('allTypes'));case'typeLayout':return e.makeRe('^',t('allTypes'),t('allAttributes'),'*\\.\\.?','(\\s+|$)');case'attributes':return e.makeRe('^',t('allAttributes'),'+');case'allTypes':return e.choiceRe(e.single.div,e.single.foot,e.single.header,e.single.bc,e.single.bq,e.single.notextile,e.single.pre,e.single.table,e.single.para);case'allAttributes':return e.choiceRe(e.attributes.selector,e.attributes.css,e.attributes.lang,e.attributes.align,e.attributes.pad);default:return e.makeRe('^',e.single[i])}},makeRe:function(){var i='';for(var t=0;t<arguments.length;++t){var e=arguments[t];i+=(typeof e==='string')?e:e.source};return new RegExp(i)},choiceRe:function(){var i=[arguments[0]];for(var t=1;t<arguments.length;++t){i[t*2-1]='|';i[t*2]=arguments[t]};i.unshift('(?:');i.push(')');return e.makeRe.apply(null,i)}};function t(t){return(e.cache[t]||(e.cache[t]=e.createRe(t)))};var n={newLayout:function(e,i){if(e.match(t('typeLayout'),!1)){i.spanningLayout=!1;return(i.mode=n.blockType)(e,i)};var a;if(!u(i)){if(e.match(t('listLayout'),!1))a=n.list;else if(e.match(t('drawTable'),!1))a=n.table;else if(e.match(t('linkDefinition'),!1))a=n.linkDefinition;else if(e.match(t('definitionList')))a=n.definitionList;else if(e.match(t('html'),!1))a=n.html};return(i.mode=(a||n.text))(e,i)},blockType:function(i,e){var l,r;e.layoutType=null;if(l=i.match(t('type')))r=l[0];else return(e.mode=n.text)(i,e);if(l=r.match(t('header'))){e.layoutType='header';e.header=parseInt(l[0][1])} +else if(r.match(t('bq'))){e.layoutType='quote'} +else if(r.match(t('bc'))){e.layoutType='code'} +else if(r.match(t('foot'))){e.layoutType='footnote'} +else if(r.match(t('notextile'))){e.layoutType='notextile'} +else if(r.match(t('pre'))){e.layoutType='pre'} +else if(r.match(t('div'))){e.layoutType='div'} +else if(r.match(t('table'))){e.layoutType='table'};e.mode=n.attributes;return a(e)},text:function(e,i){if(e.match(t('text')))return a(i);var r=e.next();if(r==='"')return(i.mode=n.link)(e,i);return s(e,i,r)},attributes:function(e,i){i.mode=n.layoutLength;if(e.match(t('attributes')))return o(i,r.attributes);else return a(i)},layoutLength:function(e,t){if(e.eat('.')&&e.eat('.'))t.spanningLayout=!0;t.mode=n.text;return a(t)},list:function(e,i){var l=e.match(t('list'));i.listDepth=l[0].length;var r=(i.listDepth-1)%3;if(!r)i.layoutType='list1';else if(r===1)i.layoutType='list2';else i.layoutType='list3';i.mode=n.attributes;return a(i)},link:function(e,i){i.mode=n.text;if(e.match(t('link'))){e.match(/\S+/);return o(i,r.link)};return a(i)},linkDefinition:function(e,t){e.skipToEnd();return o(t,r.linkDefinition)},definitionList:function(e,i){e.match(t('definitionList'));i.layoutType='definitionList';if(e.match(/\s*$/))i.spanningLayout=!0;else i.mode=n.attributes;return a(i)},html:function(e,t){e.skipToEnd();return o(t,r.html)},table:function(e,t){t.layoutType='table';return(t.mode=n.tableCell)(e,t)},tableCell:function(e,i){if(e.match(t('tableHeading')))i.tableHeading=!0;else e.eat('|');i.mode=n.tableCellAttributes;return a(i)},tableCellAttributes:function(e,i){i.mode=n.tableText;if(e.match(t('tableCellAttributes')))return o(i,r.attributes);else return a(i)},tableText:function(e,i){if(e.match(t('tableText')))return a(i);if(e.peek()==='|'){i.mode=n.tableCell;return a(i)};return s(e,i,e.next())}};i.defineMode('textile',function(){return{startState:function(){return{mode:n.newLayout}},token:function(e,t){if(e.sol())f(e,t);return t.mode(e,t)},blankLine:d}});i.defineMIME('text/x-textile','textile')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.registerHelper('wordChars','r',/[\w.]/);e.defineMode('r',function(e){function r(e){var r=e.split(' '),n={};for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var s=r('NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_'),d=r('list quote bquote eval return call parse deparse'),p=r('if else repeat while function for in next break'),m=r('if else repeat while function for'),u=/[+\-*\/^<>=!&|~$:]/,t;function a(e,n){t=null;var r=e.next();if(r=='#'){e.skipToEnd();return'comment'} +else if(r=='0'&&e.eat('x')){e.eatWhile(/[\da-f]/i);return'number'} +else if(r=='.'&&e.eat(/\d/)){e.match(/\d*(?:e[+\-]?\d+)?/);return'number'} +else if(/\d/.test(r)){e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/);return'number'} +else if(r=='\''||r=='"'){n.tokenize=x(r);return'string'} +else if(r=='`'){e.match(/[^`]+`/);return'variable-3'} +else if(r=='.'&&e.match(/.[.\d]+/)){return'keyword'} +else if(/[\w\.]/.test(r)&&r!='_'){e.eatWhile(/[\w\.]/);var i=e.current();if(s.propertyIsEnumerable(i))return'atom';if(p.propertyIsEnumerable(i)){if(m.propertyIsEnumerable(i)&&!e.match(/\s*if(\s+|$)/,!1))t='block';return'keyword'};if(d.propertyIsEnumerable(i))return'builtin';return'variable'} +else if(r=='%'){if(e.skipTo('%'))e.next();return'operator variable-2'} +else if((r=='<'&&e.eat('-'))||(r=='<'&&e.match('<-'))||(r=='-'&&e.match(/>>?/))){return'operator arrow'} +else if(r=='='&&n.ctx.argList){return'arg-is'} +else if(u.test(r)){if(r=='$')return'operator dollar';e.eatWhile(u);return'operator'} +else if(/[\(\){}\[\];]/.test(r)){t=r;if(r==';')return'semi';return null} +else{return null}};function x(e){return function(t,r){if(t.eat('\\')){var n=t.next();if(n=='x')t.match(/^[a-f0-9]{2}/i);else if((n=='u'||n=='U')&&t.eat('{')&&t.skipTo('}'))t.next();else if(n=='u')t.match(/^[a-f0-9]{4}/i);else if(n=='U')t.match(/^[a-f0-9]{8}/i);else if(/[0-7]/.test(n))t.match(/^[0-7]{1,2}/);return'string-2'} +else{var i;while((i=t.next())!=null){if(i==e){r.tokenize=a;break};if(i=='\\'){t.backUp(1);break}};return'string'}}};var o=1,i=2,f=4;function n(e,t,r){e.ctx={type:t,indent:e.indent,flags:0,column:r.column(),prev:e.ctx}};function c(e,t){var r=e.ctx;e.ctx={type:r.type,indent:r.indent,flags:r.flags|t,column:r.column,prev:r.prev}};function l(e){e.indent=e.ctx.indent;e.ctx=e.ctx.prev};return{startState:function(){return{tokenize:a,ctx:{type:'top',indent:-e.indentUnit,flags:i},indent:0,afterIdent:!1}},token:function(r,e){if(r.sol()){if((e.ctx.flags&3)==0)e.ctx.flags|=i;if(e.ctx.flags&f)l(e);e.indent=r.indentation()};if(r.eatSpace())return null;var a=e.tokenize(r,e);if(a!='comment'&&(e.ctx.flags&i)==0)c(e,o);if((t==';'||t=='{'||t=='}')&&e.ctx.type=='block')l(e);if(t=='{')n(e,'}',r);else if(t=='('){n(e,')',r);if(e.afterIdent)e.ctx.argList=!0} +else if(t=='[')n(e,']',r);else if(t=='block')n(e,'block',r);else if(t==e.ctx.type)l(e);else if(e.ctx.type=='block'&&a!='comment')c(e,f);e.afterIdent=a=='variable'||a=='keyword';return a},indent:function(t,n){if(t.tokenize!=a)return 0;var i=n&&n.charAt(0),r=t.ctx,l=i==r.type;if(r.flags&f)r=r.prev;if(r.type=='block')return r.indent+(i=='{'?0:e.indentUnit);else if(r.flags&o)return r.column+(l?0:1);else return r.indent+(l?0:e.indentUnit)},lineComment:'#'}});e.defineMIME('text/x-rsrc','r')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../ruby/ruby'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../ruby/ruby'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('haml',function(t){var r=e.getMode(t,{name:'htmlmixed'});var i=e.getMode(t,'ruby');function u(e){return function(t,i){var r=t.peek();if(r==e&&i.rubyState.tokenize.length==1){t.next();i.tokenize=o;return'closeAttributeTag'} +else{return n(t,i)}}};function n(e,t){if(e.match('-#')){e.skipToEnd();return'comment'};return i.token(e,t.rubyState)};function o(t,e){var i=t.peek();if(e.previousToken.style=='comment'){if(e.indented>e.previousToken.indented){t.skipToEnd();return'commentLine'}};if(e.startOfLine){if(i=='!'&&t.match('!!')){t.skipToEnd();return'tag'} +else if(t.match(/^%[\w:#\.]+=/)){e.tokenize=n;return'hamlTag'} +else if(t.match(/^%[\w:]+/)){return'hamlTag'} +else if(i=='/'){t.skipToEnd();return'comment'}};if(e.startOfLine||e.previousToken.style=='hamlTag'){if(i=='#'||i=='.'){t.match(/[\w-#\.]*/);return'hamlAttribute'}};if(e.startOfLine&&!t.match('-->',!1)&&(i=='='||i=='-')){e.tokenize=n;return e.tokenize(t,e)};if(e.previousToken.style=='hamlTag'||e.previousToken.style=='closeAttributeTag'||e.previousToken.style=='hamlAttribute'){if(i=='('){e.tokenize=u(')');return e.tokenize(t,e)} +else if(i=='{'){if(!t.match(/^\{%.*/)){e.tokenize=u('}');return e.tokenize(t,e)}}};return r.token(t,e.htmlState)};return{startState:function(){var t=e.startState(r),n=e.startState(i);return{htmlState:t,rubyState:n,indented:0,previousToken:{style:null,indented:0},tokenize:o}},copyState:function(t){return{htmlState:e.copyState(r,t.htmlState),rubyState:e.copyState(i,t.rubyState),indented:t.indented,previousToken:t.previousToken,tokenize:t.tokenize}},token:function(e,t){if(e.sol()){t.indented=e.indentation();t.startOfLine=!0};if(e.eatSpace())return null;var i=t.tokenize(e,t);t.startOfLine=!1;if(i&&i!='commentLine'){t.previousToken={style:i,indented:t.indented}};if(e.eol()&&t.tokenize==n){e.backUp(1);var r=e.peek();e.next();if(r&&r!=','){t.tokenize=o}};if(i=='hamlTag'){i='tag'} +else if(i=='commentLine'){i='comment'} +else if(i=='hamlAttribute'){i='attribute'} +else if(i=='closeAttributeTag'){i=null};return i}}},'htmlmixed','ruby');e.defineMIME('text/x-haml','haml')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ecl',function(t){function n(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};function v(e,t){if(!t.startOfLine)return!1;e.skipToEnd();return'meta'};var l=t.indentUnit,p=n('abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode'),m=n('apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait'),h=n('__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath'),c=n('ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode'),y=n('checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when'),r=n('catch class do else finally for if switch try while'),b=n('true false null'),u={'#':v};var s=/[+\-*&%=<>!?|\/]/,e;function o(t,i){var o=t.next();if(u[o]){var f=u[o](t,i);if(f!==!1)return f};if(o=='"'||o=='\''){i.tokenize=g(o);return i.tokenize(t,i)};if(/[\[\]{}\(\),;\:\.]/.test(o)){e=o;return null};if(/\d/.test(o)){t.eatWhile(/[\w\.]/);return'number'};if(o=='/'){if(t.eat('*')){i.tokenize=d;return d(t,i)};if(t.eat('/')){t.skipToEnd();return'comment'}};if(s.test(o)){t.eatWhile(s);return'operator'};t.eatWhile(/[\w\$_]/);var n=t.current().toLowerCase();if(p.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'keyword'} +else if(m.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'variable'} +else if(h.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'variable-2'} +else if(c.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'variable-3'} +else if(y.propertyIsEnumerable(n)){if(r.propertyIsEnumerable(n))e='newstatement';return'builtin'} +else{var a=n.length-1;while(a>=0&&(!isNaN(n[a])||n[a]=='_'))--a;if(a>0){var l=n.substr(0,a+1);if(c.propertyIsEnumerable(l)){if(r.propertyIsEnumerable(l))e='newstatement';return'variable-3'}}};if(b.propertyIsEnumerable(n))return'atom';return null};function g(e){return function(t,n){var r=!1,i,a=!1;while((i=t.next())!=null){if(i==e&&!r){a=!0;break};r=!r&&i=='\\'};if(a||!r)n.tokenize=o;return'string'}};function d(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=o;break};r=(n=='*')};return'comment'};function f(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function a(e,t,n){return e.context=new f(e.indented,t,n,null,e.context)};function i(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new f((e||0)-l,0,'top',!1),indented:0,startOfLine:!0}},token:function(t,n){var r=n.context;if(t.sol()){if(r.align==null)r.align=!1;n.indented=t.indentation();n.startOfLine=!0};if(t.eatSpace())return null;e=null;var l=(n.tokenize||o)(t,n);if(l=='comment'||l=='meta')return l;if(r.align==null)r.align=!0;if((e==';'||e==':')&&r.type=='statement')i(n);else if(e=='{')a(n,t.column(),'}');else if(e=='[')a(n,t.column(),']');else if(e=='(')a(n,t.column(),')');else if(e=='}'){while(r.type=='statement')r=i(n);if(r.type=='}')r=i(n);while(r.type=='statement')r=i(n)} +else if(e==r.type)i(n);else if(r.type=='}'||r.type=='top'||(r.type=='statement'&&e=='newstatement'))a(n,t.column(),'statement');n.startOfLine=!1;return l},indent:function(e,t){if(e.tokenize!=o&&e.tokenize!=null)return 0;var n=e.context,r=t&&t.charAt(0);if(n.type=='statement'&&r=='}')n=n.prev;var i=r==n.type;if(n.type=='statement')return n.indented+(r=='{'?0:l);else if(n.align)return n.column+(i?0:1);else return n.indented+(i?0:l)},electricChars:'{}'}});e.defineMIME('text/x-ecl','ecl')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var t=function(e){return new RegExp('^(?:'+e.join('|')+')$','i')};e.defineMode('cypher',function(n){var c=function(e){var t=e.next();if(t==='"'){e.match(/.*?"/);return'string'};if(t==='\''){e.match(/.*?'/);return'string'};if(/[{}\(\),\.;\[\]]/.test(t)){r=t;return'node'} +else if(t==='/'&&e.eat('/')){e.skipToEnd();return'comment'} +else if(a.test(t)){e.eatWhile(a);return null} +else{e.eatWhile(/[_\w\d]/);if(e.eat(':')){e.eatWhile(/[\w\d_\-]/);return'atom'};var n=e.current();if(l.test(n))return'builtin';if(d.test(n))return'def';if(u.test(n))return'keyword';return'variable'}},i=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}},o=function(e){e.indent=e.context.indent;return e.context=e.context.prev},s=n.indentUnit,r,l=t(['abs','acos','allShortestPaths','asin','atan','atan2','avg','ceil','coalesce','collect','cos','cot','count','degrees','e','endnode','exp','extract','filter','floor','haversin','head','id','keys','labels','last','left','length','log','log10','lower','ltrim','max','min','node','nodes','percentileCont','percentileDisc','pi','radians','rand','range','reduce','rel','relationship','relationships','replace','reverse','right','round','rtrim','shortestPath','sign','sin','size','split','sqrt','startnode','stdev','stdevp','str','substring','sum','tail','tan','timestamp','toFloat','toInt','toString','trim','type','upper']),d=t(['all','and','any','contains','exists','has','in','none','not','or','single','xor']),u=t(['as','asc','ascending','assert','by','case','commit','constraint','create','csv','cypher','delete','desc','descending','detach','distinct','drop','else','end','ends','explain','false','fieldterminator','foreach','from','headers','in','index','is','join','limit','load','match','merge','null','on','optional','order','periodic','profile','remove','return','scan','set','skip','start','starts','then','true','union','unique','unwind','using','when','where','with','call','yield']),a=/[*+\-<>=&|~%^]/;return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(t,e){if(t.sol()){if(e.context&&(e.context.align==null)){e.context.align=!1};e.indent=t.indentation()};if(t.eatSpace()){return null};var n=e.tokenize(t,e);if(n!=='comment'&&e.context&&(e.context.align==null)&&e.context.type!=='pattern'){e.context.align=!0};if(r==='('){i(e,')',t.column())} +else if(r==='['){i(e,']',t.column())} +else if(r==='{'){i(e,'}',t.column())} +else if(/[\]\}\)]/.test(r)){while(e.context&&e.context.type==='pattern'){o(e)};if(e.context&&r===e.context.type){o(e)}} +else if(r==='.'&&e.context&&e.context.type==='pattern'){o(e)} +else if(/atom|string|variable/.test(n)&&e.context){if(/[\}\]]/.test(e.context.type)){i(e,'pattern',t.column())} +else if(e.context.type==='pattern'&&!e.context.align){e.context.align=!0;e.context.col=t.column()}};return n},indent:function(n,r){var o=r&&r.charAt(0),t=n.context;if(/[\]\}]/.test(o)){while(t&&t.type==='pattern'){t=t.prev}};var i=t&&o===t.type;if(!t)return 0;if(t.type==='keywords')return e.commands.newlineAndIndent;if(t.align)return t.col+(i?0:1);return t.indent+(i?0:s)}}});e.modeExtensions['cypher']={autoFormatLineBreaks:function(e){var t,n,r,n=e.split('\n'),r=/\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g;for(var t=0;t<n.length;t++)n[t]=n[t].replace(r,' \n$1 ').trim();return n.join('\n')}};e.defineMIME('application/x-cypher-query','cypher')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sieve',function(e){function t(e){var t={},r=e.split(' ');for(var n=0;n<r.length;++n)t[r[n]]=!0;return t};var i=t('if elsif else stop require'),u=t('true false not'),o=e.indentUnit;function n(e,n){var t=e.next();if(t=='/'&&e.eat('*')){n.tokenize=r;return r(e,n)};if(t==='#'){e.skipToEnd();return'comment'};if(t=='"'){n.tokenize=l(t);return n.tokenize(e,n)};if(t=='('){n._indent.push('(');n._indent.push('{');return null};if(t==='{'){n._indent.push('{');return null};if(t==')'){n._indent.pop();n._indent.pop()};if(t==='}'){n._indent.pop();return null};if(t==',')return null;if(t==';')return null;if(/[{}\(\),;]/.test(t))return null;if(/\d/.test(t)){e.eatWhile(/[\d]/);e.eat(/[KkMmGg]/);return'number'};if(t==':'){e.eatWhile(/[a-zA-Z_]/);e.eatWhile(/[a-zA-Z0-9_]/);return'operator'};e.eatWhile(/\w/);var o=e.current();if((o=='text')&&e.eat(':')){n.tokenize=f;return'string'};if(i.propertyIsEnumerable(o))return'keyword';if(u.propertyIsEnumerable(o))return'atom';return null};function f(e,t){t._multiLineString=!0;if(!e.sol()){e.eatSpace();if(e.peek()=='#'){e.skipToEnd();return'comment'};e.skipToEnd();return'string'};if((e.next()=='.')&&(e.eol())){t._multiLineString=!1;t.tokenize=n};return'string'};function r(e,t){var i=!1,r;while((r=e.next())!=null){if(i&&r=='/'){t.tokenize=n;break};i=(r=='*')};return'comment'};function l(e){return function(t,r){var i=!1,u;while((u=t.next())!=null){if(u==e&&!i)break;i=!i&&u=='\\'};if(!i)r.tokenize=n;return'string'}};return{startState:function(e){return{tokenize:n,baseIndent:e||0,_indent:[]}},token:function(e,t){if(e.eatSpace())return null;return(t.tokenize||n)(e,t)},indent:function(e,n){var t=e._indent.length;if(n&&(n[0]=='}'))t--;if(t<0)t=0;return t*o},electricChars:'}'}});e.defineMIME('application/sieve','sieve')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed'],e);else e(CodeMirror)})(function(e){'use strict';var t=['template','literal','msg','fallbackmsg','let','if','elseif','else','switch','case','default','foreach','ifempty','for','call','param','deltemplate','delcall','log'];e.defineMode('soy',function(a){var r=e.getMode(a,'text/plain'),s={html:e.getMode(a,{name:'text/html',multilineTagIndentFactor:2,multilineTagIndentPastTag:!1}),attributes:r,text:r,uri:r,css:e.getMode(a,'text/css'),js:e.getMode(a,{name:'text/javascript',statementIndent:2*a.indentUnit})};function n(e){return e[e.length-1]};function l(e,t,s){if(e.sol()){for(var i=0;i<t.indent;i++){if(!e.eat(/\s/))break};if(i)return null};var a=e.string,r=s.exec(a.substr(e.pos));if(r){e.string=a.substr(0,e.pos+r.index)};var l=e.hideFirstChars(t.indent,function(){var a=n(t.localStates);return a.mode.token(e,a.state)});e.string=a;return l};function d(e,t){while(e){if(e.element===t)return!0;e=e.next};return!1};function i(e,t){return{element:t,next:e}};function o(e,t,a){return d(e,t)?'variable-2':(a?'variable':'variable-2 error')};function c(e){if(e.scopes){e.variables=e.scopes.element;e.scopes=e.scopes.next}};return{startState:function(){return{kind:[],kindTag:[],soyState:[],templates:null,variables:i(null,'ij'),scopes:null,indent:0,quoteKind:null,localStates:[{mode:s.html,state:e.startState(s.html)}]}},copyState:function(t){return{tag:t.tag,kind:t.kind.concat([]),kindTag:t.kindTag.concat([]),soyState:t.soyState.concat([]),templates:t.templates,variables:t.variables,scopes:t.scopes,indent:t.indent,quoteKind:t.quoteKind,localStates:t.localStates.map(function(t){return{mode:t.mode,state:e.copyState(t.mode,t.state)}})}},token:function(d,r){var u;switch(n(r.soyState)){case'comment':if(d.match(/^.*?\*\//)){r.soyState.pop()} +else{d.skipToEnd()};if(!r.scopes){var h=/@param\??\s+(\S+)/g,g=d.current();for(var u;(u=h.exec(g));){r.variables=i(r.variables,u[1])}};return'comment';case'string':var u=d.match(/^.*?(["']|\\[\s\S])/);if(!u){d.skipToEnd()} +else if(u[1]==r.quoteKind){r.quoteKind=null;r.soyState.pop()};return'string'};if(d.match(/^\/\*/)){r.soyState.push('comment');return'comment'} +else if(d.match(d.sol()||(r.soyState.length&&n(r.soyState)!='literal')?/^\s*\/\/.*/:/^\s+\/\/.*/)){return'comment'};switch(n(r.soyState)){case'templ-def':if(u=d.match(/^\.?([\w]+(?!\.[\w]+)*)/)){r.templates=i(r.templates,u[1]);r.scopes=i(r.scopes,r.variables);r.soyState.pop();return'def'};d.next();return null;case'templ-ref':if(u=d.match(/^\.?([\w]+)/)){r.soyState.pop();if(u[0][0]=='.'){return o(r.templates,u[1],!0)};return'variable'};d.next();return null;case'param-def':if(u=d.match(/^\w+/)){r.variables=i(r.variables,u[0]);r.soyState.pop();r.soyState.push('param-type');return'def'};d.next();return null;case'param-type':if(d.peek()=='}'){r.soyState.pop();return null};if(d.eatWhile(/^[\w]+/)){return'variable-3'};d.next();return null;case'var-def':if(u=d.match(/^\$([\w]+)/)){r.variables=i(r.variables,u[1]);r.soyState.pop();return'def'};d.next();return null;case'tag':if(d.match(/^\/?}/)){if(r.tag=='/template'||r.tag=='/deltemplate'){c(r);r.variables=i(null,'ij');r.indent=0} +else{if(r.tag=='/for'||r.tag=='/foreach'){c(r)};r.indent-=a.indentUnit*(d.current()=='/}'||t.indexOf(r.tag)==-1?2:1)};r.soyState.pop();return'keyword'} +else if(d.match(/^([\w?]+)(?==)/)){if(d.current()=='kind'&&(u=d.match(/^="([^"]+)/,!1))){var p=u[1];r.kind.push(p);r.kindTag.push(r.tag);var f=s[p]||s.html,m=n(r.localStates);if(m.mode.indent){r.indent+=m.mode.indent(m.state,'')};r.localStates.push({mode:f,state:e.startState(f)})};return'attribute'} +else if(u=d.match(/^["']/)){r.soyState.push('string');r.quoteKind=u;return'string'};if(u=d.match(/^\$([\w]+)/)){return o(r.variables,u[1])};if(u=d.match(/^\w+/)){return/^(?:as|and|or|not|in)$/.test(u[0])?'keyword':null};d.next();return null;case'literal':if(d.match(/^(?=\{\/literal})/)){r.indent-=a.indentUnit;r.soyState.pop();return this.token(d,r)};return l(d,r,/\{\/literal}/)};if(d.match(/^\{literal}/)){r.indent+=a.indentUnit;r.soyState.push('literal');return'keyword'} +else if(u=d.match(/^\{([\/@\\]?\w+\??)(?=[\s\}]|\/[/*])/)){if(u[1]!='/switch')r.indent+=(/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(u[1])&&r.tag!='switch'?1:2)*a.indentUnit;r.tag=u[1];if(r.tag=='/'+n(r.kindTag)){r.kind.pop();r.kindTag.pop();r.localStates.pop();var m=n(r.localStates);if(m.mode.indent){r.indent-=m.mode.indent(m.state,'')}};r.soyState.push('tag');if(r.tag=='template'||r.tag=='deltemplate'){r.soyState.push('templ-def')} +else if(r.tag=='call'||r.tag=='delcall'){r.soyState.push('templ-ref')} +else if(r.tag=='let'){r.soyState.push('var-def')} +else if(r.tag=='for'||r.tag=='foreach'){r.scopes=i(r.scopes,r.variables);r.soyState.push('var-def')} +else if(r.tag=='namespace'){if(!r.scopes){r.variables=i(null,'ij')}} +else if(r.tag.match(/^@(?:param\??|inject)/)){r.soyState.push('param-def')};return'keyword'} +else if(d.eat('{')){r.tag='print';r.indent+=2*a.indentUnit;r.soyState.push('tag');return'keyword'};return l(d,r,/\{|\s+\/\/|\/\*/)},indent:function(t,i){var s=t.indent,l=n(t.soyState);if(l=='comment')return e.Pass;if(l=='literal'){if(/^\{\/literal}/.test(i))s-=a.indentUnit} +else{if(/^\s*\{\/(template|deltemplate)\b/.test(i))return 0;if(/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(i))s-=a.indentUnit;if(t.tag!='switch'&&/^\{(case|default)\b/.test(i))s-=a.indentUnit;if(/^\{\/switch\b/.test(i))s-=a.indentUnit};var r=n(t.localStates);if(s&&r.mode.indent){s+=r.mode.indent(r.state,i)};return s},innerMode:function(e){if(e.soyState.length&&n(e.soyState)!='literal')return null;else return n(e.localStates)},electricInput:/^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,lineComment:'//',blockCommentStart:'/*',blockCommentEnd:'*/',blockCommentContinue:' * ',useInnerComments:!1,fold:'indent'}},'htmlmixed');e.registerHelper('hintWords','soy',t.concat(['delpackage','namespace','alias','print','css','debugger']));e.defineMIME('text/x-soy','soy')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('pig',function(e,O){var E=O.keywords,t=O.builtins,I=O.types,A=O.multiLineStrings,T=/[*+\-%<>=&?:\/!|]/;function N(e,O,T){O.tokenize=T;return T(e,O)};function n(e,O){var E=!1,T;while(T=e.next()){if(T=='/'&&E){O.tokenize=r;break};E=(T=='*')};return'comment'};function R(e){return function(O,T){var E=!1,t,I=!1;while((t=O.next())!=null){if(t==e&&!E){I=!0;break};E=!E&&t=='\\'};if(I||!(E||A))T.tokenize=r;return'error'}};function r(e,r){var O=e.next();if(O=='"'||O=='\'')return N(e,r,R(O));else if(/[\[\]{}\(\),;\.]/.test(O))return null;else if(/\d/.test(O)){e.eatWhile(/[\w\.]/);return'number'} +else if(O=='/'){if(e.eat('*')){return N(e,r,n)} +else{e.eatWhile(T);return'operator'}} +else if(O=='-'){if(e.eat('-')){e.skipToEnd();return'comment'} +else{e.eatWhile(T);return'operator'}} +else if(T.test(O)){e.eatWhile(T);return'operator'} +else{e.eatWhile(/[\w\$_]/);if(E&&E.propertyIsEnumerable(e.current().toUpperCase())){if(!e.eat(')')&&!e.eat('.'))return'keyword'};if(t&&t.propertyIsEnumerable(e.current().toUpperCase()))return'variable-2';if(I&&I.propertyIsEnumerable(e.current().toUpperCase()))return'variable-3';return'variable'}};return{startState:function(){return{tokenize:r,startOfLine:!0}},token:function(e,O){if(e.eatSpace())return null;var T=O.tokenize(e,O);return T}}});(function(){function O(e){var T={},r=e.split(' ');for(var O=0;O<r.length;++O)T[r[O]]=!0;return T};var T='ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ',r='VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE NEQ MATCHES TRUE FALSE DUMP',E='BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ';e.defineMIME('text/x-pig',{name:'pig',builtins:O(T),keywords:O(r),types:O(E)});e.registerHelper('hintWords','pig',(T+E+r).split(' '))}())});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('apl',function(){var a={'.':'innerProduct','\\':'scan','/':'reduce','⌿':'reduce1Axis','⍀':'scan1Axis','¨':'each','⍣':'power'};var e={'+':['conjugate','add'],'−':['negate','subtract'],'×':['signOf','multiply'],'÷':['reciprocal','divide'],'⌈':['ceiling','greaterOf'],'⌊':['floor','lesserOf'],'∣':['absolute','residue'],'⍳':['indexGenerate','indexOf'],'?':['roll','deal'],'⋆':['exponentiate','toThePowerOf'],'⍟':['naturalLog','logToTheBase'],'○':['piTimes','circularFuncs'],'!':['factorial','binomial'],'⌹':['matrixInverse','matrixDivide'],'<':[null,'lessThan'],'≤':[null,'lessThanOrEqual'],'=':[null,'equals'],'>':[null,'greaterThan'],'≥':[null,'greaterThanOrEqual'],'≠':[null,'notEqual'],'≡':['depth','match'],'≢':[null,'notMatch'],'∈':['enlist','membership'],'⍷':[null,'find'],'∪':['unique','union'],'∩':[null,'intersection'],'∼':['not','without'],'∨':[null,'or'],'∧':[null,'and'],'⍱':[null,'nor'],'⍲':[null,'nand'],'⍴':['shapeOf','reshape'],',':['ravel','catenate'],'⍪':[null,'firstAxisCatenate'],'⌽':['reverse','rotate'],'⊖':['axis1Reverse','axis1Rotate'],'⍉':['transpose',null],'↑':['first','take'],'↓':[null,'drop'],'⊂':['enclose','partitionWithAxis'],'⊃':['diclose','pick'],'⌷':[null,'index'],'⍋':['gradeUp',null],'⍒':['gradeDown',null],'⊤':['encode',null],'⊥':['decode',null],'⍕':['format','formatByExample'],'⍎':['execute',null],'⊣':['stop','left'],'⊢':['pass','right']};var n=/[\.\/⌿⍀¨⍣]/,t=/⍬/,r=/[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/,l=/←/,i=/[⍝#].*$/,u=function(e){var n;n=!1;return function(t){n=t;if(t===e){return n==='\\'};return!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(s,f){var o,c;if(s.eatSpace()){return null};o=s.next();if(o==='"'||o==='\''){s.eatWhile(u(o));s.next();f.prev=!0;return'string'};if(/[\[{\(]/.test(o)){f.prev=!1;return null};if(/[\]}\)]/.test(o)){f.prev=!0;return null};if(t.test(o)){f.prev=!1;return'niladic'};if(/[¯\d]/.test(o)){if(f.func){f.func=!1;f.prev=!1} +else{f.prev=!0};s.eatWhile(/[\w\.]/);return'number'};if(n.test(o)){return'operator apl-'+a[o]};if(l.test(o)){return'apl-arrow'};if(r.test(o)){c='apl-';if(e[o]!=null){if(f.prev){c+=e[o][1]} +else{c+=e[o][0]}};f.func=!0;f.prev=!1;return'function '+c};if(i.test(o)){s.skipToEnd();return'comment'};if(o==='∘'&&s.peek()==='.'){s.next();return'function jot-dot'};s.eatWhile(/[\w\$_]/);f.prev=!0;return'keyword'}}});e.defineMIME('text/apl','apl')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('crystal',function(e){function r(e,t){return new RegExp((t?'':'^')+'(?:'+e.join('|')+')'+(t?'$':'\\b'))};function t(e,t,n){n.tokenize.push(e);return e(t,n)};var c=/^(?:[-+/%|&^]|\*\*?|[<>]{2})/,s=/^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/,h=/^(?:\[\][?=]?)/,z=/^(?:\.(?:\.{2})?|->|[?:])/,u=/^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/,o=/^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/,b=r(['abstract','alias','as','asm','begin','break','case','class','def','do','else','elsif','end','ensure','enum','extend','for','fun','if','include','instance_sizeof','lib','macro','module','next','of','out','pointerof','private','protected','rescue','return','require','select','sizeof','struct','super','then','type','typeof','uninitialized','union','unless','until','when','while','with','yield','__DIR__','__END_LINE__','__FILE__','__LINE__']),x=r(['true','false','nil','self']),y=['def','fun','macro','class','module','struct','lib','enum','union','do','for'],g=r(y),I=['if','unless','case','while','until','begin','then'],w=r(I),p=['end','else','elsif','rescue','ensure'],v=r(p),d=['\\)','\\}','\\]'],S=new RegExp('^(?:'+d.join('|')+')$'),k={'def':F,'fun':F,'macro':E,'class':i,'module':i,'struct':i,'lib':i,'enum':i,'union':i};var f={'[':']','{':'}','(':')','<':'>'};function l(e,r){if(e.eatSpace()){return null};if(r.lastToken!='\\'&&e.match('{%',!1)){return t(n('%','%'),e,r)};if(r.lastToken!='\\'&&e.match('{{',!1)){return t(n('{','}'),e,r)};if(e.peek()=='#'){e.skipToEnd();return'comment'};var i;if(e.match(u)){e.eat(/[?!]/);i=e.current();if(e.eat(':')){return'atom'} +else if(r.lastToken=='.'){return'property'} +else if(b.test(i)){if(g.test(i)){if(!(i=='fun'&&r.blocks.indexOf('lib')>=0)&&!(i=='def'&&r.lastToken=='abstract')){r.blocks.push(i);r.currentIndent+=1}} +else if((r.lastStyle=='operator'||!r.lastStyle)&&w.test(i)){r.blocks.push(i);r.currentIndent+=1} +else if(i=='end'){r.blocks.pop();r.currentIndent-=1};if(k.hasOwnProperty(i)){r.tokenize.push(k[i])};return'keyword'} +else if(x.test(i)){return'atom'};return'variable'};if(e.eat('@')){if(e.peek()=='['){return t(a('[',']','meta'),e,r)};e.eat('@');e.match(u)||e.match(o);return'variable-2'};if(e.match(o)){return'tag'};if(e.eat(':')){if(e.eat('"')){return t(m('"','atom',!1),e,r)} +else if(e.match(u)||e.match(o)||e.match(c)||e.match(s)||e.match(h)){return'atom'};e.eat(':');return'operator'};if(e.eat('"')){return t(m('"','string',!0),e,r)};if(e.peek()=='%'){var d='string',p=!0,l;if(e.match('%r')){d='string-2';l=e.next()} +else if(e.match('%w')){p=!1;l=e.next()} +else if(e.match('%q')){p=!1;l=e.next()} +else{if(l=e.match(/^%([^\w\s=])/)){l=l[1]} +else if(e.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)){return'meta'} +else{return'operator'}};if(f.hasOwnProperty(l)){l=f[l]};return t(m(l,d,p),e,r)};if(i=e.match(/^<<-('?)([A-Z]\w*)\1/)){return t(A(i[2],!i[1]),e,r)};if(e.eat('\'')){e.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/);e.eat('\'');return'atom'};if(e.eat('0')){if(e.eat('x')){e.match(/^[0-9a-fA-F]+/)} +else if(e.eat('o')){e.match(/^[0-7]+/)} +else if(e.eat('b')){e.match(/^[01]+/)};return'number'};if(e.eat(/^\d/)){e.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/);return'number'};if(e.match(c)){e.eat('=');return'operator'};if(e.match(s)||e.match(z)){return'operator'};if(i=e.match(/[({[]/,!1)){i=i[0];return t(a(i,f[i],null),e,r)};if(e.eat('\\')){e.next();return'meta'};e.next();return null};function a(e,t,n,r){return function(i,u){if(!r&&i.match(e)){u.tokenize[u.tokenize.length-1]=a(e,t,n,!0);u.currentIndent+=1;return n};var o=l(i,u);if(i.current()===t){u.tokenize.pop();u.currentIndent-=1;o=n};return o}};function n(e,t,r){return function(i,u){if(!r&&i.match('{'+e)){u.currentIndent+=1;u.tokenize[u.tokenize.length-1]=n(e,t,!0);return'meta'};if(i.match(t+'}')){u.currentIndent-=1;u.tokenize.pop();return'meta'};return l(i,u)}};function E(e,t){if(e.eatSpace()){return null};var n;if(n=e.match(u)){if(n=='def'){return'keyword'};e.eat(/[?!]/)};t.tokenize.pop();return'def'};function F(e,t){if(e.eatSpace()){return null};if(e.match(u)){e.eat(/[!?]/)} +else{e.match(c)||e.match(s)||e.match(h)};t.tokenize.pop();return'def'};function i(e,t){if(e.eatSpace()){return null};e.match(o);t.tokenize.pop();return'def'};function m(t,e,r){return function(i,u){var o=!1;while(i.peek()){if(!o){if(i.match('{%',!1)){u.tokenize.push(n('%','%'));return e};if(i.match('{{',!1)){u.tokenize.push(n('{','}'));return e};if(r&&i.match('#{',!1)){u.tokenize.push(a('#{','}','meta'));return e};var f=i.next();if(f==t){u.tokenize.pop();return e};o=r&&f=='\\'} +else{i.next();o=!1}};return e}};function A(e,t){return function(r,i){if(r.sol()){r.eatSpace();if(r.match(e)){i.tokenize.pop();return'string'}};var u=!1;while(r.peek()){if(!u){if(r.match('{%',!1)){i.tokenize.push(n('%','%'));return'string'};if(r.match('{{',!1)){i.tokenize.push(n('{','}'));return'string'};if(t&&r.match('#{',!1)){i.tokenize.push(a('#{','}','meta'));return'string'};u=t&&r.next()=='\\'} +else{r.next();u=!1}};return'string'}};return{startState:function(){return{tokenize:[l],currentIndent:0,lastToken:null,lastStyle:null,blocks:[]}},token:function(e,t){var n=t.tokenize[t.tokenize.length-1](e,t),r=e.current();if(n&&n!='comment'){t.lastToken=r;t.lastStyle=n};return n},indent:function(t,n){n=n.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g,'');if(v.test(n)||S.test(n)){return e.indentUnit*(t.currentIndent-1)};return e.indentUnit*t.currentIndent},fold:'indent',electricInput:r(d.concat(p),!0),lineComment:'#'}});e.defineMIME('text/x-crystal','crystal')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(t){'use strict';function d(e,t,n,r,i,a){this.indented=e;this.column=t;this.type=n;this.info=r;this.align=i;this.prev=a};function u(e,t,n,r){var i=e.indented;if(e.context&&e.context.type=='statement'&&n!='statement')i=e.context.indented;return e.context=new d(i,t,n,r,null,e.context)};function l(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};function p(e,t,n){if(t.prevToken=='variable'||t.prevToken=='type')return!0;if(/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n)))return!0;if(t.typeAtEndOfLine&&e.column()==e.indentation())return!0};function m(e){for(;;){if(!e||e.type=='top')return!0;if(e.type=='}'&&e.prev.info!='namespace')return!1;e=e.prev}};t.defineMode('clike',function(n,e){var o=n.indentUnit,c=e.statementIndentUnit||o,k=e.dontAlignCalls,v=e.keywords||{},S=e.types||{},C=e.builtin||{},f=e.blockKeywords||{},T=e.defKeywords||{},M=e.atoms||{},a=e.hooks||{},P=e.multiLineStrings,D=e.indentStatements!==!1,L=e.indentSwitch!==!1,h=e.namespaceSeparator,I=e.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,F=e.numberStart||/[\d\.]/,z=e.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,g=e.isOperatorChar||/[+\-*&%=<>!?|\/]/,y=e.isIdentifierChar||/[\w\$_\xa1-\uffff]/;var r,s;function x(e,t){var n=e.next();if(a[n]){var l=a[n](e,t);if(l!==!1)return l};if(n=='"'||n=='\''){t.tokenize=j(n);return t.tokenize(e,t)};if(I.test(n)){r=n;return null};if(F.test(n)){e.backUp(1);if(e.match(z))return'number';e.next()};if(n=='/'){if(e.eat('*')){t.tokenize=w;return w(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(g.test(n)){while(!e.match(/^\/[\/*]/,!1)&&e.eat(g)){};return'operator'};e.eatWhile(y);if(h)while(e.match(h))e.eatWhile(y);var o=e.current();if(i(v,o)){if(i(f,o))r='newstatement';if(i(T,o))s=!0;return'keyword'};if(i(S,o))return'type';if(i(C,o)){if(i(f,o))r='newstatement';return'builtin'};if(i(M,o))return'atom';return'variable'};function j(e){return function(t,n){var r=!1,i,a=!1;while((i=t.next())!=null){if(i==e&&!r){a=!0;break};r=!r&&i=='\\'};if(a||!(r||P))n.tokenize=null;return'string'}};function w(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='*')};return'comment'};function b(t,n){if(e.typeFirstDefinitions&&t.eol()&&m(n.context))n.typeAtEndOfLine=p(t,n,t.pos)};return{startState:function(e){return{tokenize:null,context:new d((e||0)-o,0,'top',null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(t,n){var i=n.context;if(t.sol()){if(i.align==null)i.align=!1;n.indented=t.indentation();n.startOfLine=!0};if(t.eatSpace()){b(t,n);return null};r=s=null;var o=(n.tokenize||x)(t,n);if(o=='comment'||o=='meta')return o;if(i.align==null)i.align=!0;if(r==';'||r==':'||(r==','&&t.match(/^\s*(?:\/\/.*)?$/,!1)))while(n.context.type=='statement')l(n);else if(r=='{')u(n,t.column(),'}');else if(r=='[')u(n,t.column(),']');else if(r=='(')u(n,t.column(),')');else if(r=='}'){while(i.type=='statement')i=l(n);if(i.type=='}')i=l(n);while(i.type=='statement')i=l(n)} +else if(r==i.type)l(n);else if(D&&(((i.type=='}'||i.type=='top')&&r!=';')||(i.type=='statement'&&r=='newstatement'))){u(n,t.column(),'statement',t.current())};if(o=='variable'&&((n.prevToken=='def'||(e.typeFirstDefinitions&&p(t,n,t.start)&&m(n.context)&&t.match(/^\s*\(/,!1)))))o='def';if(a.token){var c=a.token(t,n,o);if(c!==undefined)o=c};if(o=='def'&&e.styleDefs===!1)o='variable';n.startOfLine=!1;n.prevToken=s?'def':o||r;b(t,n);return o},indent:function(n,r){if(n.tokenize!=x&&n.tokenize!=null||n.typeAtEndOfLine)return t.Pass;var i=n.context,s=r&&r.charAt(0);if(i.type=='statement'&&s=='}')i=i.prev;if(e.dontIndentStatements)while(i.type=='statement'&&e.dontIndentStatements.test(i.info))i=i.prev;if(a.indent){var u=a.indent(n,i,r);if(typeof u=='number')return u};var l=s==i.type,f=i.prev&&i.prev.info=='switch';if(e.allmanIndentation&&/[{(]/.test(s)){while(i.type!='top'&&i.type!='}')i=i.prev;return i.indented};if(i.type=='statement')return i.indented+(s=='{'?0:c);if(i.align&&(!k||i.type!=')'))return i.column+(l?0:1);if(i.type==')'&&!l)return i.indented+c;return i.indented+(l?0:o)+(!l&&f&&!/^(?:case|default)\b/.test(r)?o:0)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:'/*',blockCommentEnd:'*/',blockCommentContinue:' * ',lineComment:'//',fold:'brace'}});function e(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};function i(e,t){if(typeof e==='function'){return e(t)} +else{return e.propertyIsEnumerable(t)}};var c='auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile',o='int long char short double float unsigned signed void size_t ptrdiff_t';function a(e,t){if(!t.startOfLine)return!1;for(var n,r=null;n=e.peek();){if(n=='\\'&&e.match(/^.$/)){r=a;break} +else if(n=='/'&&e.match(/^\/[\/\*]/,!1)){break};e.next()};t.tokenize=r;return'meta'};function h(e,t){if(t.prevToken=='type')return'type';return!1};function r(e){e.eatWhile(/[\w\.']/);return'number'};function f(e,t){e.backUp(1);if(e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);if(!n){return!1};t.cpp11RawStringDelim=n[1];t.tokenize=y;return y(e,t)};if(e.match(/(u8|u|U|L)/)){if(e.match(/["']/,!1)){return'string'};return!1};e.next();return!1};function w(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]};function g(e,t){var n;while((n=e.next())!=null){if(n=='"'&&!e.eat('"')){t.tokenize=null;break}};return'string'};function y(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,'\\$&'),r=e.match(new RegExp('.*?\\)'+n+'"'));if(r)t.tokenize=null;else e.skipToEnd();return'string'};function n(e,n){if(typeof e=='string')e=[e];var a=[];function r(e){if(e)for(var t in e)if(e.hasOwnProperty(t))a.push(t)};r(n.keywords);r(n.types);r(n.builtin);r(n.atoms);if(a.length){n.helperType=e[0];t.registerHelper('hintWords',e[0],a)};for(var i=0;i<e.length;++i)t.defineMIME(e[i],n)};n(['text/x-csrc','text/x-c','text/x-chdr'],{name:'clike',keywords:e(c),types:e(o+' bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t'),blockKeywords:e('case do else for if switch while struct'),defKeywords:e('struct'),typeFirstDefinitions:!0,atoms:e('null true false'),hooks:{'#':a,'*':h},modeProps:{fold:['brace','include']}});n(['text/x-c++src','text/x-c++hdr'],{name:'clike',keywords:e(c+' asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override'),types:e(o+' bool wchar_t'),blockKeywords:e('catch class do else finally for if struct switch try while'),defKeywords:e('class namespace struct enum union'),typeFirstDefinitions:!0,atoms:e('true false null'),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,hooks:{'#':a,'*':h,'u':f,'U':f,'L':f,'R':f,'0':r,'1':r,'2':r,'3':r,'4':r,'5':r,'6':r,'7':r,'8':r,'9':r,token:function(e,t,n){if(n=='variable'&&e.peek()=='('&&(t.prevToken==';'||t.prevToken==null||t.prevToken=='}')&&w(e.current()))return'def'}},namespaceSeparator:'::',modeProps:{fold:['brace','include']}});n('text/x-java',{name:'clike',keywords:e('abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface'),types:e('byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void'),blockKeywords:e('catch class do else finally for if switch try while'),defKeywords:e('class interface enum @interface'),typeFirstDefinitions:!0,atoms:e('true false null'),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{'@':function(e){if(e.match('interface',!1))return!1;e.eatWhile(/[\w\$_]/);return'meta'}},modeProps:{fold:['brace','import']}});n('text/x-csharp',{name:'clike',keywords:e('abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield'),types:e('Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong'),blockKeywords:e('catch class do else finally for foreach if struct switch try while'),defKeywords:e('class interface namespace struct var'),typeFirstDefinitions:!0,atoms:e('true false null'),hooks:{'@':function(e,t){if(e.eat('"')){t.tokenize=g;return g(e,t)};e.eatWhile(/[\w\$_]/);return'meta'}}});function b(e,t){var n=!1;while(!e.eol()){if(!n&&e.match('"""')){t.tokenize=null;break};n=e.next()=='\\'&&!n};return'string'};n('text/x-scala',{name:'clike',keywords:e('abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble'),types:e('AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void'),multiLineStrings:!0,blockKeywords:e('catch class enum do else finally for forSome if match switch try while'),defKeywords:e('class enum def object package trait type val var'),atoms:e('true false null'),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{'@':function(e){e.eatWhile(/[\w\$_]/);return'meta'},'"':function(e,t){if(!e.match('""'))return!1;t.tokenize=b;return t.tokenize(e,t)},'\'':function(e){e.eatWhile(/[\w\$_\xa1-\uffff]/);return'atom'},'=':function(e,t){var n=t.context;if(n.type=='}'&&n.align&&e.eat('>')){t.context=new d(n.indented,n.column,n.type,n.info,null,n.prev);return'operator'} +else{return!1}}},modeProps:{closeBrackets:{triples:'"'}}});function k(e){return function(t,n){var r=!1,i,a=!1;while(!t.eol()){if(!e&&!r&&t.match('"')){a=!0;break};if(e&&t.match('"""')){a=!0;break};i=t.next();if(!r&&i=='$'&&t.match('{'))t.skipTo('}');r=!r&&i=='\\'&&!e};if(a||!e)n.tokenize=null;return'string'}};n('text/x-kotlin',{name:'clike',keywords:e('package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend'),types:e('Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void'),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:e('catch class do else finally for if where try while enum'),defKeywords:e('class val var object interface fun'),atoms:e('true false null this'),hooks:{'"':function(e,t){t.tokenize=k(e.match('""'));return t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}});n(['x-shader/x-vertex','x-shader/x-fragment'],{name:'clike',keywords:e('sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout'),types:e('float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4'),blockKeywords:e('for while do if else struct'),builtin:e('radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4'),atoms:e('true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers'),indentSwitch:!1,hooks:{'#':a},modeProps:{fold:['brace','include']}});n('text/x-nesc',{name:'clike',keywords:e(c+'as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends'),types:e(o),blockKeywords:e('case do else for if switch while struct'),atoms:e('null true false'),hooks:{'#':a},modeProps:{fold:['brace','include']}});n('text/x-objectivec',{name:'clike',keywords:e(c+'inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly'),types:e(o),atoms:e('YES NO NULL NILL ON OFF true false'),hooks:{'@':function(e){e.eatWhile(/[\w\$]/);return'keyword'},'#':a,indent:function(e,t,n){if(t.type=='statement'&&/^@\w/.test(n))return t.indented}},modeProps:{fold:'brace'}});n('text/x-squirrel',{name:'clike',keywords:e('base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static'),types:e(o),blockKeywords:e('case catch class else for foreach if switch try while'),defKeywords:e('function local class'),typeFirstDefinitions:!0,atoms:e('true false null'),hooks:{'#':a},modeProps:{fold:['brace','include']}});var s=null;function x(e){return function(t,n){var r=!1,a,i=!1;while(!t.eol()){if(!r&&t.match('"')&&(e=='single'||t.match('""'))){i=!0;break};if(!r&&t.match('``')){s=x(e);i=!0;break};a=t.next();r=e=='single'&&!r&&a=='\\'};if(i)n.tokenize=null;return'string'}};n('text/x-ceylon',{name:'clike',keywords:e('abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while'),types:function(e){var t=e.charAt(0);return(t===t.toUpperCase()&&t!==t.toLowerCase())},blockKeywords:e('case catch class dynamic else finally for function if interface module new object switch try while'),defKeywords:e('class dynamic function interface module object package value'),builtin:e('abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable'),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:e('true false null larger smaller equal empty finished'),indentSwitch:!1,styleDefs:!1,hooks:{'@':function(e){e.eatWhile(/[\w\$_]/);return'meta'},'"':function(e,t){t.tokenize=x(e.match('""')?'triple':'single');return t.tokenize(e,t)},'`':function(e,t){if(!s||!e.match('`'))return!1;t.tokenize=s;s=null;return t.tokenize(e,t)},'\'':function(e){e.eatWhile(/[\w\$_\xa1-\uffff]/);return'atom'},token:function(e,t,n){if((n=='variable'||n=='type')&&t.prevToken=='.'){return'variable-2'}}},modeProps:{fold:['brace','import'],closeBrackets:{triples:'"'}}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('oz',function(e){function n(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var c=/[\^@!\|<>#~\.\*\-\+\\/,=]/,f=/(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/,s=/(:::)|(\.\.\.)|(=<:)|(>=:)/,r=['in','then','else','of','elseof','elsecase','elseif','catch','finally','with','require','prepare','import','export','define','do'],i=['end'],l=n(['true','false','nil','unit']),d=n(['andthen','at','attr','declare','feat','from','lex','mod','div','mode','orelse','parser','prod','prop','scanner','self','syn','token']),m=n(['local','proc','fun','case','class','if','cond','or','dis','choice','not','thread','try','raise','lock','for','suchthat','meth','functor']),o=n(r),a=n(i);function t(e,t){if(e.eatSpace()){return null};if(e.match(/[{}]/)){return'bracket'};if(e.match(/(\[])/)){return'keyword'};if(e.match(s)||e.match(f)){return'operator'};if(e.match(l)){return'atom'};var r=e.match(m);if(r){if(!t.doInCurrentLine)t.currentIndent++;else t.doInCurrentLine=!1;if(r[0]=='proc'||r[0]=='fun')t.tokenize=p;else if(r[0]=='class')t.tokenize=h;else if(r[0]=='meth')t.tokenize=k;return'keyword'};if(e.match(o)||e.match(d)){return'keyword'};if(e.match(a)){t.currentIndent--;return'keyword'};var n=e.next();if(n=='"'||n=='\''){t.tokenize=z(n);return t.tokenize(e,t)};if(/[~\d]/.test(n)){if(n=='~'){if(!/^[0-9]/.test(e.peek()))return null;else if((e.next()=='0'&&e.match(/^[xX][0-9a-fA-F]+/))||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return'number'};if((n=='0'&&e.match(/^[xX][0-9a-fA-F]+/))||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return'number';return null};if(n=='%'){e.skipToEnd();return'comment'} +else if(n=='/'){if(e.eat('*')){t.tokenize=u;return u(e,t)}};if(c.test(n)){return'operator'};e.eatWhile(/\w/);return'variable'};function h(e,n){if(e.eatSpace()){return null};e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);n.tokenize=t;return'variable-3'};function k(e,n){if(e.eatSpace()){return null};e.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);n.tokenize=t;return'def'};function p(e,n){if(e.eatSpace()){return null};if(!n.hasPassedFirstStage&&e.eat('{')){n.hasPassedFirstStage=!0;return'bracket'} +else if(n.hasPassedFirstStage){e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);n.hasPassedFirstStage=!1;n.tokenize=t;return'def'} +else{n.tokenize=t;return null}};function u(e,n){var i=!1,r;while(r=e.next()){if(r=='/'&&i){n.tokenize=t;break};i=(r=='*')};return'comment'};function z(e){return function(n,r){var i=!1,o,a=!1;while((o=n.next())!=null){if(o==e&&!i){a=!0;break};i=!i&&o=='\\'};if(a||!i)r.tokenize=t;return'string'}};function b(){var e=r.concat(i);return new RegExp('[\\[\\]]|('+e.join('|')+')$')};return{startState:function(){return{tokenize:t,currentIndent:0,doInCurrentLine:!1,hasPassedFirstStage:!1}},token:function(e,t){if(e.sol())t.doInCurrentLine=0;return t.tokenize(e,t)},indent:function(t,n){var r=n.replace(/^\s+|\s+$/g,'');if(r.match(a)||r.match(o)||r.match(/(\[])/))return e.indentUnit*(t.currentIndent-1);if(t.currentIndent<0)return 0;return t.currentIndent*e.indentUnit},fold:'indent',electricInput:b(),lineComment:'%',blockCommentStart:'/*',blockCommentEnd:'*/'}});e.defineMIME('text/x-oz','oz')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("modelica",function(t,n){var u=t.indentUnit,f=n.keywords||{};var s=n.builtin||{};var a=n.atoms||{};var o=/[;=\(:\),{}.*<>+\-\/^\[\]]/,l=/(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/,i=/[0-9]/,r=/[_a-zA-Z]/;function c(e,t){e.skipToEnd();t.tokenize=null;return"comment"};function p(e,t){var i=!1,n;while(n=e.next()){if(i&&n=="/"){t.tokenize=null;break};i=(n=="*")};return"comment"};function d(e,t){var n=!1,i;while((i=e.next())!=null){if(i=="\""&&!n){t.tokenize=null;t.sol=!1;break};n=!n&&i=="\\"};return"string"};function m(e,t){e.eatWhile(i);while(e.eat(i)||e.eat(r)){};var n=e.current();if(t.sol&&(n=="package"||n=="model"||n=="when"||n=="connector"))t.level++;else if(t.sol&&n=="end"&&t.level>0)t.level--;t.tokenize=null;t.sol=!1;if(f.propertyIsEnumerable(n))return"keyword";else if(s.propertyIsEnumerable(n))return"builtin";else if(a.propertyIsEnumerable(n))return"atom";else return"variable"};function k(e,t){while(e.eat(/[^']/)){};t.tokenize=null;t.sol=!1;if(e.eat("'"))return"variable";else return"error"};function h(e,t){e.eatWhile(i);if(e.eat(".")){e.eatWhile(i)};if(e.eat("e")||e.eat("E")){if(!e.eat("-"))e.eat("+");e.eatWhile(i)};t.tokenize=null;t.sol=!1;return"number"};return{startState:function(){return{tokenize:null,level:0,sol:!0}},token:function(t,e){if(e.tokenize!=null){return e.tokenize(t,e)};if(t.sol()){e.sol=!0};if(t.eatSpace()){e.tokenize=null;return null};var n=t.next();if(n=="/"&&t.eat("/")){e.tokenize=c} +else if(n=="/"&&t.eat("*")){e.tokenize=p} +else if(l.test(n+t.peek())){t.next();e.tokenize=null;return"operator"} +else if(o.test(n)){e.tokenize=null;return"operator"} +else if(r.test(n)){e.tokenize=m} +else if(n=="'"&&t.peek()&&t.peek()!="'"){e.tokenize=k} +else if(n=="\""){e.tokenize=d} +else if(i.test(n)){e.tokenize=h} +else{e.tokenize=null;return"error"};return e.tokenize(t,e)},indent:function(t,n){if(t.tokenize!=null)return e.Pass;var i=t.level;if(/(algorithm)/.test(n))i--;if(/(equation)/.test(n))i--;if(/(initial algorithm)/.test(n))i--;if(/(initial equation)/.test(n))i--;if(/(end)/.test(n))i--;if(i>0)return u*i;else return 0},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});function t(e){var n={},i=e.split(" ");for(var t=0;t<i.length;++t)n[i[t]]=!0;return n};var n="algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within",i="abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh",r="Real Boolean Integer String";function o(t,n){if(typeof t=="string")t=[t];var r=[];function o(e){if(e)for(var t in e)if(e.hasOwnProperty(t))r.push(t)};o(n.keywords);o(n.builtin);o(n.atoms);if(r.length){n.helperType=t[0];e.registerHelper("hintWords",t[0],r)};for(var i=0;i<t.length;++i)e.defineMIME(t[i],n)};o(["text/x-modelica"],{name:"modelica",keywords:t(n),builtin:t(i),atoms:t(r)})});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("gherkin",function(){return{startState:function(){return{lineNumber:0,tableHeaderLine:!1,allowFeature:!0,allowBackground:!1,allowScenario:!1,allowSteps:!1,allowPlaceholders:!1,allowMultilineArgument:!1,inMultilineString:!1,inMultilineTable:!1,inKeywordLine:!1}},token:function(a,e){if(a.sol()){e.lineNumber++;e.inKeywordLine=!1;if(e.inMultilineTable){e.tableHeaderLine=!1;if(!a.match(/\s*\|/,!1)){e.allowMultilineArgument=!1;e.inMultilineTable=!1}}};a.eatSpace();if(e.allowMultilineArgument){if(e.inMultilineString){if(a.match("\"\"\"")){e.inMultilineString=!1;e.allowMultilineArgument=!1} +else{a.match(/.*/)};return"string"};if(e.inMultilineTable){if(a.match(/\|\s*/)){return"bracket"} +else{a.match(/[^\|]*/);return e.tableHeaderLine?"header":"string"}};if(a.match("\"\"\"")){e.inMultilineString=!0;return"string"} +else if(a.match("|")){e.inMultilineTable=!0;e.tableHeaderLine=!0;return"bracket"}};if(a.match(/#.*/)){return"comment"} +else if(!e.inKeywordLine&&a.match(/@\S+/)){return"tag"} +else if(!e.inKeywordLine&&e.allowFeature&&a.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)){e.allowScenario=!0;e.allowBackground=!0;e.allowPlaceholders=!1;e.allowSteps=!1;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} +else if(!e.inKeywordLine&&e.allowBackground&&a.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)){e.allowPlaceholders=!1;e.allowSteps=!0;e.allowBackground=!1;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} +else if(!e.inKeywordLine&&e.allowScenario&&a.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)){e.allowPlaceholders=!0;e.allowSteps=!0;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} +else if(e.allowScenario&&a.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)){e.allowPlaceholders=!1;e.allowSteps=!0;e.allowBackground=!1;e.allowMultilineArgument=!0;return"keyword"} +else if(!e.inKeywordLine&&e.allowScenario&&a.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)){e.allowPlaceholders=!1;e.allowSteps=!0;e.allowBackground=!1;e.allowMultilineArgument=!1;e.inKeywordLine=!0;return"keyword"} +else if(!e.inKeywordLine&&e.allowSteps&&a.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)){e.inStep=!0;e.allowPlaceholders=!0;e.allowMultilineArgument=!0;e.inKeywordLine=!0;return"keyword"} +else if(a.match(/"[^"]*"?/)){return"string"} +else if(e.allowPlaceholders&&a.match(/<[^>]*>?/)){return"variable"} +else{a.next();a.eatWhile(/[^@"<#]/);return null}}}});e.defineMIME("text/x-feature","gherkin")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){var n={};for(var t=0;t<e.length;t++)n[e[t]]=!0;return n};var i=t(['_','var','let','class','enum','extension','import','protocol','struct','func','typealias','associatedtype','open','public','internal','fileprivate','private','deinit','init','new','override','self','subscript','super','convenience','dynamic','final','indirect','lazy','required','static','unowned','unowned(safe)','unowned(unsafe)','weak','as','is','break','case','continue','default','else','fallthrough','for','guard','if','in','repeat','switch','where','while','defer','return','inout','mutating','nonmutating','catch','do','rethrows','throw','throws','try','didSet','get','set','willSet','assignment','associativity','infix','left','none','operator','postfix','precedence','precedencegroup','prefix','right','Any','AnyObject','Type','dynamicType','Self','Protocol','__COLUMN__','__FILE__','__FUNCTION__','__LINE__']),o=t(['var','let','class','enum','extension','import','protocol','struct','func','typealias','associatedtype','for']),a=t(['true','false','nil','self','super','_']),u=t(['Array','Bool','Character','Dictionary','Double','Float','Int','Int8','Int16','Int32','Int64','Never','Optional','Set','String','UInt8','UInt16','UInt32','UInt64','Void']),c='+-/*%=|&<>~^?!',f=':;,.(){}[]',l=/^\-?0b[01][01_]*/,d=/^\-?0o[0-7][0-7_]*/,s=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,p=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,m=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,h=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,v=/^\#[A-Za-z]+/,x=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function n(e,t,k){if(e.sol())t.indented=e.indentation();if(e.eatSpace())return null;var n=e.peek();if(n=='/'){if(e.match('//')){e.skipToEnd();return'comment'};if(e.match('/*')){t.tokenize.push(r);return r(e,t)}};if(e.match(v))return'builtin';if(e.match(x))return'attribute';if(e.match(l))return'number';if(e.match(d))return'number';if(e.match(s))return'number';if(e.match(p))return'number';if(e.match(h))return'property';if(c.indexOf(n)>-1){e.next();return'operator'};if(f.indexOf(n)>-1){e.next();e.match('..');return'punctuation'};if(n=='"'||n=='\''){e.next();var w=b(n);t.tokenize.push(w);return w(e,t)};if(e.match(m)){var y=e.current();if(u.hasOwnProperty(y))return'variable-2';if(a.hasOwnProperty(y))return'atom';if(i.hasOwnProperty(y)){if(o.hasOwnProperty(y))t.prev='define';return'keyword'};if(k=='define')return'def';return'variable'};e.next();return null};function y(){var e=0;return function(t,r,i){var o=n(t,r,i);if(o=='punctuation'){if(t.current()=='(')++e;else if(t.current()==')'){if(e==0){t.backUp(1);r.tokenize.pop();return r.tokenize[r.tokenize.length-1](t,r)} +else--e}};return o}};function b(e){return function(t,n){var r,i=!1;while(r=t.next()){if(i){if(r=='('){n.tokenize.push(y());return'string'};i=!1} +else if(r==e){break} +else{i=r=='\\'}};n.tokenize.pop();return'string'}};function r(e,t){e.match(/^(?:[^*]|\*(?!\/))*/);if(e.match('*/'))t.tokenize.pop();return'comment'};function k(e,t,n){this.prev=e;this.align=t;this.indented=n};function w(e,t){var n=t.match(/^\s*($|\/[\/\*])/,!1)?null:t.column()+1;e.context=new k(e.context,n,e.indented)};function z(e){if(e.context){e.indented=e.context.indented;e.context=e.context.prev}};e.defineMode('swift',function(e){return{startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(e,t){var o=t.prev;t.prev=null;var a=t.tokenize[t.tokenize.length-1]||n,r=a(e,t,o);if(!r||r=='comment')t.prev=o;else if(!t.prev)t.prev=r;if(r=='punctuation'){var i=/[\(\[\{]|([\]\)\}])/.exec(e.current());if(i)(i[1]?z:w)(t,e)};return r},indent:function(t,n){var r=t.context;if(!r)return 0;var i=/^[\]\}\)]/.test(n);if(r.align!=null)return r.align-(i?1:0);return r.indented+(i?0:e.indentUnit)},electricInput:/^\s*[\)\}\]]$/,lineComment:'//',blockCommentStart:'/*',blockCommentEnd:'*/',fold:'brace',closeBrackets:'()[]{}\'\'""``'}});e.defineMIME('text/x-swift','swift')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('scheme',function(){var p='builtin',e='comment',r='string',a='atom',c='number',l='bracket',h=2;function s(e){var i={},n=e.split(' ');for(var t=0;t<n.length;++t)i[n[t]]=!0;return i};var n=s('λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?'),m=s('define let letrec let* lambda');function g(e,t,i){this.indent=e;this.type=t;this.prev=i};function t(e,t,i){e.indentStack=new g(t,i,e.indentStack)};function x(e){e.indentStack=e.indentStack.prev};var o=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),d=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),f=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),u=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function b(e){return e.match(o)};function v(e){return e.match(d)};function i(e,t){if(t===!0){e.backUp(1)};return e.match(u)};function k(e){return e.match(f)};return{startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1}},token:function(s,o){if(o.indentStack==null&&s.sol()){o.indentation=s.indentation()};if(s.eatSpace()){return null};var d=null;switch(o.mode){case'string':var g,S=!1;while((g=s.next())!=null){if(g=='"'&&!S){o.mode=!1;break};S=!S&&g=='\\'};d=r;break;case'comment':var g,M=!1;while((g=s.next())!=null){if(g=='#'&&M){o.mode=!1;break};M=(g=='|')};d=e;break;case's-expr-comment':o.mode=!1;if(s.peek()=='('||s.peek()=='['){o.sExprComment=0} +else{s.eatWhile(/[^/s]/);d=e;break};default:var f=s.next();if(f=='"'){o.mode='string';d=r} +else if(f=='\''){d=a} +else if(f=='#'){if(s.eat('|')){o.mode='comment';d=e} +else if(s.eat(/[tf]/i)){d=a} +else if(s.eat(';')){o.mode='s-expr-comment';d=e} +else{var u=null,E=!1,C=!0;if(s.eat(/[ei]/i)){E=!0} +else{s.backUp(1)};if(s.match(/^#b/i)){u=b} +else if(s.match(/^#o/i)){u=v} +else if(s.match(/^#x/i)){u=k} +else if(s.match(/^#d/i)){u=i} +else if(s.match(/^[-+0-9.]/,!1)){C=!1;u=i} +else if(!E){s.eat('#')};if(u!=null){if(C&&!E){s.match(/^#[ei]/i)};if(u(s))d=c}}} +else if(/^[-+0-9.]/.test(f)&&i(s,!0)){d=c} +else if(f==';'){s.skipToEnd();d=e} +else if(f=='('||f=='['){var y='',w=s.column(),q;while((q=s.eat(/[^\s\(\[\;\)\]]/))!=null){y+=q};if(y.length>0&&m.propertyIsEnumerable(y)){t(o,w+h,f)} +else{s.eatSpace();if(s.eol()||s.peek()==';'){t(o,w+1,f)} +else{t(o,w+s.current().length,f)}};s.backUp(s.current().length-1);if(typeof o.sExprComment=='number')o.sExprComment++;d=l} +else if(f==')'||f==']'){d=l;if(o.indentStack!=null&&o.indentStack.type==(f==')'?'(':'[')){x(o);if(typeof o.sExprComment=='number'){if(--o.sExprComment==0){d=e;o.sExprComment=!1}}}} +else{s.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);if(n&&n.propertyIsEnumerable(s.current())){d=p} +else d='variable'}};return(typeof o.sExprComment=='number')?e:d},indent:function(e){if(e.indentStack==null)return e.indentation;return e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:';;'}});e.defineMIME('text/x-scheme','scheme')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function i(e){return new RegExp('^(('+e.join(')|(')+'))\\b','i')};var t=['a_correlate','abs','acos','adapt_hist_equal','alog','alog2','alog10','amoeba','annotate','app_user_dir','app_user_dir_query','arg_present','array_equal','array_indices','arrow','ascii_template','asin','assoc','atan','axis','axis','bandpass_filter','bandreject_filter','barplot','bar_plot','beseli','beselj','beselk','besely','beta','biginteger','bilinear','bin_date','binary_template','bindgen','binomial','bit_ffs','bit_population','blas_axpy','blk_con','boolarr','boolean','boxplot','box_cursor','breakpoint','broyden','bubbleplot','butterworth','bytarr','byte','byteorder','bytscl','c_correlate','calendar','caldat','call_external','call_function','call_method','call_procedure','canny','catch','cd','cdf','ceil','chebyshev','check_math','chisqr_cvf','chisqr_pdf','choldc','cholsol','cindgen','cir_3pnt','clipboard','close','clust_wts','cluster','cluster_tree','cmyk_convert','code_coverage','color_convert','color_exchange','color_quan','color_range_map','colorbar','colorize_sample','colormap_applicable','colormap_gradient','colormap_rotation','colortable','comfit','command_line_args','common','compile_opt','complex','complexarr','complexround','compute_mesh_normals','cond','congrid','conj','constrained_min','contour','contour','convert_coord','convol','convol_fft','coord2to3','copy_lun','correlate','cos','cosh','cpu','cramer','createboxplotdata','create_cursor','create_struct','create_view','crossp','crvlength','ct_luminance','cti_test','cursor','curvefit','cv_coord','cvttobm','cw_animate','cw_animate_getp','cw_animate_load','cw_animate_run','cw_arcball','cw_bgroup','cw_clr_index','cw_colorsel','cw_defroi','cw_field','cw_filesel','cw_form','cw_fslider','cw_light_editor','cw_light_editor_get','cw_light_editor_set','cw_orient','cw_palette_editor','cw_palette_editor_get','cw_palette_editor_set','cw_pdmenu','cw_rgbslider','cw_tmpl','cw_zoom','db_exists','dblarr','dcindgen','dcomplex','dcomplexarr','define_key','define_msgblk','define_msgblk_from_file','defroi','defsysv','delvar','dendro_plot','dendrogram','deriv','derivsig','determ','device','dfpmin','diag_matrix','dialog_dbconnect','dialog_message','dialog_pickfile','dialog_printersetup','dialog_printjob','dialog_read_image','dialog_write_image','dictionary','digital_filter','dilate','dindgen','dissolve','dist','distance_measure','dlm_load','dlm_register','doc_library','double','draw_roi','edge_dog','efont','eigenql','eigenvec','ellipse','elmhes','emboss','empty','enable_sysrtn','eof','eos','erase','erf','erfc','erfcx','erode','errorplot','errplot','estimator_filter','execute','exit','exp','expand','expand_path','expint','extrac','extract_slice','f_cvf','f_pdf','factorial','fft','file_basename','file_chmod','file_copy','file_delete','file_dirname','file_expand_path','file_gunzip','file_gzip','file_info','file_lines','file_link','file_mkdir','file_move','file_poll_input','file_readlink','file_same','file_search','file_tar','file_test','file_untar','file_unzip','file_which','file_zip','filepath','findgen','finite','fix','flick','float','floor','flow3','fltarr','flush','format_axis_values','forward_function','free_lun','fstat','fulstr','funct','function','fv_test','fx_root','fz_roots','gamma','gamma_ct','gauss_cvf','gauss_pdf','gauss_smooth','gauss2dfit','gaussfit','gaussian_function','gaussint','get_drive_list','get_dxf_objects','get_kbrd','get_login_info','get_lun','get_screen_size','getenv','getwindows','greg2jul','grib','grid_input','grid_tps','grid3','griddata','gs_iter','h_eq_ct','h_eq_int','hanning','hash','hdf','hdf5','heap_free','heap_gc','heap_nosave','heap_refcount','heap_save','help','hilbert','hist_2d','hist_equal','histogram','hls','hough','hqr','hsv','i18n_multibytetoutf8','i18n_multibytetowidechar','i18n_utf8tomultibyte','i18n_widechartomultibyte','ibeta','icontour','iconvertcoord','idelete','identity','idl_base64','idl_container','idl_validname','idlexbr_assistant','idlitsys_createtool','idlunit','iellipse','igamma','igetcurrent','igetdata','igetid','igetproperty','iimage','image','image_cont','image_statistics','image_threshold','imaginary','imap','indgen','int_2d','int_3d','int_tabulated','intarr','interpol','interpolate','interval_volume','invert','ioctl','iopen','ir_filter','iplot','ipolygon','ipolyline','iputdata','iregister','ireset','iresolve','irotate','isa','isave','iscale','isetcurrent','isetproperty','ishft','isocontour','isosurface','isurface','itext','itranslate','ivector','ivolume','izoom','journal','json_parse','json_serialize','jul2greg','julday','keyword_set','krig2d','kurtosis','kw_test','l64indgen','la_choldc','la_cholmprove','la_cholsol','la_determ','la_eigenproblem','la_eigenql','la_eigenvec','la_elmhes','la_gm_linear_model','la_hqr','la_invert','la_least_square_equality','la_least_squares','la_linear_equation','la_ludc','la_lumprove','la_lusol','la_svd','la_tridc','la_trimprove','la_triql','la_trired','la_trisol','label_date','label_region','ladfit','laguerre','lambda','lambdap','lambertw','laplacian','least_squares_filter','leefilt','legend','legendre','linbcg','lindgen','linfit','linkimage','list','ll_arc_distance','lmfit','lmgr','lngamma','lnp_test','loadct','locale_get','logical_and','logical_or','logical_true','lon64arr','lonarr','long','long64','lsode','lu_complex','ludc','lumprove','lusol','m_correlate','machar','make_array','make_dll','make_rt','map','mapcontinents','mapgrid','map_2points','map_continents','map_grid','map_image','map_patch','map_proj_forward','map_proj_image','map_proj_info','map_proj_init','map_proj_inverse','map_set','matrix_multiply','matrix_power','max','md_test','mean','meanabsdev','mean_filter','median','memory','mesh_clip','mesh_decimate','mesh_issolid','mesh_merge','mesh_numtriangles','mesh_obj','mesh_smooth','mesh_surfacearea','mesh_validate','mesh_volume','message','min','min_curve_surf','mk_html_help','modifyct','moment','morph_close','morph_distance','morph_gradient','morph_hitormiss','morph_open','morph_thin','morph_tophat','multi','n_elements','n_params','n_tags','ncdf','newton','noise_hurl','noise_pick','noise_scatter','noise_slur','norm','obj_class','obj_destroy','obj_hasmethod','obj_isa','obj_new','obj_valid','objarr','on_error','on_ioerror','online_help','openr','openu','openw','oplot','oploterr','orderedhash','p_correlate','parse_url','particle_trace','path_cache','path_sep','pcomp','plot','plot3d','plot','plot_3dbox','plot_field','ploterr','plots','polar_contour','polar_surface','polyfill','polyshade','pnt_line','point_lun','polarplot','poly','poly_2d','poly_area','poly_fit','polyfillv','polygon','polyline','polywarp','popd','powell','pref_commit','pref_get','pref_set','prewitt','primes','print','printf','printd','pro','product','profile','profiler','profiles','project_vol','ps_show_fonts','psafm','pseudo','ptr_free','ptr_new','ptr_valid','ptrarr','pushd','qgrid3','qhull','qromb','qromo','qsimp','query_*','query_ascii','query_bmp','query_csv','query_dicom','query_gif','query_image','query_jpeg','query_jpeg2000','query_mrsid','query_pict','query_png','query_ppm','query_srf','query_tiff','query_video','query_wav','r_correlate','r_test','radon','randomn','randomu','ranks','rdpix','read','readf','read_ascii','read_binary','read_bmp','read_csv','read_dicom','read_gif','read_image','read_interfile','read_jpeg','read_jpeg2000','read_mrsid','read_pict','read_png','read_ppm','read_spr','read_srf','read_sylk','read_tiff','read_video','read_wav','read_wave','read_x11_bitmap','read_xwd','reads','readu','real_part','rebin','recall_commands','recon3','reduce_colors','reform','region_grow','register_cursor','regress','replicate','replicate_inplace','resolve_all','resolve_routine','restore','retall','return','reverse','rk4','roberts','rot','rotate','round','routine_filepath','routine_info','rs_test','s_test','save','savgol','scale3','scale3d','scatterplot','scatterplot3d','scope_level','scope_traceback','scope_varfetch','scope_varname','search2d','search3d','sem_create','sem_delete','sem_lock','sem_release','set_plot','set_shading','setenv','sfit','shade_surf','shade_surf_irr','shade_volume','shift','shift_diff','shmdebug','shmmap','shmunmap','shmvar','show3','showfont','signum','simplex','sin','sindgen','sinh','size','skewness','skip_lun','slicer3','slide_image','smooth','sobel','socket','sort','spawn','sph_4pnt','sph_scat','spher_harm','spl_init','spl_interp','spline','spline_p','sprsab','sprsax','sprsin','sprstp','sqrt','standardize','stddev','stop','strarr','strcmp','strcompress','streamline','streamline','stregex','stretch','string','strjoin','strlen','strlowcase','strmatch','strmessage','strmid','strpos','strput','strsplit','strtrim','struct_assign','struct_hide','strupcase','surface','surface','surfr','svdc','svdfit','svsol','swap_endian','swap_endian_inplace','symbol','systime','t_cvf','t_pdf','t3d','tag_names','tan','tanh','tek_color','temporary','terminal_size','tetra_clip','tetra_surface','tetra_volume','text','thin','thread','threed','tic','time_test2','timegen','timer','timestamp','timestamptovalues','tm_test','toc','total','trace','transpose','tri_surf','triangulate','trigrid','triql','trired','trisol','truncate_lun','ts_coef','ts_diff','ts_fcast','ts_smooth','tv','tvcrs','tvlct','tvrd','tvscl','typename','uindgen','uint','uintarr','ul64indgen','ulindgen','ulon64arr','ulonarr','ulong','ulong64','uniq','unsharp_mask','usersym','value_locate','variance','vector','vector_field','vel','velovect','vert_t3d','voigt','volume','voronoi','voxel_proj','wait','warp_tri','watershed','wdelete','wf_draw','where','widget_base','widget_button','widget_combobox','widget_control','widget_displaycontextmenu','widget_draw','widget_droplist','widget_event','widget_info','widget_label','widget_list','widget_propertysheet','widget_slider','widget_tab','widget_table','widget_text','widget_tree','widget_tree_move','widget_window','wiener_filter','window','window','write_bmp','write_csv','write_gif','write_image','write_jpeg','write_jpeg2000','write_nrif','write_pict','write_png','write_ppm','write_spr','write_srf','write_sylk','write_tiff','write_video','write_wav','write_wave','writeu','wset','wshow','wtn','wv_applet','wv_cwt','wv_cw_wavelet','wv_denoise','wv_dwt','wv_fn_coiflet','wv_fn_daubechies','wv_fn_gaussian','wv_fn_haar','wv_fn_morlet','wv_fn_paul','wv_fn_symlet','wv_import_data','wv_import_wavelet','wv_plot3d_wps','wv_plot_multires','wv_pwt','wv_tool_denoise','xbm_edit','xdisplayfile','xdxf','xfont','xinteranimate','xloadct','xmanager','xmng_tmpl','xmtool','xobjview','xobjview_rotate','xobjview_write_image','xpalette','xpcolor','xplot3d','xregistered','xroi','xsq_test','xsurface','xvaredit','xvolume','xvolume_rotate','xvolume_write_image','xyouts','zlib_compress','zlib_uncompress','zoom','zoom_24'],s=i(t),r=['begin','end','endcase','endfor','endwhile','endif','endrep','endforeach','break','case','continue','for','foreach','goto','if','then','else','repeat','until','switch','while','do','pro','function'],n=i(r);e.registerHelper('hintWords','idl',t.concat(r));var a=new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*','i'),o=/[+\-*&=<>\/@#~$]/,l=new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)','i');function d(e){if(e.eatSpace())return null;if(e.match(';')){e.skipToEnd();return'comment'};if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return'number';if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return'number';if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return'number'};if(e.match(/^"([^"]|(""))*"/)){return'string'};if(e.match(/^'([^']|(''))*'/)){return'string'};if(e.match(n)){return'keyword'};if(e.match(s)){return'builtin'};if(e.match(a)){return'variable'};if(e.match(o)||e.match(l)){return'operator'};e.next();return null};e.defineMode('idl',function(){return{token:function(e){return d(e)}}});e.defineMIME('text/x-idl','idl')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('yaml',function(){var e=['true','false','on','off','yes','no'],i=new RegExp('\\b(('+e.join(')|(')+'))$','i');return{token:function(t,e){var r=t.peek(),n=e.escaped;e.escaped=!1;if(r=='#'&&(t.pos==0||/\s/.test(t.string.charAt(t.pos-1)))){t.skipToEnd();return'comment'};if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return'string';if(e.literal&&t.indentation()>e.keyCol){t.skipToEnd();return'string'} +else if(e.literal){e.literal=!1};if(t.sol()){e.keyCol=0;e.pair=!1;e.pairStart=!1;if(t.match(/---/)){return'def'};if(t.match(/\.\.\./)){return'def'};if(t.match(/\s*-\s+/)){return'meta'}};if(t.match(/^(\{|\}|\[|\])/)){if(r=='{')e.inlinePairs++;else if(r=='}')e.inlinePairs--;else if(r=='[')e.inlineList++;else e.inlineList--;return'meta'};if(e.inlineList>0&&!n&&r==','){t.next();return'meta'};if(e.inlinePairs>0&&!n&&r==','){e.keyCol=0;e.pair=!1;e.pairStart=!1;t.next();return'meta'};if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/)){e.literal=!0;return'meta'};if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)){return'variable-2'};if(e.inlinePairs==0&&t.match(/^\s*-?[0-9\.\,]+\s?$/)){return'number'};if(e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)){return'number'};if(t.match(i)){return'keyword'}};if(!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)){e.pair=!0;e.keyCol=t.indentation();return'atom'};if(e.pair&&t.match(/^:\s*/)){e.pairStart=!0;return'meta'};e.pairStart=!1;e.escaped=(r=='\\');t.next();return null},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}});e.defineMIME('text/x-yaml','yaml');e.defineMIME('text/yaml','yaml')});(function(e){'use strict';if(typeof exports==='object'&&typeof module==='object'){e(require('../../lib/codemirror'),require('../../addon/mode/overlay'),require('../xml/xml'),require('../javascript/javascript'),require('../coffeescript/coffeescript'),require('../css/css'),require('../sass/sass'),require('../stylus/stylus'),require('../pug/pug'),require('../handlebars/handlebars'))} +else if(typeof define==='function'&&define.amd){define(['../../lib/codemirror','../../addon/mode/overlay','../xml/xml','../javascript/javascript','../coffeescript/coffeescript','../css/css','../sass/sass','../stylus/stylus','../pug/pug','../handlebars/handlebars'],e)} +else{e(CodeMirror)}})(function(e){var s={script:[['lang',/coffee(script)?/,'coffeescript'],['type',/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,'coffeescript'],['lang',/^babel$/,'javascript'],['type',/^text\/babel$/,'javascript'],['type',/^text\/ecmascript-\d+$/,'javascript']],style:[['lang',/^stylus$/i,'stylus'],['lang',/^sass$/i,'sass'],['lang',/^less$/i,'text/x-less'],['lang',/^scss$/i,'text/x-scss'],['type',/^(text\/)?(x-)?styl(us)?$/i,'stylus'],['type',/^text\/sass/i,'sass'],['type',/^(text\/)?(x-)?scss$/i,'text/x-scss'],['type',/^(text\/)?(x-)?less$/i,'text/x-less']],template:[['lang',/^vue-template$/i,'vue'],['lang',/^pug$/i,'pug'],['lang',/^handlebars$/i,'handlebars'],['type',/^(text\/)?(x-)?pug$/i,'pug'],['type',/^text\/x-handlebars-template$/i,'handlebars'],[null,null,'vue-template']]};e.defineMode('vue-template',function(s,t){var a={token:function(e){if(e.match(/^\{\{.*?\}\}/))return'meta mustache';while(e.next()&&!e.match('{{',!1)){};return null}};return e.overlayMode(e.getMode(s,t.backdrop||'text/html'),a)});e.defineMode('vue',function(t){return e.getMode(t,{name:'htmlmixed',tags:s})},'htmlmixed','xml','javascript','coffeescript','css','sass','stylus','pug','handlebars');e.defineMIME('script/x-vue','vue');e.defineMIME('text/x-vue','vue')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../../addon/mode/multiplex'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../../addon/mode/multiplex'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('twig:inner',function(){var t=['and','as','autoescape','endautoescape','block','do','endblock','else','elseif','extends','for','endfor','embed','endembed','filter','endfilter','flush','from','if','endif','in','is','include','import','not','or','set','spaceless','endspaceless','with','endwith','trans','endtrans','blocktrans','endblocktrans','macro','endmacro','use','verbatim','endverbatim'],i=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,e=['true','false','null','empty','defined','divisibleby','divisible by','even','odd','iterable','sameas','same as'],n=/^(\d[+\-\*\/])?\d+(\.\d+)?/;t=new RegExp('(('+t.join(')|(')+'))\\b');e=new RegExp('(('+e.join(')|(')+'))\\b');function o(o,a){var s=o.peek();if(a.incomment){if(!o.skipTo('#}')){o.skipToEnd()} +else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} +else if(a.intag){if(a.operator){a.operator=!1;if(o.match(e)){return'atom'};if(o.match(n)){return'number'}};if(a.sign){a.sign=!1;if(o.match(e)){return'atom'};if(o.match(n)){return'number'}};if(a.instring){if(s==a.instring){a.instring=!1};o.next();return'string'} +else if(s=='\''||s=='"'){a.instring=s;o.next();return'string'} +else if(o.match(a.intag+'}')||o.eat('-')&&o.match(a.intag+'}')){a.intag=!1;return'tag'} +else if(o.match(i)){a.operator=!0;return'operator'} +else if(o.match(r)){a.sign=!0} +else{if(o.eat(' ')||o.sol()){if(o.match(t)){return'keyword'};if(o.match(e)){return'atom'};if(o.match(n)){return'number'};if(o.sol()){o.next()}} +else{o.next()}};return'variable'} +else if(o.eat('{')){if(o.eat('#')){a.incomment=!0;if(!o.skipTo('#}')){o.skipToEnd()} +else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} +else if(s=o.eat(/\{|%/)){a.intag=s;if(s=='{'){a.intag='}'};o.eat('-');return'tag'}};o.next()};return{startState:function(){return{}},token:function(e,t){return o(e,t)}}});e.defineMode('twig',function(t,n){var i=e.getMode(t,'twig:inner');if(!n||!n.base)return i;return e.multiplexingMode(e.getMode(t,n.base),{open:/\{[{#%]/,close:/[}#%]\}/,mode:i,parseDelimiters:!0})});e.defineMIME('text/x-twig','twig')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('cmake',function(){var n=/({)?[a-zA-Z0-9_]+(})?/;function e(e,n){var i,t,r=!1;while(!e.eol()&&(i=e.next())!=n.pending){if(i==='$'&&t!='\\'&&n.pending=='"'){r=!0;break};t=i};if(r){e.backUp(1)};if(i==n.pending){n.continueString=!1} +else{n.continueString=!0};return'string'};function i(i,r){var t=i.next();if(t==='$'){if(i.match(n)){return'variable-2'};return'variable'};if(r.continueString){i.backUp(1);return e(i,r)};if(i.match(/(\s+)?\w+\(/)||i.match(/(\s+)?\w+\ \(/)){i.backUp(1);return'def'};if(t=='#'){i.skipToEnd();return'comment'};if(t=='\''||t=='"'){r.pending=t;return e(i,r)};if(t=='('||t==')'){return'bracket'};if(t.match(/[0-9]/)){return'number'};i.eatWhile(/[\w-]/);return null};return{startState:function(){var e={};e.inDefinition=!1;e.inInclude=!1;e.continueString=!1;e.pending=!1;return e},token:function(e,n){if(e.eatSpace())return null;return i(e,n)}}});e.defineMIME('text/x-cmake','cmake')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function t(e){var t=e.match(/^\s*\S/);e.skipToEnd();return t?'error':null};e.defineMode('asciiarmor',function(){return{token:function(e,r){var i;if(r.state=='top'){if(e.sol()&&(i=e.match(/^-----BEGIN (.*)?-----\s*$/))){r.state='headers';r.type=i[1];return'tag'};return t(e)} +else if(r.state=='headers'){if(e.sol()&&e.match(/^\w+:/)){r.state='header';return'atom'} +else{var n=t(e);if(n)r.state='body';return n}} +else if(r.state=='header'){e.skipToEnd();r.state='headers';return'string'} +else if(r.state=='body'){if(e.sol()&&(i=e.match(/^-----END (.*)?-----\s*$/))){if(i[1]!=r.type)return'error';r.state='end';return'tag'} +else{if(e.eatWhile(/[A-Za-z0-9+\/=]/)){return null} +else{e.next();return'error'}}} +else if(r.state=='end'){return t(e)}},blankLine:function(e){if(e.state=='headers')e.state='body'},startState:function(){return{state:'top',type:null}}}});e.defineMIME('application/pgp','asciiarmor');e.defineMIME('application/pgp-encrypted','asciiarmor');e.defineMIME('application/pgp-keys','asciiarmor');e.defineMIME('application/pgp-signature','asciiarmor')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../javascript/javascript'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../javascript/javascript'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('pegjs',function(t){var n=e.getMode(t,'javascript');function i(e){return e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)};return{startState:function(){return{inString:!1,stringType:null,inComment:!1,inCharacterClass:!1,braced:0,lhs:!0,localState:null}},token:function(t,r){if(t)if(!r.inString&&!r.inComment&&((t.peek()=='"')||(t.peek()=='\''))){r.stringType=t.peek();t.next();r.inString=!0};if(!r.inString&&!r.inComment&&t.match(/^\/\*/)){r.inComment=!0};if(r.inString){while(r.inString&&!t.eol()){if(t.peek()===r.stringType){t.next();r.inString=!1} +else if(t.peek()==='\\'){t.next();t.next()} +else{t.match(/^.[^\\"']*/)}};return r.lhs?'property string':'string'} +else if(r.inComment){while(r.inComment&&!t.eol()){if(t.match(/\*\//)){r.inComment=!1} +else{t.match(/^.[^\*]*/)}};return'comment'} +else if(r.inCharacterClass){while(r.inCharacterClass&&!t.eol()){if(!(t.match(/^[^\]\\]+/)||t.match(/^\\./))){r.inCharacterClass=!1}}} +else if(t.peek()==='['){t.next();r.inCharacterClass=!0;return'bracket'} +else if(t.match(/^\/\//)){t.skipToEnd();return'comment'} +else if(r.braced||t.peek()==='{'){if(r.localState===null){r.localState=e.startState(n)};var c=n.token(t,r.localState),l=t.current();if(!c){for(var a=0;a<l.length;a++){if(l[a]==='{'){r.braced++} +else if(l[a]==='}'){r.braced--}}};return c} +else if(i(t)){if(t.peek()===':'){return'variable'};return'variable-2'} +else if(['[',']','(',')'].indexOf(t.peek())!=-1){t.next();return'bracket'} +else if(!t.eatSpace()){t.next()};return null}}},'javascript')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('solr',function(){'use strict';var t=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}"\\]/,n=/[\|\!\+\-\*\?\~\^\&]/,i=/^(OR|AND|NOT|TO)$/i;function r(e){return parseFloat(e).toString()===e};function o(t){return function(n,i){var r=!1,o;while((o=n.next())!=null){if(o==t&&!r)break;r=!r&&o=='\\'};if(!r)i.tokenize=e;return'string'}};function f(t){return function(n,i){var r='operator';if(t=='+')r+=' positive';else if(t=='-')r+=' negative';else if(t=='|')n.eat(/\|/);else if(t=='&')n.eat(/\&/);else if(t=='^')r+=' boost';i.tokenize=e;return r}};function u(n){return function(o,f){var u=n;while((n=o.peek())&&n.match(t)!=null){u+=o.next()};f.tokenize=e;if(i.test(u))return'operator';else if(r(u))return'number';else if(o.peek()==':')return'field';else return'string'}};function e(i,r){var l=i.next();if(l=='"')r.tokenize=o(l);else if(n.test(l))r.tokenize=f(l);else if(t.test(l))r.tokenize=u(l);return(r.tokenize!=e)?r.tokenize(i,r):null};return{startState:function(){return{tokenize:e}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)}}});e.defineMIME('text/x-solr','solr')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("tiki",function(e){function i(e,t,n){return function(i,u){while(!i.eol()){if(i.match(t)){u.tokenize=r;break};i.next()};if(n)u.tokenize=n;return e}};function a(e){return function(t,n){while(!t.eol()){t.next()};n.tokenize=r;return e}};function r(e,n){function t(t){n.tokenize=t;return t(e,n)};var o=e.sol(),u=e.next();switch(u){case"{":e.eat("/");e.eatSpace();e.eatWhile(/[^\s\u00a0="'\/?(}]/);n.tokenize=s;return"tag";case"_":if(e.eat("_"))return t(i("strong","__",r));break;case"'":if(e.eat("'"))return t(i("em","''",r));break;case"(":if(e.eat("("))return t(i("variable-2","))",r));break;case"[":return t(i("variable-3","]",r));break;case"|":if(e.eat("|"))return t(i("comment","||"));break;case"-":if(e.eat("=")){return t(i("header string","=-",r))} +else if(e.eat("-")){return t(i("error tw-deleted","--",r))};break;case"=":if(e.match("=="))return t(i("tw-underline","===",r));break;case":":if(e.eat(":"))return t(i("comment","::"));break;case"^":return t(i("tw-box","^"));break;case"~":if(e.match("np~"))return t(i("meta","~/np~"));break};if(o){switch(u){case"!":if(e.match("!!!!!")){return t(a("header string"))} +else if(e.match("!!!!")){return t(a("header string"))} +else if(e.match("!!!")){return t(a("header string"))} +else if(e.match("!!")){return t(a("header string"))} +else{return t(a("header string"))};break;case"*":case"#":case"+":return t(a("tw-listitem bracket"));break}};return null};var m=e.indentUnit,c,f;function s(e,t){var n=e.next(),i=e.peek();if(n=="}"){t.tokenize=r;return"tag"} +else if(n=="("||n==")"){return"bracket"} +else if(n=="="){f="equals";if(i==">"){e.next();i=e.peek()};if(!/['"]/.test(i)){t.tokenize=b()};return"operator"} +else if(/['"]/.test(n)){t.tokenize=p(n);return t.tokenize(e,t)} +else{e.eatWhile(/[^\s\u00a0="'\/?]/);return"keyword"}};function p(e){return function(t,n){while(!t.eol()){if(t.next()==e){n.tokenize=s;break}};return"string"}};function b(){return function(e,t){while(!e.eol()){var n=e.next(),r=e.peek();if(n==" "||n==","||/[ )}]/.test(r)){t.tokenize=s;break}};return"string"}};var t,u;function o(){for(var e=arguments.length-1;e>=0;e--)t.cc.push(arguments[e])};function n(){o.apply(null,arguments);return!0};function d(e,n){var r=t.context&&t.context.noIndent;t.context={prev:t.context,pluginName:e,indent:t.indented,startOfLine:n,noIndent:r}};function k(){if(t.context)t.context=t.context.prev};function h(e){if(e=="openPlugin"){t.pluginName=c;return n(l,x(t.startOfLine))} +else if(e=="closePlugin"){var i=!1;if(t.context){i=t.context.pluginName!=c;k()} +else{i=!0};if(i)u="error";return n(v(i))} +else if(e=="string"){if(!t.context||t.context.name!="!cdata")d("!cdata");if(t.tokenize==r)k();return n()} +else return n()};function x(e){return function(r){if(r=="selfclosePlugin"||r=="endPlugin")return n();if(r=="endPlugin"){d(t.pluginName,e);return n()};return n()}};function v(e){return function(t){if(e)u="error";if(t=="endPlugin")return n();return o()}};function l(e){if(e=="keyword"){u="attribute";return n(l)};if(e=="equals")return n(w,l);return o()};function w(e){if(e=="keyword"){u="string";return n()};if(e=="string")return n(g);return o()};function g(e){if(e=="string")return n(g);else return o()};return{startState:function(){return{tokenize:r,cc:[],indented:0,startOfLine:!0,pluginName:null,context:null}},token:function(e,n){if(e.sol()){n.startOfLine=!0;n.indented=e.indentation()};if(e.eatSpace())return null;u=f=c=null;var r=n.tokenize(e,n);if((r||f)&&r!="comment"){t=n;while(!0){var i=n.cc.pop()||h;if(i(f||r))break}};n.startOfLine=!1;return u||r},indent:function(e,n){var t=e.context;if(t&&t.noIndent)return 0;if(t&&/^{\//.test(n))t=t.prev;while(t&&!t.startOfLine)t=t.prev;if(t)return t.indent+m;else return 0},electricChars:"/"}});e.defineMIME("text/tiki","tiki")});(function(t){if(typeof exports=="object"&&typeof module=="object")t(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../ruby/ruby"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror","../htmlmixed/htmlmixed","../ruby/ruby"],t);else t(CodeMirror)})(function(t){"use strict";t.defineMode("slim",function(e){var s=t.getMode(e,{name:"htmlmixed"});var u=t.getMode(e,"ruby"),f={html:s,ruby:u};var h={ruby:"ruby",javascript:"javascript",css:"text/css",sass:"text/x-sass",scss:"text/x-scss",less:"text/x-less",styl:"text/x-styl",coffee:"coffeescript",asciidoc:"text/x-asciidoc",markdown:"text/x-markdown",textile:"text/x-textile",creole:"text/x-creole",wiki:"text/x-wiki",mediawiki:"text/x-mediawiki",rdoc:"text/x-rdoc",builder:"text/x-builder",nokogiri:"text/x-nokogiri",erb:"application/x-erb"};var U=function(t){var e=[];for(var n in t)e.push(n);return new RegExp("^("+e.join("|")+"):")}(h),x={"commentLine":"comment","slimSwitch":"operator special","slimTag":"tag","slimId":"attribute def","slimClass":"attribute qualifier","slimAttribute":"attribute","slimSubmode":"keyword special","closeAttributeTag":null,"slimDoctype":null,"lineContinuation":null};var T={"{":"}","[":"]","(":")"};var c="_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",l=c+"\\-0-9\xB7\u0300-\u036F\u203F-\u2040",C=new RegExp("^[:"+c+"](?::["+l+"]|["+l+"]*)"),D=new RegExp("^[:"+c+"][:\\."+l+"]*(?=\\s*=)"),E=new RegExp("^[:"+c+"][:\\."+l+"]*"),A=/^\.-?[_a-zA-Z]+[\w\-]*/,L=/^#[_a-zA-Z]+[\w\-]*/;function O(t,e,n){var i=function(i,r){r.tokenize=e;if(i.pos<t){i.pos=t;return n};return r.tokenize(i,r)};return function(t,n){n.tokenize=i;return e(t,n)}};function R(t,e,n,r,i){var u=t.current(),o=u.search(n);if(o>-1){e.tokenize=O(t.pos,e.tokenize,i);t.backUp(u.length-o-r)};return i};function k(t,e){t.stack={parent:t.stack,style:"continuation",indented:e,tokenize:t.line};t.line=t.tokenize};function d(t){if(t.line==t.tokenize){t.line=t.stack.tokenize;t.stack=t.stack.parent}};function j(t,e){return function(n,i){d(i);if(n.match(/^\\$/)){k(i,t);return"lineContinuation"};var r=e(n,i);if(n.eol()&&n.current().match(/(?:^|[^\\])(?:\\\\)*\\$/)){n.backUp(1)};return r}};function I(t,e){return function(n,i){d(i);var r=e(n,i);if(n.eol()&&n.current().match(/,$/)){k(i,t)};return r}};function m(t,e){return function(n,i){var r=n.peek();if(r==t&&i.rubyState.tokenize.length==1){n.next();i.tokenize=e;return"closeAttributeTag"} +else{return o(n,i)}}};function n(e){var n,i=function(t,i){if(i.rubyState.tokenize.length==1&&!i.rubyState.context.prev){t.backUp(1);if(t.eatSpace()){i.rubyState=n;i.tokenize=e;return e(t,i)};t.next()};return o(t,i)};return function(e,r){n=r.rubyState;r.rubyState=t.startState(u);r.tokenize=i;return o(e,r)}};function o(t,e){return u.token(t,e.rubyState)};function P(t,e){if(t.match(/^\\$/)){return"lineContinuation"};return y(t,e)};function y(t,e){if(t.match(/^#\{/)){e.tokenize=m("}",e.tokenize);return null};return R(t,e,/[^\\]#\{/,1,s.token(t,e.htmlState))};function q(t){return function(e,n){var i=P(e,n);if(e.eol())n.tokenize=t;return i}};function S(t,e,n){e.stack={parent:e.stack,style:"html",indented:t.column()+n,tokenize:e.line};e.line=e.tokenize=y;return null};function v(t,e){t.skipToEnd();return e.stack.style};function Z(t,e){e.stack={parent:e.stack,style:"comment",indented:e.indented+1,tokenize:e.line};e.line=v;return v(t,e)};function r(t,e){if(t.eat(e.stack.endQuote)){e.line=e.stack.line;e.tokenize=e.stack.tokenize;e.stack=e.stack.parent;return null};if(t.match(E)){e.tokenize=Q;return"slimAttribute"};t.next();return null};function Q(t,e){if(t.match(/^==?/)){e.tokenize=V;return null};return r(t,e)};function V(t,e){var i=t.peek();if(i=="\""||i=="'"){e.tokenize=g(i,"string",!0,!1,r);t.next();return e.tokenize(t,e)};if(i=="["){return n(r)(t,e)};if(t.match(/^(true|false|nil)\b/)){e.tokenize=r;return"keyword"};return n(r)(t,e)};function B(t,e,n){t.stack={parent:t.stack,style:"wrapper",indented:t.indented+1,tokenize:n,line:t.line,endQuote:e};t.line=t.tokenize=r;return null};function tt(e,n){if(e.match(/^#\{/)){n.tokenize=m("}",n.tokenize);return null};var i=new t.StringStream(e.string.slice(n.stack.indented),e.tabSize);i.pos=e.pos-n.stack.indented;i.start=e.start-n.stack.indented;i.lastColumnPos=e.lastColumnPos-n.stack.indented;i.lastColumnValue=e.lastColumnValue-n.stack.indented;var r=n.subMode.token(i,n.subState);e.pos=i.pos+n.stack.indented;return r};function et(t,e){e.stack.indented=t.column();e.line=e.tokenize=tt;return e.tokenize(t,e)};function nt(n){var i=h[n],u=t.mimeModes[i];if(u){return t.getMode(e,u)};var r=t.modes[i];if(r){return r(e,{name:i})};return t.getMode(e,"null")};function it(t){if(!f.hasOwnProperty(t)){return f[t]=nt(t)};return f[t]};function rt(e,n){var i=it(e),r=t.startState(i);n.subMode=i;n.subState=r;n.stack={parent:n.stack,style:"sub",indented:n.indented+1,tokenize:n.line};n.line=n.tokenize=et;return"slimSubmode"};function ut(t,e){t.skipToEnd();return"slimDoctype"};function ot(t,e){var i=t.peek();if(i=="<"){return(e.tokenize=q(e.tokenize))(t,e)};if(t.match(/^[|']/)){return S(t,e,1)};if(t.match(/^\/(!|\[\w+])?/)){return Z(t,e)};if(t.match(/^(-|==?[<>]?)/)){e.tokenize=j(t.column(),I(t.column(),o));return"slimSwitch"};if(t.match(/^doctype\b/)){e.tokenize=ut;return"keyword"};var n=t.match(U);if(n){return rt(n[1],e)};return z(t,e)};function b(t,e){if(e.startOfLine){return ot(t,e)};return z(t,e)};function z(t,e){if(t.eat("*")){e.tokenize=n(w);return null};if(t.match(C)){e.tokenize=w;return"slimTag"};return a(t,e)};function w(t,e){if(t.match(/^(<>?|><?)/)){e.tokenize=a;return null};return a(t,e)};function a(t,e){if(t.match(L)){e.tokenize=a;return"slimId"};if(t.match(A)){e.tokenize=a;return"slimClass"};return i(t,e)};function i(t,e){if(t.match(/^([\[\{\(])/)){return B(e,T[RegExp.$1],i)};if(t.match(D)){e.tokenize=at;return"slimAttribute"};if(t.peek()=="*"){t.next();e.tokenize=n(F);return null};return F(t,e)};function at(t,e){if(t.match(/^==?/)){e.tokenize=ct;return null};return i(t,e)};function ct(t,e){var r=t.peek();if(r=="\""||r=="'"){e.tokenize=g(r,"string",!0,!1,i);t.next();return e.tokenize(t,e)};if(r=="["){return n(i)(t,e)};if(r==":"){return n(M)(t,e)};if(t.match(/^(true|false|nil)\b/)){e.tokenize=i;return"keyword"};return n(i)(t,e)};function M(t,e){t.backUp(1);if(t.match(/^[^\s],(?=:)/)){e.tokenize=n(M);return null};t.next();return i(t,e)};function g(t,e,n,i,r){return function(u,o){d(o);var l=u.current().length==0;if(u.match(/^\\$/,l)){if(!l)return e;k(o,o.indented);return"lineContinuation"};if(u.match(/^#\{/,l)){if(!l)return e;o.tokenize=m("}",o.tokenize);return null};var a=!1,c;while((c=u.next())!=null){if(c==t&&(i||!a)){o.tokenize=r;break};if(n&&c=="#"&&!a){if(u.eat("{")){u.backUp(2);break}};a=!a&&c=="\\"};if(u.eol()&&a){u.backUp(1)};return e}};function F(t,e){if(t.match(/^==?/)){e.tokenize=o;return"slimSwitch"};if(t.match(/^\/$/)){e.tokenize=b;return null};if(t.match(/^:/)){e.tokenize=z;return"slimSwitch"};S(t,e,0);return e.tokenize(t,e)};var p={startState:function(){var e=t.startState(s),n=t.startState(u);return{htmlState:e,rubyState:n,stack:null,last:null,tokenize:b,line:b,indented:0}},copyState:function(e){return{htmlState:t.copyState(s,e.htmlState),rubyState:t.copyState(u,e.rubyState),subMode:e.subMode,subState:e.subMode&&t.copyState(e.subMode,e.subState),stack:e.stack,last:e.last,tokenize:e.tokenize,line:e.line}},token:function(e,t){if(e.sol()){t.indented=e.indentation();t.startOfLine=!0;t.tokenize=t.line;while(t.stack&&t.stack.indented>t.indented&&t.last!="slimSubmode"){t.line=t.tokenize=t.stack.tokenize;t.stack=t.stack.parent;t.subMode=null;t.subState=null}};if(e.eatSpace())return null;var n=t.tokenize(e,t);t.startOfLine=!1;if(n)t.last=n;return x.hasOwnProperty(n)?x[n]:n},blankLine:function(t){if(t.subMode&&t.subMode.blankLine){return t.subMode.blankLine(t.subState)}},innerMode:function(t){if(t.subMode)return{state:t.subState,mode:t.subMode};return{state:t,mode:p}}};return p},"htmlmixed","ruby");t.defineMIME("text/x-slim","slim");t.defineMIME("application/x-slim","slim")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('puppet',function(){var i={};var t=/({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;function e(e,n){var r=n.split(' ');for(var t=0;t<r.length;t++){i[r[t]]=e}};e('keyword','class define site node include import inherits');e('keyword','case if else in and elsif default or');e('atom','false true running present absent file directory undef');e('builtin','action augeas burst chain computer cron destination dport exec file filebucket group host icmp iniface interface jump k5login limit log_level log_prefix macauthorization mailalias maillist mcx mount nagios_command nagios_contact nagios_contactgroup nagios_host nagios_hostdependency nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo nagios_servicegroup nagios_timeperiod name notify outiface package proto reject resources router schedule scheduled_task selboolean selmodule service source sport ssh_authorized_key sshkey stage state table tidy todest toports tosource user vlan yumrepo zfs zone zpool');function n(e,i){var n,t,r=!1;while(!e.eol()&&(n=e.next())!=i.pending){if(n==='$'&&t!='\\'&&i.pending=='"'){r=!0;break};t=n};if(r){e.backUp(1)};if(n==i.pending){i.continueString=!1} +else{i.continueString=!0};return'string'};function r(e,r){var a=e.match(/[\w]+/,!1),s=e.match(/(\s+)?\w+\s+=>.*/,!1),c=e.match(/(\s+)?[\w:_]+(\s+)?{/,!1),u=e.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/,!1),o=e.next();if(o==='$'){if(e.match(t)){return r.continueString?'variable-2':'variable'};return'error'};if(r.continueString){e.backUp(1);return n(e,r)};if(r.inDefinition){if(e.match(/(\s+)?[\w:_]+(\s+)?/)){return'def'};e.match(/\s+{/);r.inDefinition=!1};if(r.inInclude){e.match(/(\s+)?\S+(\s+)?/);r.inInclude=!1;return'def'};if(e.match(/(\s+)?\w+\(/)){e.backUp(1);return'def'};if(s){e.match(/(\s+)?\w+/);return'tag'};if(a&&i.hasOwnProperty(a)){e.backUp(1);e.match(/[\w]+/);if(e.match(/\s+\S+\s+{/,!1)){r.inDefinition=!0};if(a=='include'){r.inInclude=!0};return i[a]};if(/(^|\s+)[A-Z][\w:_]+/.test(a)){e.backUp(1);e.match(/(^|\s+)[A-Z][\w:_]+/);return'def'};if(c){e.match(/(\s+)?[\w:_]+/);return'def'};if(u){e.match(/(\s+)?[@]{1,2}/);return'special'};if(o=='#'){e.skipToEnd();return'comment'};if(o=='\''||o=='"'){r.pending=o;return n(e,r)};if(o=='{'||o=='}'){return'bracket'};if(o=='/'){e.match(/.*?\//);return'variable-3'};if(o.match(/[0-9]/)){e.eatWhile(/[0-9]+/);return'number'};if(o=='='){if(e.peek()=='>'){e.next()};return'operator'};e.eatWhile(/[\w-]/);return null};return{startState:function(){var e={};e.inDefinition=!1;e.inInclude=!1;e.continueString=!1;e.pending=!1;return e},token:function(e,i){if(e.eatSpace())return null;return r(e,i)}}});e.defineMIME('text/x-puppet','puppet')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.modeInfo=[{name:'APL',mime:'text/apl',mode:'apl',ext:['dyalog','apl']},{name:'PGP',mimes:['application/pgp','application/pgp-encrypted','application/pgp-keys','application/pgp-signature'],mode:'asciiarmor',ext:['asc','pgp','sig']},{name:'ASN.1',mime:'text/x-ttcn-asn',mode:'asn.1',ext:['asn','asn1']},{name:'Asterisk',mime:'text/x-asterisk',mode:'asterisk',file:/^extensions\.conf$/i},{name:'Brainfuck',mime:'text/x-brainfuck',mode:'brainfuck',ext:['b','bf']},{name:'C',mime:'text/x-csrc',mode:'clike',ext:['c','h']},{name:'C++',mime:'text/x-c++src',mode:'clike',ext:['cpp','c++','cc','cxx','hpp','h++','hh','hxx'],alias:['cpp']},{name:'Cobol',mime:'text/x-cobol',mode:'cobol',ext:['cob','cpy']},{name:'C#',mime:'text/x-csharp',mode:'clike',ext:['cs'],alias:['csharp']},{name:'Clojure',mime:'text/x-clojure',mode:'clojure',ext:['clj','cljc','cljx']},{name:'ClojureScript',mime:'text/x-clojurescript',mode:'clojure',ext:['cljs']},{name:'Closure Stylesheets (GSS)',mime:'text/x-gss',mode:'css',ext:['gss']},{name:'CMake',mime:'text/x-cmake',mode:'cmake',ext:['cmake','cmake.in'],file:/^CMakeLists.txt$/},{name:'CoffeeScript',mimes:['application/vnd.coffeescript','text/coffeescript','text/x-coffeescript'],mode:'coffeescript',ext:['coffee'],alias:['coffee','coffee-script']},{name:'Common Lisp',mime:'text/x-common-lisp',mode:'commonlisp',ext:['cl','lisp','el'],alias:['lisp']},{name:'Cypher',mime:'application/x-cypher-query',mode:'cypher',ext:['cyp','cypher']},{name:'Cython',mime:'text/x-cython',mode:'python',ext:['pyx','pxd','pxi']},{name:'Crystal',mime:'text/x-crystal',mode:'crystal',ext:['cr']},{name:'CSS',mime:'text/css',mode:'css',ext:['css']},{name:'CQL',mime:'text/x-cassandra',mode:'sql',ext:['cql']},{name:'D',mime:'text/x-d',mode:'d',ext:['d']},{name:'Dart',mimes:['application/dart','text/x-dart'],mode:'dart',ext:['dart']},{name:'diff',mime:'text/x-diff',mode:'diff',ext:['diff','patch']},{name:'Django',mime:'text/x-django',mode:'django'},{name:'Dockerfile',mime:'text/x-dockerfile',mode:'dockerfile',file:/^Dockerfile$/},{name:'DTD',mime:'application/xml-dtd',mode:'dtd',ext:['dtd']},{name:'Dylan',mime:'text/x-dylan',mode:'dylan',ext:['dylan','dyl','intr']},{name:'EBNF',mime:'text/x-ebnf',mode:'ebnf'},{name:'ECL',mime:'text/x-ecl',mode:'ecl',ext:['ecl']},{name:'edn',mime:'application/edn',mode:'clojure',ext:['edn']},{name:'Eiffel',mime:'text/x-eiffel',mode:'eiffel',ext:['e']},{name:'Elm',mime:'text/x-elm',mode:'elm',ext:['elm']},{name:'Embedded Javascript',mime:'application/x-ejs',mode:'htmlembedded',ext:['ejs']},{name:'Embedded Ruby',mime:'application/x-erb',mode:'htmlembedded',ext:['erb']},{name:'Erlang',mime:'text/x-erlang',mode:'erlang',ext:['erl']},{name:'Esper',mime:'text/x-esper',mode:'sql'},{name:'Factor',mime:'text/x-factor',mode:'factor',ext:['factor']},{name:'FCL',mime:'text/x-fcl',mode:'fcl'},{name:'Forth',mime:'text/x-forth',mode:'forth',ext:['forth','fth','4th']},{name:'Fortran',mime:'text/x-fortran',mode:'fortran',ext:['f','for','f77','f90']},{name:'F#',mime:'text/x-fsharp',mode:'mllike',ext:['fs'],alias:['fsharp']},{name:'Gas',mime:'text/x-gas',mode:'gas',ext:['s']},{name:'Gherkin',mime:'text/x-feature',mode:'gherkin',ext:['feature']},{name:'GitHub Flavored Markdown',mime:'text/x-gfm',mode:'gfm',file:/^(readme|contributing|history).md$/i},{name:'Go',mime:'text/x-go',mode:'go',ext:['go']},{name:'Groovy',mime:'text/x-groovy',mode:'groovy',ext:['groovy','gradle'],file:/^Jenkinsfile$/},{name:'HAML',mime:'text/x-haml',mode:'haml',ext:['haml']},{name:'Haskell',mime:'text/x-haskell',mode:'haskell',ext:['hs']},{name:'Haskell (Literate)',mime:'text/x-literate-haskell',mode:'haskell-literate',ext:['lhs']},{name:'Haxe',mime:'text/x-haxe',mode:'haxe',ext:['hx']},{name:'HXML',mime:'text/x-hxml',mode:'haxe',ext:['hxml']},{name:'ASP.NET',mime:'application/x-aspx',mode:'htmlembedded',ext:['aspx'],alias:['asp','aspx']},{name:'HTML',mime:'text/html',mode:'htmlmixed',ext:['html','htm'],alias:['xhtml']},{name:'HTTP',mime:'message/http',mode:'http'},{name:'IDL',mime:'text/x-idl',mode:'idl',ext:['pro']},{name:'Pug',mime:'text/x-pug',mode:'pug',ext:['jade','pug'],alias:['jade']},{name:'Java',mime:'text/x-java',mode:'clike',ext:['java']},{name:'Java Server Pages',mime:'application/x-jsp',mode:'htmlembedded',ext:['jsp'],alias:['jsp']},{name:'JavaScript',mimes:['text/javascript','text/ecmascript','application/javascript','application/x-javascript','application/ecmascript'],mode:'javascript',ext:['js'],alias:['ecmascript','js','node']},{name:'JSON',mimes:['application/json','application/x-json'],mode:'javascript',ext:['json','map'],alias:['json5']},{name:'JSON-LD',mime:'application/ld+json',mode:'javascript',ext:['jsonld'],alias:['jsonld']},{name:'JSX',mime:'text/jsx',mode:'jsx',ext:['jsx']},{name:'Jinja2',mime:'null',mode:'jinja2'},{name:'Julia',mime:'text/x-julia',mode:'julia',ext:['jl']},{name:'Kotlin',mime:'text/x-kotlin',mode:'clike',ext:['kt']},{name:'LESS',mime:'text/x-less',mode:'css',ext:['less']},{name:'LiveScript',mime:'text/x-livescript',mode:'livescript',ext:['ls'],alias:['ls']},{name:'Lua',mime:'text/x-lua',mode:'lua',ext:['lua']},{name:'Markdown',mime:'text/x-markdown',mode:'markdown',ext:['markdown','md','mkd']},{name:'mIRC',mime:'text/mirc',mode:'mirc'},{name:'MariaDB SQL',mime:'text/x-mariadb',mode:'sql'},{name:'Mathematica',mime:'text/x-mathematica',mode:'mathematica',ext:['m','nb']},{name:'Modelica',mime:'text/x-modelica',mode:'modelica',ext:['mo']},{name:'MUMPS',mime:'text/x-mumps',mode:'mumps',ext:['mps']},{name:'MS SQL',mime:'text/x-mssql',mode:'sql'},{name:'mbox',mime:'application/mbox',mode:'mbox',ext:['mbox']},{name:'MySQL',mime:'text/x-mysql',mode:'sql'},{name:'Nginx',mime:'text/x-nginx-conf',mode:'nginx',file:/nginx.*\.conf$/i},{name:'NSIS',mime:'text/x-nsis',mode:'nsis',ext:['nsh','nsi']},{name:'NTriples',mimes:['application/n-triples','application/n-quads','text/n-triples'],mode:'ntriples',ext:['nt','nq']},{name:'Objective C',mime:'text/x-objectivec',mode:'clike',ext:['m','mm'],alias:['objective-c','objc']},{name:'OCaml',mime:'text/x-ocaml',mode:'mllike',ext:['ml','mli','mll','mly']},{name:'Octave',mime:'text/x-octave',mode:'octave',ext:['m']},{name:'Oz',mime:'text/x-oz',mode:'oz',ext:['oz']},{name:'Pascal',mime:'text/x-pascal',mode:'pascal',ext:['p','pas']},{name:'PEG.js',mime:'null',mode:'pegjs',ext:['jsonld']},{name:'Perl',mime:'text/x-perl',mode:'perl',ext:['pl','pm']},{name:'PHP',mime:['application/x-httpd-php','text/x-php'],mode:'php',ext:['php','php3','php4','php5','php7','phtml']},{name:'Pig',mime:'text/x-pig',mode:'pig',ext:['pig']},{name:'Plain Text',mime:'text/plain',mode:'null',ext:['txt','text','conf','def','list','log']},{name:'PLSQL',mime:'text/x-plsql',mode:'sql',ext:['pls']},{name:'PowerShell',mime:'application/x-powershell',mode:'powershell',ext:['ps1','psd1','psm1']},{name:'Properties files',mime:'text/x-properties',mode:'properties',ext:['properties','ini','in'],alias:['ini','properties']},{name:'ProtoBuf',mime:'text/x-protobuf',mode:'protobuf',ext:['proto']},{name:'Python',mime:'text/x-python',mode:'python',ext:['BUILD','bzl','py','pyw'],file:/^(BUCK|BUILD)$/},{name:'Puppet',mime:'text/x-puppet',mode:'puppet',ext:['pp']},{name:'Q',mime:'text/x-q',mode:'q',ext:['q']},{name:'R',mime:'text/x-rsrc',mode:'r',ext:['r','R'],alias:['rscript']},{name:'reStructuredText',mime:'text/x-rst',mode:'rst',ext:['rst'],alias:['rst']},{name:'RPM Changes',mime:'text/x-rpm-changes',mode:'rpm'},{name:'RPM Spec',mime:'text/x-rpm-spec',mode:'rpm',ext:['spec']},{name:'Ruby',mime:'text/x-ruby',mode:'ruby',ext:['rb'],alias:['jruby','macruby','rake','rb','rbx']},{name:'Rust',mime:'text/x-rustsrc',mode:'rust',ext:['rs']},{name:'SAS',mime:'text/x-sas',mode:'sas',ext:['sas']},{name:'Sass',mime:'text/x-sass',mode:'sass',ext:['sass']},{name:'Scala',mime:'text/x-scala',mode:'clike',ext:['scala']},{name:'Scheme',mime:'text/x-scheme',mode:'scheme',ext:['scm','ss']},{name:'SCSS',mime:'text/x-scss',mode:'css',ext:['scss']},{name:'Shell',mimes:['text/x-sh','application/x-sh'],mode:'shell',ext:['sh','ksh','bash'],alias:['bash','sh','zsh'],file:/^PKGBUILD$/},{name:'Sieve',mime:'application/sieve',mode:'sieve',ext:['siv','sieve']},{name:'Slim',mimes:['text/x-slim','application/x-slim'],mode:'slim',ext:['slim']},{name:'Smalltalk',mime:'text/x-stsrc',mode:'smalltalk',ext:['st']},{name:'Smarty',mime:'text/x-smarty',mode:'smarty',ext:['tpl']},{name:'Solr',mime:'text/x-solr',mode:'solr'},{name:'Soy',mime:'text/x-soy',mode:'soy',ext:['soy'],alias:['closure template']},{name:'SPARQL',mime:'application/sparql-query',mode:'sparql',ext:['rq','sparql'],alias:['sparul']},{name:'Spreadsheet',mime:'text/x-spreadsheet',mode:'spreadsheet',alias:['excel','formula']},{name:'SQL',mime:'text/x-sql',mode:'sql',ext:['sql']},{name:'SQLite',mime:'text/x-sqlite',mode:'sql'},{name:'Squirrel',mime:'text/x-squirrel',mode:'clike',ext:['nut']},{name:'Stylus',mime:'text/x-styl',mode:'stylus',ext:['styl']},{name:'Swift',mime:'text/x-swift',mode:'swift',ext:['swift']},{name:'sTeX',mime:'text/x-stex',mode:'stex'},{name:'LaTeX',mime:'text/x-latex',mode:'stex',ext:['text','ltx'],alias:['tex']},{name:'SystemVerilog',mime:'text/x-systemverilog',mode:'verilog',ext:['v','sv','svh']},{name:'Tcl',mime:'text/x-tcl',mode:'tcl',ext:['tcl']},{name:'Textile',mime:'text/x-textile',mode:'textile',ext:['textile']},{name:'TiddlyWiki ',mime:'text/x-tiddlywiki',mode:'tiddlywiki'},{name:'Tiki wiki',mime:'text/tiki',mode:'tiki'},{name:'TOML',mime:'text/x-toml',mode:'toml',ext:['toml']},{name:'Tornado',mime:'text/x-tornado',mode:'tornado'},{name:'troff',mime:'text/troff',mode:'troff',ext:['1','2','3','4','5','6','7','8','9']},{name:'TTCN',mime:'text/x-ttcn',mode:'ttcn',ext:['ttcn','ttcn3','ttcnpp']},{name:'TTCN_CFG',mime:'text/x-ttcn-cfg',mode:'ttcn-cfg',ext:['cfg']},{name:'Turtle',mime:'text/turtle',mode:'turtle',ext:['ttl']},{name:'TypeScript',mime:'application/typescript',mode:'javascript',ext:['ts'],alias:['ts']},{name:'TypeScript-JSX',mime:'text/typescript-jsx',mode:'jsx',ext:['tsx'],alias:['tsx']},{name:'Twig',mime:'text/x-twig',mode:'twig'},{name:'Web IDL',mime:'text/x-webidl',mode:'webidl',ext:['webidl']},{name:'VB.NET',mime:'text/x-vb',mode:'vb',ext:['vb']},{name:'VBScript',mime:'text/vbscript',mode:'vbscript',ext:['vbs']},{name:'Velocity',mime:'text/velocity',mode:'velocity',ext:['vtl']},{name:'Verilog',mime:'text/x-verilog',mode:'verilog',ext:['v']},{name:'VHDL',mime:'text/x-vhdl',mode:'vhdl',ext:['vhd','vhdl']},{name:'Vue.js Component',mimes:['script/x-vue','text/x-vue'],mode:'vue',ext:['vue']},{name:'XML',mimes:['application/xml','text/xml'],mode:'xml',ext:['xml','xsl','xsd','svg'],alias:['rss','wsdl','xsd']},{name:'XQuery',mime:'application/xquery',mode:'xquery',ext:['xy','xquery']},{name:'Yacas',mime:'text/x-yacas',mode:'yacas',ext:['ys']},{name:'YAML',mimes:['text/x-yaml','text/yaml'],mode:'yaml',ext:['yaml','yml'],alias:['yml']},{name:'Z80',mime:'text/x-z80',mode:'z80',ext:['z80']},{name:'mscgen',mime:'text/x-mscgen',mode:'mscgen',ext:['mscgen','mscin','msc']},{name:'xu',mime:'text/x-xu',mode:'mscgen',ext:['xu']},{name:'msgenny',mime:'text/x-msgenny',mode:'mscgen',ext:['msgenny']}];for(var t=0;t<e.modeInfo.length;t++){var m=e.modeInfo[t];if(m.mimes)m.mime=m.mimes[0]};e.findModeByMIME=function(m){m=m.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var t=e.modeInfo[i];if(t.mime==m)return t;if(t.mimes)for(var a=0;a<t.mimes.length;a++)if(t.mimes[a]==m)return t};if(/\+xml$/.test(m))return e.findModeByMIME('application/xml');if(/\+json$/.test(m))return e.findModeByMIME('application/json')};e.findModeByExtension=function(m){for(var i=0;i<e.modeInfo.length;i++){var t=e.modeInfo[i];if(t.ext)for(var a=0;a<t.ext.length;a++)if(t.ext[a]==m)return t}};e.findModeByFileName=function(m){for(var a=0;a<e.modeInfo.length;a++){var t=e.modeInfo[a];if(t.file&&t.file.test(m))return t};var i=m.lastIndexOf('.'),x=i>-1&&m.substring(i+1,m.length);if(x)return e.findModeByExtension(x)};e.findModeByName=function(m){m=m.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var t=e.modeInfo[i];if(t.name.toLowerCase()==m)return t;if(t.alias)for(var a=0;a<t.alias.length;a++)if(t.alias[a].toLowerCase()==m)return t}}});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('go',function(t){var a=t.indentUnit,s={'break':!0,'case':!0,'chan':!0,'const':!0,'continue':!0,'default':!0,'defer':!0,'else':!0,'fallthrough':!0,'for':!0,'func':!0,'go':!0,'goto':!0,'if':!0,'import':!0,'interface':!0,'map':!0,'package':!0,'range':!0,'return':!0,'select':!0,'struct':!0,'switch':!0,'type':!0,'var':!0,'bool':!0,'byte':!0,'complex64':!0,'complex128':!0,'float32':!0,'float64':!0,'int8':!0,'int16':!0,'int32':!0,'int64':!0,'string':!0,'uint8':!0,'uint16':!0,'uint32':!0,'uint64':!0,'int':!0,'uint':!0,'uintptr':!0,'error':!0,'rune':!0};var u={'true':!0,'false':!0,'iota':!0,'nil':!0,'append':!0,'cap':!0,'close':!0,'complex':!0,'copy':!0,'delete':!0,'imag':!0,'len':!0,'make':!0,'new':!0,'panic':!0,'print':!0,'println':!0,'real':!0,'recover':!0};var o=/[+\-*&^%:=<>!|\/]/,n;function i(e,t){var i=e.next();if(i=='"'||i=='\''||i=='`'){t.tokenize=d(i);return t.tokenize(e,t)};if(/[\d\.]/.test(i)){if(i=='.'){e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/)} +else if(i=='0'){e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/)} +else{e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/)};return'number'};if(/[\[\]{}\(\),;\:\.]/.test(i)){n=i;return null};if(i=='/'){if(e.eat('*')){t.tokenize=c;return c(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(o.test(i)){e.eatWhile(o);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var r=e.current();if(s.propertyIsEnumerable(r)){if(r=='case'||r=='default')n='case';return'keyword'};if(u.propertyIsEnumerable(r))return'atom';return'variable'};function d(e){return function(t,n){var r=!1,o,a=!1;while((o=t.next())!=null){if(o==e&&!r){a=!0;break};r=!r&&e!='`'&&o=='\\'};if(a||!(r||e=='`'))n.tokenize=i;return'string'}};function c(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=i;break};r=(n=='*')};return'comment'};function f(e,t,n,i,r){this.indented=e;this.column=t;this.type=n;this.align=i;this.prev=r};function r(e,t,n){return e.context=new f(e.indented,t,n,null,e.context)};function l(e){if(!e.context.prev)return;var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new f((e||0)-a,0,'top',!1),indented:0,startOfLine:!0}},token:function(e,t){var o=t.context;if(e.sol()){if(o.align==null)o.align=!1;t.indented=e.indentation();t.startOfLine=!0;if(o.type=='case')o.type='}'};if(e.eatSpace())return null;n=null;var a=(t.tokenize||i)(e,t);if(a=='comment')return a;if(o.align==null)o.align=!0;if(n=='{')r(t,e.column(),'}');else if(n=='[')r(t,e.column(),']');else if(n=='(')r(t,e.column(),')');else if(n=='case')o.type='case';else if(n=='}'&&o.type=='}')l(t);else if(n==o.type)l(t);t.startOfLine=!1;return a},indent:function(t,n){if(t.tokenize!=i&&t.tokenize!=null)return e.Pass;var r=t.context,c=n&&n.charAt(0);if(r.type=='case'&&/^(?:case|default)\b/.test(n)){t.context.type='}';return r.indented};var o=c==r.type;if(r.align)return r.column+(o?0:1);else return r.indented+(o?0:a)},electricChars:'{}):',closeBrackets:'()[]{}\'\'""``',fold:'brace',blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:'//'}});e.defineMIME('text/x-go','go')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('commonlisp',function(t){var o=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,i=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,l=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,u=/[^\s'`,@()\[\]";]/,e;function n(e){var t;while(t=e.next()){if(t=='\\')e.next();else if(!u.test(t)){e.backUp(1);break}};return e.current()};function r(t,u){if(t.eatSpace()){e='ws';return null};if(t.match(l))return'number';var r=t.next();if(r=='\\')r=t.next();if(r=='"')return(u.tokenize=c)(t,u);else if(r=='('){e='open';return'bracket'} +else if(r==')'||r==']'){e='close';return'bracket'} +else if(r==';'){t.skipToEnd();e='ws';return'comment'} +else if(/['`,@]/.test(r))return null;else if(r=='|'){if(t.skipTo('|')){t.next();return'symbol'} +else{t.skipToEnd();return'error'}} +else if(r=='#'){var r=t.next();if(r=='('){e='open';return'bracket'} +else if(/[+\-=\.']/.test(r))return null;else if(/\d/.test(r)&&t.match(/^\d*#/))return null;else if(r=='|')return(u.tokenize=s)(t,u);else if(r==':'){n(t);return'meta'} +else if(r=='\\'){t.next();n(t);return'string-2'} +else return'error'} +else{var f=n(t);if(f=='.')return null;e='symbol';if(f=='nil'||f=='t'||f.charAt(0)==':')return'atom';if(u.lastType=='open'&&(o.test(f)||i.test(f)))return'keyword';if(f.charAt(0)=='&')return'variable-2';return'variable'}};function c(e,t){var n=!1,i;while(i=e.next()){if(i=='"'&&!n){t.tokenize=r;break};n=!n&&i=='\\'};return'string'};function s(t,n){var i,o;while(i=t.next()){if(i=='#'&&o=='|'){n.tokenize=r;break};o=i};e='ws';return'comment'};return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:r}},token:function(r,n){if(r.sol()&&typeof n.ctx.indentTo!='number')n.ctx.indentTo=n.ctx.start+1;e=null;var o=n.tokenize(r,n);if(e!='ws'){if(n.ctx.indentTo==null){if(e=='symbol'&&i.test(r.current()))n.ctx.indentTo=n.ctx.start+t.indentUnit;else n.ctx.indentTo='next'} +else if(n.ctx.indentTo=='next'){n.ctx.indentTo=r.column()};n.lastType=e};if(e=='open')n.ctx={prev:n.ctx,start:r.column(),indentTo:null};else if(e=='close')n.ctx=n.ctx.prev||n.ctx;return o},indent:function(e,t){var n=e.ctx.indentTo;return typeof n=='number'?n:e.ctx.start+1},closeBrackets:{pairs:'()[]{}""'},lineComment:';;',blockCommentStart:'#|',blockCommentEnd:'|#'}});e.defineMIME('text/x-common-lisp','commonlisp')});(function(e){'use strict';if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(window.CodeMirror)})(function(e){'use strict';e.defineMode('powershell',function(){function t(e,t){t=t||{};var n=t.prefix!==undefined?t.prefix:'^',i=t.suffix!==undefined?t.suffix:'\\b';for(var r=0;r<e.length;r++){if(e[r]instanceof RegExp){e[r]=e[r].source} +else{e[r]=e[r].replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&')}};return new RegExp(n+'('+e.join('|')+')'+i,'i')};var a='(?=[^A-Za-z\\d\\-_]|$)',n=/[\w\-:]/,k=t([/begin|break|catch|continue|data|default|do|dynamicparam/,/else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/,/param|process|return|switch|throw|trap|try|until|where|while/],{suffix:a});var C=/[\[\]{},;`\.]|@[({]/,h=t(['f',/b?not/,/[ic]?split/,'join',/is(not)?/,'as',/[ic]?(eq|ne|[gl][te])/,/[ic]?(not)?(like|match|contains)/,/[ic]?replace/,/b?(and|or|xor)/],{prefix:'-'});var b=/[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/,g=t([h,b],{suffix:''});var S=/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,d=/^[A-Za-z\_][A-Za-z\-\_\d]*\b/,P=/[A-Z]:|%|\?/i,v=t([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,new RegExp('Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)'),/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,new RegExp('New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)'),/Out-(Default|File|GridView|Host|Null|Printer|String)/,/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,new RegExp('Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)'),/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:'',suffix:''});var f=t([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:'\\$',suffix:''});var m=t([P,v,f],{suffix:a});var o={keyword:k,number:S,operator:g,builtin:m,punctuation:C,identifier:d};function e(e,t){var u=t.returnStack[t.returnStack.length-1];if(u&&u.shouldReturnFrom(t)){t.tokenize=u.tokenize;t.returnStack.pop();return t.tokenize(e,t)};if(e.eatSpace()){return null};if(e.eat('(')){t.bracketNesting+=1;return'punctuation'};if(e.eat(')')){t.bracketNesting-=1;return'punctuation'};for(var p in o){if(e.match(o[p])){return p}};var a=e.next();if(a==='\''){return x(e,t)};if(a==='$'){return i(e,t)};if(a==='"'){return s(e,t)};if(a==='<'&&e.eat('#')){t.tokenize=c;return c(e,t)};if(a==='#'){e.skipToEnd();return'comment'};if(a==='@'){var l=e.eat(/["']/);if(l&&e.eol()){t.tokenize=r;t.startQuote=l[0];return r(e,t)} +else if(e.eol()){return'error'} +else if(e.peek().match(/[({]/)){return'punctuation'} +else if(e.peek().match(n)){return i(e,t)}};return'error'};function x(t,r){var n;while((n=t.peek())!=null){t.next();if(n==='\''&&!t.eat('\'')){r.tokenize=e;return'string'}};return'error'};function s(t,r){var n;while((n=t.peek())!=null){if(n==='$'){r.tokenize=E;return'string'};t.next();if(n==='`'){t.next();continue};if(n==='"'&&!t.eat('"')){r.tokenize=e;return'string'}};return'error'};function E(e,t){return u(e,t,s)};function w(e,t){t.tokenize=r;t.startQuote='"';return r(e,t)};function y(e,t){return u(e,t,w)};function u(r,t,n){if(r.match('$(')){var o=t.bracketNesting;t.returnStack.push({shouldReturnFrom:function(e){return e.bracketNesting===o},tokenize:n});t.tokenize=e;t.bracketNesting+=1;return'punctuation'} +else{r.next();t.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:n});t.tokenize=i;return t.tokenize(r,t)}};function c(t,r){var i=!1,n;while((n=t.next())!=null){if(i&&n=='>'){r.tokenize=e;break};i=(n==='#')};return'comment'};function i(t,r){var i=t.peek();if(t.eat('{')){r.tokenize=l;return l(t,r)} +else if(i!=undefined&&i.match(n)){t.eatWhile(n);r.tokenize=e;return'variable-2'} +else{r.tokenize=e;return'error'}};function l(t,r){var n;while((n=t.next())!=null){if(n==='}'){r.tokenize=e;break}};return'variable-2'};function r(t,r){var i=r.startQuote;if(t.sol()&&t.match(new RegExp(i+'@'))){r.tokenize=e} +else if(i==='"'){while(!t.eol()){var n=t.peek();if(n==='$'){r.tokenize=y;return'string'};t.next();if(n==='`'){t.next()}}} +else{t.skipToEnd()};return'string'};var p={startState:function(){return{returnStack:[],bracketNesting:0,tokenize:e}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:'<#',blockCommentEnd:'#>',lineComment:'#',fold:'brace'};return p});e.defineMIME('application/x-powershell','powershell')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('stex',function(){'use strict';function a(t,e){t.cmdState.push(e)};function u(t){if(t.cmdState.length>0){return t.cmdState[t.cmdState.length-1]} +else{return null}};function o(t){var e=t.cmdState.pop();if(e){e.closeBracket()}};function f(t){var r=t.cmdState;for(var e=r.length-1;e>=0;e--){var n=r[e];if(n.name=='DEFAULT'){continue};return n};return{styleIdentifier:function(){return null}}};function r(t,e,n){return function(){this.name=t;this.bracketNo=0;this.style=e;this.styles=n;this.argument=null;this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null};this.openBracket=function(){this.bracketNo++;return'bracket'};this.closeBracket=function(){}}};var t={};t['importmodule']=r('importmodule','tag',['string','builtin']);t['documentclass']=r('documentclass','tag',['','atom']);t['usepackage']=r('usepackage','tag',['atom']);t['begin']=r('begin','tag',['atom']);t['end']=r('end','tag',['atom']);t['DEFAULT']=function(){this.name='DEFAULT';this.style='tag';this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function e(t,e){t.f=e};function n(n,r){var o;if(n.match(/^\\[a-zA-Z@]+/)){var l=n.current().slice(1);o=t[l]||t['DEFAULT'];o=new o();a(r,o);e(r,c);return o.style};if(n.match(/^\\[$&%#{}_]/)){return'tag'};if(n.match(/^\\[,;!\/\\]/)){return'tag'};if(n.match('\\[')){e(r,function(t,e){return i(t,e,'\\]')});return'keyword'};if(n.match('$$')){e(r,function(t,e){return i(t,e,'$$')});return'keyword'};if(n.match('$')){e(r,function(t,e){return i(t,e,'$')});return'keyword'};var s=n.next();if(s=='%'){n.skipToEnd();return'comment'} +else if(s=='}'||s==']'){o=u(r);if(o){o.closeBracket(s);e(r,c)} +else{return'error'};return'bracket'} +else if(s=='{'||s=='['){o=t['DEFAULT'];o=new o();a(r,o);return'bracket'} +else if(/\d/.test(s)){n.eatWhile(/[\w.%]/);return'atom'} +else{n.eatWhile(/[\w\-_]/);o=f(r);if(o.name=='begin'){o.argument=n.current()};return o.styleIdentifier()}};function i(t,r,a){if(t.eatSpace()){return null};if(t.match(a)){e(r,n);return'keyword'};if(t.match(/^\\[a-zA-Z@]+/)){return'tag'};if(t.match(/^[a-zA-Z]+/)){return'variable-2'};if(t.match(/^\\[$&%#{}_]/)){return'tag'};if(t.match(/^\\[,;!\/]/)){return'tag'};if(t.match(/^[\^_&]/)){return'tag'};if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)){return null};if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)){return'number'};var i=t.next();if(i=='{'||i=='}'||i=='['||i==']'||i=='('||i==')'){return'bracket'};if(i=='%'){t.skipToEnd();return'comment'};return'error'};function c(t,r){var i=t.peek(),a;if(i=='{'||i=='['){a=u(r);a.openBracket(i);t.eat(i);e(r,n);return'bracket'};if(/[ \t\r]/.test(i)){t.eat(i);return null};e(r,n);o(r);return n(t,r)};return{startState:function(){return{cmdState:[],f:n}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=n;t.cmdState.length=0},lineComment:'%'}});t.defineMIME('text/x-stex','stex');t.defineMIME('text/x-latex','stex')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('q',function(e){var o=e.indentUnit,t,s=a(['abs','acos','aj','aj0','all','and','any','asc','asin','asof','atan','attr','avg','avgs','bin','by','ceiling','cols','cor','cos','count','cov','cross','csv','cut','delete','deltas','desc','dev','differ','distinct','div','do','each','ej','enlist','eval','except','exec','exit','exp','fby','fills','first','fkeys','flip','floor','from','get','getenv','group','gtime','hclose','hcount','hdel','hopen','hsym','iasc','idesc','if','ij','in','insert','inter','inv','key','keys','last','like','list','lj','load','log','lower','lsq','ltime','ltrim','mavg','max','maxs','mcount','md5','mdev','med','meta','min','mins','mmax','mmin','mmu','mod','msum','neg','next','not','null','or','over','parse','peach','pj','plist','prd','prds','prev','prior','rand','rank','ratios','raze','read0','read1','reciprocal','reverse','rload','rotate','rsave','rtrim','save','scan','select','set','setenv','show','signum','sin','sqrt','ss','ssr','string','sublist','sum','sums','sv','system','tables','tan','til','trim','txf','type','uj','ungroup','union','update','upper','upsert','value','var','view','views','vs','wavg','where','where','while','within','wj','wj1','wsum','xasc','xbar','xcol','xcols','xdesc','xexp','xgroup','xkey','xlog','xprev','xrank']),c=/[|/&^!+:\\\-*%$=~#;@><,?_'"\[\(\]\)\s{}]/;function a(e){return new RegExp('^('+e.join('|')+')$')};function n(e,i){var a=e.sol(),r=e.next();t=null;if(a)if(r=='/')return(i.tokenize=l)(e,i);else if(r=='\\'){if(e.eol()||/\s/.test(e.peek()))return e.skipToEnd(),/^\\\s*$/.test(e.current())?(i.tokenize=d)(e):i.tokenize=n,'comment';else return i.tokenize=n,'builtin'};if(/\s/.test(r))return e.peek()=='/'?(e.skipToEnd(),'comment'):'whitespace';if(r=='"')return(i.tokenize=f)(e,i);if(r=='`')return e.eatWhile(/[A-Za-z\d_:\/.]/),'symbol';if(('.'==r&&/\d/.test(e.peek()))||/\d/.test(r)){var o=null;e.backUp(1);if(e.match(/^\d{4}\.\d{2}(m|\.\d{2}([DT](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/))o='temporal';else if(e.match(/^0[NwW]{1}/)||e.match(/^0x[\da-fA-F]*/)||e.match(/^[01]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))o='number';return(o&&(!(r=e.peek())||c.test(r)))?o:(e.next(),'error')};if(/[A-Za-z]|\./.test(r))return e.eatWhile(/[A-Za-z._\d]/),s.test(e.current())?'keyword':'variable';if(/[|/&^!+:\\\-*%$=~#;@><\.,?_']/.test(r))return null;if(/[{}\(\[\]\)]/.test(r))return null;return'error'};function l(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=u)(e,t):(t.tokenize=n),'comment'};function u(e,t){var i=e.sol()&&e.peek()=='\\';e.skipToEnd();if(i&&/^\\\s*$/.test(e.current()))t.tokenize=n;return'comment'};function d(e){return e.skipToEnd(),'comment'};function f(e,t){var i=!1,r,o=!1;while((r=e.next())){if(r=='"'&&!i){o=!0;break};i=!i&&r=='\\'};if(o)t.tokenize=n;return'string'};function i(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}};function r(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:n,context:null,indent:0,col:0}},token:function(n,e){if(n.sol()){if(e.context&&e.context.align==null)e.context.align=!1;e.indent=n.indentation()};var o=e.tokenize(n,e);if(o!='comment'&&e.context&&e.context.align==null&&e.context.type!='pattern'){e.context.align=!0};if(t=='(')i(e,')',n.column());else if(t=='[')i(e,']',n.column());else if(t=='{')i(e,'}',n.column());else if(/[\]\}\)]/.test(t)){while(e.context&&e.context.type=='pattern')r(e);if(e.context&&t==e.context.type)r(e)} +else if(t=='.'&&e.context&&e.context.type=='pattern')r(e);else if(/atom|string|variable/.test(o)&&e.context){if(/[\}\]]/.test(e.context.type))i(e,'pattern',n.column());else if(e.context.type=='pattern'&&!e.context.align){e.context.align=!0;e.context.col=n.column()}};return o},indent:function(e,n){var r=n&&n.charAt(0),t=e.context;if(/[\]\}]/.test(r))while(t&&t.type=='pattern')t=t.prev;var i=t&&r==t.type;if(!t)return 0;else if(t.type=='pattern')return t.col;else if(t.align)return t.col+(i?0:1);else return t.indent+(i?0:o)}}});e.defineMIME('text/x-q','q')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../../addon/mode/multiplex'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../../addon/mode/multiplex'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('htmlembedded',function(d,i){return e.multiplexingMode(e.getMode(d,'htmlmixed'),{open:i.open||i.scriptStartRegex||'<%',close:i.close||i.scriptEndRegex||'%>',mode:e.getMode(d,i.scriptingModeSpec)})},'htmlmixed');e.defineMIME('application/x-ejs',{name:'htmlembedded',scriptingModeSpec:'javascript'});e.defineMIME('application/x-aspx',{name:'htmlembedded',scriptingModeSpec:'text/x-csharp'});e.defineMIME('application/x-jsp',{name:'htmlembedded',scriptingModeSpec:'text/x-java'});e.defineMIME('application/x-erb',{name:'htmlembedded',scriptingModeSpec:'ruby'})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('d',function(t,n){var a=t.indentUnit,p=n.statementIndentUnit||a,h=n.keywords||{},y=n.builtin||{},u=n.blockKeywords||{},b=n.atoms||{},s=n.hooks||{},v=n.multiLineStrings;var l=/[+\-*&%=<>!?|\/]/,r;function f(e,t){var n=e.next();if(s[n]){var o=s[n](e,t);if(o!==!1)return o};if(n=='"'||n=='\''||n=='`'){t.tokenize=w(n);return t.tokenize(e,t)};if(/[\[\]{}\(\),;\:\.]/.test(n)){r=n;return null};if(/\d/.test(n)){e.eatWhile(/[\w\.]/);return'number'};if(n=='/'){if(e.eat('+')){t.tokenize=d;return d(e,t)};if(e.eat('*')){t.tokenize=c;return c(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(l.test(n)){e.eatWhile(l);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var i=e.current();if(h.propertyIsEnumerable(i)){if(u.propertyIsEnumerable(i))r='newstatement';return'keyword'};if(y.propertyIsEnumerable(i)){if(u.propertyIsEnumerable(i))r='newstatement';return'builtin'};if(b.propertyIsEnumerable(i))return'atom';return'variable'};function w(e){return function(t,n){var r=!1,i,o=!1;while((i=t.next())!=null){if(i==e&&!r){o=!0;break};r=!r&&i=='\\'};if(o||!(r||v))n.tokenize=null;return'string'}};function c(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='*')};return'comment'};function d(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='+')};return'comment'};function m(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function o(e,t,n){var r=e.indented;if(e.context&&e.context.type=='statement')r=e.context.indented;return e.context=new m(r,t,n,null,e.context)};function i(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new m((e||0)-a,0,'top',!1),indented:0,startOfLine:!0}},token:function(t,e){var n=e.context;if(t.sol()){if(n.align==null)n.align=!1;e.indented=t.indentation();e.startOfLine=!0};if(t.eatSpace())return null;r=null;var a=(e.tokenize||f)(t,e);if(a=='comment'||a=='meta')return a;if(n.align==null)n.align=!0;if((r==';'||r==':'||r==',')&&n.type=='statement')i(e);else if(r=='{')o(e,t.column(),'}');else if(r=='[')o(e,t.column(),']');else if(r=='(')o(e,t.column(),')');else if(r=='}'){while(n.type=='statement')n=i(e);if(n.type=='}')n=i(e);while(n.type=='statement')n=i(e)} +else if(r==n.type)i(e);else if(((n.type=='}'||n.type=='top')&&r!=';')||(n.type=='statement'&&r=='newstatement'))o(e,t.column(),'statement');e.startOfLine=!1;return a},indent:function(t,n){if(t.tokenize!=f&&t.tokenize!=null)return e.Pass;var r=t.context,i=n&&n.charAt(0);if(r.type=='statement'&&i=='}')r=r.prev;var o=i==r.type;if(r.type=='statement')return r.indented+(i=='{'?0:p);else if(r.align)return r.column+(o?0:1);else return r.indented+(o?0:a)},electricChars:'{}'}});function t(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var n='body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with';e.defineMIME('text/x-d',{name:'d',keywords:t('abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters '+n),blockKeywords:t(n),builtin:t('bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t'),atoms:t('exit failure success true false null'),hooks:{'@':function(e,t){e.eatWhile(/[\w\$_]/);return'meta'}}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function i(e){return new RegExp('^(('+e.join(')|(')+'))\\b','i')};var t=['package','message','import','syntax','required','optional','repeated','reserved','default','extensions','packed','bool','bytes','double','enum','float','string','int32','int64','uint32','uint64','sint32','sint64','fixed32','fixed64','sfixed32','sfixed64','option','service','rpc','returns'],n=i(t);e.registerHelper('hintWords','protobuf',t);var r=new RegExp('^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*');function f(e){if(e.eatSpace())return null;if(e.match('//')){e.skipToEnd();return'comment'};if(e.match(/^[0-9\.+-]/,!1)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return'number';if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return'number';if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return'number'};if(e.match(/^"([^"]|(""))*"/)){return'string'};if(e.match(/^'([^']|(''))*'/)){return'string'};if(e.match(n)){return'keyword'};if(e.match(r)){return'variable'};e.next();return null};e.defineMode('protobuf',function(){return{token:f}});e.defineMIME('text/x-protobuf','protobuf')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';var n={mscgen:{'keywords':['msc'],'options':['hscale','width','arcgradient','wordwraparcs'],'constants':['true','false','on','off'],'attributes':['label','idurl','id','url','linecolor','linecolour','textcolor','textcolour','textbgcolor','textbgcolour','arclinecolor','arclinecolour','arctextcolor','arctextcolour','arctextbgcolor','arctextbgcolour','arcskip'],'brackets':['\\{','\\}'],'arcsWords':['note','abox','rbox','box'],'arcsOthers':['\\|\\|\\|','\\.\\.\\.','---','--','<->','==','<<=>>','<=>','\\.\\.','<<>>','::','<:>','->','=>>','=>','>>',':>','<-','<<=','<=','<<','<:','x-','-x'],'singlecomment':['//','#'],'operators':['=']},xu:{'keywords':['msc','xu'],'options':['hscale','width','arcgradient','wordwraparcs','watermark'],'constants':['true','false','on','off','auto'],'attributes':['label','idurl','id','url','linecolor','linecolour','textcolor','textcolour','textbgcolor','textbgcolour','arclinecolor','arclinecolour','arctextcolor','arctextcolour','arctextbgcolor','arctextbgcolour','arcskip'],'brackets':['\\{','\\}'],'arcsWords':['note','abox','rbox','box','alt','else','opt','break','par','seq','strict','neg','critical','ignore','consider','assert','loop','ref','exc'],'arcsOthers':['\\|\\|\\|','\\.\\.\\.','---','--','<->','==','<<=>>','<=>','\\.\\.','<<>>','::','<:>','->','=>>','=>','>>',':>','<-','<<=','<=','<<','<:','x-','-x'],'singlecomment':['//','#'],'operators':['=']},msgenny:{'keywords':null,'options':['hscale','width','arcgradient','wordwraparcs','watermark'],'constants':['true','false','on','off','auto'],'attributes':null,'brackets':['\\{','\\}'],'arcsWords':['note','abox','rbox','box','alt','else','opt','break','par','seq','strict','neg','critical','ignore','consider','assert','loop','ref','exc'],'arcsOthers':['\\|\\|\\|','\\.\\.\\.','---','--','<->','==','<<=>>','<=>','\\.\\.','<<>>','::','<:>','->','=>>','=>','>>',':>','<-','<<=','<=','<<','<:','x-','-x'],'singlecomment':['//','#'],'operators':['=']}};t.defineMode('mscgen',function(t,r){var e=n[r&&r.language||'mscgen'];return{startState:o,copyState:i,token:c(e),lineComment:'#',blockCommentStart:'/*',blockCommentEnd:'*/'}});t.defineMIME('text/x-mscgen','mscgen');t.defineMIME('text/x-xu',{name:'mscgen',language:'xu'});t.defineMIME('text/x-msgenny',{name:'mscgen',language:'msgenny'});function e(t){return new RegExp('\\b('+t.join('|')+')\\b','i')};function r(t){return new RegExp('('+t.join('|')+')','i')};function o(){return{inComment:!1,inString:!1,inAttributeList:!1,inScript:!1}};function i(t){return{inComment:t.inComment,inString:t.inString,inAttributeList:t.inAttributeList,inScript:t.inScript}};function c(t){return function(n,o){if(n.match(r(t.brackets),!0,!0)){return'bracket'};if(!o.inComment){if(n.match(/\/\*[^\*\/]*/,!0,!0)){o.inComment=!0;return'comment'};if(n.match(r(t.singlecomment),!0,!0)){n.skipToEnd();return'comment'}};if(o.inComment){if(n.match(/[^\*\/]*\*\//,!0,!0))o.inComment=!1;else n.skipToEnd();return'comment'};if(!o.inString&&n.match(/"(\\"|[^"])*/,!0,!0)){o.inString=!0;return'string'};if(o.inString){if(n.match(/[^"]*"/,!0,!0))o.inString=!1;else n.skipToEnd();return'string'};if(!!t.keywords&&n.match(e(t.keywords),!0,!0))return'keyword';if(n.match(e(t.options),!0,!0))return'keyword';if(n.match(e(t.arcsWords),!0,!0))return'keyword';if(n.match(r(t.arcsOthers),!0,!0))return'keyword';if(!!t.operators&&n.match(r(t.operators),!0,!0))return'operator';if(!!t.constants&&n.match(r(t.constants),!0,!0))return'variable';if(!t.inAttributeList&&!!t.attributes&&n.match(/\[/,!0,!0)){t.inAttributeList=!0;return'bracket'};if(t.inAttributeList){if(t.attributes!==null&&n.match(e(t.attributes),!0,!0)){return'attribute'};if(n.match(/]/,!0,!0)){t.inAttributeList=!1;return'bracket'}};n.next();return'base'}}});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('django:inner',function(){var i=['block','endblock','for','endfor','true','false','filter','endfilter','loop','none','self','super','if','elif','endif','as','else','import','with','endwith','without','context','ifequal','endifequal','ifnotequal','endifnotequal','extends','include','load','comment','endcomment','empty','url','static','trans','blocktrans','endblocktrans','now','regroup','lorem','ifchanged','endifchanged','firstof','debug','cycle','csrf_token','autoescape','endautoescape','spaceless','endspaceless','ssi','templatetag','verbatim','endverbatim','widthratio'],e=['add','addslashes','capfirst','center','cut','date','default','default_if_none','dictsort','dictsortreversed','divisibleby','escape','escapejs','filesizeformat','first','floatformat','force_escape','get_digit','iriencode','join','last','length','length_is','linebreaks','linebreaksbr','linenumbers','ljust','lower','make_list','phone2numeric','pluralize','pprint','random','removetags','rjust','safe','safeseq','slice','slugify','stringformat','striptags','time','timesince','timeuntil','title','truncatechars','truncatechars_html','truncatewords','truncatewords_html','unordered_list','upper','urlencode','urlize','urlizetrunc','wordcount','wordwrap','yesno'],n=['==','!=','<','>','<=','>='],o=['in','not','or','and'];i=new RegExp('^\\b('+i.join('|')+')\\b');e=new RegExp('^\\b('+e.join('|')+')\\b');n=new RegExp('^\\b('+n.join('|')+')\\b');o=new RegExp('^\\b('+o.join('|')+')\\b');function t(e,t){if(e.match('{{')){t.tokenize=l;return'tag'} +else if(e.match('{%')){t.tokenize=a;return'tag'} +else if(e.match('{#')){t.tokenize=u;return'comment'} +while(e.next()!=null&&!e.match(/\{[{%#]/,!1)){};return null};function r(e,t){return function(r,i){if(!i.escapeNext&&r.eat(e)){i.tokenize=t} +else{if(i.escapeNext){i.escapeNext=!1};var n=r.next();if(n=='\\'){i.escapeNext=!0}};return'string'}};function l(n,i){if(i.waitDot){i.waitDot=!1;if(n.peek()!='.'){return'null'};if(n.match(/\.\W+/)){return'error'} +else if(n.eat('.')){i.waitProperty=!0;return'null'} +else{throw Error('Unexpected error while waiting for property.')}};if(i.waitPipe){i.waitPipe=!1;if(n.peek()!='|'){return'null'};if(n.match(/\.\W+/)){return'error'} +else if(n.eat('|')){i.waitFilter=!0;return'null'} +else{throw Error('Unexpected error while waiting for filter.')}};if(i.waitProperty){i.waitProperty=!1;if(n.match(/\b(\w+)\b/)){i.waitDot=!0;i.waitPipe=!0;return'property'}};if(i.waitFilter){i.waitFilter=!1;if(n.match(e)){return'variable-2'}};if(n.eatSpace()){i.waitProperty=!1;return'null'};if(n.match(/\b\d+(\.\d+)?\b/)){return'number'};if(n.match('\'')){i.tokenize=r('\'',i.tokenize);return'string'} +else if(n.match('"')){i.tokenize=r('"',i.tokenize);return'string'};if(n.match(/\b(\w+)\b/)&&!i.foundVariable){i.waitDot=!0;i.waitPipe=!0;return'variable'};if(n.match('}}')){i.waitProperty=null;i.waitFilter=null;i.waitDot=null;i.waitPipe=null;i.tokenize=t;return'tag'};n.next();return'null'};function a(l,a){if(a.waitDot){a.waitDot=!1;if(l.peek()!='.'){return'null'};if(l.match(/\.\W+/)){return'error'} +else if(l.eat('.')){a.waitProperty=!0;return'null'} +else{throw Error('Unexpected error while waiting for property.')}};if(a.waitPipe){a.waitPipe=!1;if(l.peek()!='|'){return'null'};if(l.match(/\.\W+/)){return'error'} +else if(l.eat('|')){a.waitFilter=!0;return'null'} +else{throw Error('Unexpected error while waiting for filter.')}};if(a.waitProperty){a.waitProperty=!1;if(l.match(/\b(\w+)\b/)){a.waitDot=!0;a.waitPipe=!0;return'property'}};if(a.waitFilter){a.waitFilter=!1;if(l.match(e)){return'variable-2'}};if(l.eatSpace()){a.waitProperty=!1;return'null'};if(l.match(/\b\d+(\.\d+)?\b/)){return'number'};if(l.match('\'')){a.tokenize=r('\'',a.tokenize);return'string'} +else if(l.match('"')){a.tokenize=r('"',a.tokenize);return'string'};if(l.match(n)){return'operator'};if(l.match(o)){return'keyword'};var u=l.match(i);if(u){if(u[0]=='comment'){a.blockCommentTag=!0};return'keyword'};if(l.match(/\b(\w+)\b/)){a.waitDot=!0;a.waitPipe=!0;return'variable'};if(l.match('%}')){a.waitProperty=null;a.waitFilter=null;a.waitDot=null;a.waitPipe=null;if(a.blockCommentTag){a.blockCommentTag=!1;a.tokenize=f} +else{a.tokenize=t};return'tag'};l.next();return'null'};function u(e,r){if(e.match(/^.*?#\}/))r.tokenize=t;else e.skipToEnd();return'comment'};function f(e,t){if(e.match(/\{%\s*endcomment\s*%\}/,!1)){t.tokenize=a;e.match('{%');return'tag'} +else{e.next();return'comment'}};return{startState:function(){return{tokenize:t}},token:function(e,t){return t.tokenize(e,t)},blockCommentStart:'{% comment %}',blockCommentEnd:'{% endcomment %}'}});e.defineMode('django',function(t){var r=e.getMode(t,'text/html'),i=e.getMode(t,'django:inner');return e.overlayMode(r,i)});e.defineMIME('text/x-django','django')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('toml',function(){return{startState:function(){return{inString:!1,stringType:'',lhs:!0,inArray:0}},token:function(e,t){if(!t.inString&&((e.peek()=='"')||(e.peek()=='\''))){t.stringType=e.peek();e.next();t.inString=!0};if(e.sol()&&t.inArray===0){t.lhs=!0};if(t.inString){while(t.inString&&!e.eol()){if(e.peek()===t.stringType){e.next();t.inString=!1} +else if(e.peek()==='\\'){e.next();e.next()} +else{e.match(/^.[^\\"']*/)}};return t.lhs?'property string':'string'} +else if(t.inArray&&e.peek()===']'){e.next();t.inArray--;return'bracket'} +else if(t.lhs&&e.peek()==='['&&e.skipTo(']')){e.next();if(e.peek()===']')e.next();return'atom'} +else if(e.peek()==='#'){e.skipToEnd();return'comment'} +else if(e.eatSpace()){return null} +else if(t.lhs&&e.eatWhile(function(e){return e!='='&&e!=' '})){return'property'} +else if(t.lhs&&e.peek()==='='){e.next();t.lhs=!1;return null} +else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)){return'atom'} +else if(!t.lhs&&(e.match('true')||e.match('false'))){return'atom'} +else if(!t.lhs&&e.peek()==='['){t.inArray++;e.next();return'bracket'} +else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)){return'number'} +else if(!e.eatSpace()){e.next()};return null}}});e.defineMIME('text/x-toml','toml')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("yacas",function(t,r){function p(e){var r={},n=e.split(" ");for(var t=0;t<n.length;++t)r[n[t]]=!0;return r};var a=p("Assert BackQuote D Defun Deriv For ForEach FromFile FromString Function Integrate InverseTaylor Limit LocalSymbols Macro MacroRule MacroRulePattern NIntegrate Rule RulePattern Subst TD TExplicitSum TSum Taylor Taylor1 Taylor2 Taylor3 ToFile ToStdout ToString TraceRule Until While"),u="(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)",n="(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)",c=new RegExp(u),l=new RegExp(n),f=new RegExp(n+"?_"+n),s=new RegExp(n+"\\s*\\(");function i(e,t){var r;r=e.next();if(r==="\""){t.tokenize=m;return t.tokenize(e,t)};if(r==="/"){if(e.eat("*")){t.tokenize=d;return t.tokenize(e,t)};if(e.eat("/")){e.skipToEnd();return"comment"}};e.backUp(1);var i=e.match(/^(\w+)\s*\(/,!1);if(i!==null&&a.hasOwnProperty(i[1]))t.scopes.push("bodied");var n=o(t);if(n==="bodied"&&r==="[")t.scopes.pop();if(r==="["||r==="{"||r==="(")t.scopes.push(r);n=o(t);if(n==="["&&r==="]"||n==="{"&&r==="}"||n==="("&&r===")")t.scopes.pop();if(r===";"){while(n==="bodied"){t.scopes.pop();n=o(t)}};if(e.match(/\d+ *#/,!0,!1)){return"qualifier"};if(e.match(c,!0,!1)){return"number"};if(e.match(f,!0,!1)){return"variable-3"};if(e.match(/(?:\[|\]|{|}|\(|\))/,!0,!1)){return"bracket"};if(e.match(s,!0,!1)){e.backUp(1);return"variable"};if(e.match(l,!0,!1)){return"variable-2"};if(e.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%|#)/,!0,!1)){return"operator"};return"error"};function m(e,t){var n,o=!1,r=!1;while((n=e.next())!=null){if(n==="\""&&!r){o=!0;break};r=!r&&n==="\\"};if(o&&!r){t.tokenize=i};return"string"};function d(e,t){var n,r;while((r=e.next())!=null){if(n==="*"&&r==="/"){t.tokenize=i;break};n=r};return"comment"};function o(e){var t=null;if(e.scopes.length>0)t=e.scopes[e.scopes.length-1];return t};return{startState:function(){return{tokenize:i,scopes:[]}},token:function(e,t){if(e.eatSpace())return null;return t.tokenize(e,t)},indent:function(r,n){if(r.tokenize!==i&&r.tokenize!==null)return e.Pass;var o=0;if(n==="]"||n==="];"||n==="}"||n==="};"||n===");")o=-1;return(r.scopes.length+o)*t.indentUnit},electricChars:"{}[]();",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});e.defineMIME("text/x-yacas",{name:"yacas"})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function n(e){return new RegExp('^(('+e.join(')|(')+'))\\b')};var o=n(['and','or','not','is']),r=['as','assert','break','class','continue','def','del','elif','else','except','finally','for','from','global','if','import','lambda','pass','raise','return','try','while','with','yield','in'],i=['abs','all','any','bin','bool','bytearray','callable','chr','classmethod','compile','complex','delattr','dict','dir','divmod','enumerate','eval','filter','float','format','frozenset','getattr','globals','hasattr','hash','help','hex','id','input','int','isinstance','issubclass','iter','len','list','locals','map','max','memoryview','min','next','object','oct','open','ord','pow','property','range','repr','reversed','round','set','setattr','slice','sorted','staticmethod','str','sum','super','tuple','type','vars','zip','__import__','NotImplemented','Ellipsis','__debug__'];e.registerHelper('hintWords','python',r.concat(i));function t(e){return e.scopes[e.scopes.length-1]};e.defineMode('python',function(s,a){var c='error',F=a.delimiters||a.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.]/,u=[a.singleOperators,a.doubleOperators,a.doubleDelimiters,a.tripleDelimiters,a.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/];for(var d=0;d<u.length;d++)if(!u[d])u.splice(d--,1);var h=a.hangingIndent||s.indentUnit,l=r,f=i;if(a.extra_keywords!=undefined)l=l.concat(a.extra_keywords);if(a.extra_builtins!=undefined)f=f.concat(a.extra_builtins);var y=!(a.version&&Number(a.version)<3);if(y){var p=a.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;l=l.concat(['nonlocal','False','True','None','async','await']);f=f.concat(['ascii','bytes','exec','print']);var b=new RegExp('^(([rbuf]|(br))?(\'{3}|"{3}|[\'"]))','i')} +else{var p=a.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;l=l.concat(['exec','print']);f=f.concat(['apply','basestring','buffer','cmp','coerce','execfile','file','intern','long','raw_input','reduce','reload','unichr','unicode','xrange','False','True','None']);var b=new RegExp('^(([rubf]|(ur)|(br))?(\'{3}|"{3}|[\'"]))','i')};var w=n(l),z=n(f);function m(e,n){if(e.sol())n.indent=e.indentation();if(e.sol()&&t(n).type=='py'){var r=t(n).offset;if(e.eatSpace()){var a=e.indentation();if(a>r)v(n);else if(a<r&&x(e,n)&&e.peek()!='#')n.errorToken=!0;return null} +else{var i=g(e,n);if(r>0&&x(e,n))i+=' '+c;return i}};return g(e,n)};function g(e,t){if(e.eatSpace())return null;var a=e.peek();if(a=='#'){e.skipToEnd();return'comment'};if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)){r=!0};if(e.match(/^[\d_]+\.\d*/)){r=!0};if(e.match(/^\.\d+/)){r=!0};if(r){e.eat(/J/i);return'number'};var n=!1;if(e.match(/^0x[0-9a-f_]+/i))n=!0;if(e.match(/^0b[01_]+/i))n=!0;if(e.match(/^0o[0-7_]+/i))n=!0;if(e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)){e.eat(/J/i);n=!0};if(e.match(/^0(?![\dx])/i))n=!0;if(n){e.eat(/L/i);return'number'}};if(e.match(b)){t.tokenize=E(e.current());return t.tokenize(e,t)};for(var i=0;i<u.length;i++)if(e.match(u[i]))return'operator';if(e.match(F))return'punctuation';if(t.lastToken=='.'&&e.match(p))return'property';if(e.match(w)||e.match(o))return'keyword';if(e.match(z))return'builtin';if(e.match(/^(self|cls)\b/))return'variable-2';if(e.match(p)){if(t.lastToken=='def'||t.lastToken=='class')return'def';return'variable'};e.next();return c};function E(e){while('rubf'.indexOf(e.charAt(0).toLowerCase())>=0)e=e.substr(1);var n=e.length==1,t='string';function r(r,i){while(!r.eol()){r.eatWhile(/[^'"\\]/);if(r.eat('\\')){r.next();if(n&&r.eol())return t} +else if(r.match(e)){i.tokenize=m;return t} +else{r.eat(/['"]/)}};if(n){if(a.singleLineStringErrors)return c;else i.tokenize=m};return t};r.isString=!0;return r};function v(e){while(t(e).type!='py')e.scopes.pop();e.scopes.push({offset:t(e).offset+s.indentUnit,type:'py',align:null})};function T(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+h,type:n,align:r})};function x(e,n){var r=e.indentation();while(n.scopes.length>1&&t(n).offset>r){if(t(n).type!='py')return!0;n.scopes.pop()};return t(n).offset!=r};function A(n,e){if(n.sol())e.beginningOfLine=!0;var a=e.tokenize(n,e),r=n.current();if(e.beginningOfLine&&r=='@')return n.match(p,!1)?'meta':y?'operator':c;if(/\S/.test(r))e.beginningOfLine=!1;if((a=='variable'||a=='builtin')&&e.lastToken=='meta')a='meta';if(r=='pass'||r=='return')e.dedent+=1;if(r=='lambda')e.lambda=!0;if(r==':'&&!e.lambda&&t(e).type=='py')v(e);var i=r.length==1?'[({'.indexOf(r):-1;if(i!=-1)T(n,e,'])}'.slice(i,i+1));i='])}'.indexOf(r);if(i!=-1){if(t(e).type==r)e.indent=e.scopes.pop().offset-h;else return c};if(e.dedent>0&&n.eol()&&t(e).type=='py'){if(e.scopes.length>1)e.scopes.pop();e.dedent-=1};return a};var k={startState:function(e){return{tokenize:m,scopes:[{offset:e||0,type:'py',align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var r=t.errorToken;if(r)t.errorToken=!1;var n=A(e,t);if(n&&n!='comment')t.lastToken=(n=='keyword'||n=='punctuation')?e.current():n;if(n=='punctuation')n=null;if(e.eol()&&t.lambda)t.lambda=!1;return r?n+' '+c:n},indent:function(n,r){if(n.tokenize!=m)return n.tokenize.isString?e.Pass:0;var i=t(n),a=i.type==r.charAt(0);if(i.align!=null)return i.align-(a?1:0);else return i.offset-(a?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:'\'"'},lineComment:'#',fold:'indent'};return k});e.defineMIME('text/x-python','python');var a=function(e){return e.split(' ')};e.defineMIME('text/x-cython',{name:'python',extra_keywords:a('by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE')})});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("vb",function(n,t){var i="error";function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")};var v=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),x=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),g=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),w=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),I=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),y=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),u=["class","module","sub","enum","select","while","if","function","get","set","property","try"],f=["else","elseif","case","catch"],d=["next","loop"],l=["and","or","not","xor","in"],E=r(l),s=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],m=["integer","string","double","decimal","boolean","short","char","float","single"],L=r(s),z=r(m),C="\"",R=r(u),h=r(f),p=r(d),b=r(["end"]),F=r(["do"]),M=null;e.registerHelper("hintWords","vb",u.concat(f).concat(d).concat(l).concat(s).concat(m));function a(e,n){n.currentIndent++};function o(e,n){n.currentIndent--};function c(e,n){if(e.eatSpace()){return null};var c=e.peek();if(c==="'"){e.skipToEnd();return"comment"};if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var r=!1;if(e.match(/^\d*\.\d+F?/i)){r=!0} +else if(e.match(/^\d+\.\d*F?/)){r=!0} +else if(e.match(/^\.\d+F?/)){r=!0};if(r){e.eat(/J/i);return"number"};var t=!1;if(e.match(/^&H[0-9a-f]+/i)){t=!0} +else if(e.match(/^&O[0-7]+/i)){t=!0} +else if(e.match(/^[1-9]\d*F?/)){e.eat(/J/i);t=!0} +else if(e.match(/^0(?![\dx])/i)){t=!0};if(t){e.eat(/L/i);return"number"}};if(e.match(C)){n.tokenize=O(e.current());return n.tokenize(e,n)};if(e.match(I)||e.match(w)){return null};if(e.match(g)||e.match(v)||e.match(E)){return"operator"};if(e.match(x)){return null};if(e.match(F)){a(e,n);n.doInCurrentLine=!0;return"keyword"};if(e.match(R)){if(!n.doInCurrentLine)a(e,n);else n.doInCurrentLine=!1;return"keyword"};if(e.match(h)){return"keyword"};if(e.match(b)){o(e,n);o(e,n);return"keyword"};if(e.match(p)){o(e,n);return"keyword"};if(e.match(z)){return"keyword"};if(e.match(L)){return"keyword"};if(e.match(y)){return"variable"};e.next();return i};function O(e){var r=e.length==1,n="string";return function(o,a){while(!o.eol()){o.eatWhile(/[^'"]/);if(o.match(e)){a.tokenize=c;return n} +else{o.eat(/['"]/)}};if(r){if(t.singleLineStringErrors){return i} +else{a.tokenize=c}};return n}};function T(e,n){var r=n.tokenize(e,n),c=e.current();if(c==="."){r=n.tokenize(e,n);if(r==="variable"){return"variable"} +else{return i}};var t="[({".indexOf(c);if(t!==-1){a(e,n)};if(M==="dedent"){if(o(e,n)){return i}};t="])}".indexOf(c);if(t!==-1){if(o(e,n)){return i}};return r};var k={electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:c,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,n){if(e.sol()){n.currentIndent+=n.nextLineIndent;n.nextLineIndent=0;n.doInCurrentLine=0};var t=T(e,n);n.lastToken={style:t,content:e.current()};return t},indent:function(e,t){var r=t.replace(/^\s+|\s+$/g,"");if(r.match(p)||r.match(b)||r.match(h))return n.indentUnit*(e.currentIndent-1);if(e.currentIndent<0)return 0;return e.currentIndent*n.indentUnit},lineComment:"'"};return k});e.defineMIME("text/x-vb","vb")});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("octave",function(){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")};var r=new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]"),i=new RegExp("^[\\(\\[\\{\\},:=;]"),o=new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))"),f=new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))"),a=new RegExp("^((>>=)|(<<=))"),u=new RegExp("^[\\]\\)]"),c=new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*"),m=n(["error","eval","function","abs","acos","atan","asin","cos","cosh","exp","log","prod","sum","log10","max","min","sign","sin","sinh","sqrt","tan","reshape","break","zeros","default","margin","round","ones","rand","syn","ceil","floor","size","clear","zeros","eye","mean","std","cov","det","eig","inv","norm","rank","trace","expm","logm","sqrtm","linspace","plot","title","xlabel","ylabel","legend","text","grid","meshgrid","mesh","num2str","fft","ifft","arrayfun","cellfun","input","fliplr","flipud","ismember"]),s=n(["return","case","switch","else","elseif","end","endif","endfunction","if","otherwise","do","for","while","try","catch","classdef","properties","events","methods","global","persistent","endfor","endwhile","printf","sprintf","disp","until","continue","pkg"]);function t(n,t){if(!n.sol()&&n.peek()==="'"){n.next();t.tokenize=e;return"operator"};t.tokenize=e;return e(n,t)};function l(n,t){if(n.match(/^.*%}/)){t.tokenize=e;return"comment"};n.skipToEnd();return"comment"};function e(d,p){if(d.eatSpace())return null;if(d.match("%{")){p.tokenize=l;d.skipToEnd();return"comment"};if(d.match(/^[%#]/)){d.skipToEnd();return"comment"};if(d.match(/^[0-9\.+-]/,!1)){if(d.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)){d.tokenize=e;return"number"};if(d.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)){return"number"};if(d.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)){return"number"}};if(d.match(n(["nan","NaN","inf","Inf"]))){return"number"};var h=d.match(/^"(?:[^"]|"")*("|$)/)||d.match(/^'(?:[^']|'')*('|$)/);if(h){return h[1]?"string":"string error"};if(d.match(s)){return"keyword"};if(d.match(m)){return"builtin"};if(d.match(c)){return"variable"};if(d.match(r)||d.match(o)){return"operator"};if(d.match(i)||d.match(f)||d.match(a)){return null};if(d.match(u)){p.tokenize=t;return null};d.next();return"error"};return{startState:function(){return{tokenize:e}},token:function(e,n){var r=n.tokenize(e,n);if(r==="number"||r==="variable"){n.tokenize=t};return r},lineComment:"%",fold:"indent"}});e.defineMIME("text/x-octave","octave")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('tcl',function(){function a(e){var t={},n=e.split(' ');for(var r=0;r<n.length;++r)t[n[r]]=!0;return t};var t=a('Tcl safe after append array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd close concat continue dde eof encoding error eval exec exit expr fblocked fconfigure fcopy file fileevent filename filename flush for foreach format gets glob global history http if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lset lsort memory msgcat namespace open package parray pid pkg::create pkg_mkIndex proc puts pwd re_syntax read regex regexp registry regsub rename resource return scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_wordBreakAfter tcl_startOfPreviousWord tcl_wordBreakBefore tcltest tclvars tell time trace unknown unset update uplevel upvar variable vwait'),n=a('if elseif else and not or eq ne in ni for foreach while switch'),i=/[+\-*&%=<>!?^\/\|]/;function r(e,r,t){r.tokenize=t;return t(e,r)};function e(e,a){var c=a.beforeParams;a.beforeParams=!1;var s=e.next();if((s=='"'||s=='\'')&&a.inParams){return r(e,a,o(s))} +else if(/[\[\]{}\(\),;\.]/.test(s)){if(s=='('&&c)a.inParams=!0;else if(s==')')a.inParams=!1;return null} +else if(/\d/.test(s)){e.eatWhile(/[\w\.]/);return'number'} +else if(s=='#'){if(e.eat('*'))return r(e,a,l);if(s=='#'&&e.match(/ *\[ *\[/))return r(e,a,f);e.skipToEnd();return'comment'} +else if(s=='"'){e.skipTo(/"/);return'comment'} +else if(s=='$'){e.eatWhile(/[$_a-z0-9A-Z\.{:]/);e.eatWhile(/}/);a.beforeParams=!0;return'builtin'} +else if(i.test(s)){e.eatWhile(i);return'comment'} +else{e.eatWhile(/[\w\$_{}\xa1-\uffff]/);var u=e.current().toLowerCase();if(t&&t.propertyIsEnumerable(u))return'keyword';if(n&&n.propertyIsEnumerable(u)){a.beforeParams=!0;return'keyword'};return null}};function o(r){return function(t,n){var i=!1,a,o=!1;while((a=t.next())!=null){if(a==r&&!i){o=!0;break};i=!i&&a=='\\'};if(o)n.tokenize=e;return'string'}};function l(r,t){var i=!1,n;while(n=r.next()){if(n=='#'&&i){t.tokenize=e;break};i=(n=='*')};return'comment'};function f(r,t){var i=0,n;while(n=r.next()){if(n=='#'&&i==2){t.tokenize=e;break};if(n==']')i++;else if(n!=' ')i=0};return'meta'};return{startState:function(){return{tokenize:e,beforeParams:!1,inParams:!1}},token:function(e,r){if(e.eatSpace())return null;return r.tokenize(e,r)}}});e.defineMIME('text/x-tcl','tcl')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("clojure",function(t){var f="builtin",u="comment",d="string",p="string-2",r="atom",h="number",c="bracket",m="keyword",y="variable",g=t.indentUnit||2,b=t.indentUnit||2;function n(e){var n={},r=e.split(" ");for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var i=n("true false nil"),o=n("defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),s=n("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),l=n("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),e={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/,block_indent:/^(?:def|with)[^\/]+$|\/(?:def|with)/};function k(e,t,n){this.indent=e;this.type=t;this.prev=n};function a(e,t,n){e.indentStack=new k(t,n,e.indentStack)};function v(e){e.indentStack=e.indentStack.prev};function w(n,t){if(n==="0"&&t.eat(/x/i)){t.eatWhile(e.hex);return!0};if((n=="+"||n=="-")&&(e.digit.test(t.peek()))){t.eat(e.sign);n=t.next()};if(e.digit.test(n)){t.eat(n);t.eatWhile(e.digit);if("."==t.peek()){t.eat(".");t.eatWhile(e.digit)} +else if("/"==t.peek()){t.eat("/");t.eatWhile(e.digit)};if(t.eat(e.exponent)){t.eat(e.sign);t.eatWhile(e.digit)};return!0};return!1};function x(e){var t=e.next();if(t&&t.match(/[a-z]/)&&e.match(/[a-z]+/,!0)){return};if(t==="u"){e.match(/[0-9a-z]{4}/i,!0)}};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(t,k){if(k.indentStack==null&&t.sol()){k.indentation=t.indentation()};if(k.mode!="string"&&t.eatSpace()){return null};var q=null;switch(k.mode){case"string":var E,z=!1;while((E=t.next())!=null){if(E=="\""&&!z){k.mode=!1;break};z=!z&&E=="\\"};q=d;break;default:var n=t.next();if(n=="\""){k.mode="string";q=d} +else if(n=="\\"){x(t);q=p} +else if(n=="'"&&!(e.digit_or_colon.test(t.peek()))){q=r} +else if(n==";"){t.skipToEnd();q=u} +else if(w(n,t)){q=h} +else if(n=="("||n=="["||n=="{"){var j="",S=t.column(),M;if(n=="(")while((M=t.eat(e.keyword_char))!=null){j+=M};if(j.length>0&&(l.propertyIsEnumerable(j)||e.block_indent.test(j))){a(k,S+g,n)} +else{t.eatSpace();if(t.eol()||t.peek()==";"){a(k,S+b,n)} +else{a(k,S+t.current().length,n)}};t.backUp(t.current().length-1);q=c} +else if(n==")"||n=="]"||n=="}"){q=c;if(k.indentStack!=null&&k.indentStack.type==(n==")"?"(":(n=="]"?"[":"{"))){v(k)}} +else if(n==":"){t.eatWhile(e.symbol);return r} +else{t.eatWhile(e.symbol);if(o&&o.propertyIsEnumerable(t.current())){q=m} +else if(s&&s.propertyIsEnumerable(t.current())){q=f} +else if(i&&i.propertyIsEnumerable(t.current())){q=r} +else{q=y}}};return q},indent:function(e){if(e.indentStack==null)return e.indentation;return e.indentStack.indent},closeBrackets:{pairs:"()[]{}\"\""},lineComment:";;"}});e.defineMIME("text/x-clojure","clojure");e.defineMIME("text/x-clojurescript","clojure");e.defineMIME("application/edn","clojure")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../css/css'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../css/css'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sass',function(r){var f=e.mimeModes['text/css'],u=f.propertyKeywords||{},x=f.colorKeywords||{},y=f.valueKeywords||{},v=f.fontProperties||{};function z(e){return new RegExp('^'+e.join('|'))};var d=['true','false','null','auto'],a=new RegExp('^'+d.join('|')),k=['\\(','\\)','=','>','<','==','>=','<=','\\+','-','\\!=','/','\\*','%','and','or','not',';','\\{','\\}',':'],c=z(k),w=/^::?[a-zA-Z_][\w\-]*/,n;function t(e){return!e.peek()||e.match(/\s+$/,!1)};function l(e,r){var t=e.peek();if(t===')'){e.next();r.tokenizer=o;return'operator'} +else if(t==='('){e.next();e.eatSpace();return'operator'} +else if(t==='\''||t==='"'){r.tokenizer=s(e.next());return'string'} +else{r.tokenizer=s(')',!1);return'string'}};function p(e,r){return function(t,n){if(t.sol()&&t.indentation()<=e){n.tokenizer=o;return o(t,n)};if(r&&t.skipTo('*/')){t.next();t.next();n.tokenizer=o} +else{t.skipToEnd()};return'comment'}};function s(e,r){if(r==null){r=!0};function n(i,f){var u=i.next(),s=i.peek(),a=i.string.charAt(i.pos-2),c=((u!=='\\'&&s===e)||(u===e&&a!=='\\'));if(c){if(u!==e&&r){i.next()};if(t(i)){f.cursorHalf=0};f.tokenizer=o;return'string'} +else if(u==='#'&&s==='{'){f.tokenizer=h(n);i.next();return'operator'} +else{return'string'}};return n};function h(e){return function(r,t){if(r.peek()==='}'){r.next();t.tokenizer=e;return'operator'} +else{return o(r,t)}}};function i(e){if(e.indentCount==0){e.indentCount++;var t=e.scopes[0].offset,n=t+r.indentUnit;e.scopes.unshift({offset:n})}};function m(e){if(e.scopes.length==1)return;e.scopes.shift()};function o(e,r){var f=e.peek();if(e.match('/*')){r.tokenizer=p(e.indentation(),!0);return r.tokenizer(e,r)};if(e.match('//')){r.tokenizer=p(e.indentation(),!1);return r.tokenizer(e,r)};if(e.match('#{')){r.tokenizer=h(o);return'operator'};if(f==='"'||f==='\''){e.next();r.tokenizer=s(f);return'string'};if(!r.cursorHalf){if(f==='-'){if(e.match(/^-\w+-/)){return'meta'}};if(f==='.'){e.next();if(e.match(/^[\w-]+/)){i(r);return'qualifier'} +else if(e.peek()==='#'){i(r);return'tag'}};if(f==='#'){e.next();if(e.match(/^[\w-]+/)){i(r);return'builtin'};if(e.peek()==='#'){i(r);return'tag'}};if(f==='$'){e.next();e.eatWhile(/[\w-]/);return'variable-2'};if(e.match(/^-?[0-9\.]+/))return'number';if(e.match(/^(px|em|in)\b/))return'unit';if(e.match(a))return'keyword';if(e.match(/^url/)&&e.peek()==='('){r.tokenizer=l;return'atom'};if(f==='='){if(e.match(/^=[\w-]+/)){i(r);return'meta'}};if(f==='+'){if(e.match(/^\+[\w-]+/)){return'variable-3'}};if(f==='@'){if(e.match(/@extend/)){if(!e.match(/\s*[\w]/))m(r)}};if(e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/)){i(r);return'def'};if(f==='@'){e.next();e.eatWhile(/[\w-]/);return'def'};if(e.eatWhile(/[\w-]/)){if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){n=e.current().toLowerCase();var d=r.prevProp+'-'+n;if(u.hasOwnProperty(d)){return'property'} +else if(u.hasOwnProperty(n)){r.prevProp=n;return'property'} +else if(v.hasOwnProperty(n)){return'property'};return'tag'} +else if(e.match(/ *:/,!1)){i(r);r.cursorHalf=1;r.prevProp=e.current().toLowerCase();return'property'} +else if(e.match(/ *,/,!1)){return'tag'} +else{i(r);return'tag'}};if(f===':'){if(e.match(w)){return'variable-3'};e.next();r.cursorHalf=1;return'operator'}} +else{if(f==='#'){e.next();if(e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)){if(t(e)){r.cursorHalf=0};return'number'}};if(e.match(/^-?[0-9\.]+/)){if(t(e)){r.cursorHalf=0};return'number'};if(e.match(/^(px|em|in)\b/)){if(t(e)){r.cursorHalf=0};return'unit'};if(e.match(a)){if(t(e)){r.cursorHalf=0};return'keyword'};if(e.match(/^url/)&&e.peek()==='('){r.tokenizer=l;if(t(e)){r.cursorHalf=0};return'atom'};if(f==='$'){e.next();e.eatWhile(/[\w-]/);if(t(e)){r.cursorHalf=0};return'variable-2'};if(f==='!'){e.next();r.cursorHalf=0;return e.match(/^[\w]+/)?'keyword':'operator'};if(e.match(c)){if(t(e)){r.cursorHalf=0};return'operator'};if(e.eatWhile(/[\w-]/)){if(t(e)){r.cursorHalf=0};n=e.current().toLowerCase();if(y.hasOwnProperty(n)){return'atom'} +else if(x.hasOwnProperty(n)){return'keyword'} +else if(u.hasOwnProperty(n)){r.prevProp=e.current().toLowerCase();return'property'} +else{return'tag'}};if(t(e)){r.cursorHalf=0;return null}};if(e.match(c))return'operator';e.next();return null};function g(e,t){if(e.sol())t.indentCount=0;var u=t.tokenizer(e,t),i=e.current();if(i==='@return'||i==='}'){m(t)};if(u!==null){var s=e.pos-i.length,a=s+(r.indentUnit*t.indentCount),f=[];for(var n=0;n<t.scopes.length;n++){var o=t.scopes[n];if(o.offset<=a)f.push(o)};t.scopes=f};return u};return{startState:function(){return{tokenizer:o,scopes:[{offset:0,type:'sass'}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,r){var t=g(e,r);r.lastToken={style:t,content:e.current()};return t},indent:function(e){return e.scopes[0].offset}}},'css');e.defineMIME('text/x-sass','sass')});(function(i){if(typeof exports=='object'&&typeof module=='object')i(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],i);else i(CodeMirror)})(function(i){'use strict';i.defineMode('gas',function(t,l){'use strict';var r=[],e='',b={'.abort':'builtin','.align':'builtin','.altmacro':'builtin','.ascii':'builtin','.asciz':'builtin','.balign':'builtin','.balignw':'builtin','.balignl':'builtin','.bundle_align_mode':'builtin','.bundle_lock':'builtin','.bundle_unlock':'builtin','.byte':'builtin','.cfi_startproc':'builtin','.comm':'builtin','.data':'builtin','.def':'builtin','.desc':'builtin','.dim':'builtin','.double':'builtin','.eject':'builtin','.else':'builtin','.elseif':'builtin','.end':'builtin','.endef':'builtin','.endfunc':'builtin','.endif':'builtin','.equ':'builtin','.equiv':'builtin','.eqv':'builtin','.err':'builtin','.error':'builtin','.exitm':'builtin','.extern':'builtin','.fail':'builtin','.file':'builtin','.fill':'builtin','.float':'builtin','.func':'builtin','.global':'builtin','.gnu_attribute':'builtin','.hidden':'builtin','.hword':'builtin','.ident':'builtin','.if':'builtin','.incbin':'builtin','.include':'builtin','.int':'builtin','.internal':'builtin','.irp':'builtin','.irpc':'builtin','.lcomm':'builtin','.lflags':'builtin','.line':'builtin','.linkonce':'builtin','.list':'builtin','.ln':'builtin','.loc':'builtin','.loc_mark_labels':'builtin','.local':'builtin','.long':'builtin','.macro':'builtin','.mri':'builtin','.noaltmacro':'builtin','.nolist':'builtin','.octa':'builtin','.offset':'builtin','.org':'builtin','.p2align':'builtin','.popsection':'builtin','.previous':'builtin','.print':'builtin','.protected':'builtin','.psize':'builtin','.purgem':'builtin','.pushsection':'builtin','.quad':'builtin','.reloc':'builtin','.rept':'builtin','.sbttl':'builtin','.scl':'builtin','.section':'builtin','.set':'builtin','.short':'builtin','.single':'builtin','.size':'builtin','.skip':'builtin','.sleb128':'builtin','.space':'builtin','.stab':'builtin','.string':'builtin','.struct':'builtin','.subsection':'builtin','.symver':'builtin','.tag':'builtin','.text':'builtin','.title':'builtin','.type':'builtin','.uleb128':'builtin','.val':'builtin','.version':'builtin','.vtable_entry':'builtin','.vtable_inherit':'builtin','.warning':'builtin','.weak':'builtin','.weakref':'builtin','.word':'builtin'};var i={};function a(t){e='#';i.ax='variable';i.eax='variable-2';i.rax='variable-3';i.bx='variable';i.ebx='variable-2';i.rbx='variable-3';i.cx='variable';i.ecx='variable-2';i.rcx='variable-3';i.dx='variable';i.edx='variable-2';i.rdx='variable-3';i.si='variable';i.esi='variable-2';i.rsi='variable-3';i.di='variable';i.edi='variable-2';i.rdi='variable-3';i.sp='variable';i.esp='variable-2';i.rsp='variable-3';i.bp='variable';i.ebp='variable-2';i.rbp='variable-3';i.ip='variable';i.eip='variable-2';i.rip='variable-3';i.cs='keyword';i.ds='keyword';i.ss='keyword';i.es='keyword';i.fs='keyword';i.gs='keyword'};function o(t){e='@';b.syntax='builtin';i.r0='variable';i.r1='variable';i.r2='variable';i.r3='variable';i.r4='variable';i.r5='variable';i.r6='variable';i.r7='variable';i.r8='variable';i.r9='variable';i.r10='variable';i.r11='variable';i.r12='variable';i.sp='variable-2';i.lr='variable-2';i.pc='variable-2';i.r13=i.sp;i.r14=i.lr;i.r15=i.pc;r.push(function(i,t){if(i==='#'){t.eatWhile(/\w/);return'number'}})};var n=(l.architecture||'x86').toLowerCase();if(n==='x86'){a(l)} +else if(n==='arm'||n==='armv6'){o(l)};function s(i,t){var l=!1,e;while((e=i.next())!=null){if(e===t&&!l){return!1};l=!l&&e==='\\'};return l};function u(i,t){var e=!1,l;while((l=i.next())!=null){if(l==='/'&&e){t.tokenize=null;break};e=(l==='*')};return'comment'};return{startState:function(){return{tokenize:null}},token:function(t,n){if(n.tokenize){return n.tokenize(t,n)};if(t.eatSpace()){return null};var a,o,l=t.next();if(l==='/'){if(t.eat('*')){n.tokenize=u;return u(t,n)}};if(l===e){t.skipToEnd();return'comment'};if(l==='"'){s(t,'"');return'string'};if(l==='.'){t.eatWhile(/\w/);o=t.current().toLowerCase();a=b[o];return a||null};if(l==='='){t.eatWhile(/\w/);return'tag'};if(l==='{'){return'braket'};if(l==='}'){return'braket'};if(/\d/.test(l)){if(l==='0'&&t.eat('x')){t.eatWhile(/[0-9a-fA-F]/);return'number'};t.eatWhile(/\d/);return'number'};if(/\w/.test(l)){t.eatWhile(/\w/);if(t.eat(':')){return'tag'};o=t.current().toLowerCase();a=i[o];return a||null};for(var c=0;c<r.length;c++){a=r[c](l,t,n);if(a){return a}}},lineComment:e,blockCommentStart:'/*',blockCommentEnd:'*/'}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sas',function(){var e={};var n={eq:'operator',lt:'operator',le:'operator',gt:'operator',ge:'operator','in':'operator',ne:'operator',or:'operator'};var r=/(<=|>=|!=|<>)/,s=/[=\(:\),{}.*<>+\-\/^\[\]]/;function t(t,n,s){if(s){var o=n.split(' ');for(var r=0;r<o.length;r++){e[o[r]]={style:t,state:s}}}};t('def','stack pgm view source debug nesting nolist',['inDataStep']);t('def','if while until for do do; end end; then else cancel',['inDataStep']);t('def','label format _n_ _error_',['inDataStep']);t('def','ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME',['inDataStep']);t('def','filevar finfo finv fipname fipnamel fipstate first firstobs floor',['inDataStep']);t('def','varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday',['inDataStep']);t('def','zipfips zipname zipnamel zipstate',['inDataStep']);t('def','put putc putn',['inDataStep']);t('builtin','data run',['inDataStep']);t('def','data',['inProc']);t('def','%if %end %end; %else %else; %do %do; %then',['inMacro']);t('builtin','proc run; quit; libname filename %macro %mend option options',['ALL']);t('def','footnote title libname ods',['ALL']);t('def','%let %put %global %sysfunc %eval ',['ALL']);t('variable','&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext',['ALL']);t('def','source2 nosource2 page pageno pagesize',['ALL']);t('def','_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max',['inDataStep','inProc']);t('operator','and not ',['inDataStep','inProc']);function o(t,a){var i=t.next();if(i==='/'&&t.eat('*')){a.continueComment=!0;return'comment'} +else if(a.continueComment===!0){if(i==='*'&&t.peek()==='/'){t.next();a.continueComment=!1} +else if(t.skipTo('*')){t.skipTo('*');t.next();if(t.eat('/'))a.continueComment=!1} +else{t.skipToEnd()};return'comment'};if(i=='*'&&t.column()==t.indentation()){t.skipToEnd();return'comment'};var c=i+t.peek();if((i==='"'||i==='\'')&&!a.continueString){a.continueString=i;return'string'} +else if(a.continueString){if(a.continueString==i){a.continueString=null} +else if(t.skipTo(a.continueString)){t.next();a.continueString=null} +else{t.skipToEnd()};return'string'} +else if(a.continueString!==null&&t.eol()){t.skipTo(a.continueString)||t.skipToEnd();return'string'} +else if(/[\d\.]/.test(i)){if(i==='.')t.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);else if(i==='0')t.match(/^[xX][0-9a-fA-F]+/)||t.match(/^0[0-7]+/);else t.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);return'number'} +else if(r.test(i+t.peek())){t.next();return'operator'} +else if(n.hasOwnProperty(c)){t.next();if(t.peek()===' ')return n[c.toLowerCase()]} +else if(s.test(i)){return'operator'};var o;if(t.match(/[%&;\w]+/,!1)!=null){o=i+t.match(/[%&;\w]+/,!0);if(/&/.test(o))return'variable'} +else{o=i};if(a.nextword){t.match(/[\w]+/);if(t.peek()==='.')t.skipTo(' ');a.nextword=!1;return'variable-2'};o=o.toLowerCase();if(a.inDataStep){if(o==='run;'||t.match(/run\s;/)){a.inDataStep=!1;return'builtin'};if((o)&&t.next()==='.'){if(/\w/.test(t.peek()))return'variable-2';else return'variable'};if(o&&e.hasOwnProperty(o)&&(e[o].state.indexOf('inDataStep')!==-1||e[o].state.indexOf('ALL')!==-1)){if(t.start<t.pos)t.backUp(t.pos-t.start);for(var l=0;l<o.length;++l)t.next();return e[o].style}};if(a.inProc){if(o==='run;'||o==='quit;'){a.inProc=!1;return'builtin'};if(o&&e.hasOwnProperty(o)&&(e[o].state.indexOf('inProc')!==-1||e[o].state.indexOf('ALL')!==-1)){t.match(/[\w]+/);return e[o].style}};if(a.inMacro){if(o==='%mend'){if(t.peek()===';')t.next();a.inMacro=!1;return'builtin'};if(o&&e.hasOwnProperty(o)&&(e[o].state.indexOf('inMacro')!==-1||e[o].state.indexOf('ALL')!==-1)){t.match(/[\w]+/);return e[o].style};return'atom'};if(o&&e.hasOwnProperty(o)){t.backUp(1);t.match(/[\w]+/);if(o==='data'&&/=/.test(t.peek())===!1){a.inDataStep=!0;a.nextword=!0;return'builtin'};if(o==='proc'){a.inProc=!0;a.nextword=!0;return'builtin'};if(o==='%macro'){a.inMacro=!0;a.nextword=!0;return'builtin'};if(/title[1-9]/.test(o))return'def';if(o==='footnote'){t.eat(/[1-9]/);return'def'};if(a.inDataStep===!0&&e[o].state.indexOf('inDataStep')!==-1)return e[o].style;if(a.inProc===!0&&e[o].state.indexOf('inProc')!==-1)return e[o].style;if(a.inMacro===!0&&e[o].state.indexOf('inMacro')!==-1)return e[o].style;if(e[o].state.indexOf('ALL')!==-1)return e[o].style;return null};return null};return{startState:function(){return{inDataStep:!1,inProc:!1,inMacro:!1,nextword:!1,continueString:null,continueComment:!1}},token:function(e,t){if(e.eatSpace())return null;return o(e,t)},blockCommentStart:'/*',blockCommentEnd:'*/'}});e.defineMIME('text/x-sas','sas')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('julia',function(e,t){function i(e,t){if(typeof t==='undefined'){t='\\b'};return new RegExp('^(('+e.join(')|(')+'))'+t)};var u='\\\\[0-7]{1,3}',s='\\\\x[A-Fa-f0-9]{1,2}',c='\\\\[abefnrtv0%?\'"\\\\]',l='([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])',m=t.operators||i(['[<>]:','[<>=]=','<<=?','>>>?=?','=>','->','\\/\\/','[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?','\\?','\\$','~',':','\\u00D7','\\u2208','\\u2209','\\u220B','\\u220C','\\u2218','\\u221A','\\u221B','\\u2229','\\u222A','\\u2260','\\u2264','\\u2265','\\u2286','\\u2288','\\u228A','\\u22C5','\\b(in|isa)\\b(?!\.?\\()'],''),h=t.delimiters||/^[;,()[\]{}]/,p=t.identifiers||/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/,d=i([u,s,c,l],'\''),v=i(['begin','function','type','struct','immutable','let','macro','for','while','quote','if','else','elseif','try','finally','catch','do']),k=i(['end','else','elseif','catch','finally']),b=i(['if','else','elseif','while','for','begin','let','end','do','try','catch','finally','return','break','continue','global','local','const','export','import','importall','using','function','where','macro','module','baremodule','struct','type','mutable','immutable','quote','typealias','abstract','primitive','bitstype']),F=i(['true','false','nothing','NaN','Inf']),g=/^@[_A-Za-z][\w]*/,x=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/,z=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;function a(e){return o(e,'[')};function o(e,t){var n=r(e),i=r(e,1);if(typeof(t)==='undefined'){t='('};if(n===t||(i===t&&n==='for')){return!0};return!1};function r(e,t){if(typeof(t)==='undefined'){t=0};if(e.scopes.length<=t){return null};return e.scopes[e.scopes.length-(t+1)]};function n(e,t){if(e.match(/^#=/,!1)){t.tokenize=E;return t.tokenize(e,t)};var f=t.leavingExpr;if(e.sol()){f=!1};t.leavingExpr=!1;if(f){if(e.match(/^'+/)){return'operator'}};if(e.match(/\.{4,}/)){return'error'} +else if(e.match(/\.{1,3}/)){return'operator'};if(e.eatSpace()){return null};var i=e.peek();if(i==='#'){e.skipToEnd();return'comment'};if(i==='['){t.scopes.push('[')};if(i==='('){t.scopes.push('(')};var s=r(t);if(a(t)&&i===']'){if(s==='for'){t.scopes.pop()};t.scopes.pop();t.leavingExpr=!0};if(o(t)&&i===')'){if(s==='for'){t.scopes.pop()};t.scopes.pop();t.leavingExpr=!0};if(a(t)){if(t.lastToken=='end'&&e.match(/^:/)){return'operator'};if(e.match(/^end/)){return'number'}};var u;if(u=e.match(v,!1)){t.scopes.push(u[0])};if(e.match(k,!1)){t.scopes.pop()};if(e.match(/^::(?![:\$])/)){t.tokenize=y;return t.tokenize(e,t)};if(!f&&e.match(x)||e.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)){return'builtin'};if(e.match(m)){return'operator'};if(e.match(/^\.?\d/,!1)){var l=RegExp(/^im\b/),n=!1;if(e.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)){n=!0};if(e.match(/^\d+\.(?!\.)\d*/)){n=!0};if(e.match(/^\.\d+/)){n=!0};if(e.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)){n=!0};if(e.match(/^0x[0-9a-f]+/i)){n=!0};if(e.match(/^0b[01]+/i)){n=!0};if(e.match(/^0o[0-7]+/i)){n=!0};if(e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)){n=!0};if(e.match(/^0(?![\dx])/i)){n=!0};if(n){e.match(l);t.leavingExpr=!0;return'number'}};if(e.match(/^'/)){t.tokenize=P;return t.tokenize(e,t)};if(e.match(z)){t.tokenize=D(e.current());return t.tokenize(e,t)};if(e.match(g)){return'meta'};if(e.match(h)){return null};if(e.match(b)){return'keyword'};if(e.match(F)){return'builtin'};var c=t.isDefinition||t.lastToken=='function'||t.lastToken=='macro'||t.lastToken=='type'||t.lastToken=='struct'||t.lastToken=='immutable';if(e.match(p)){if(c){if(e.peek()==='.'){t.isDefinition=!0;return'variable'};t.isDefinition=!1;return'def'};if(e.match(/^({[^}]*})*\(/,!1)){t.tokenize=A;return t.tokenize(e,t)};t.leavingExpr=!0;return'variable'};e.next();return'error'};function A(t,e){var i=t.match(/^(\(\s*)/);if(i){if(e.firstParenPos<0)e.firstParenPos=e.scopes.length;e.scopes.push('(');e.charsAdvanced+=i[1].length};if(r(e)=='('&&t.match(/^\)/)){e.scopes.pop();e.charsAdvanced+=1;if(e.scopes.length<=e.firstParenPos){var a=t.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/,!1);t.backUp(e.charsAdvanced);e.firstParenPos=-1;e.charsAdvanced=0;e.tokenize=n;if(a)return'def';return'builtin'}};if(t.match(/^$/g,!1)){t.backUp(e.charsAdvanced);while(e.scopes.length>e.firstParenPos)e.scopes.pop();e.firstParenPos=-1;e.charsAdvanced=0;e.tokenize=n;return'builtin'};e.charsAdvanced+=t.match(/^([^()]*)/)[1].length;return e.tokenize(t,e)};function y(e,t){e.match(/.*?(?=,|;|{|}|\(|\)|=|$|\s)/);if(e.match(/^{/)){t.nestedLevels++} +else if(e.match(/^}/)){t.nestedLevels--};if(t.nestedLevels>0){e.match(/.*?(?={|})/)||e.next()} +else if(t.nestedLevels==0){t.tokenize=n};return'builtin'};function E(e,t){if(e.match(/^#=/)){t.nestedLevels++};if(!e.match(/.*?(?=(#=|=#))/)){e.skipToEnd()};if(e.match(/^=#/)){t.nestedLevels--;if(t.nestedLevels==0)t.tokenize=n};return'comment'};function P(e,t){var r=!1,a;if(e.match(d)){r=!0} +else if(a=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){var i=parseInt(a[1],16);if(i<=55295||i>=57344){r=!0;e.next()}} +else if(a=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var i=parseInt(a[1],16);if(i<=1114111){r=!0;e.next()}};if(r){t.leavingExpr=!0;t.tokenize=n;return'string'};if(!e.match(/^[^']+(?=')/)){e.skipToEnd()};if(e.match(/^'/)){t.tokenize=n};return'error'};function D(e){if(e.substr(-3)==='"""'){e='"""'} +else if(e.substr(-1)==='"'){e='"'};function t(t,i){if(t.eat('\\')){t.next()} +else if(t.match(e)){i.tokenize=n;i.leavingExpr=!0;return'string'} +else{t.eat(/[`"]/)};t.eatWhile(/[^\\`"]/);return'string'};return t};var f={startState:function(){return{tokenize:n,scopes:[],lastToken:null,leavingExpr:!1,isDefinition:!1,nestedLevels:0,charsAdvanced:0,firstParenPos:-1}},token:function(e,t){var n=t.tokenize(e,t),i=e.current();if(i&&n){t.lastToken=i};return n},indent:function(n,t){var i=0;if(t===']'||t===')'||t==='end'||t==='else'||t==='catch'||t==='elseif'||t==='finally'){i=-1};return(n.scopes.length+i)*e.indentUnit},electricInput:/\b(end|else|catch|finally)\b/,blockCommentStart:'#=',blockCommentEnd:'=#',lineComment:'#',fold:'indent'};return f});e.defineMIME('text/x-julia','julia')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('fcl',function(e){var o=e.indentUnit,l={'term':!0,'method':!0,'accu':!0,'rule':!0,'then':!0,'is':!0,'and':!0,'or':!0,'if':!0,'default':!0};var i={'var_input':!0,'var_output':!0,'fuzzify':!0,'defuzzify':!0,'function_block':!0,'ruleblock':!0};var n={'end_ruleblock':!0,'end_defuzzify':!0,'end_function_block':!0,'end_fuzzify':!0,'end_var':!0};var a={'true':!0,'false':!0,'nan':!0,'real':!0,'min':!0,'max':!0,'cog':!0,'cogs':!0};var r=/[+\-*&^%:=<>!|\/]/;function t(e,t){var o=e.next();if(/[\d\.]/.test(o)){if(o=='.'){e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/)} +else if(o=='0'){e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/)} +else{e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/)};return'number'};if(o=='/'||o=='('){if(e.eat('*')){t.tokenize=u;return u(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(r.test(o)){e.eatWhile(r);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var f=e.current().toLowerCase();if(l.propertyIsEnumerable(f)||i.propertyIsEnumerable(f)||n.propertyIsEnumerable(f)){return'keyword'};if(a.propertyIsEnumerable(f))return'atom';return'variable'};function u(e,n){var i=!1,r;while(r=e.next()){if((r=='/'||r==')')&&i){n.tokenize=t;break};i=(r=='*')};return'comment'};function f(e,n,t,r,i){this.indented=e;this.column=n;this.type=t;this.align=r;this.prev=i};function c(e,n,t){return e.context=new f(e.indented,n,t,null,e.context)};function d(e){if(!e.context.prev)return;var n=e.context.type;if(n=='end_block')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new f((e||0)-o,0,'top',!1),indented:0,startOfLine:!0}},token:function(e,r){var o=r.context;if(e.sol()){if(o.align==null)o.align=!1;r.indented=e.indentation();r.startOfLine=!0};if(e.eatSpace())return null;var u=(r.tokenize||t)(e,r);if(u=='comment')return u;if(o.align==null)o.align=!0;var f=e.current().toLowerCase();if(i.propertyIsEnumerable(f))c(r,e.column(),'end_block');else if(n.propertyIsEnumerable(f))d(r);r.startOfLine=!1;return u},indent:function(e,r){if(e.tokenize!=t&&e.tokenize!=null)return 0;var i=e.context,u=n.propertyIsEnumerable(r);if(i.align)return i.column+(u?0:1);else return i.indented+(u?0:o)},electricChars:'ryk',fold:'brace',blockCommentStart:'(*',blockCommentEnd:'*)',lineComment:'//'}});e.defineMIME('text/x-fcl','fcl')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../htmlmixed/htmlmixed'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../htmlmixed/htmlmixed','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('tornado:inner',function(){var e=['and','as','assert','autoescape','block','break','class','comment','context','continue','datetime','def','del','elif','else','end','escape','except','exec','extends','false','finally','for','from','global','if','import','in','include','is','json_encode','lambda','length','linkify','load','module','none','not','or','pass','print','put','raise','raw','return','self','set','squeeze','super','true','try','url_escape','while','with','without','xhtml_escape','yield'];e=new RegExp('^(('+e.join(')|(')+'))\\b');function t(e,t){e.eatWhile(/[^\{]/);var o=e.next();if(o=='{'){if(o=e.eat(/\{|%|#/)){t.tokenize=n(o);return'tag'}}};function n(n){if(n=='{'){n='}'};return function(o,r){var i=o.next();if((i==n)&&o.eat('}')){r.tokenize=t;return'tag'};if(o.match(e)){return'keyword'};return n=='#'?'comment':'string'}};return{startState:function(){return{tokenize:t}},token:function(e,t){return t.tokenize(e,t)}}});e.defineMode('tornado',function(t){var n=e.getMode(t,'text/html'),o=e.getMode(t,'tornado:inner');return e.overlayMode(n,o)});e.defineMIME('text/x-tornado','tornado')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('asterisk',function(){var e=['exten','same','include','ignorepat','switch'],t=['#include','#exec'],i=['addqueuemember','adsiprog','aelsub','agentlogin','agentmonitoroutgoing','agi','alarmreceiver','amd','answer','authenticate','background','backgrounddetect','bridge','busy','callcompletioncancel','callcompletionrequest','celgenuserevent','changemonitor','chanisavail','channelredirect','chanspy','clearhash','confbridge','congestion','continuewhile','controlplayback','dahdiacceptr2call','dahdibarge','dahdiras','dahdiscan','dahdisendcallreroutingfacility','dahdisendkeypadfacility','datetime','dbdel','dbdeltree','deadagi','dial','dictate','directory','disa','dumpchan','eagi','echo','endwhile','exec','execif','execiftime','exitwhile','extenspy','externalivr','festival','flash','followme','forkcdr','getcpeid','gosub','gosubif','goto','gotoif','gotoiftime','hangup','iax2provision','ices','importvar','incomplete','ivrdemo','jabberjoin','jabberleave','jabbersend','jabbersendgroup','jabberstatus','jack','log','macro','macroexclusive','macroexit','macroif','mailboxexists','meetme','meetmeadmin','meetmechanneladmin','meetmecount','milliwatt','minivmaccmess','minivmdelete','minivmgreet','minivmmwi','minivmnotify','minivmrecord','mixmonitor','monitor','morsecode','mp3player','mset','musiconhold','nbscat','nocdr','noop','odbc','odbc','odbcfinish','originate','ospauth','ospfinish','osplookup','ospnext','page','park','parkandannounce','parkedcall','pausemonitor','pausequeuemember','pickup','pickupchan','playback','playtones','privacymanager','proceeding','progress','queue','queuelog','raiseexception','read','readexten','readfile','receivefax','receivefax','receivefax','record','removequeuemember','resetcdr','retrydial','return','ringing','sayalpha','saycountedadj','saycountednoun','saycountpl','saydigits','saynumber','sayphonetic','sayunixtime','senddtmf','sendfax','sendfax','sendfax','sendimage','sendtext','sendurl','set','setamaflags','setcallerpres','setmusiconhold','sipaddheader','sipdtmfmode','sipremoveheader','skel','slastation','slatrunk','sms','softhangup','speechactivategrammar','speechbackground','speechcreate','speechdeactivategrammar','speechdestroy','speechloadgrammar','speechprocessingsound','speechstart','speechunloadgrammar','stackpop','startmusiconhold','stopmixmonitor','stopmonitor','stopmusiconhold','stopplaytones','system','testclient','testserver','transfer','tryexec','trysystem','unpausemonitor','unpausequeuemember','userevent','verbose','vmauthenticate','vmsayname','voicemail','voicemailmain','wait','waitexten','waitfornoise','waitforring','waitforsilence','waitmusiconhold','waituntil','while','zapateller'];function n(i,a){var r='',n=i.next();if(n==';'){i.skipToEnd();return'comment'};if(n=='['){i.skipTo(']');i.eat(']');return'header'};if(n=='"'){i.skipTo('"');return'string'};if(n=='\''){i.skipTo('\'');return'string-2'};if(n=='#'){i.eatWhile(/\w/);r=i.current();if(t.indexOf(r)!==-1){i.skipToEnd();return'strong'}};if(n=='$'){var o=i.peek();if(o=='{'){i.skipTo('}');i.eat('}');return'variable-3'}};i.eatWhile(/\w/);r=i.current();if(e.indexOf(r)!==-1){a.extenStart=!0;switch(r){case'same':a.extenSame=!0;break;case'include':case'switch':case'ignorepat':a.extenInclude=!0;break;default:break};return'atom'}};return{startState:function(){return{extenStart:!1,extenSame:!1,extenInclude:!1,extenExten:!1,extenPriority:!1,extenApplication:!1}},token:function(t,e){var r='';if(t.eatSpace())return null;if(e.extenStart){t.eatWhile(/[^\s]/);r=t.current();if(/^=>?$/.test(r)){e.extenExten=!0;e.extenStart=!1;return'strong'} +else{e.extenStart=!1;t.skipToEnd();return'error'}} +else if(e.extenExten){e.extenExten=!1;e.extenPriority=!0;t.eatWhile(/[^,]/);if(e.extenInclude){t.skipToEnd();e.extenPriority=!1;e.extenInclude=!1};if(e.extenSame){e.extenPriority=!1;e.extenSame=!1;e.extenApplication=!0};return'tag'} +else if(e.extenPriority){e.extenPriority=!1;e.extenApplication=!0;t.next();if(e.extenSame)return null;t.eatWhile(/[^,]/);return'number'} +else if(e.extenApplication){t.eatWhile(/,/);r=t.current();if(r===',')return null;t.eatWhile(/\w/);r=t.current().toLowerCase();e.extenApplication=!1;if(i.indexOf(r)!==-1){return'def strong'}} +else{return n(t,e)};return null}}});e.defineMIME('text/x-asterisk','asterisk')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sql',function(t,r){'use strict';var c=r.client||{},u=r.atoms||{'false':!0,'true':!0,'null':!0},d=r.builtin||{},m=r.keywords||{},s=r.operatorChars||/^[*+\-%<>!=&|~^]/,a=r.support||{},o=r.hooks||{},p=r.dateSQL||{'date':!0,'time':!0,'timestamp':!0};function i(e,r){var t=e.next();if(o[t]){var l=o[t](e,r);if(l!==!1)return l};if(a.hexNumber&&((t=='0'&&e.match(/^[xX][0-9a-fA-F]+/))||(t=='x'||t=='X')&&e.match(/^'[0-9a-fA-F]+'/))){return'number'} +else if(a.binaryNumber&&(((t=='b'||t=='B')&&e.match(/^'[01]+'/))||(t=='0'&&e.match(/^b[01]+/)))){return'number'} +else if(t.charCodeAt(0)>47&&t.charCodeAt(0)<58){e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/);a.decimallessFloat&&e.match(/^\.(?!\.)/);return'number'} +else if(t=='?'&&(e.eatSpace()||e.eol()||e.eat(';'))){return'variable-3'} +else if(t=='\''||(t=='"'&&a.doubleQuote)){r.tokenize=g(t);return r.tokenize(e,r)} +else if((((a.nCharCast&&(t=='n'||t=='N'))||(a.charsetCast&&t=='_'&&e.match(/[a-z][a-z0-9]*/i)))&&(e.peek()=='\''||e.peek()=='"'))){return'keyword'} +else if(/^[\(\),\;\[\]]/.test(t)){return null} +else if(a.commentSlashSlash&&t=='/'&&e.eat('/')){e.skipToEnd();return'comment'} +else if((a.commentHash&&t=='#')||(t=='-'&&e.eat('-')&&(!a.commentSpaceRequired||e.eat(' ')))){e.skipToEnd();return'comment'} +else if(t=='/'&&e.eat('*')){r.tokenize=n(1);return r.tokenize(e,r)} +else if(t=='.'){if(a.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i))return'number';if(e.match(/^\.+/))return null;if(a.ODBCdotTable&&e.match(/^[\w\d_]+/))return'variable-2'} +else if(s.test(t)){e.eatWhile(s);return null} +else if(t=='{'&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))){return'number'} +else{e.eatWhile(/^[_\w\d]/);var i=e.current().toLowerCase();if(p.hasOwnProperty(i)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/)))return'number';if(u.hasOwnProperty(i))return'atom';if(d.hasOwnProperty(i))return'builtin';if(m.hasOwnProperty(i))return'keyword';if(c.hasOwnProperty(i))return'string-2';return null}};function g(e){return function(t,r){var a=!1,n;while((n=t.next())!=null){if(n==e&&!a){r.tokenize=i;break};a=!a&&n=='\\'};return'string'}};function n(e){return function(t,r){var a=t.match(/^.*?(\/\*|\*\/)/);if(!a)t.skipToEnd();else if(a[1]=='/*')r.tokenize=n(e+1);else if(e>1)r.tokenize=n(e-1);else r.tokenize=i;return'comment'}};function l(e,t,r){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:r}};function h(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:i,context:null}},token:function(e,t){if(e.sol()){if(t.context&&t.context.align==null)t.context.align=!1};if(t.tokenize==i&&e.eatSpace())return null;var a=t.tokenize(e,t);if(a=='comment')return a;if(t.context&&t.context.align==null)t.context.align=!0;var r=e.current();if(r=='(')l(e,t,')');else if(r=='[')l(e,t,']');else if(t.context&&t.context.type==r)h(t);return a},indent:function(r,a){var i=r.context;if(!i)return e.Pass;var n=a.charAt(0)==i.type;if(i.align)return i.col+(n?0:1);else return i.indent+(n?0:t.indentUnit)},blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:a.commentSlashSlash?'//':a.commentHash?'#':'--'}});(function(){'use strict';function i(e){var t;while((t=e.next())!=null){if(t=='`'&&!e.eat('`'))return'variable-2'};e.backUp(e.current().length-1);return e.eatWhile(/\w/)?'variable-2':null};function s(e){var t;while((t=e.next())!=null){if(t=='"'&&!e.eat('"'))return'variable-2'};e.backUp(e.current().length-1);return e.eatWhile(/\w/)?'variable-2':null};function r(e){if(e.eat('@')){e.match(/^session\./);e.match(/^local\./);e.match(/^global\./)};if(e.eat('\'')){e.match(/^.*'/);return'variable-2'} +else if(e.eat('"')){e.match(/^.*"/);return'variable-2'} +else if(e.eat('`')){e.match(/^.*`/);return'variable-2'} +else if(e.match(/^[0-9a-zA-Z$\.\_]+/)){return'variable-2'};return null};function n(e){if(e.eat('N')){return'atom'};return e.match(/^[a-zA-Z.#!?]/)?'variable-2':null};var a='alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ';function t(e){var r={},a=e.split(' ');for(var t=0;t<a.length;++t)r[a[t]]=!0;return r};e.defineMIME('text/x-sql',{name:'sql',keywords:t(a+'begin'),builtin:t('bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable doubleQuote binaryNumber hexNumber')});e.defineMIME('text/x-mssql',{name:'sql',client:t('charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee'),keywords:t(a+'begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec'),builtin:t('bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table '),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=]/,dateSQL:t('date datetimeoffset datetime2 smalldatetime datetime time'),hooks:{'@':r}});e.defineMIME('text/x-mysql',{name:'sql',client:t('charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee'),keywords:t(a+'accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat'),builtin:t('bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired'),hooks:{'@':r,'`':i,'\\':n}});e.defineMIME('text/x-mariadb',{name:'sql',client:t('charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee'),keywords:t(a+'accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat'),builtin:t('bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired'),hooks:{'@':r,'`':i,'\\':n}});e.defineMIME('text/x-sqlite',{name:'sql',client:t('auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width'),keywords:t(a+'abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without'),builtin:t('bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real'),atoms:t('null current_date current_time current_timestamp'),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:t('date time timestamp datetime'),support:t('decimallessFloat zerolessFloat'),identifierQuote:'"',hooks:{'@':r,':':r,'?':r,'$':r,'"':s,'`':i}});e.defineMIME('text/x-cassandra',{name:'sql',client:{},keywords:t('add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime'),builtin:t('ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint'),atoms:t('false true infinity NaN'),operatorChars:/^[<>=]/,dateSQL:{},support:t('commentSlashSlash decimallessFloat'),hooks:{}});e.defineMIME('text/x-plsql',{name:'sql',client:t('appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap'),keywords:t('abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work'),builtin:t('abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml'),operatorChars:/^[*+\-%<>!=~]/,dateSQL:t('date time timestamp'),support:t('doubleQuote nCharCast zerolessFloat binaryNumber hexNumber')});e.defineMIME('text/x-hive',{name:'sql',keywords:t('select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with'),builtin:t('bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=]/,dateSQL:t('date timestamp'),support:t('ODBCdotTable doubleQuote binaryNumber hexNumber')});e.defineMIME('text/x-pgsql',{name:'sql',client:t('source'),keywords:t(a+'a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone'),builtin:t('bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast')});e.defineMIME('text/x-gql',{name:'sql',keywords:t('ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where'),atoms:t('false true'),builtin:t('blob datetime first key __key__ string integer double boolean null'),operatorChars:/^[*+\-%<>!=]/});e.defineMIME('text/x-gpsql',{name:'sql',client:t('source'),keywords:t('abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone'),builtin:t('bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml'),atoms:t('false true null unknown'),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast')});e.defineMIME('text/x-sparksql',{name:'sql',keywords:t('add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with'),builtin:t('tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat'),atoms:t('false true null'),operatorChars:/^[*+\-%<>!=~&|^]/,dateSQL:t('date time timestamp'),support:t('ODBCdotTable doubleQuote zerolessFloat')});e.defineMIME('text/x-esper',{name:'sql',client:t('source'),keywords:t('alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window'),builtin:{},atoms:t('false true null'),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:t('time'),support:t('decimallessFloat zerolessFloat binaryNumber hexNumber')})}())});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../markdown/markdown'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../markdown/markdown','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode('gfm',function(a,n){var r=0;function c(e){e.code=!1;return null};var s={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,a){a.combineTokens=null;if(a.codeBlock){if(e.match(/^```+/)){a.codeBlock=!1;return null};e.skipToEnd();return null};if(e.sol()){a.code=!1};if(e.sol()&&e.match(/^```+/)){e.skipToEnd();a.codeBlock=!0;return null};if(e.peek()==='`'){e.next();var i=e.pos;e.eatWhile('`');var o=1+e.pos-i;if(!a.code){r=o;a.code=!0} +else{if(o===r){a.code=!1}};return null} +else if(a.code){e.next();return null};if(e.eatSpace()){a.ateSpace=!0;return null};if(e.sol()||a.ateSpace){a.ateSpace=!1;if(n.gitHubSpice!==!1){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)){a.combineTokens=!0;return'link'} +else if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)){a.combineTokens=!0;return'link'}}};if(e.match(t)&&e.string.slice(e.start-2,e.start)!=']('&&(e.start==0||/\W/.test(e.string.charAt(e.start-1)))){a.combineTokens=!0;return'link'};e.next();return null},blankLine:c};var o={taskLists:!0,strikethrough:!0,emoji:!0};for(var i in n){o[i]=n[i]};o.name='markdown';return e.overlayMode(e.getMode(a,o),s)},'markdown');e.defineMIME('text/x-gfm','gfm')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('mllike',function(r,e){var o={'let':'keyword','rec':'keyword','in':'keyword','of':'keyword','and':'keyword','if':'keyword','then':'keyword','else':'keyword','for':'keyword','to':'keyword','while':'keyword','do':'keyword','done':'keyword','fun':'keyword','function':'keyword','val':'keyword','type':'keyword','mutable':'keyword','match':'keyword','with':'keyword','try':'keyword','open':'builtin','ignore':'builtin','begin':'keyword','end':'keyword'};var i=e.extraWords||{};for(var t in i){if(i.hasOwnProperty(t)){o[t]=e.extraWords[t]}};function n(r,t){var n=r.next();if(n==='"'){t.tokenize=d;return t.tokenize(r,t)};if(n==='('){if(r.eat('*')){t.commentLevel++;t.tokenize=l;return t.tokenize(r,t)}};if(n==='~'){r.eatWhile(/\w/);return'variable-2'};if(n==='`'){r.eatWhile(/\w/);return'quote'};if(n==='/'&&e.slashComments&&r.eat('/')){r.skipToEnd();return'comment'};if(/\d/.test(n)){r.eatWhile(/[\d]/);if(r.eat('.')){r.eatWhile(/[\d]/)};return'number'};if(/[+\-*&%=<>!?|]/.test(n)){return'operator'};if(/[\w\xa1-\uffff]/.test(n)){r.eatWhile(/[\w\xa1-\uffff]/);var i=r.current();return o.hasOwnProperty(i)?o[i]:'variable'};return null};function d(e,r){var o,i=!1,t=!1;while((o=e.next())!=null){if(o==='"'&&!t){i=!0;break};t=!t&&o==='\\'};if(i&&!t){r.tokenize=n};return'string'};function l(r,e){var o,t;while(e.commentLevel>0&&(t=r.next())!=null){if(o==='('&&t==='*')e.commentLevel++;if(o==='*'&&t===')')e.commentLevel--;o=t};if(e.commentLevel<=0){e.tokenize=n};return'comment'};return{startState:function(){return{tokenize:n,commentLevel:0}},token:function(e,r){if(e.eatSpace())return null;return r.tokenize(e,r)},blockCommentStart:'(*',blockCommentEnd:'*)',lineComment:e.slashComments?'//':null}});e.defineMIME('text/x-ocaml',{name:'mllike',extraWords:{'succ':'keyword','trace':'builtin','exit':'builtin','print_string':'builtin','print_endline':'builtin','true':'atom','false':'atom','raise':'keyword'}});e.defineMIME('text/x-fsharp',{name:'mllike',extraWords:{'abstract':'keyword','as':'keyword','assert':'keyword','base':'keyword','class':'keyword','default':'keyword','delegate':'keyword','downcast':'keyword','downto':'keyword','elif':'keyword','exception':'keyword','extern':'keyword','finally':'keyword','global':'keyword','inherit':'keyword','inline':'keyword','interface':'keyword','internal':'keyword','lazy':'keyword','let!':'keyword','member':'keyword','module':'keyword','namespace':'keyword','new':'keyword','null':'keyword','override':'keyword','private':'keyword','public':'keyword','return':'keyword','return!':'keyword','select':'keyword','static':'keyword','struct':'keyword','upcast':'keyword','use':'keyword','use!':'keyword','val':'keyword','when':'keyword','yield':'keyword','yield!':'keyword','List':'builtin','Seq':'builtin','Map':'builtin','Set':'builtin','int':'builtin','string':'builtin','raise':'builtin','failwith':'builtin','not':'builtin','true':'builtin','false':'builtin'},slashComments:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../python/python'),require('../stex/stex'),require('../../addon/mode/overlay'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../python/python','../stex/stex','../../addon/mode/overlay'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('rst',function(t,a){var c=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,n=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,r=/^``[^`\s](?:[^`]*[^`\s])``/,m=/^(?:[\d]+(?:[\.,]\d+)*)/,o=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,f='[Hh][Tt][Tt][Pp][Ss]?://',h='(?:[\\d\\w.-]+)\\.(?:\\w{2,6})',p='(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*',i=new RegExp('^'+f+h+p),u={token:function(e){if(e.match(c)&&e.match(/\W+|$/,!1))return'strong';if(e.match(n)&&e.match(/\W+|$/,!1))return'em';if(e.match(r)&&e.match(/\W+|$/,!1))return'string-2';if(e.match(m))return'number';if(e.match(o))return'positive';if(e.match(s))return'negative';if(e.match(i))return'link';while(e.next()!=null){if(e.match(c,!1))break;if(e.match(n,!1))break;if(e.match(r,!1))break;if(e.match(m,!1))break;if(e.match(o,!1))break;if(e.match(s,!1))break;if(e.match(i,!1))break};return null}};var l=e.getMode(t,a.backdrop||'rst-base');return e.overlayMode(l,u,!0)},'python','stex');e.defineMode('rst-base',function(r){function n(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,a){return typeof t[a]!='undefined'?t[a]:e})};var b=e.getMode(r,'python'),w=e.getMode(r,'stex'),y='\\s+',m='(?:\\s*|\\W|$)',v=new RegExp(n('^{0}',m)),k='(?:[^\\W\\d_](?:[\\w!"#$%&\'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)',S=new RegExp(n('^{0}',k)),j='(?:[^\\W\\d_](?:[\\w\\s!"#$%&\'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)',o=n('(?:{0}|`{1}`)',k,j),M='(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)',g='(?:[^\\`]+)',W=new RegExp(n('^{0}',g)),A=new RegExp('^([!\'#$%&"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$'),C=new RegExp(n('^\\.\\.{0}',y)),E=new RegExp(n('^_{0}:{1}|^__:{1}',o,m)),x=new RegExp(n('^{0}::{1}',o,m)),u=new RegExp(n('^\\|{0}\\|{1}{2}::{3}',M,y,o,m)),H=new RegExp(n('^\\[(?:\\d+|#{0}?|\\*)]{1}',o,m)),P=new RegExp(n('^\\[{0}\\]{1}',o,m)),R=new RegExp(n('^\\|{0}\\|',M)),ee=new RegExp(n('^\\[(?:\\d+|#{0}?|\\*)]_',o)),te=new RegExp(n('^\\[{0}\\]_',o)),ae=new RegExp(n('^{0}__?',o)),p=new RegExp(n('^`{0}`_',g)),i=new RegExp(n('^:{0}:`{1}`{2}',k,g,m)),l=new RegExp(n('^`{1}`:{0}:{2}',k,g,m)),d=new RegExp(n('^:{0}:{1}',k,m)),ce=new RegExp(n('^{0}',o)),ne=new RegExp(n('^::{0}',m)),T=new RegExp(n('^\\|{0}\\|',M)),re=new RegExp(n('^{0}',y)),me=new RegExp(n('^{0}',o)),oe=new RegExp(n('^::{0}',m)),se=new RegExp('^_'),ie=new RegExp(n('^{0}|_',o)),le=new RegExp(n('^:{0}',m)),fe=new RegExp('^::\\s*$'),he=new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');function a(n,r){var m=null;if(n.sol()&&n.match(he,!1)){t(r,q,{mode:b,local:e.startState(b)})} +else if(n.sol()&&n.match(C)){t(r,s);m='meta'} +else if(n.sol()&&n.match(A)){t(r,a);m='header'} +else if(h(r)==i||n.match(i,!1)){switch(f(r)){case 0:t(r,a,c(i,1));n.match(/^:/);m='meta';break;case 1:t(r,a,c(i,2));n.match(S);m='keyword';if(n.current().match(/^(?:math|latex)/)){r.tmp_stex=!0};break;case 2:t(r,a,c(i,3));n.match(/^:`/);m='meta';break;case 3:if(r.tmp_stex){r.tmp_stex=undefined;r.tmp={mode:w,local:e.startState(w)}};if(r.tmp){if(n.peek()=='`'){t(r,a,c(i,4));r.tmp=undefined;break};m=r.tmp.mode.token(n,r.tmp.local);break};t(r,a,c(i,4));n.match(W);m='string';break;case 4:t(r,a,c(i,5));n.match(/^`/);m='meta';break;case 5:t(r,a,c(i,6));n.match(v);break;default:t(r,a)}} +else if(h(r)==l||n.match(l,!1)){switch(f(r)){case 0:t(r,a,c(l,1));n.match(/^`/);m='meta';break;case 1:t(r,a,c(l,2));n.match(W);m='string';break;case 2:t(r,a,c(l,3));n.match(/^`:/);m='meta';break;case 3:t(r,a,c(l,4));n.match(S);m='keyword';break;case 4:t(r,a,c(l,5));n.match(/^:/);m='meta';break;case 5:t(r,a,c(l,6));n.match(v);break;default:t(r,a)}} +else if(h(r)==d||n.match(d,!1)){switch(f(r)){case 0:t(r,a,c(d,1));n.match(/^:/);m='meta';break;case 1:t(r,a,c(d,2));n.match(S);m='keyword';break;case 2:t(r,a,c(d,3));n.match(/^:/);m='meta';break;case 3:t(r,a,c(d,4));n.match(v);break;default:t(r,a)}} +else if(h(r)==R||n.match(R,!1)){switch(f(r)){case 0:t(r,a,c(R,1));n.match(T);m='variable-2';break;case 1:t(r,a,c(R,2));if(n.match(/^_?_?/))m='link';break;default:t(r,a)}} +else if(n.match(ee)){t(r,a);m='quote'} +else if(n.match(te)){t(r,a);m='quote'} +else if(n.match(ae)){t(r,a);if(!n.peek()||n.peek().match(/^\W$/)){m='link'}} +else if(h(r)==p||n.match(p,!1)){switch(f(r)){case 0:if(!n.peek()||n.peek().match(/^\W$/)){t(r,a,c(p,1))} +else{n.match(p)};break;case 1:t(r,a,c(p,2));n.match(/^`/);m='link';break;case 2:t(r,a,c(p,3));n.match(W);break;case 3:t(r,a,c(p,4));n.match(/^`_/);m='link';break;default:t(r,a)}} +else if(n.match(fe)){t(r,ue)} +else{if(n.next())t(r,a)};return m};function s(n,r){var m=null;if(h(r)==u||n.match(u,!1)){switch(f(r)){case 0:t(r,s,c(u,1));n.match(T);m='variable-2';break;case 1:t(r,s,c(u,2));n.match(re);break;case 2:t(r,s,c(u,3));n.match(me);m='keyword';break;case 3:t(r,s,c(u,4));n.match(oe);m='meta';break;default:t(r,a)}} +else if(h(r)==x||n.match(x,!1)){switch(f(r)){case 0:t(r,s,c(x,1));n.match(ce);m='keyword';if(n.current().match(/^(?:math|latex)/))r.tmp_stex=!0;else if(n.current().match(/^python/))r.tmp_py=!0;break;case 1:t(r,s,c(x,2));n.match(ne);m='meta';if(n.match(/^latex\s*$/)||r.tmp_stex){r.tmp_stex=undefined;t(r,q,{mode:w,local:e.startState(w)})};break;case 2:t(r,s,c(x,3));if(n.match(/^python\s*$/)||r.tmp_py){r.tmp_py=undefined;t(r,q,{mode:b,local:e.startState(b)})};break;default:t(r,a)}} +else if(h(r)==E||n.match(E,!1)){switch(f(r)){case 0:t(r,s,c(E,1));n.match(se);n.match(ie);m='link';break;case 1:t(r,s,c(E,2));n.match(le);m='meta';break;default:t(r,a)}} +else if(n.match(H)){t(r,a);m='quote'} +else if(n.match(P)){t(r,a);m='quote'} +else{n.eatSpace();if(n.eol()){t(r,a)} +else{n.skipToEnd();t(r,pe);m='comment'}};return m};function pe(e,t){return I(e,t,'comment')};function ue(e,t){return I(e,t,'meta')};function I(e,c,n){if(e.eol()||e.eatSpace()){e.skipToEnd();return n} +else{t(c,a);return null}};function q(e,c){if(c.ctx.mode&&c.ctx.local){if(e.sol()){if(!e.eatSpace())t(c,a);return null};return c.ctx.mode.token(e,c.ctx.local)};t(c,a);return null};function c(e,t,a,c){return{phase:e,stage:t,mode:a,local:c}};function t(e,t,a){e.tok=t;e.ctx=a||{}};function f(e){return e.ctx.stage||0};function h(e){return e.ctx.phase};return{startState:function(){return{tok:a,ctx:c(undefined,0)}},copyState:function(t){var a=t.ctx,c=t.tmp;if(a.local)a={mode:a.mode,local:e.copyState(a.mode,a.local)};if(c)c={mode:c.mode,local:e.copyState(c.mode,c.local)};return{tok:t.tok,ctx:a,tmp:c}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},'python','stex');e.defineMIME('text/x-rst','rst')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ntriples',function(){var e={PRE_SUBJECT:0,WRITING_SUB_URI:1,WRITING_BNODE_URI:2,PRE_PRED:3,WRITING_PRED_URI:4,PRE_OBJ:5,WRITING_OBJ_URI:6,WRITING_OBJ_BNODE:7,WRITING_OBJ_LITERAL:8,WRITING_LIT_LANG:9,WRITING_LIT_TYPE:10,POST_OBJ:11,ERROR:12};function i(t,r){var i=t.location,n;if(i==e.PRE_SUBJECT&&r=='<')n=e.WRITING_SUB_URI;else if(i==e.PRE_SUBJECT&&r=='_')n=e.WRITING_BNODE_URI;else if(i==e.PRE_PRED&&r=='<')n=e.WRITING_PRED_URI;else if(i==e.PRE_OBJ&&r=='<')n=e.WRITING_OBJ_URI;else if(i==e.PRE_OBJ&&r=='_')n=e.WRITING_OBJ_BNODE;else if(i==e.PRE_OBJ&&r=='"')n=e.WRITING_OBJ_LITERAL;else if(i==e.WRITING_SUB_URI&&r=='>')n=e.PRE_PRED;else if(i==e.WRITING_BNODE_URI&&r==' ')n=e.PRE_PRED;else if(i==e.WRITING_PRED_URI&&r=='>')n=e.PRE_OBJ;else if(i==e.WRITING_OBJ_URI&&r=='>')n=e.POST_OBJ;else if(i==e.WRITING_OBJ_BNODE&&r==' ')n=e.POST_OBJ;else if(i==e.WRITING_OBJ_LITERAL&&r=='"')n=e.POST_OBJ;else if(i==e.WRITING_LIT_LANG&&r==' ')n=e.POST_OBJ;else if(i==e.WRITING_LIT_TYPE&&r=='>')n=e.POST_OBJ;else if(i==e.WRITING_OBJ_LITERAL&&r=='@')n=e.WRITING_LIT_LANG;else if(i==e.WRITING_OBJ_LITERAL&&r=='^')n=e.WRITING_LIT_TYPE;else if(r==' '&&(i==e.PRE_SUBJECT||i==e.PRE_PRED||i==e.PRE_OBJ||i==e.POST_OBJ))n=i;else if(i==e.POST_OBJ&&r=='.')n=e.PRE_SUBJECT;else n=e.ERROR;t.location=n};return{startState:function(){return{location:e.PRE_SUBJECT,uris:[],anchors:[],bnodes:[],langs:[],types:[]}},token:function(e,n){var r=e.next();if(r=='<'){i(n,r);var T='';e.eatWhile(function(e){if(e!='#'&&e!='>'){T+=e;return!0};return!1});n.uris.push(T);if(e.match('#',!1))return'variable';e.next();i(n,'>');return'variable'};if(r=='#'){var f='';e.eatWhile(function(e){if(e!='>'&&e!=' '){f+=e;return!0};return!1});n.anchors.push(f);return'variable-2'};if(r=='>'){i(n,'>');return'variable'};if(r=='_'){i(n,r);var R='';e.eatWhile(function(e){if(e!=' '){R+=e;return!0};return!1});n.bnodes.push(R);e.next();i(n,' ');return'builtin'};if(r=='"'){i(n,r);e.eatWhile(function(e){return e!='"'});e.next();if(e.peek()!='@'&&e.peek()!='^'){i(n,'"')};return'string'};if(r=='@'){i(n,'@');var I='';e.eatWhile(function(e){if(e!=' '){I+=e;return!0};return!1});n.langs.push(I);e.next();i(n,' ');return'string-2'};if(r=='^'){e.next();i(n,'^');var t='';e.eatWhile(function(e){if(e!='>'){t+=e;return!0};return!1});n.types.push(t);e.next();i(n,'>');return'variable'};if(r==' '){i(n,r)};if(r=='.'){i(n,r)}}}});e.defineMIME('application/n-triples','ntriples');e.defineMIME('application/n-quads','ntriples');e.defineMIME('text/n-triples','ntriples')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('sparql',function(e){var l=e.indentUnit,t;function o(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var s=o(['str','lang','langmatches','datatype','bound','sameterm','isiri','isuri','iri','uri','bnode','count','sum','min','max','avg','sample','group_concat','rand','abs','ceil','floor','round','concat','substr','strlen','replace','ucase','lcase','encode_for_uri','contains','strstarts','strends','strbefore','strafter','year','month','day','hours','minutes','seconds','timezone','tz','now','uuid','struuid','md5','sha1','sha256','sha384','sha512','coalesce','if','strlang','strdt','isnumeric','regex','exists','isblank','isliteral','a','bind']),c=o(['base','prefix','select','distinct','reduced','construct','describe','ask','from','named','where','order','limit','offset','filter','optional','graph','by','asc','desc','as','having','undef','values','group','minus','in','not','service','silent','using','insert','delete','union','true','false','with','data','copy','to','move','add','create','drop','clear','load']),i=/[*+\-<>=&|\^\/!\?]/;function a(e,r){var n=e.next();t=null;if(n=='$'||n=='?'){if(n=='?'&&e.match(/\s/,!1)){return'operator'};e.match(/^[\w\d]*/);return'variable-2'} +else if(n=='<'&&!e.match(/^[\s\u00a0=]/,!1)){e.match(/^[^\s\u00a0>]*>?/);return'atom'} +else if(n=='"'||n=='\''){r.tokenize=u(n);return r.tokenize(e,r)} +else if(/[{}\(\),\.;\[\]]/.test(n)){t=n;return'bracket'} +else if(n=='#'){e.skipToEnd();return'comment'} +else if(i.test(n)){e.eatWhile(i);return'operator'} +else if(n==':'){e.eatWhile(/[\w\d\._\-]/);return'atom'} +else if(n=='@'){e.eatWhile(/[a-z\d\-]/i);return'meta'} +else{e.eatWhile(/[_\w\d]/);if(e.eat(':')){e.eatWhile(/[\w\d_\-]/);return'atom'};var o=e.current();if(s.test(o))return'builtin';else if(c.test(o))return'keyword';else return'variable'}};function u(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=a;break};r=!r&&i=='\\'};return'string'}};function n(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}};function r(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:a,context:null,indent:0,col:0}},token:function(i,e){if(i.sol()){if(e.context&&e.context.align==null)e.context.align=!1;e.indent=i.indentation()};if(i.eatSpace())return null;var o=e.tokenize(i,e);if(o!='comment'&&e.context&&e.context.align==null&&e.context.type!='pattern'){e.context.align=!0};if(t=='(')n(e,')',i.column());else if(t=='[')n(e,']',i.column());else if(t=='{')n(e,'}',i.column());else if(/[\]\}\)]/.test(t)){while(e.context&&e.context.type=='pattern')r(e);if(e.context&&t==e.context.type){r(e);if(t=='}'&&e.context&&e.context.type=='pattern')r(e)}} +else if(t=='.'&&e.context&&e.context.type=='pattern')r(e);else if(/atom|string|variable/.test(o)&&e.context){if(/[\}\]]/.test(e.context.type))n(e,'pattern',i.column());else if(e.context.type=='pattern'&&!e.context.align){e.context.align=!0;e.context.col=i.column()}};return o},indent:function(t,n){var i=n&&n.charAt(0),e=t.context;if(/[\]\}]/.test(i))while(e&&e.type=='pattern')e=e.prev;var r=e&&i==e.type;if(!e)return 0;else if(e.type=='pattern')return e.col;else if(e.align)return e.col+(r?0:1);else return e.indent+(r?0:l)},lineComment:'#'}});e.defineMIME('application/sparql-query','sparql')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('properties',function(){return{token:function(i,e){var n=i.sol()||e.afterSection,o=i.eol();e.afterSection=!1;if(n){if(e.nextMultiline){e.inMultiline=!0;e.nextMultiline=!1} +else{e.position='def'}};if(o&&!e.nextMultiline){e.inMultiline=!1;e.position='def'};if(n){while(i.eatSpace()){}};var t=i.next();if(n&&(t==='#'||t==='!'||t===';')){e.position='comment';i.skipToEnd();return'comment'} +else if(n&&t==='['){e.afterSection=!0;i.skipTo(']');i.eat(']');return'header'} +else if(t==='='||t===':'){e.position='quote';return null} +else if(t==='\\'&&e.position==='quote'){if(i.eol()){e.nextMultiline=!0}};return e.position},startState:function(){return{position:'def',nextMultiline:!1,inMultiline:!1,afterSection:!1}}}});e.defineMIME('text/x-properties','properties');e.defineMIME('text/x-ini','properties')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('rpm-changes',function(){var e=/^-+$/,r=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /,t=/^[\w+.-]+@[\w.-]+/;return{token:function(n){if(n.sol()){if(n.match(e)){return'tag'};if(n.match(r)){return'tag'}};if(n.match(t)){return'string'};n.next();return null}}});e.defineMIME('text/x-rpm-changes','rpm-changes');e.defineMode('rpm-spec',function(){var e=/^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/,r=/^[a-zA-Z0-9()]+:/,t=/^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/,n=/^%(ifnarch|ifarch|if)/,i=/^%(else|endif)/,o=/^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/;return{startState:function(){return{controlFlow:!1,macroParameters:!1,section:!1}},token:function(a,c){var f=a.peek();if(f=='#'){a.skipToEnd();return'comment'};if(a.sol()){if(a.match(r)){return'header'};if(a.match(t)){return'atom'}};if(a.match(/^\$\w+/)){return'def'};if(a.match(/^\$\{\w+\}/)){return'def'};if(a.match(i)){return'keyword'};if(a.match(n)){c.controlFlow=!0;return'keyword'};if(c.controlFlow){if(a.match(o)){return'operator'};if(a.match(/^(\d+)/)){return'number'};if(a.eol()){c.controlFlow=!1}};if(a.match(e)){if(a.eol()){c.controlFlow=!1};return'number'};if(a.match(/^%[\w]+/)){if(a.match(/^\(/)){c.macroParameters=!0};return'keyword'};if(c.macroParameters){if(a.match(/^\d+/)){return'number'};if(a.match(/^\)/)){c.macroParameters=!1;return'keyword'}};if(a.match(/^%\{\??[\w \-\:\!]+\}/)){if(a.eol()){c.controlFlow=!1};return'def'};a.next();return null}}});e.defineMIME('text/x-rpm-spec','rpm-spec')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'),require('../xml/xml'),require('../javascript/javascript'),require('../css/css'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../xml/xml','../javascript/javascript','../css/css'],t);else t(CodeMirror)})(function(t){'use strict';var l={script:[['lang',/(javascript|babel)/i,'javascript'],['type',/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,'javascript'],['type',/./,'text/plain'],[null,null,'javascript']],style:[['lang',/^css$/i,'css'],['type',/^(text\/)?(x-)?(stylesheet|css)$/i,'css'],['type',/./,'text/plain'],[null,null,'css']]};function r(t,e,n){var a=t.current(),l=a.search(e);if(l>-1){t.backUp(a.length-l)} +else if(a.match(/<\/?$/)){t.backUp(a.length);if(!t.match(e,!1))t.match(a)};return n};var e={};function i(t){var a=e[t];if(a)return a;return e[t]=new RegExp('\\s+'+t+'\\s*=\\s*(\'|")?([^\'"]+)(\'|")?\\s*')};function o(t,e){var a=t.match(i(e));return a?/^\s*(.*?)\s*$/.exec(a[2])[1]:''};function a(t,e){return new RegExp((e?'^':'')+'<\/\s*'+t+'\s*>','i')};function n(t,e){for(var n in t){var r=e[n]||(e[n]=[]),l=t[n];for(var a=l.length-1;a>=0;a--)r.unshift(l[a])}};function c(t,e){for(var n=0;n<t.length;n++){var a=t[n];if(!a[0]||a[1].test(o(e,a[0])))return a[2]}};t.defineMode('htmlmixed',function(e,i){var o=t.getMode(e,{name:'xml',htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag});var s={};var m=i&&i.tags,f=i&&i.scriptTypes;n(l,s);if(m)n(m,s);if(f)for(var u=f.length-1;u>=0;u--)s.script.unshift(['type',f[u].matches,f[u].mode]);function d(l,n){var m=o.token(l,n.htmlState),p=/\btag\b/.test(m),u;if(p&&!/[<>\s\/]/.test(l.current())&&(u=n.htmlState.tagName&&n.htmlState.tagName.toLowerCase())&&s.hasOwnProperty(u)){n.inTag=u+' '} +else if(n.inTag&&p&&/>$/.test(l.current())){var i=/^([\S]+) (.*)/.exec(n.inTag);n.inTag=null;var g=l.current()=='>'&&c(s[i[1]],i[2]),f=t.getMode(e,g),h=a(i[1],!0),v=a(i[1],!1);n.token=function(t,e){if(t.match(h,!1)){e.token=d;e.localState=e.localMode=null;return null};return r(t,v,e.localMode.token(t,e.localState))};n.localMode=f;n.localState=t.startState(f,o.indent(n.htmlState,''))} +else if(n.inTag){n.inTag+=l.current();if(l.eol())n.inTag+=' '};return m};return{startState:function(){var e=t.startState(o);return{token:d,inTag:null,localMode:null,localState:null,htmlState:e}},copyState:function(e){var a;if(e.localState){a=t.copyState(e.localMode,e.localState)};return{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:a,htmlState:t.copyState(o,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,a,n){if(!e.localMode||/^\s*<\//.test(a))return o.indent(e.htmlState,a);else if(e.localMode.indent)return e.localMode.indent(e.localState,a,n);else return t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||o}}}},'xml','javascript','css');t.defineMIME('text/html','htmlmixed')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var r={autoSelfClosers:{'area':!0,'base':!0,'br':!0,'col':!0,'command':!0,'embed':!0,'frame':!0,'hr':!0,'img':!0,'input':!0,'keygen':!0,'link':!0,'meta':!0,'param':!0,'source':!0,'track':!0,'wbr':!0,'menuitem':!0},implicitlyClosed:{'dd':!0,'li':!0,'optgroup':!0,'option':!0,'p':!0,'rp':!0,'rt':!0,'tbody':!0,'td':!0,'tfoot':!0,'th':!0,'tr':!0},contextGrabbers:{'dd':{'dd':!0,'dt':!0},'dt':{'dd':!0,'dt':!0},'li':{'li':!0},'option':{'option':!0,'optgroup':!0},'optgroup':{'optgroup':!0},'p':{'address':!0,'article':!0,'aside':!0,'blockquote':!0,'dir':!0,'div':!0,'dl':!0,'fieldset':!0,'footer':!0,'form':!0,'h1':!0,'h2':!0,'h3':!0,'h4':!0,'h5':!0,'h6':!0,'header':!0,'hgroup':!0,'hr':!0,'menu':!0,'nav':!0,'ol':!0,'p':!0,'pre':!0,'section':!0,'table':!0,'ul':!0},'rp':{'rp':!0,'rt':!0},'rt':{'rp':!0,'rt':!0},'tbody':{'tbody':!0,'tfoot':!0},'td':{'td':!0,'th':!0},'tfoot':{'tbody':!0},'th':{'td':!0,'th':!0},'thead':{'tbody':!0,'tfoot':!0},'tr':{'tr':!0}},doNotIndent:{'pre':!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0};var t={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode('xml',function(n,i){var c=n.indentUnit,o={};var x=i.htmlMode?r:t;for(var f in x)o[f]=x[f];for(var f in i)o[f]=i[f];var s,a;function l(e,t){function n(r){t.tokenize=r;return r(e,t)};var i=e.next();if(i=='<'){if(e.eat('!')){if(e.eat('[')){if(e.match('CDATA['))return n(g('atom',']]>'));else return null} +else if(e.match('--')){return n(g('comment','-->'))} +else if(e.match('DOCTYPE',!0,!0)){e.eatWhile(/[\w\._\-]/);return n(h(1))} +else{return null}} +else if(e.eat('?')){e.eatWhile(/[\w\._\-]/);t.tokenize=g('meta','?>');return'meta'} +else{s=e.eat('/')?'closeTag':'openTag';t.tokenize=m;return'tag bracket'}} +else if(i=='&'){var r;if(e.eat('#')){if(e.eat('x')){r=e.eatWhile(/[a-fA-F\d]/)&&e.eat(';')} +else{r=e.eatWhile(/[\d]/)&&e.eat(';')}} +else{r=e.eatWhile(/[\w\.\-:]/)&&e.eat(';')};return r?'atom':'error'} +else{e.eatWhile(/[^&<]/);return null}};l.isInText=!0;function m(e,t){var r=e.next();if(r=='>'||(r=='/'&&e.eat('>'))){t.tokenize=l;s=r=='>'?'endTag':'selfcloseTag';return'tag bracket'} +else if(r=='='){s='equals';return null} +else if(r=='<'){t.tokenize=l;t.state=d;t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+' tag error':'tag error'} +else if(/['"]/.test(r)){t.tokenize=N(r);t.stringStartCol=e.column();return t.tokenize(e,t)} +else{e.match(/^[^\s\u00a0=<>"']*[^\s\u00a0=<>"'\/]/);return'word'}};function N(e){var t=function(t,r){while(!t.eol()){if(t.next()==e){r.tokenize=m;break}};return'string'};t.isInAttribute=!0;return t};function g(e,t){return function(r,n){while(!r.eol()){if(r.match(t)){n.tokenize=l;break};r.next()};return e}};function h(e){return function(t,r){var n;while((n=t.next())!=null){if(n=='<'){r.tokenize=h(e+1);return r.tokenize(t,r)} +else if(n=='>'){if(e==1){r.tokenize=l;break} +else{r.tokenize=h(e-1);return r.tokenize(t,r)}}};return'meta'}};function T(e,t,r){this.prev=e.context;this.tagName=t;this.indent=e.indented;this.startOfLine=r;if(o.doNotIndent.hasOwnProperty(t)||(e.context&&e.context.noIndent))this.noIndent=!0};function p(e){if(e.context)e.context=e.context.prev};function k(e,t){var r;while(!0){if(!e.context){return};r=e.context.tagName;if(!o.contextGrabbers.hasOwnProperty(r)||!o.contextGrabbers[r].hasOwnProperty(t)){return};p(e)}};function d(e,t,r){if(e=='openTag'){r.tagStart=t.column();return w} +else if(e=='closeTag'){return C} +else{return d}};function w(e,t,r){if(e=='word'){r.tagName=t.current();a='tag';return u} +else{a='error';return w}};function C(e,t,r){if(e=='word'){var n=t.current();if(r.context&&r.context.tagName!=n&&o.implicitlyClosed.hasOwnProperty(r.context.tagName))p(r);if((r.context&&r.context.tagName==n)||o.matchClosing===!1){a='tag';return b} +else{a='tag error';return v}} +else{a='error';return v}};function b(e,t,r){if(e!='endTag'){a='error';return b};p(r);return d};function v(e,t,r){a='error';return b(e,t,r)};function u(e,t,r){if(e=='word'){a='attribute';return I} +else if(e=='endTag'||e=='selfcloseTag'){var n=r.tagName,i=r.tagStart;r.tagName=r.tagStart=null;if(e=='selfcloseTag'||o.autoSelfClosers.hasOwnProperty(n)){k(r,n)} +else{k(r,n);r.context=new T(r,n,i==r.indented)};return d};a='error';return u};function I(e,t,r){if(e=='equals')return y;if(!o.allowMissing)a='error';return u(e,t,r)};function y(e,t,r){if(e=='string')return z;if(e=='word'&&o.allowUnquoted){a='string';return u};a='error';return u(e,t,r)};function z(e,t,r){if(e=='string')return z;return u(e,t,r)};return{startState:function(e){var t={tokenize:l,state:d,indented:e||0,tagName:null,tagStart:null,context:null};if(e!=null)t.baseIndent=e;return t},token:function(e,t){if(!t.tagName&&e.sol())t.indented=e.indentation();if(e.eatSpace())return null;s=null;var r=t.tokenize(e,t);if((r||s)&&r!='comment'){a=null;t.state=t.state(s||r,e,t);if(a)r=a=='error'?r+' error':a};return r},indent:function(t,r,i){var n=t.context;if(t.tokenize.isInAttribute){if(t.tagStart==t.indented)return t.stringStartCol+1;else return t.indented+c};if(n&&n.noIndent)return e.Pass;if(t.tokenize!=m&&t.tokenize!=l)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName){if(o.multilineTagIndentPastTag!==!1)return t.tagStart+t.tagName.length+2;else return t.tagStart+c*(o.multilineTagIndentFactor||1)};if(o.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var a=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(a&&a[1]){while(n){if(n.tagName==a[2]){n=n.prev;break} +else if(o.implicitlyClosed.hasOwnProperty(n.tagName)){n=n.prev} +else{break}}} +else if(a){while(n){var u=o.contextGrabbers[n.tagName];if(u&&u.hasOwnProperty(a[2]))n=n.prev;else break}} +while(n&&n.prev&&!n.startOfLine)n=n.prev;if(n)return n.indent+c;else return t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:'<!--',blockCommentEnd:'-->',configuration:o.htmlMode?'html':'xml',helperType:o.htmlMode?'html':'xml',skipAttribute:function(e){if(e.state==y)e.state=u}}});e.defineMIME('text/xml','xml');e.defineMIME('application/xml','xml');if(!e.mimeModes.hasOwnProperty('text/html'))e.defineMIME('text/html',{name:'xml',htmlMode:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ttcn-cfg',function(e,n){var C=e.indentUnit,N=n.keywords||{},o=n.fileNCtrlMaskOptions||{},I=n.externalCommands||{},l=n.multiLineStrings,A=n.indentStatements!==!1;var i=/[\|]/,t;function U(e,T){var n=e.next();if(n=='"'||n=='\''){T.tokenize=O(n);return T.tokenize(e,T)};if(/[:=]/.test(n)){t=n;return'punctuation'};if(n=='#'){e.skipToEnd();return'comment'};if(/\d/.test(n)){e.eatWhile(/[\w\.]/);return'number'};if(i.test(n)){e.eatWhile(i);return'operator'};if(n=='['){e.eatWhile(/[\w_\]]/);return'number sectionTitle'};e.eatWhile(/[\w\$_]/);var E=e.current();if(N.propertyIsEnumerable(E))return'keyword';if(o.propertyIsEnumerable(E))return'negative fileNCtrlMaskOptions';if(I.propertyIsEnumerable(E))return'negative externalCommands';return'variable'};function O(e){return function(t,n){var E=!1,i,r=!1;while((i=t.next())!=null){if(i==e&&!E){var T=t.peek();if(T){T=T.toLowerCase();if(T=='b'||T=='h'||T=='o')t.next()};r=!0;break};E=!E&&i=='\\'};if(r||!(E||l))n.tokenize=null;return'string'}};function r(e,t,n,T,E){this.indented=e;this.column=t;this.type=n;this.align=T;this.prev=E};function E(e,t,n){var T=e.indented;if(e.context&&e.context.type=='statement')T=e.context.indented;return e.context=new r(T,t,n,null,e.context)};function T(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new r((e||0)-C,0,'top',!1),indented:0,startOfLine:!0}},token:function(n,e){var i=e.context;if(n.sol()){if(i.align==null)i.align=!1;e.indented=n.indentation();e.startOfLine=!0};if(n.eatSpace())return null;t=null;var r=(e.tokenize||U)(n,e);if(r=='comment')return r;if(i.align==null)i.align=!0;if((t==';'||t==':'||t==',')&&i.type=='statement'){T(e)} +else if(t=='{')E(e,n.column(),'}');else if(t=='[')E(e,n.column(),']');else if(t=='(')E(e,n.column(),')');else if(t=='}'){while(i.type=='statement')i=T(e);if(i.type=='}')i=T(e);while(i.type=='statement')i=T(e)} +else if(t==i.type)T(e);else if(A&&(((i.type=='}'||i.type=='top')&&t!=';')||(i.type=='statement'&&t=='newstatement')))E(e,n.column(),'statement');e.startOfLine=!1;return r},electricChars:'{}',lineComment:'#',fold:'brace'}});function t(e){var n={},T=e.split(' ');for(var t=0;t<T.length;++t)n[T[t]]=!0;return n};e.defineMIME('text/x-ttcn-cfg',{name:'ttcn-cfg',keywords:t('Yes No LogFile FileMask ConsoleMask AppendFile TimeStampFormat LogEventTypes SourceInfoFormat LogEntityName LogSourceInfo DiskFullAction LogFileNumber LogFileSize MatchingHints Detailed Compact SubCategories Stack Single None Seconds DateTime Time Stop Error Retry Delete TCPPort KillTimer NumHCs UnixSocketsEnabled LocalAddress'),fileNCtrlMaskOptions:t('TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION TTCN_USER TTCN_FUNCTION TTCN_STATISTICS TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG EXECUTOR ERROR WARNING PORTEVENT TIMEROP VERDICTOP DEFAULTOP TESTCASE ACTION USER FUNCTION STATISTICS PARALLEL MATCHING DEBUG LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED DEBUG_ENCDEC DEBUG_TESTPORT DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED FUNCTION_RND FUNCTION_UNQUALIFIED MATCHING_DONE MATCHING_MCSUCCESS MATCHING_MCUNSUCC MATCHING_MMSUCCESS MATCHING_MMUNSUCC MATCHING_PCSUCCESS MATCHING_PCUNSUCC MATCHING_PMSUCCESS MATCHING_PMUNSUCC MATCHING_PROBLEM MATCHING_TIMEOUT MATCHING_UNQUALIFIED PARALLEL_PORTCONN PARALLEL_PORTMAP PARALLEL_PTC PARALLEL_UNQUALIFIED PORTEVENT_DUALRECV PORTEVENT_DUALSEND PORTEVENT_MCRECV PORTEVENT_MCSEND PORTEVENT_MMRECV PORTEVENT_MMSEND PORTEVENT_MQUEUE PORTEVENT_PCIN PORTEVENT_PCOUT PORTEVENT_PMIN PORTEVENT_PMOUT PORTEVENT_PQUEUE PORTEVENT_STATE PORTEVENT_UNQUALIFIED STATISTICS_UNQUALIFIED STATISTICS_VERDICT TESTCASE_FINISH TESTCASE_START TESTCASE_UNQUALIFIED TIMEROP_GUARD TIMEROP_READ TIMEROP_START TIMEROP_STOP TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED USER_UNQUALIFIED VERDICTOP_FINAL VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED'),externalCommands:t('BeginControlPart EndControlPart BeginTestCase EndTestCase'),multiLineStrings:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ttcn',function(t,e){var l=t.indentUnit,c=e.keywords||{},u=e.builtin||{},p=e.timerOps||{},f=e.portOps||{},d=e.configOps||{},m=e.verdictOps||{},b=e.sutOps||{},h=e.functionOps||{},y=e.verdictConsts||{},v=e.booleanConsts||{},x=e.otherConsts||{},g=e.types||{},k=e.visibilityModifiers||{},O=e.templateMatch||{},w=e.multiLineStrings,E=e.indentStatements!==!1;var o=/[+\-*&@=<>!\/]/,n;function C(e,r){var i=e.next();if(i=='"'||i=='\''){r.tokenize=I(i);return r.tokenize(e,r)};if(/[\[\]{}\(\),;\\:\?\.]/.test(i)){n=i;return'punctuation'};if(i=='#'){e.skipToEnd();return'atom preprocessor'};if(i=='%'){e.eatWhile(/\b/);return'atom ttcn3Macros'};if(/\d/.test(i)){e.eatWhile(/[\w\.]/);return'number'};if(i=='/'){if(e.eat('*')){r.tokenize=s;return s(e,r)};if(e.eat('/')){e.skipToEnd();return'comment'}};if(o.test(i)){if(i=='@'){if(e.match('try')||e.match('catch')||e.match('lazy')){return'keyword'}};e.eatWhile(o);return'operator'};e.eatWhile(/[\w\$_\xa1-\uffff]/);var t=e.current();if(c.propertyIsEnumerable(t))return'keyword';if(u.propertyIsEnumerable(t))return'builtin';if(p.propertyIsEnumerable(t))return'def timerOps';if(d.propertyIsEnumerable(t))return'def configOps';if(m.propertyIsEnumerable(t))return'def verdictOps';if(f.propertyIsEnumerable(t))return'def portOps';if(b.propertyIsEnumerable(t))return'def sutOps';if(h.propertyIsEnumerable(t))return'def functionOps';if(y.propertyIsEnumerable(t))return'string verdictConsts';if(v.propertyIsEnumerable(t))return'string booleanConsts';if(x.propertyIsEnumerable(t))return'string otherConsts';if(g.propertyIsEnumerable(t))return'builtin types';if(k.propertyIsEnumerable(t))return'builtin visibilityModifiers';if(O.propertyIsEnumerable(t))return'atom templateMatch';return'variable'};function I(e){return function(t,n){var i=!1,o,s=!1;while((o=t.next())!=null){if(o==e&&!i){var r=t.peek();if(r){r=r.toLowerCase();if(r=='b'||r=='h'||r=='o')t.next()};s=!0;break};i=!i&&o=='\\'};if(s||!(i||w))n.tokenize=null;return'string'}};function s(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize=null;break};r=(n=='*')};return'comment'};function a(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function i(e,t,n){var r=e.indented;if(e.context&&e.context.type=='statement')r=e.context.indented;return e.context=new a(r,t,n,null,e.context)};function r(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new a((e||0)-l,0,'top',!1),indented:0,startOfLine:!0}},token:function(e,t){var o=t.context;if(e.sol()){if(o.align==null)o.align=!1;t.indented=e.indentation();t.startOfLine=!0};if(e.eatSpace())return null;n=null;var s=(t.tokenize||C)(e,t);if(s=='comment')return s;if(o.align==null)o.align=!0;if((n==';'||n==':'||n==',')&&o.type=='statement'){r(t)} +else if(n=='{')i(t,e.column(),'}');else if(n=='[')i(t,e.column(),']');else if(n=='(')i(t,e.column(),')');else if(n=='}'){while(o.type=='statement')o=r(t);if(o.type=='}')o=r(t);while(o.type=='statement')o=r(t)} +else if(n==o.type)r(t);else if(E&&(((o.type=='}'||o.type=='top')&&n!=';')||(o.type=='statement'&&n=='newstatement')))i(t,e.column(),'statement');t.startOfLine=!1;return s},electricChars:'{}',blockCommentStart:'/*',blockCommentEnd:'*/',lineComment:'//',fold:'brace'}});function t(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};function n(t,n){if(typeof t=='string')t=[t];var o=[];function r(e){if(e)for(var t in e)if(e.hasOwnProperty(t))o.push(t)};r(n.keywords);r(n.builtin);r(n.timerOps);r(n.portOps);if(o.length){n.helperType=t[0];e.registerHelper('hintWords',t[0],o)};for(var i=0;i<t.length;++i)e.defineMIME(t[i],n)};n(['text/x-ttcn','text/x-ttcn3','text/x-ttcnpp'],{name:'ttcn',keywords:t('activate address alive all alt altstep and and4b any break case component const continue control deactivate display do else encode enumerated except exception execute extends extension external for from function goto group if import in infinity inout interleave label language length log match message mixed mod modifies module modulepar mtc noblock not not4b nowait of on optional or or4b out override param pattern port procedure record recursive rem repeat return runs select self sender set signature system template testcase to type union value valueof var variant while with xor xor4b'),builtin:t('bit2hex bit2int bit2oct bit2str char2int char2oct encvalue decomp decvalue float2int float2str hex2bit hex2int hex2oct hex2str int2bit int2char int2float int2hex int2oct int2str int2unichar isbound ischosen ispresent isvalue lengthof log2str oct2bit oct2char oct2hex oct2int oct2str regexp replace rnd sizeof str2bit str2float str2hex str2int str2oct substr unichar2int unichar2char enum2int'),types:t('anytype bitstring boolean char charstring default float hexstring integer objid octetstring universal verdicttype timer'),timerOps:t('read running start stop timeout'),portOps:t('call catch check clear getcall getreply halt raise receive reply send trigger'),configOps:t('create connect disconnect done kill killed map unmap'),verdictOps:t('getverdict setverdict'),sutOps:t('action'),functionOps:t('apply derefers refers'),verdictConsts:t('error fail inconc none pass'),booleanConsts:t('true false'),otherConsts:t('null NULL omit'),visibilityModifiers:t('private public friend'),templateMatch:t('complement ifpresent subset superset permutation'),multiLineStrings:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('z80',function(e,i){var l=i.ez80,t,r;if(l){t=/^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i;r=/^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i} +else{t=/^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i;r=/^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i};var s=/^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i,o=/^(n?[zc]|p[oe]?|m)\b/i,c=/^([hl][xy]|i[xy][hl]|slia|sll)\b/i,n=/^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;return{startState:function(){return{context:0}},token:function(e,i){if(!e.column())i.context=0;if(e.eatSpace())return null;var a;if(e.eatWhile(/\w/)){if(l&&e.eat('.')){e.eatWhile(/\w/)};a=e.current();if(e.indentation()){if((i.context==1||i.context==4)&&s.test(a)){i.context=4;return'var2'};if(i.context==2&&o.test(a)){i.context=4;return'var3'};if(t.test(a)){i.context=1;return'keyword'} +else if(r.test(a)){i.context=2;return'keyword'} +else if(i.context==4&&n.test(a)){return'number'};if(c.test(a))return'error'} +else if(e.match(n)){return'number'} +else{return null}} +else if(e.eat(';')){e.skipToEnd();return'comment'} +else if(e.eat('"')){while(a=e.next()){if(a=='"')break;if(a=='\\')e.next()};return'string'} +else if(e.eat('\'')){if(e.match(/\\?.'/))return'number'} +else if(e.eat('.')||e.sol()&&e.eat('#')){i.context=5;if(e.eatWhile(/\w/))return'def'} +else if(e.eat('$')){if(e.eatWhile(/[\da-f]/i))return'number'} +else if(e.eat('%')){if(e.eatWhile(/[01]/))return'number'} +else{e.next()};return null}}});e.defineMIME('text/x-z80','z80');e.defineMIME('text/x-ez80',{name:'z80',ez80:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var n='><+-.,[]'.split('');e.defineMode('brainfuck',function(){return{startState:function(){return{commentLine:!1,left:0,right:0,commentLoop:!1}},token:function(t,i){if(t.eatSpace())return null;if(t.sol()){i.commentLine=!1};var e=t.next().toString();if(n.indexOf(e)!==-1){if(i.commentLine===!0){if(t.eol()){i.commentLine=!1};return'comment'};if(e===']'||e==='['){if(e==='['){i.left++} +else{i.right++};return'bracket'} +else if(e==='+'||e==='-'){return'keyword'} +else if(e==='<'||e==='>'){return'atom'} +else if(e==='.'||e===','){return'def'}} +else{i.commentLine=!0;if(t.eol()){i.commentLine=!1};return'comment'};if(t.eol()){i.commentLine=!1}}}});e.defineMIME('text/x-brainfuck','brainfuck')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';function e(t){var e=[];t.split(' ').forEach(function(t){e.push({name:t})});return e};var E=e('INVERT AND OR XOR 2* 2/ LSHIFT RSHIFT 0= = 0< < > U< MIN MAX 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP >R R> R@ + - 1+ 1- ABS NEGATE S>D * M* UM* FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2! ALIGN ALIGNED +! ALLOT CHAR [CHAR] [ ] BL FIND EXECUTE IMMEDIATE COUNT LITERAL STATE ; DOES> >BODY EVALUATE SOURCE >IN <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL FILL MOVE . CR EMIT SPACE SPACES TYPE U. .R U.R ACCEPT TRUE FALSE <> U> 0<> 0> NIP TUCK ROLL PICK 2>R 2R@ 2R> WITHIN UNUSED MARKER I J TO COMPILE, [COMPILE] SAVE-INPUT RESTORE-INPUT PAD ERASE 2LITERAL DNEGATE D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS M+ M*/ D. D.R 2ROT DU< CATCH THROW FREE RESIZE ALLOCATE CS-PICK CS-ROLL GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL'),i=e('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE');t.defineMode('forth',function(){function t(t,E){var e;for(e=t.length-1;e>=0;e--){if(t[e].name===E.toUpperCase()){return t[e]}};return undefined};return{startState:function(){return{state:'',base:10,coreWordList:E,immediateWordList:i,wordList:[]}},token:function(e,E){var i;if(e.eatSpace()){return null};if(E.state===''){if(e.match(/^(\]|:NONAME)(\s|$)/i)){E.state=' compilation';return'builtin compilation'};i=e.match(/^(\:)\s+(\S+)(\s|$)+/);if(i){E.wordList.push({name:i[2].toUpperCase()});E.state=' compilation';return'def'+E.state};i=e.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i);if(i){E.wordList.push({name:i[2].toUpperCase()});return'def'+E.state};i=e.match(/^('|\['\])\s+(\S+)(\s|$)+/);if(i){return'builtin'+E.state}} +else{if(e.match(/^(\;|\[)(\s)/)){E.state='';e.backUp(1);return'builtin compilation'};if(e.match(/^(\;|\[)($)/)){E.state='';return'builtin compilation'};if(e.match(/^(POSTPONE)\s+\S+(\s|$)+/)){return'builtin'}};i=e.match(/^(\S+)(\s+|$)/);if(i){if(t(E.wordList,i[1])!==undefined){return'variable'+E.state};if(i[1]==='\\'){e.skipToEnd();return'comment'+E.state};if(t(E.coreWordList,i[1])!==undefined){return'builtin'+E.state};if(t(E.immediateWordList,i[1])!==undefined){return'keyword'+E.state};if(i[1]==='('){e.eatWhile(function(t){return t!==')'});e.eat(')');return'comment'+E.state};if(i[1]==='.('){e.eatWhile(function(t){return t!==')'});e.eat(')');return'string'+E.state};if(i[1]==='S"'||i[1]==='."'||i[1]==='C"'){e.eatWhile(function(t){return t!=='"'});e.eat('"');return'string'+E.state};if(i[1]-0xfffffffff){return'number'+E.state};return'atom'+E.state}}}});t.defineMIME('text/x-forth','forth')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('nginx',function(e){function s(e){var i={},r=e.split(' ');for(var t=0;t<r.length;++t)i[r[t]]=!0;return i};var n=s('break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23'),c=s('http mail events server types location upstream charset_map limit_except if geo map'),l=s('include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files'),p=e.indentUnit,i;function t(e,t){i=t;return e};function r(e,r){e.eatWhile(/[\w\$_]/);var s=e.current();if(n.propertyIsEnumerable(s)){return'keyword'} +else if(c.propertyIsEnumerable(s)){return'variable-2'} +else if(l.propertyIsEnumerable(s)){return'string-2'};var i=e.next();if(i=='@'){e.eatWhile(/[\w\\\-]/);return t('meta',e.current())} +else if(i=='/'&&e.eat('*')){r.tokenize=a;return a(e,r)} +else if(i=='<'&&e.eat('!')){r.tokenize=o;return o(e,r)} +else if(i=='=')t(null,'compare');else if((i=='~'||i=='|')&&e.eat('='))return t(null,'compare');else if(i=='"'||i=='\''){r.tokenize=u(i);return r.tokenize(e,r)} +else if(i=='#'){e.skipToEnd();return t('comment','comment')} +else if(i=='!'){e.match(/^\s*\w*/);return t('keyword','important')} +else if(/\d/.test(i)){e.eatWhile(/[\w.%]/);return t('number','unit')} +else if(/[,.+>*\/]/.test(i)){return t(null,'select-op')} +else if(/[;{}:\[\]]/.test(i)){return t(null,i)} +else{e.eatWhile(/[\w\\\-]/);return t('variable','variable')}};function a(e,i){var a=!1,s;while((s=e.next())!=null){if(a&&s=='/'){i.tokenize=r;break};a=(s=='*')};return t('comment','comment')};function o(e,i){var s=0,a;while((a=e.next())!=null){if(s>=2&&a=='>'){i.tokenize=r;break};s=(a=='-')?s+1:0};return t('comment','comment')};function u(e){return function(i,s){var a=!1,o;while((o=i.next())!=null){if(o==e&&!a)break;a=!a&&o=='\\'};if(!a)s.tokenize=r;return t('string','string')}};return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(t,e){if(t.eatSpace())return null;i=null;var s=e.tokenize(t,e),r=e.stack[e.stack.length-1];if(i=='hash'&&r=='rule')s='atom';else if(s=='variable'){if(r=='rule')s='number';else if(!r||r=='@media{')s='tag'};if(r=='rule'&&/^[\{\};]$/.test(i))e.stack.pop();if(i=='{'){if(r=='@media')e.stack[e.stack.length-1]='@media{';else e.stack.push('{')} +else if(i=='}')e.stack.pop();else if(i=='@media')e.stack.push('@media');else if(r=='{'&&i!='comment')e.stack.push('rule');return s},indent:function(e,t){var i=e.stack.length;if(/^\}/.test(t))i-=e.stack[e.stack.length-1]=='rule'?2:1;return e.baseIndent+i*p},electricChars:'}'}});e.defineMIME('text/x-nginx-conf','nginx')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('javascript',function(t,i){var M=t.indentUnit,ce=i.statementIndent,P=i.jsonld,b=i.json||P,d=i.typescript,ne=i.wordCharacters||/[\w$\xa1-\uffff]/,de=function(){function e(e){return{type:e,style:'keyword'}};var l=e('keyword a'),i=e('keyword b'),r=e('keyword c'),a=e('keyword d'),f=e('operator'),t={type:'atom',style:'atom'};var s={'if':e('if'),'while':l,'with':l,'else':i,'do':i,'try':i,'finally':i,'return':a,'break':a,'continue':a,'new':e('new'),'delete':r,'void':r,'throw':r,'debugger':e('debugger'),'var':e('var'),'const':e('var'),'let':e('var'),'function':e('function'),'catch':e('catch'),'for':e('for'),'switch':e('switch'),'case':e('case'),'default':e('default'),'in':f,'typeof':f,'instanceof':f,'true':t,'false':t,'null':t,'undefined':t,'NaN':t,'Infinity':t,'this':e('this'),'class':e('class'),'super':e('atom'),'yield':r,'export':e('export'),'import':e('import'),'extends':r,'await':r};if(d){var n={type:'variable',style:'type'};var o={'interface':e('class'),'implements':r,'namespace':r,'public':e('modifier'),'private':e('modifier'),'protected':e('modifier'),'abstract':e('modifier'),'readonly':e('modifier'),'string':n,'number':n,'boolean':n,'any':n};for(var u in o){s[u]=o[u]}};return s}(),pe=/[+\-*&%=<>!?|~^@]/,ze=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Te(e){var n=!1,r,t=!1;while((r=e.next())!=null){if(!n){if(r=='/'&&!t)return;if(r=='[')t=!0;else if(t&&r==']')t=!1};n=!n&&r=='\\'}};var A,q;function l(e,r,t){A=e;q=t;return r};function w(e,r){var t=e.next();if(t=='"'||t=='\''){r.tokenize=Ce(t);return r.tokenize(e,r)} +else if(t=='.'&&e.match(/^\d+(?:[eE][+\-]?\d+)?/)){return l('number','number')} +else if(t=='.'&&e.match('..')){return l('spread','meta')} +else if(/[\[\]{}\(\),;\:\.]/.test(t)){return l(t)} +else if(t=='='&&e.eat('>')){return l('=>','operator')} +else if(t=='0'&&e.eat(/x/i)){e.eatWhile(/[\da-f]/i);return l('number','number')} +else if(t=='0'&&e.eat(/o/i)){e.eatWhile(/[0-7]/i);return l('number','number')} +else if(t=='0'&&e.eat(/b/i)){e.eatWhile(/[01]/i);return l('number','number')} +else if(/\d/.test(t)){e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return l('number','number')} +else if(t=='/'){if(e.eat('*')){r.tokenize=S;return S(e,r)} +else if(e.eat('/')){e.skipToEnd();return l('comment','comment')} +else if(Ve(e,r,1)){Te(e);e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return l('regexp','string-2')} +else{e.eat('=');return l('operator','operator',e.current())}} +else if(t=='`'){r.tokenize=ie;return ie(e,r)} +else if(t=='#'){e.skipToEnd();return l('error','error')} +else if(pe.test(t)){if(t!='>'||!r.lexical||r.lexical.type!='>'){if(e.eat('=')){if(t=='!'||t=='=')e.eat('=')} +else if(/[<>*+\-]/.test(t)){e.eat(t);if(t=='>')e.eat(t)}};return l('operator','operator',e.current())} +else if(ne.test(t)){e.eatWhile(ne);var n=e.current();if(r.lastType!='.'){if(de.propertyIsEnumerable(n)){var i=de[n];return l(i.type,i.style,n)};if(n=='async'&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return l('async','keyword',n)};return l('variable','variable',n)}};function Ce(e){return function(r,t){var n=!1,i;if(P&&r.peek()=='@'&&r.match(ze)){t.tokenize=w;return l('jsonld-keyword','meta')} +while((i=r.next())!=null){if(i==e&&!n)break;n=!n&&i=='\\'};if(!n)t.tokenize=w;return l('string','string')}};function S(e,r){var n=!1,t;while(t=e.next()){if(t=='/'&&n){r.tokenize=w;break};n=(t=='*')};return l('comment','comment')};function ie(e,r){var n=!1,t;while((t=e.next())!=null){if(!n&&(t=='`'||t=='$'&&e.eat('{'))){r.tokenize=w;break};n=!n&&t=='\\'};return l('quasi','string-2',e.current())};var Ie='([{}])';function ae(e,r){if(r.fatArrowAt)r.fatArrowAt=null;var u=e.string.indexOf('=>',e.start);if(u<0)return;if(d){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,u));if(o)u=o.index};var n=0,f=!1;for(var t=u-1;t>=0;--t){var i=e.string.charAt(t),a=Ie.indexOf(i);if(a>=0&&a<3){if(!n){++t;break};if(--n==0){if(i=='(')f=!0;break}} +else if(a>=3&&a<6){++n} +else if(ne.test(i)){f=!0} +else if(/["'\/]/.test(i)){return} +else if(f&&!n){++t;break}};if(f&&!n)r.fatArrowAt=t};var Ee={'atom':!0,'number':!0,'variable':!0,'string':!0,'regexp':!0,'this':!0,'jsonld-keyword':!0};function me(e,r,t,n,i,a){this.indented=e;this.column=r;this.type=t;this.prev=i;this.info=a;if(n!=null)this.align=n};function Oe(e,r){for(var t=e.localVars;t;t=t.next)if(t.name==r)return!0;for(var n=e.context;n;n=n.prev){for(var t=n.vars;t;t=t.next)if(t.name==r)return!0}};function qe(e,r,t,a,f){var i=e.cc;n.state=e;n.stream=f;n.marked=null,n.cc=i;n.style=r;if(!e.lexical.hasOwnProperty('align'))e.lexical.align=!0;while(!0){var u=i.length?i.pop():b?s:p;if(u(t,a)){while(i.length&&i[i.length-1].lex)i.pop()();if(n.marked)return n.marked;if(t=='variable'&&Oe(e,a))return'variable-2';return r}}};var n={state:null,column:null,marked:null,cc:null};function o(){for(var e=arguments.length-1;e>=0;e--)n.cc.push(arguments[e])};function r(){o.apply(null,arguments);return!0};function E(e){function t(r){for(var t=r;t;t=t.next)if(t.name==e)return!0;return!1};var r=n.state;n.marked='def';if(r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}} +else{if(t(r.globalVars))return;if(i.globalVars)r.globalVars={name:e,next:r.globalVars}}};var Ae={name:'this',next:{name:'arguments'}};function I(){n.state.context={prev:n.state.context,vars:n.state.localVars};n.state.localVars=Ae};function z(){n.state.localVars=n.state.context.vars;n.state.context=n.state.context.prev};function f(e,r){var t=function(){var i=n.state,a=i.indented;if(i.lexical.type=='stat')a=i.lexical.indented;else for(var t=i.lexical;t&&t.type==')'&&t.align;t=t.prev)a=t.indented;i.lexical=new me(a,n.stream.column(),e,null,i.lexical,r)};t.lex=!0;return t};function a(){var e=n.state;if(e.lexical.prev){if(e.lexical.type==')')e.indented=e.lexical.indented;e.lexical=e.lexical.prev}};a.lex=!0;function u(e){function t(n){if(n==e)return r();else if(e==';')return o();else return r(t)};return t};function p(e,t){if(e=='var')return r(f('vardef',t.length),oe,u(';'),a);if(e=='keyword a')return r(f('form'),fe,p,a);if(e=='keyword b')return r(f('form'),p,a);if(e=='keyword d')return n.stream.match(/^\s*$/,!1)?r():r(f('stat'),ue,u(';'),a);if(e=='debugger')return r(u(';'));if(e=='{')return r(f('}'),U,a);if(e==';')return r();if(e=='if'){if(n.state.lexical.info=='else'&&n.state.cc[n.state.cc.length-1]==a)n.state.cc.pop()();return r(f('form'),fe,p,a,he)};if(e=='function')return r(y);if(e=='for')return r(f('form'),ur,p,a);if(e=='variable'){if(d&&t=='type'){n.marked='keyword';return r(c,u('operator'),c,u(';'))} +else if(d&&t=='declare'){n.marked='keyword';return r(p)} +else if(d&&(t=='module'||t=='enum')&&n.stream.match(/^\s*\w/,!1)){n.marked='keyword';return r(f('form'),k,u('{'),f('}'),U,a,a)} +else{return r(f('stat'),Ue)}};if(e=='switch')return r(f('form'),fe,u('{'),f('}','switch'),U,a,a);if(e=='case')return r(s,u(':'));if(e=='default')return r(u(':'));if(e=='catch')return r(f('form'),I,u('('),O,u(')'),p,a,z);if(e=='class')return r(f('form'),ge,a);if(e=='export')return r(f('stat'),cr,a);if(e=='import')return r(f('stat'),dr,a);if(e=='async')return r(p);if(t=='@')return r(s,p);return o(f('stat'),s,u(';'),a)};function s(e){return ve(e,!1)};function m(e){return ve(e,!0)};function fe(e){if(e!='(')return o();return r(f(')'),s,u(')'),a)};function ve(e,t){if(n.state.fatArrowAt==n.stream.start){var l=t?ke:ye;if(e=='(')return r(I,f(')'),v(O,')'),a,u('=>'),l,z);else if(e=='variable')return o(I,k,u('=>'),l,z)};var i=t?V:h;if(Ee.hasOwnProperty(e))return r(i);if(e=='function')return r(y,i);if(e=='class')return r(f('form'),lr,a);if(e=='keyword c'||e=='async')return r(t?m:s);if(e=='(')return r(f(')'),ue,u(')'),a,i);if(e=='operator'||e=='spread')return r(t?m:s);if(e=='[')return r(f(']'),mr,a,i);if(e=='{')return T(N,'}',null,i);if(e=='quasi')return o(W,i);if(e=='new')return r(Se(t));return r()};function ue(e){if(e.match(/[;\}\)\],]/))return o();return o(s)};function h(e,t){if(e==',')return r(s);return V(e,t,!1)};function V(e,t,i){var l=i==!1?h:V,p=i==!1?s:m;if(e=='=>')return r(I,i?ke:ye,z);if(e=='operator'){if(/\+\+|--/.test(t)||d&&t=='!')return r(l);if(d&&t=='<'&&n.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1))return r(f('>'),v(c,'>'),a,l);if(t=='?')return r(s,u(':'),p);return r(p)};if(e=='quasi'){return o(W,l)};if(e==';')return;if(e=='(')return T(m,')','call',l);if(e=='.')return r(Be,l);if(e=='[')return r(f(']'),ue,u(']'),a,l);if(d&&t=='as'){n.marked='keyword';return r(c,l)};if(e=='regexp'){n.state.lastType=n.marked='operator';n.stream.backUp(n.stream.pos-n.stream.start-1);return r(p)}};function W(e,t){if(e!='quasi')return o();if(t.slice(t.length-2)!='${')return r(W);return r(s,Pe)};function Pe(e){if(e=='}'){n.marked='string-2';n.state.tokenize=ie;return r(W)}};function ye(e){ae(n.stream,n.state);return o(e=='{'?p:s)};function ke(e){ae(n.stream,n.state);return o(e=='{'?p:m)};function Se(e){return function(t){if(t=='.')return r(e?Ne:We);else if(t=='variable'&&d)return r(nr,e?V:h);else return o(e?m:s)}};function We(e,t){if(t=='target'){n.marked='keyword';return r(h)}};function Ne(e,t){if(t=='target'){n.marked='keyword';return r(V)}};function Ue(e){if(e==':')return r(a,p);return o(h,u(';'),a)};function Be(e){if(e=='variable'){n.marked='property';return r()}};function N(e,t){if(e=='async'){n.marked='property';return r(N)} +else if(e=='variable'||n.style=='keyword'){n.marked='property';if(t=='get'||t=='set')return r(He);var i;if(d&&n.state.fatArrowAt==n.stream.start&&(i=n.stream.match(/^\s*:\s*/,!1)))n.state.fatArrowAt=n.stream.pos+i[0].length;return r(x)} +else if(e=='number'||e=='string'){n.marked=P?'property':(n.style+' property');return r(x)} +else if(e=='jsonld-keyword'){return r(x)} +else if(e=='modifier'){return r(N)} +else if(e=='['){return r(s,u(']'),x)} +else if(e=='spread'){return r(m,x)} +else if(t=='*'){n.marked='keyword';return r(N)} +else if(e==':'){return o(x)}};function He(e){if(e!='variable')return o(x);n.marked='property';return r(y)};function x(e){if(e==':')return r(m);if(e=='(')return o(y)};function v(e,t,i){function a(f,s){if(i?i.indexOf(f)>-1:f==','){var l=n.state.lexical;if(l.info=='call')l.pos=(l.pos||0)+1;return r(function(r,n){if(r==t||n==t)return o();return o(e)},a)};if(f==t||s==t)return r();return r(u(t))};return function(n,i){if(n==t||i==t)return r();return o(e,a)}};function T(e,t,i){for(var u=3;u<arguments.length;u++)n.cc.push(arguments[u]);return r(f(t,i),v(e,t),a)};function U(e){if(e=='}')return r();return o(p,U)};function B(e,t){if(d){if(e==':')return r(c);if(t=='?')return r(B)}};function er(e){if(d&&e==':'){if(n.stream.match(/^\s*\w+\s+is\b/,!1))return r(s,rr,c);else return r(c)}};function rr(e,t){if(t=='is'){n.marked='keyword';return r()}};function c(e,t){if(e=='variable'||t=='void'){if(t=='keyof'){n.marked='keyword';return r(c)} +else{n.marked='type';return r(g)}};if(e=='string'||e=='number'||e=='atom')return r(g);if(e=='[')return r(f(']'),v(c,']',','),a,g);if(e=='{')return r(f('}'),v(H,'}',',;'),a,g);if(e=='(')return r(v(be,')'),tr)};function tr(e){if(e=='=>')return r(c)};function H(e,t){if(e=='variable'||n.style=='keyword'){n.marked='property';return r(H)} +else if(t=='?'){return r(H)} +else if(e==':'){return r(c)} +else if(e=='['){return r(s,B,u(']'),H)}};function be(e){if(e=='variable')return r(be);else if(e==':')return r(c)};function g(e,t){if(t=='<')return r(f('>'),v(c,'>'),a,g);if(t=='|'||e=='.')return r(c);if(e=='[')return r(u(']'),g);if(t=='extends')return r(c)};function nr(e,t){if(t=='<')return r(f('>'),v(c,'>'),a,g)};function we(){return o(c,ir)};function ir(e,t){if(t=='=')return r(c)};function oe(){return o(k,B,C,fr)};function k(e,t){if(e=='modifier')return r(k);if(e=='variable'){E(t);return r()};if(e=='spread')return r(k);if(e=='[')return T(k,']');if(e=='{')return T(ar,'}')};function ar(e,t){if(e=='variable'&&!n.stream.match(/^\s*:/,!1)){E(t);return r(C)};if(e=='variable')n.marked='property';if(e=='spread')return r(k);if(e=='}')return o();return r(u(':'),k,C)};function C(e,t){if(t=='=')return r(m)};function fr(e){if(e==',')return r(oe)};function he(e,t){if(e=='keyword b'&&t=='else')return r(f('form','else'),p,a)};function ur(e){if(e=='(')return r(f(')'),or,u(')'),a)};function or(e){if(e=='var')return r(oe,u(';'),ee);if(e==';')return r(ee);if(e=='variable')return r(sr);return o(s,u(';'),ee)};function sr(e,t){if(t=='in'||t=='of'){n.marked='keyword';return r(s)};return r(h,ee)};function ee(e,t){if(e==';')return r(xe);if(t=='in'||t=='of'){n.marked='keyword';return r(s)};return o(s,u(';'),xe)};function xe(e){if(e!=')')r(s)};function y(e,t){if(t=='*'){n.marked='keyword';return r(y)};if(e=='variable'){E(t);return r(y)};if(e=='(')return r(I,f(')'),v(O,')'),a,er,p,z);if(d&&t=='<')return r(f('>'),v(we,'>'),a,y)};function O(e,t){if(t=='@')r(s,O);if(e=='spread'||e=='modifier')return r(O);return o(k,B,C)};function lr(e,r){if(e=='variable')return ge(e,r);return re(e,r)};function ge(e,t){if(e=='variable'){E(t);return r(re)}};function re(e,t){if(t=='<')return r(f('>'),v(we,'>'),a,re);if(t=='extends'||t=='implements'||(d&&e==','))return r(d?c:s,re);if(e=='{')return r(f('}'),j,a)};function j(e,t){if(e=='modifier'||e=='async'||(e=='variable'&&(t=='static'||t=='get'||t=='set')&&n.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))){n.marked='keyword';return r(j)};if(e=='variable'||n.style=='keyword'){n.marked='property';return r(d?se:y,j)};if(e=='[')return r(s,u(']'),d?se:y,j);if(t=='*'){n.marked='keyword';return r(j)};if(e==';')return r(j);if(e=='}')return r();if(t=='@')return r(s,j)};function se(e,t){if(t=='?')return r(se);if(e==':')return r(c,C);if(t=='=')return r(m);return o(y)};function cr(e,t){if(t=='*'){n.marked='keyword';return r(le,u(';'))};if(t=='default'){n.marked='keyword';return r(s,u(';'))};if(e=='{')return r(v(je,'}'),le,u(';'));return o(p)};function je(e,t){if(t=='as'){n.marked='keyword';return r(u('variable'))};if(e=='variable')return o(m,je)};function dr(e){if(e=='string')return r();return o(te,Me,le)};function te(e,t){if(e=='{')return T(te,'}');if(e=='variable')E(t);if(t=='*')n.marked='keyword';return r(pr)};function Me(e){if(e==',')return r(te,Me)};function pr(e,t){if(t=='as'){n.marked='keyword';return r(te)}};function le(e,t){if(t=='from'){n.marked='keyword';return r(s)}};function mr(e){if(e==']')return r();return o(v(m,']'))};function vr(e,r){return e.lastType=='operator'||e.lastType==','||pe.test(r.charAt(0))||/[,.]/.test(r.charAt(0))};function Ve(e,r,t){return r.tokenize==w&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(r.lastType)||(r.lastType=='quasi'&&/\{\s*$/.test(e.string.slice(0,e.pos-(t||0))))};return{startState:function(e){var r={tokenize:w,lastType:'sof',cc:[],lexical:new me((e||0)-M,0,'block',!1),localVars:i.localVars,context:i.localVars&&{vars:i.localVars},indented:e||0};if(i.globalVars&&typeof i.globalVars=='object')r.globalVars=i.globalVars;return r},token:function(e,r){if(e.sol()){if(!r.lexical.hasOwnProperty('align'))r.lexical.align=!1;r.indented=e.indentation();ae(e,r)};if(r.tokenize!=S&&e.eatSpace())return null;var t=r.tokenize(e,r);if(A=='comment')return t;r.lastType=A=='operator'&&(q=='++'||q=='--')?'incdec':A;return qe(r,t,A,q,e)},indent:function(r,t){if(r.tokenize==S)return e.Pass;if(r.tokenize!=w)return 0;var s=t&&t.charAt(0),n=r.lexical,l;if(!/^\s*else\b/.test(t))for(var o=r.cc.length-1;o>=0;--o){var c=r.cc[o];if(c==a)n=n.prev;else if(c!=he)break} +while((n.type=='stat'||n.type=='form')&&(s=='}'||((l=r.cc[r.cc.length-1])&&(l==h||l==V)&&!/^[,\.=+\-*:?[\(]/.test(t))))n=n.prev;if(ce&&n.type==')'&&n.prev.type=='stat')n=n.prev;var f=n.type,u=s==f;if(f=='vardef')return n.indented+(r.lastType=='operator'||r.lastType==','?n.info+1:0);else if(f=='form'&&s=='{')return n.indented;else if(f=='form')return n.indented+M;else if(f=='stat')return n.indented+(vr(r,t)?ce||M:0);else if(n.info=='switch'&&!u&&i.doubleIndentSwitch!=!1)return n.indented+(/^(?:case|default)\b/.test(t)?M:2*M);else if(n.align)return n.column+(u?0:1);else return n.indented+(u?0:M)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:b?null:'/*',blockCommentEnd:b?null:'*/',blockCommentContinue:b?null:' * ',lineComment:b?null:'//',fold:'brace',closeBrackets:'()[]{}\'\'""``',helperType:b?'json':'javascript',jsonldMode:P,jsonMode:b,expressionAllowed:Ve,skipExpression:function(e){var r=e.cc[e.cc.length-1];if(r==s||r==m)e.cc.pop()}}});e.registerHelper('wordChars','javascript',/[\w$]/);e.defineMIME('text/javascript','javascript');e.defineMIME('text/ecmascript','javascript');e.defineMIME('application/javascript','javascript');e.defineMIME('application/x-javascript','javascript');e.defineMIME('application/ecmascript','javascript');e.defineMIME('application/json',{name:'javascript',json:!0});e.defineMIME('application/x-json',{name:'javascript',json:!0});e.defineMIME('application/ld+json',{name:'javascript',jsonld:!0});e.defineMIME('text/typescript',{name:'javascript',typescript:!0});e.defineMIME('application/typescript',{name:'javascript',typescript:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('pascal',function(){function i(e){var t={},n=e.split(' ');for(var r=0;r<n.length;++r)t[n[r]]=!0;return t};var t=i('and array begin case const div do downto else end file for forward integer boolean char function goto if in label mod nil not of or packed procedure program record repeat set string then to type until var while with'),n={'null':!0};var e=/[+\-*&%=<>!?|\/]/;function o(i,o){var u=i.next();if(u=='#'&&o.startOfLine){i.skipToEnd();return'meta'};if(u=='"'||u=='\''){o.tokenize=a(u);return o.tokenize(i,o)};if(u=='('&&i.eat('*')){o.tokenize=r;return r(i,o)};if(/[\[\]{}\(\),;\:\.]/.test(u)){return null};if(/\d/.test(u)){i.eatWhile(/[\w\.]/);return'number'};if(u=='/'){if(i.eat('/')){i.skipToEnd();return'comment'}};if(e.test(u)){i.eatWhile(e);return'operator'};i.eatWhile(/[\w\$_]/);var f=i.current();if(t.propertyIsEnumerable(f))return'keyword';if(n.propertyIsEnumerable(f))return'atom';return'variable'};function a(e){return function(r,t){var n=!1,i,o=!1;while((i=r.next())!=null){if(i==e&&!n){o=!0;break};n=!n&&i=='\\'};if(o||!n)t.tokenize=null;return'string'}};function r(e,r){var n=!1,t;while(t=e.next()){if(t==')'&&n){r.tokenize=null;break};n=(t=='*')};return'comment'};return{startState:function(){return{tokenize:null}},token:function(e,r){if(e.eatSpace())return null;var t=(r.tokenize||o)(e,r);if(t=='comment'||t=='meta')return t;return t},electricChars:'{}'}});e.defineMIME('text/x-pascal','pascal')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("haxe",function(t,r){var b=t.indentUnit;function a(e){return{type:e,style:"keyword"}};var O=a("keyword a"),A=a("keyword b"),v=a("keyword c"),ne=a("operator"),S={type:"atom",style:"atom"},h={type:"attribute",style:"attribute"};var f=a("typedef"),I={"if":O,"while":O,"else":A,"do":A,"try":A,"return":v,"break":v,"continue":v,"new":v,"throw":v,"var":a("var"),"inline":h,"static":h,"using":a("import"),"public":h,"private":h,"cast":a("cast"),"import":a("import"),"macro":a("macro"),"function":a("function"),"catch":a("catch"),"untyped":a("untyped"),"callback":a("cb"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":ne,"never":a("property_access"),"trace":a("trace"),"class":f,"abstract":f,"enum":f,"interface":f,"typedef":f,"extends":f,"implements":f,"dynamic":f,"true":S,"false":S,"null":S};var V=/[+\-*&%=<>!?|]/;function P(e,t,r){t.tokenize=r;return r(e,t)};function D(e,t){var r=!1,n;while((n=e.next())!=null){if(n==t&&!r)return!0;r=!r&&n=="\\"}};var f,Z;function o(e,t,r){f=e;Z=r;return t};function x(e,t){var r=e.next();if(r=="\""||r=="'"){return P(e,t,ie(r))} +else if(/[\[\]{}\(\),;\:\.]/.test(r)){return o(r)} +else if(r=="0"&&e.eat(/x/i)){e.eatWhile(/[\da-f]/i);return o("number","number")} +else if(/\d/.test(r)||r=="-"&&e.eat(/\d/)){e.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/);return o("number","number")} +else if(t.reAllowed&&(r=="~"&&e.eat(/\//))){D(e,"/");e.eatWhile(/[gimsu]/);return o("regexp","string-2")} +else if(r=="/"){if(e.eat("*")){return P(e,t,ae)} +else if(e.eat("/")){e.skipToEnd();return o("comment","comment")} +else{e.eatWhile(V);return o("operator",null,e.current())}} +else if(r=="#"){e.skipToEnd();return o("conditional","meta")} +else if(r=="@"){e.eat(/:/);e.eatWhile(/[\w_]/);return o("metadata","meta")} +else if(V.test(r)){e.eatWhile(V);return o("operator",null,e.current())} +else{var n;if(/[A-Z]/.test(r)){e.eatWhile(/[\w_<>]/);n=e.current();return o("type","variable-3",n)} +else{e.eatWhile(/[\w_]/);var n=e.current(),i=I.propertyIsEnumerable(n)&&I[n];return(i&&t.kwAllowed)?o(i.type,i.style,n):o("variable","variable",n)}}};function ie(e){return function(t,r){if(D(t,e))r.tokenize=x;return o("string","string")}};function ae(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=x;break};n=(r=="*")};return o("comment","comment")};var T={"atom":!0,"number":!0,"variable":!0,"string":!0,"regexp":!0};function j(e,t,r,n,i,a){this.indented=e;this.column=t;this.type=r;this.prev=i;this.info=a;if(n!=null)this.align=n};function ue(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0};function fe(e,t,i,a,u){var r=e.cc;n.state=e;n.stream=u;n.marked=null,n.cc=r;if(!e.lexical.hasOwnProperty("align"))e.lexical.align=!0;while(!0){var f=r.length?r.pop():m;if(f(i,a)){while(r.length&&r[r.length-1].lex)r.pop()();if(n.marked)return n.marked;if(i=="variable"&&ue(e,a))return"variable-2";if(i=="variable"&&le(e,a))return"variable-3";return t}}};function le(e,t){if(/[a-z]/.test(t.charAt(0)))return!1;var n=e.importedtypes.length;for(var r=0;r<n;r++)if(e.importedtypes[r]==t)return!0};function B(e){var r=n.state;for(var t=r.importedtypes;t;t=t.next)if(t.name==e)return;r.importedtypes={name:e,next:r.importedtypes}};var n={state:null,column:null,marked:null,cc:null};function d(){for(var e=arguments.length-1;e>=0;e--)n.cc.push(arguments[e])};function e(){d.apply(null,arguments);return!0};function F(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1};function k(e){var t=n.state;if(t.context){n.marked="def";if(F(e,t.localVars))return;t.localVars={name:e,next:t.localVars}} +else if(t.globalVars){if(F(e,t.globalVars))return;t.globalVars={name:e,next:t.globalVars}}};var re={name:"this",next:null};function E(){if(!n.state.context)n.state.localVars=re;n.state.context={prev:n.state.context,vars:n.state.localVars}};function w(){n.state.localVars=n.state.context.vars;n.state.context=n.state.context.prev};w.lex=!0;function u(e,t){var r=function(){var r=n.state;r.lexical=new j(r.indented,n.stream.column(),e,null,r.lexical,t)};r.lex=!0;return r};function i(){var e=n.state;if(e.lexical.prev){if(e.lexical.type==")")e.indented=e.lexical.indented;e.lexical=e.lexical.prev}};i.lex=!0;function l(t){function r(n){if(n==t)return e();else if(t==";")return d();else return e(r)};return r};function m(t){if(t=="@")return e(M);if(t=="var")return e(u("vardef"),C,l(";"),i);if(t=="keyword a")return e(u("form"),c,m,i);if(t=="keyword b")return e(u("form"),m,i);if(t=="{")return e(u("}"),E,z,i,w);if(t==";")return e();if(t=="attribute")return e(U);if(t=="function")return e(y);if(t=="for")return e(u("form"),l("("),u(")"),pe,l(")"),i,m,i);if(t=="variable")return e(u("stat"),se);if(t=="switch")return e(u("form"),c,u("}","switch"),l("{"),z,i,i);if(t=="case")return e(c,l(":"));if(t=="default")return e(l(":"));if(t=="catch")return e(u("form"),E,l("("),te,l(")"),m,i,w);if(t=="import")return e(q,l(";"));if(t=="typedef")return e(ce);return d(u("stat"),c,l(";"),i)};function c(t){if(T.hasOwnProperty(t))return e(s);if(t=="type")return e(s);if(t=="function")return e(y);if(t=="keyword c")return e(W);if(t=="(")return e(u(")"),W,l(")"),i,s);if(t=="operator")return e(c);if(t=="[")return e(u("]"),p(W,"]"),i,s);if(t=="{")return e(u("}"),p(me,"}"),i,s);return e()};function W(e){if(e.match(/[;\}\)\],]/))return d();return d(c)};function s(t,r){if(t=="operator"&&/\+\+|--/.test(r))return e(s);if(t=="operator"||t==":")return e(c);if(t==";")return;if(t=="(")return e(u(")"),p(c,")"),i,s);if(t==".")return e(de,s);if(t=="[")return e(u("]"),c,l("]"),i,s)};function U(t){if(t=="attribute")return e(U);if(t=="function")return e(y);if(t=="var")return e(C)};function M(t){if(t==":")return e(M);if(t=="variable")return e(M);if(t=="(")return e(u(")"),p(oe,")"),i,m)};function oe(t){if(t=="variable")return e()};function q(t,r){if(t=="variable"&&/[A-Z]/.test(r.charAt(0))){B(r);return e()} +else if(t=="variable"||t=="property"||t=="."||r=="*")return e(q)};function ce(t,r){if(t=="variable"&&/[A-Z]/.test(r.charAt(0))){B(r);return e()} +else if(t=="type"&&/[A-Z]/.test(r.charAt(0))){return e()}};function se(t){if(t==":")return e(i,m);return d(s,l(";"),i)};function de(t){if(t=="variable"){n.marked="property";return e()}};function me(t){if(t=="variable")n.marked="property";if(T.hasOwnProperty(t))return e(l(":"),c)};function p(t,r){function n(i){if(i==",")return e(t,n);if(i==r)return e();return e(l(r))};return function(i){if(i==r)return e();else return d(t,n)}};function z(t){if(t=="}")return e();return d(m,z)};function C(t,r){if(t=="variable"){k(r);return e(g,ee)};return e()};function ee(t,r){if(r=="=")return e(c,ee);if(t==",")return e(C)};function pe(t,r){if(t=="variable"){k(r);return e(ve,c)} +else{return d()}};function ve(t,r){if(r=="in")return e()};function y(t,r){if(t=="variable"||t=="type"){k(r);return e(y)};if(r=="new")return e(y);if(t=="(")return e(u(")"),E,p(te,")"),i,g,m,w)};function g(t){if(t==":")return e(be)};function be(t){if(t=="type")return e();if(t=="variable")return e();if(t=="{")return e(u("}"),p(ye,"}"),i)};function ye(t){if(t=="variable")return e(g)};function te(t,r){if(t=="variable"){k(r);return e(g)}};return{startState:function(e){var n=["Int","Float","String","Void","Std","Bool","Dynamic","Array"],t={tokenize:x,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new j((e||0)-b,0,"block",!1),localVars:r.localVars,importedtypes:n,context:r.localVars&&{vars:r.localVars},indented:0};if(r.globalVars&&typeof r.globalVars=="object")t.globalVars=r.globalVars;return t},token:function(e,t){if(e.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=!1;t.indented=e.indentation()};if(e.eatSpace())return null;var r=t.tokenize(e,t);if(f=="comment")return r;t.reAllowed=!!(f=="operator"||f=="keyword c"||f.match(/^[\[{}\(,;:]$/));t.kwAllowed=f!=".";return fe(t,r,f,Z,e)},indent:function(e,t){if(e.tokenize!=x)return 0;var a=t&&t.charAt(0),r=e.lexical;if(r.type=="stat"&&a=="}")r=r.prev;var n=r.type,i=a==n;if(n=="vardef")return r.indented+4;else if(n=="form"&&a=="{")return r.indented;else if(n=="stat"||n=="form")return r.indented+b;else if(r.info=="switch"&&!i)return r.indented+(/^(?:case|default)\b/.test(t)?b:2*b);else if(r.align)return r.column+(i?0:1);else return r.indented+(i?0:b)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}});e.defineMIME("text/x-haxe","haxe");e.defineMode("hxml",function(){return{startState:function(){return{define:!1,inString:!1}},token:function(e,t){var r=e.peek(),i=e.sol();if(r=="#"){e.skipToEnd();return"comment"};if(i&&r=="-"){var n="variable-2";e.eat(/-/);if(e.peek()=="-"){e.eat(/-/);n="keyword a"};if(e.peek()=="D"){e.eat(/[D]/);n="keyword c";t.define=!0};e.eatWhile(/[A-Z]/i);return n};var r=e.peek();if(t.inString==!1&&r=="'"){t.inString=!0;e.next()};if(t.inString==!0){if(e.skipTo("'")){} +else{e.skipToEnd()};if(e.peek()=="'"){e.next();t.inString=!1};return"string"};e.next();return null},lineComment:"#"}});e.defineMIME("text/x-hxml","hxml")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(r){'use strict';r.defineMode('perl',function(){var a={'->':4,'++':4,'--':4,'**':4,'=~':4,'!~':4,'*':4,'/':4,'%':4,'x':4,'+':4,'-':4,'.':4,'<<':4,'>>':4,'<':4,'>':4,'<=':4,'>=':4,'lt':4,'gt':4,'le':4,'ge':4,'==':4,'!=':4,'<=>':4,'eq':4,'ne':4,'cmp':4,'~~':4,'&':4,'|':4,'^':4,'&&':4,'||':4,'//':4,'..':4,'...':4,'?':4,':':4,'=':4,'+=':4,'-=':4,'*=':4,',':4,'=>':4,'::':4,'not':4,'and':4,'or':4,'xor':4,'BEGIN':[5,1],'END':[5,1],'PRINT':[5,1],'PRINTF':[5,1],'GETC':[5,1],'READ':[5,1],'READLINE':[5,1],'DESTROY':[5,1],'TIE':[5,1],'TIEHANDLE':[5,1],'UNTIE':[5,1],'STDIN':5,'STDIN_TOP':5,'STDOUT':5,'STDOUT_TOP':5,'STDERR':5,'STDERR_TOP':5,'$ARG':5,'$_':5,'@ARG':5,'@_':5,'$LIST_SEPARATOR':5,'$"':5,'$PROCESS_ID':5,'$PID':5,'$$':5,'$REAL_GROUP_ID':5,'$GID':5,'$(':5,'$EFFECTIVE_GROUP_ID':5,'$EGID':5,'$)':5,'$PROGRAM_NAME':5,'$0':5,'$SUBSCRIPT_SEPARATOR':5,'$SUBSEP':5,'$;':5,'$REAL_USER_ID':5,'$UID':5,'$<':5,'$EFFECTIVE_USER_ID':5,'$EUID':5,'$>':5,'$a':5,'$b':5,'$COMPILING':5,'$^C':5,'$DEBUGGING':5,'$^D':5,'${^ENCODING}':5,'$ENV':5,'%ENV':5,'$SYSTEM_FD_MAX':5,'$^F':5,'@F':5,'${^GLOBAL_PHASE}':5,'$^H':5,'%^H':5,'@INC':5,'%INC':5,'$INPLACE_EDIT':5,'$^I':5,'$^M':5,'$OSNAME':5,'$^O':5,'${^OPEN}':5,'$PERLDB':5,'$^P':5,'$SIG':5,'%SIG':5,'$BASETIME':5,'$^T':5,'${^TAINT}':5,'${^UNICODE}':5,'${^UTF8CACHE}':5,'${^UTF8LOCALE}':5,'$PERL_VERSION':5,'$^V':5,'${^WIN32_SLOPPY_STAT}':5,'$EXECUTABLE_NAME':5,'$^X':5,'$1':5,'$MATCH':5,'$&':5,'${^MATCH}':5,'$PREMATCH':5,'$`':5,'${^PREMATCH}':5,'$POSTMATCH':5,'$\'':5,'${^POSTMATCH}':5,'$LAST_PAREN_MATCH':5,'$+':5,'$LAST_SUBMATCH_RESULT':5,'$^N':5,'@LAST_MATCH_END':5,'@+':5,'%LAST_PAREN_MATCH':5,'%+':5,'@LAST_MATCH_START':5,'@-':5,'%LAST_MATCH_START':5,'%-':5,'$LAST_REGEXP_CODE_RESULT':5,'$^R':5,'${^RE_DEBUG_FLAGS}':5,'${^RE_TRIE_MAXBUF}':5,'$ARGV':5,'@ARGV':5,'ARGV':5,'ARGVOUT':5,'$OUTPUT_FIELD_SEPARATOR':5,'$OFS':5,'$,':5,'$INPUT_LINE_NUMBER':5,'$NR':5,'$.':5,'$INPUT_RECORD_SEPARATOR':5,'$RS':5,'$/':5,'$OUTPUT_RECORD_SEPARATOR':5,'$ORS':5,'$\\':5,'$OUTPUT_AUTOFLUSH':5,'$|':5,'$ACCUMULATOR':5,'$^A':5,'$FORMAT_FORMFEED':5,'$^L':5,'$FORMAT_PAGE_NUMBER':5,'$%':5,'$FORMAT_LINES_LEFT':5,'$-':5,'$FORMAT_LINE_BREAK_CHARACTERS':5,'$:':5,'$FORMAT_LINES_PER_PAGE':5,'$=':5,'$FORMAT_TOP_NAME':5,'$^':5,'$FORMAT_NAME':5,'$~':5,'${^CHILD_ERROR_NATIVE}':5,'$EXTENDED_OS_ERROR':5,'$^E':5,'$EXCEPTIONS_BEING_CAUGHT':5,'$^S':5,'$WARNING':5,'$^W':5,'${^WARNING_BITS}':5,'$OS_ERROR':5,'$ERRNO':5,'$!':5,'%OS_ERROR':5,'%ERRNO':5,'%!':5,'$CHILD_ERROR':5,'$?':5,'$EVAL_ERROR':5,'$@':5,'$OFMT':5,'$#':5,'$*':5,'$ARRAY_BASE':5,'$[':5,'$OLD_PERL_VERSION':5,'$]':5,'if':[1,1],elsif:[1,1],'else':[1,1],'while':[1,1],unless:[1,1],'for':[1,1],foreach:[1,1],'abs':1,accept:1,alarm:1,'atan2':1,bind:1,binmode:1,bless:1,bootstrap:1,'break':1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,'continue':[1,1],'cos':1,crypt:1,dbmclose:1,dbmopen:1,'default':1,defined:1,'delete':1,die:1,'do':1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,'eval':1,'exec':1,exists:1,exit:1,'exp':1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,'goto':1,grep:1,hex:1,'import':1,index:1,'int':1,ioctl:1,'join':1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,'link':1,listen:1,local:2,localtime:1,lock:1,'log':1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,'new':1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,'package':1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,'return':1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,'sin':1,sleep:1,socket:1,socketpair:1,'sort':1,splice:1,'split':1,sprintf:1,'sqrt':1,srand:1,stat:1,state:1,study:1,'sub':1,'substr':1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null};var s='string-2',u=/[goseximacplud]/;function r(t,e,r,n,i){e.chain=null;e.style=null;e.tail=null;e.tokenize=function(e,t){var s=!1,u,a=0;while(u=e.next()){if(u===r[a]&&!s){if(r[++a]!==undefined){t.chain=r[a];t.style=n;t.tail=i} +else if(i)e.eatWhile(i);t.tokenize=f;return n};s=!s&&u=='\\'};return n};return e.tokenize(t,e)};function l(e,t,r){t.tokenize=function(e,t){if(e.string==r)t.tokenize=f;e.skipToEnd();return'string'};return t.tokenize(e,t)};function f(f,E){if(f.eatSpace())return null;if(E.chain)return r(f,E,E.chain,E.style,E.tail);if(f.match(/^\-?[\d\.]/,!1))if(f.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return'number';if(f.match(/^<<(?=\w)/)){f.eatWhile(/\w/);return l(f,E,f.current().substr(2))};if(f.sol()&&f.match(/^\=item(?!\w)/)){return l(f,E,'=cut')};var R=f.next();if(R=='"'||R=='\''){if(i(f,3)=='<<'+R){var c=f.pos;f.eatWhile(/\w/);var T=f.current().substr(1);if(T&&f.eat(R))return l(f,E,T);f.pos=c};return r(f,E,[R],'string')};if(R=='q'){var o=t(f,-2);if(!(o&&/\w/.test(o))){o=t(f,0);if(o=='x'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],s,u)};if(o=='['){e(f,2);return r(f,E,[']'],s,u)};if(o=='{'){e(f,2);return r(f,E,['}'],s,u)};if(o=='<'){e(f,2);return r(f,E,['>'],s,u)};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],s,u)}} +else if(o=='q'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],'string')};if(o=='['){e(f,2);return r(f,E,[']'],'string')};if(o=='{'){e(f,2);return r(f,E,['}'],'string')};if(o=='<'){e(f,2);return r(f,E,['>'],'string')};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],'string')}} +else if(o=='w'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],'bracket')};if(o=='['){e(f,2);return r(f,E,[']'],'bracket')};if(o=='{'){e(f,2);return r(f,E,['}'],'bracket')};if(o=='<'){e(f,2);return r(f,E,['>'],'bracket')};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],'bracket')}} +else if(o=='r'){o=t(f,1);if(o=='('){e(f,2);return r(f,E,[')'],s,u)};if(o=='['){e(f,2);return r(f,E,[']'],s,u)};if(o=='{'){e(f,2);return r(f,E,['}'],s,u)};if(o=='<'){e(f,2);return r(f,E,['>'],s,u)};if(/[\^'"!~\/]/.test(o)){e(f,1);return r(f,E,[f.eat(o)],s,u)}} +else if(/[\^'"!~\/(\[{<]/.test(o)){if(o=='('){e(f,1);return r(f,E,[')'],'string')};if(o=='['){e(f,1);return r(f,E,[']'],'string')};if(o=='{'){e(f,1);return r(f,E,['}'],'string')};if(o=='<'){e(f,1);return r(f,E,['>'],'string')};if(/[\^'"!~\/]/.test(o)){return r(f,E,[f.eat(o)],'string')}}}};if(R=='m'){var o=t(f,-2);if(!(o&&/\w/.test(o))){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(/[\^'"!~\/]/.test(o)){return r(f,E,[o],s,u)};if(o=='('){return r(f,E,[')'],s,u)};if(o=='['){return r(f,E,[']'],s,u)};if(o=='{'){return r(f,E,['}'],s,u)};if(o=='<'){return r(f,E,['>'],s,u)}}}};if(R=='s'){var o=/[\/>\]})\w]/.test(t(f,-2));if(!o){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(o=='[')return r(f,E,[']',']'],s,u);if(o=='{')return r(f,E,['}','}'],s,u);if(o=='<')return r(f,E,['>','>'],s,u);if(o=='(')return r(f,E,[')',')'],s,u);return r(f,E,[o,o],s,u)}}};if(R=='y'){var o=/[\/>\]})\w]/.test(t(f,-2));if(!o){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(o=='[')return r(f,E,[']',']'],s,u);if(o=='{')return r(f,E,['}','}'],s,u);if(o=='<')return r(f,E,['>','>'],s,u);if(o=='(')return r(f,E,[')',')'],s,u);return r(f,E,[o,o],s,u)}}};if(R=='t'){var o=/[\/>\]})\w]/.test(t(f,-2));if(!o){o=f.eat('r');if(o){o=f.eat(/[(\[{<\^'"!~\/]/);if(o){if(o=='[')return r(f,E,[']',']'],s,u);if(o=='{')return r(f,E,['}','}'],s,u);if(o=='<')return r(f,E,['>','>'],s,u);if(o=='(')return r(f,E,[')',')'],s,u);return r(f,E,[o,o],s,u)}}}};if(R=='`'){return r(f,E,[R],'variable-2')};if(R=='/'){if(!/~\s*$/.test(i(f)))return'operator';else return r(f,E,[R],s,u)};if(R=='$'){var c=f.pos;if(f.eatWhile(/\d/)||f.eat('{')&&f.eatWhile(/\d/)&&f.eat('}'))return'variable-2';else f.pos=c};if(/[$@%]/.test(R)){var c=f.pos;if(f.eat('^')&&f.eat(/[A-Z]/)||!/[@$%&]/.test(t(f,-2))&&f.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var o=f.current();if(a[o])return'variable-2'};f.pos=c};if(/[$@%&]/.test(R)){if(f.eatWhile(/[\w$\[\]]/)||f.eat('{')&&f.eatWhile(/[\w$\[\]]/)&&f.eat('}')){var o=f.current();if(a[o])return'variable-2';else return'variable'}};if(R=='#'){if(t(f,-2)!='$'){f.skipToEnd();return'comment'}};if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(R)){var c=f.pos;f.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(a[f.current()])return'operator';else f.pos=c};if(R=='_'){if(f.pos==1){if(n(f,6)=='_END__'){return r(f,E,['\0'],'comment')} +else if(n(f,7)=='_DATA__'){return r(f,E,['\0'],'variable-2')} +else if(n(f,7)=='_C__'){return r(f,E,['\0'],'string')}}};if(/\w/.test(R)){var c=f.pos;if(t(f,-2)=='{'&&(t(f,0)=='}'||f.eatWhile(/\w/)&&t(f,0)=='}'))return'string';else f.pos=c};if(/[A-Z]/.test(R)){var p=t(f,-2),c=f.pos;f.eatWhile(/[A-Z_]/);if(/[\da-z]/.test(t(f,0))){f.pos=c} +else{var o=a[f.current()];if(!o)return'meta';if(o[1])o=o[0];if(p!=':'){if(o==1)return'keyword';else if(o==2)return'def';else if(o==3)return'atom';else if(o==4)return'operator';else if(o==5)return'variable-2';else return'meta'} +else return'meta'}};if(/[a-zA-Z_]/.test(R)){var p=t(f,-2);f.eatWhile(/\w/);var o=a[f.current()];if(!o)return'meta';if(o[1])o=o[0];if(p!=':'){if(o==1)return'keyword';else if(o==2)return'def';else if(o==3)return'atom';else if(o==4)return'operator';else if(o==5)return'variable-2';else return'meta'} +else return'meta'};return null};return{startState:function(){return{tokenize:f,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||f)(e,t)},lineComment:'#'}});r.registerHelper('wordChars','perl',/[\w$]/);r.defineMIME('text/x-perl','perl');function t(e,t){return e.string.charAt(e.pos+(t||0))};function i(e,t){if(t){var r=e.pos-t;return e.string.substr((r>=0?r:0),t)} +else{return e.string.substr(0,e.pos-1)}};function n(e,t){var r=e.string.length,n=r-e.pos+1;return e.string.substr(e.pos,(t&&t<r?t:n))};function e(e,t){var r=e.pos+t,n;if(r<=0)e.pos=0;else if(r>=(n=e.string.length-1))e.pos=n;else e.pos=r}});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('smarty',function(r,i){var s=i.rightDelimiter||'}',a=i.leftDelimiter||'{',u=i.version||2,o=e.getMode(r,i.baseMode||'null'),d=['debug','extends','function','include','literal'],n={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/};var f;function t(e,t){f=t;return e};function p(e,t,r){t.tokenize=r;return r(e,t)};function h(e,t){if(t==null)t=e.pos;return u===3&&a=='{'&&(t==e.string.length||/\s/.test(e.string.charAt(t)))};function l(e,t){var i=e.string;for(var n=e.pos;;){var r=i.indexOf(a,n);n=r+a.length;if(r==-1||!h(e,r+a.length))break};if(r==e.pos){e.match(a);if(e.eat('*')){return p(e,t,k('comment','*'+s))} +else{t.depth++;t.tokenize=c;f='startTag';return'tag'}};if(r>-1)e.string=i.slice(0,r);var l=o.token(e,t.base);if(r>-1)e.string=i;return l};function c(e,r){if(e.match(s,!0)){if(u===3){r.depth--;if(r.depth<=0){r.tokenize=l}} +else{r.tokenize=l};return t('tag',null)};if(e.match(a,!0)){r.depth++;return t('tag','startTag')};var i=e.next();if(i=='$'){e.eatWhile(n.validIdentifier);return t('variable-2','variable')} +else if(i=='|'){return t('operator','pipe')} +else if(i=='.'){return t('operator','property')} +else if(n.stringChar.test(i)){r.tokenize=b(i);return t('string','string')} +else if(n.operatorChars.test(i)){e.eatWhile(n.operatorChars);return t('operator','operator')} +else if(i=='['||i==']'){return t('bracket','bracket')} +else if(i=='('||i==')'){return t('bracket','operator')} +else if(/\d/.test(i)){e.eatWhile(/\d/);return t('number','number')} +else{if(r.last=='variable'){if(i=='@'){e.eatWhile(n.validIdentifier);return t('property','property')} +else if(i=='|'){e.eatWhile(n.validIdentifier);return t('qualifier','modifier')}} +else if(r.last=='pipe'){e.eatWhile(n.validIdentifier);return t('qualifier','modifier')} +else if(r.last=='whitespace'){e.eatWhile(n.validIdentifier);return t('attribute','modifier')};if(r.last=='property'){e.eatWhile(n.validIdentifier);return t('property',null)} +else if(/\s/.test(i)){f='whitespace';return null};var c='';if(i!='/'){c+=i};var p=null;while(p=e.eat(n.validIdentifier)){c+=p};for(var o=0,h=d.length;o<h;o++){if(d[o]==c){return t('keyword','keyword')}};if(/\s/.test(i)){return null};return t('tag','tag')}};function b(e){return function(t,r){var i=null,n=null;while(!t.eol()){n=t.peek();if(t.next()==e&&i!=='\\'){r.tokenize=c;break};i=n};return'string'}};function k(e,t){return function(r,i){while(!r.eol()){if(r.match(t)){i.tokenize=l;break};r.next()};return e}};return{startState:function(){return{base:e.startState(o),tokenize:l,last:null,depth:0}},copyState:function(t){return{base:e.copyState(o,t.base),tokenize:t.tokenize,last:t.last,depth:t.depth}},innerMode:function(e){if(e.tokenize==l)return{mode:o,state:e.base}},token:function(e,t){var r=t.tokenize(e,t);t.last=f;return r},indent:function(t,r){if(t.tokenize==l&&o.indent)return o.indent(t.base,r);else return e.Pass},blockCommentStart:a+'*',blockCommentEnd:'*'+s}});e.defineMIME('text/x-smarty','smarty')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('vbscript',function(e,r){var a='error';function t(e){return new RegExp('^(('+e.join(')|(')+'))\\b','i')};var I=new RegExp('^[\\+\\-\\*/&\\\\\\^<>=]'),C=new RegExp('^((<>)|(<=)|(>=))'),L=new RegExp('^[\\.,]'),E=new RegExp('^[\\(\\)]'),D=new RegExp('^[A-Za-z][_A-Za-z0-9]*'),S=['class','sub','select','while','if','function','property','with','for'],T=['else','elseif','case'],O=['next','loop','wend'],j=t(['and','or','not','xor','is','mod','eqv','imp']),F=['dim','redim','then','until','randomize','byval','byref','new','property','exit','in','const','private','public','get','set','let','stop','on error resume next','on error goto 0','option explicit','call','me'],R=['true','false','nothing','empty','null'],z=['abs','array','asc','atn','cbool','cbyte','ccur','cdate','cdbl','chr','cint','clng','cos','csng','cstr','date','dateadd','datediff','datepart','dateserial','datevalue','day','escape','eval','execute','exp','filter','formatcurrency','formatdatetime','formatnumber','formatpercent','getlocale','getobject','getref','hex','hour','inputbox','instr','instrrev','int','fix','isarray','isdate','isempty','isnull','isnumeric','isobject','join','lbound','lcase','left','len','loadpicture','log','ltrim','rtrim','trim','maths','mid','minute','month','monthname','msgbox','now','oct','replace','rgb','right','rnd','round','scriptengine','scriptenginebuildversion','scriptenginemajorversion','scriptengineminorversion','second','setlocale','sgn','sin','space','split','sqr','strcomp','string','strreverse','tan','time','timer','timeserial','timevalue','typename','ubound','ucase','unescape','vartype','weekday','weekdayname','year'],B=['vbBlack','vbRed','vbGreen','vbYellow','vbBlue','vbMagenta','vbCyan','vbWhite','vbBinaryCompare','vbTextCompare','vbSunday','vbMonday','vbTuesday','vbWednesday','vbThursday','vbFriday','vbSaturday','vbUseSystemDayOfWeek','vbFirstJan1','vbFirstFourDays','vbFirstFullWeek','vbGeneralDate','vbLongDate','vbShortDate','vbLongTime','vbShortTime','vbObjectError','vbOKOnly','vbOKCancel','vbAbortRetryIgnore','vbYesNoCancel','vbYesNo','vbRetryCancel','vbCritical','vbQuestion','vbExclamation','vbInformation','vbDefaultButton1','vbDefaultButton2','vbDefaultButton3','vbDefaultButton4','vbApplicationModal','vbSystemModal','vbOK','vbCancel','vbAbort','vbRetry','vbIgnore','vbYes','vbNo','vbCr','VbCrLf','vbFormFeed','vbLf','vbNewLine','vbNullChar','vbNullString','vbTab','vbVerticalTab','vbUseDefault','vbTrue','vbFalse','vbEmpty','vbNull','vbInteger','vbLong','vbSingle','vbDouble','vbCurrency','vbDate','vbString','vbObject','vbError','vbBoolean','vbVariant','vbDataObject','vbDecimal','vbByte','vbArray'],n=['WScript','err','debug','RegExp'],M=['description','firstindex','global','helpcontext','helpfile','ignorecase','length','number','pattern','source','value','count'],A=['clear','execute','raise','replace','test','write','writeline','close','open','state','eof','update','addnew','end','createobject','quit'],N=['server','response','request','session','application'],W=['buffer','cachecontrol','charset','contenttype','expires','expiresabsolute','isclientconnected','pics','status','clientcertificate','cookies','form','querystring','servervariables','totalbytes','contents','staticobjects','codepage','lcid','sessionid','timeout','scripttimeout'],q=['addheader','appendtolog','binarywrite','end','flush','redirect','binaryread','remove','removeall','lock','unlock','abandon','getlasterror','htmlencode','mappath','transfer','urlencode'],i=A.concat(M);n=n.concat(B);if(e.isASP){n=n.concat(N);i=i.concat(q,W)};var v=t(F),f=t(R),m=t(z),p=t(n),h=t(i),y='"',g=t(S),u=t(T),s=t(O),l=t(['end']),x=t(['do']),k=t(['on error resume next','exit']),w=t(['rem']);function b(e,t){t.currentIndent++};function o(e,t){t.currentIndent--};function c(e,t){if(e.eatSpace()){return'space'};var i=e.peek();if(i==='\''){e.skipToEnd();return'comment'};if(e.match(w)){e.skipToEnd();return'comment'};if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var n=!1;if(e.match(/^\d*\.\d+/i)){n=!0} +else if(e.match(/^\d+\.\d*/)){n=!0} +else if(e.match(/^\.\d+/)){n=!0};if(n){e.eat(/J/i);return'number'};var r=!1;if(e.match(/^&H[0-9a-f]+/i)){r=!0} +else if(e.match(/^&O[0-7]+/i)){r=!0} +else if(e.match(/^[1-9]\d*F?/)){e.eat(/J/i);r=!0} +else if(e.match(/^0(?![\dx])/i)){r=!0};if(r){e.eat(/L/i);return'number'}};if(e.match(y)){t.tokenize=K(e.current());return t.tokenize(e,t)};if(e.match(C)||e.match(I)||e.match(j)){return'operator'};if(e.match(L)){return null};if(e.match(E)){return'bracket'};if(e.match(k)){t.doInCurrentLine=!0;return'keyword'};if(e.match(x)){b(e,t);t.doInCurrentLine=!0;return'keyword'};if(e.match(g)){if(!t.doInCurrentLine)b(e,t);else t.doInCurrentLine=!1;return'keyword'};if(e.match(u)){return'keyword'};if(e.match(l)){o(e,t);o(e,t);return'keyword'};if(e.match(s)){if(!t.doInCurrentLine)o(e,t);else t.doInCurrentLine=!1;return'keyword'};if(e.match(v)){return'keyword'};if(e.match(f)){return'atom'};if(e.match(h)){return'variable-2'};if(e.match(m)){return'builtin'};if(e.match(p)){return'variable-2'};if(e.match(D)){return'variable'};e.next();return a};function K(e){var n=e.length==1,t='string';return function(i,o){while(!i.eol()){i.eatWhile(/[^'"]/);if(i.match(e)){o.tokenize=c;return t} +else{i.eat(/['"]/)}};if(n){if(r.singleLineStringErrors){return a} +else{o.tokenize=c}};return t}};function U(e,t){var r=t.tokenize(e,t),n=e.current();if(n==='.'){r=t.tokenize(e,t);n=e.current();if(r&&(r.substr(0,8)==='variable'||r==='builtin'||r==='keyword')){if(r==='builtin'||r==='keyword')r='variable';if(i.indexOf(n.substr(1))>-1)r='variable-2';return r} +else{return a}};return r};var d={electricChars:'dDpPtTfFeE ',startState:function(){return{tokenize:c,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){if(e.sol()){t.currentIndent+=t.nextLineIndent;t.nextLineIndent=0;t.doInCurrentLine=0};var r=U(e,t);t.lastToken={style:r,content:e.current()};if(r==='space')r=null;return r},indent:function(t,r){var n=r.replace(/^\s+|\s+$/g,'');if(n.match(s)||n.match(l)||n.match(u))return e.indentUnit*(t.currentIndent-1);if(t.currentIndent<0)return 0;return t.currentIndent*e.indentUnit}};return d});e.defineMIME('text/vbscript','vbscript')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';function n(e,n){for(var t=0;t<e.length;t++)n(e[t],t)};function t(e,n){for(var t=0;t<e.length;t++)if(n(e[t],t))return!0;return!1};e.defineMode('dylan',function(i){var e={unnamedDefinition:['interface'],namedDefinition:['module','library','macro','C-struct','C-union','C-function','C-callable-wrapper'],typeParameterizedDefinition:['class','C-subtype','C-mapped-subtype'],otherParameterizedDefinition:['method','function','C-variable','C-address'],constantSimpleDefinition:['constant'],variableSimpleDefinition:['variable'],otherSimpleDefinition:['generic','domain','C-pointer-type','table'],statement:['if','block','begin','method','case','for','select','when','unless','until','while','iterate','profiling','dynamic-bind'],separator:['finally','exception','cleanup','else','elseif','afterwards'],other:['above','below','by','from','handler','in','instance','let','local','otherwise','slot','subclass','then','to','keyed-by','virtual'],signalingCalls:['signal','error','cerror','break','check-type','abort']};e['otherDefinition']=e['unnamedDefinition'].concat(e['namedDefinition']).concat(e['otherParameterizedDefinition']);e['definition']=e['typeParameterizedDefinition'].concat(e['otherDefinition']);e['parameterizedDefinition']=e['typeParameterizedDefinition'].concat(e['otherParameterizedDefinition']);e['simpleDefinition']=e['constantSimpleDefinition'].concat(e['variableSimpleDefinition']).concat(e['otherSimpleDefinition']);e['keyword']=e['statement'].concat(e['separator']).concat(e['other']);var a='[-_a-zA-Z?!*@<>$%]+',p=new RegExp('^'+a),r={symbolKeyword:a+':',symbolClass:'<'+a+'>',symbolGlobal:'\\*'+a+'\\*',symbolConstant:'\\$'+a};var d={symbolKeyword:'atom',symbolClass:'tag',symbolGlobal:'variable-2',symbolConstant:'variable-3'};for(var l in r)if(r.hasOwnProperty(l))r[l]=new RegExp('^'+r[l]);r['keyword']=[/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];var o={};o['keyword']='keyword';o['definition']='def';o['simpleDefinition']='def';o['signalingCalls']='builtin';var c={};var u={};n(['keyword','definition','simpleDefinition','signalingCalls'],function(t){n(e[t],function(e){c[e]=t;u[e]=o[t]})});function f(e,n,t){n.tokenize=t;return t(e,n)};function s(e,i){var n=e.peek();if(n=='\''||n=='"'){e.next();return f(e,i,m(n,'string'))} +else if(n=='/'){e.next();if(e.eat('*')){return f(e,i,b)} +else if(e.eat('/')){e.skipToEnd();return'comment'};e.backUp(1)} +else if(/[+\-\d\.]/.test(n)){if(e.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i)||e.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i)||e.match(/^[+-]?\d+/)){return'number'}} +else if(n=='#'){e.next();n=e.peek();if(n=='"'){e.next();return f(e,i,m('"','string'))} +else if(n=='b'){e.next();e.eatWhile(/[01]/);return'number'} +else if(n=='x'){e.next();e.eatWhile(/[\da-f]/i);return'number'} +else if(n=='o'){e.next();e.eatWhile(/[0-7]/);return'number'} +else if(n=='#'){e.next();return'punctuation'} +else if((n=='[')||(n=='(')){e.next();return'bracket'} +else if(e.match(/f|t|all-keys|include|key|next|rest/i)){return'atom'} +else{e.eatWhile(/[-a-zA-Z]/);return'error'}} +else if(n=='~'){e.next();n=e.peek();if(n=='='){e.next();n=e.peek();if(n=='='){e.next();return'operator'};return'operator'};return'operator'} +else if(n==':'){e.next();n=e.peek();if(n=='='){e.next();return'operator'} +else if(n==':'){e.next();return'punctuation'}} +else if('[](){}'.indexOf(n)!=-1){e.next();return'bracket'} +else if('.,'.indexOf(n)!=-1){e.next();return'punctuation'} +else if(e.match('end')){return'keyword'};for(var a in r){if(r.hasOwnProperty(a)){var o=r[a];if((o instanceof Array&&t(o,function(n){return e.match(n)}))||e.match(o))return d[a]}};if(/[+\-*\/^=<>&|]/.test(n)){e.next();return'operator'};if(e.match('define')){return'def'} +else{e.eatWhile(/[\w\-]/);if(c.hasOwnProperty(e.current())){return u[e.current()]} +else if(e.current().match(p)){return'variable'} +else{e.next();return'variable-2'}}};function b(e,n){var r=!1,o=!1,i=0,t;while((t=e.next())){if(t=='/'&&r){if(i>0){i--} +else{n.tokenize=s;break}} +else if(t=='*'&&o){i++};r=(t=='*');o=(t=='/')};return'comment'};function m(e,n){return function(t,i){var r=!1,o,a=!1;while((o=t.next())!=null){if(o==e&&!r){a=!0;break};r=!r&&o=='\\'};if(a||!r){i.tokenize=s};return n}};return{startState:function(){return{tokenize:s,currentIndent:0}},token:function(e,n){if(e.eatSpace())return null;var t=n.tokenize(e,n);return t},blockCommentStart:'/*',blockCommentEnd:'*/'}});e.defineMIME('text/x-dylan','dylan')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('asn.1',function(t,e){var a=t.indentUnit,s=e.keywords||{},I=e.cmipVerbs||{},T=e.compareTypes||{},u=e.status||{},l=e.tags||{},S=e.storage||{},f=e.modifier||{},c=e.accessTypes||{},A=e.multiLineStrings,p=e.indentStatements!==!1;var o=/[\|\^]/,n;function N(e,t){var i=e.next();if(i=='"'||i=='\''){t.tokenize=m(i);return t.tokenize(e,t)};if(/[\[\]\(\){}:=,;]/.test(i)){n=i;return'punctuation'};if(i=='-'){if(e.eat('-')){e.skipToEnd();return'comment'}};if(/\d/.test(i)){e.eatWhile(/[\w\.]/);return'number'};if(o.test(i)){e.eatWhile(o);return'operator'};e.eatWhile(/[\w\-]/);var r=e.current();if(s.propertyIsEnumerable(r))return'keyword';if(I.propertyIsEnumerable(r))return'variable cmipVerbs';if(T.propertyIsEnumerable(r))return'atom compareTypes';if(u.propertyIsEnumerable(r))return'comment status';if(l.propertyIsEnumerable(r))return'variable-3 tags';if(S.propertyIsEnumerable(r))return'builtin storage';if(f.propertyIsEnumerable(r))return'string-2 modifier';if(c.propertyIsEnumerable(r))return'atom accessTypes';return'variable'};function m(e){return function(t,n){var i=!1,o,E=!1;while((o=t.next())!=null){if(o==e&&!i){var r=t.peek();if(r){r=r.toLowerCase();if(r=='b'||r=='h'||r=='o')t.next()};E=!0;break};i=!i&&o=='\\'};if(E||!(i||A))n.tokenize=null;return'string'}};function E(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function i(e,t,n){var r=e.indented;if(e.context&&e.context.type=='statement')r=e.context.indented;return e.context=new E(r,t,n,null,e.context)};function r(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:null,context:new E((e||0)-a,0,'top',!1),indented:0,startOfLine:!0}},token:function(t,e){var o=e.context;if(t.sol()){if(o.align==null)o.align=!1;e.indented=t.indentation();e.startOfLine=!0};if(t.eatSpace())return null;n=null;var E=(e.tokenize||N)(t,e);if(E=='comment')return E;if(o.align==null)o.align=!0;if((n==';'||n==':'||n==',')&&o.type=='statement'){r(e)} +else if(n=='{')i(e,t.column(),'}');else if(n=='[')i(e,t.column(),']');else if(n=='(')i(e,t.column(),')');else if(n=='}'){while(o.type=='statement')o=r(e);if(o.type=='}')o=r(e);while(o.type=='statement')o=r(e)} +else if(n==o.type)r(e);else if(p&&(((o.type=='}'||o.type=='top')&&n!=';')||(o.type=='statement'&&n=='newstatement')))i(e,t.column(),'statement');e.startOfLine=!1;return E},electricChars:'{}',lineComment:'--',fold:'brace'}});function t(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};e.defineMIME('text/x-ttcn-asn',{name:'asn.1',keywords:t('DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS MINACCESS MAXACCESS REVISION STATUS DESCRIPTION SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY IMPLIED EXPORTS'),cmipVerbs:t('ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE'),compareTypes:t('OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL TEXTUAL-CONVENTION'),status:t('current deprecated mandatory obsolete'),tags:t('APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS UNIVERSAL'),storage:t('BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING UTCTime InterfaceIndex IANAifType CMIP-Attribute REAL PACKAGE PACKAGES IpAddress PhysAddress NetworkAddress BITS BMPString TimeStamp TimeTicks TruthValue RowStatus DisplayString GeneralString GraphicString IA5String NumericString PrintableString SnmpAdminAtring TeletexString UTF8String VideotexString VisibleString StringStore ISO646String T61String UniversalString Unsigned32 Integer32 Gauge Gauge32 Counter Counter32 Counter64'),modifier:t('ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS DEFINED'),accessTypes:t('not-accessible accessible-for-notify read-only read-create read-write'),multiLineStrings:!0})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('ruby',function(e){function a(e){var n={};for(var t=0,i=e.length;t<i;++t)n[e[t]]=!0;return n};var l=a(['alias','and','BEGIN','begin','break','case','class','def','defined?','do','else','elsif','END','end','ensure','false','for','if','in','module','next','not','or','redo','rescue','retry','return','self','super','then','true','undef','unless','until','when','while','yield','nil','raise','throw','catch','fail','loop','callcc','caller','lambda','proc','public','protected','private','require','load','require_relative','extend','autoload','__END__','__FILE__','__LINE__','__dir__']),u=a(['def','class','case','for','while','until','module','then','catch','loop','proc','begin']),s=a(['end','until']),o={'[':']','{':'}','(':')'};var t;function n(e,t,n){n.tokenize.push(e);return e(t,n)};function r(e,a){if(e.sol()&&e.match('=begin')&&e.eol()){a.tokenize.push(k);return'comment'};if(e.eatSpace())return null;var r=e.next(),s;if(r=='`'||r=='\''||r=='"'){return n(i(r,'string',r=='"'||r=='`'),e,a)} +else if(r=='/'){if(d(e))return n(i(r,'string-2',!0),e,a);else return'operator'} +else if(r=='%'){var l='string',u=!0;if(e.eat('s'))l='atom';else if(e.eat(/[WQ]/))l='string';else if(e.eat(/[r]/))l='string-2';else if(e.eat(/[wxq]/)){l='string';u=!1};var f=e.eat(/[^\w\s=]/);if(!f)return'operator';if(o.propertyIsEnumerable(f))f=o[f];return n(i(f,l,u,!0),e,a)} +else if(r=='#'){e.skipToEnd();return'comment'} +else if(r=='<'&&(s=e.match(/^<-?[\`"']?([a-zA-Z_?]\w*)[\`"']?(?:;|$)/))){return n(p(s[1]),e,a)} +else if(r=='0'){if(e.eat('x'))e.eatWhile(/[\da-fA-F]/);else if(e.eat('b'))e.eatWhile(/[01]/);else e.eatWhile(/[0-7]/);return'number'} +else if(/\d/.test(r)){e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);return'number'} +else if(r=='?'){while(e.match(/^\\[CM]-/)){};if(e.eat('\\'))e.eatWhile(/\w/);else e.next();return'string'} +else if(r==':'){if(e.eat('\''))return n(i('\'','atom',!1),e,a);if(e.eat('"'))return n(i('"','atom',!0),e,a);if(e.eat(/[\<\>]/)){e.eat(/[\<\>]/);return'atom'};if(e.eat(/[\+\-\*\/\&\|\:\!]/)){return'atom'};if(e.eat(/[a-zA-Z$@_\xa1-\uffff]/)){e.eatWhile(/[\w$\xa1-\uffff]/);e.eat(/[\?\!\=]/);return'atom'};return'operator'} +else if(r=='@'&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/)){e.eat('@');e.eatWhile(/[\w\xa1-\uffff]/);return'variable-2'} +else if(r=='$'){if(e.eat(/[a-zA-Z_]/)){e.eatWhile(/[\w]/)} +else if(e.eat(/\d/)){e.eat(/\d/)} +else{e.next()};return'variable-3'} +else if(/[a-zA-Z_\xa1-\uffff]/.test(r)){e.eatWhile(/[\w\xa1-\uffff]/);e.eat(/[\?\!]/);if(e.eat(':'))return'atom';return'ident'} +else if(r=='|'&&(a.varList||a.lastTok=='{'||a.lastTok=='do')){t='|';return null} +else if(/[\(\)\[\]{}\\;]/.test(r)){t=r;return null} +else if(r=='-'&&e.eat('>')){return'arrow'} +else if(/[=+\-\/*:\.^%<>~|]/.test(r)){var c=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);if(r=='.'&&!c)t='.';return'operator'} +else{return null}};function d(e){var o=e.pos,n=0,t,r=!1,i=!1;while((t=e.next())!=null){if(!i){if('[{('.indexOf(t)>-1){n++} +else if(']})'.indexOf(t)>-1){n--;if(n<0)break} +else if(t=='/'&&n==0){r=!0;break};i=t=='\\'} +else{i=!1}};e.backUp(e.pos-o);return r};function f(e){if(!e)e=1;return function(t,n){if(t.peek()=='}'){if(e==1){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)} +else{n.tokenize[n.tokenize.length-1]=f(e-1)}} +else if(t.peek()=='{'){n.tokenize[n.tokenize.length-1]=f(e+1)};return r(t,n)}};function c(){var e=!1;return function(t,n){if(e){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)};e=!0;return r(t,n)}};function i(e,t,n,i){return function(r,o){var a=!1,l;if(o.context.type==='read-quoted-paused'){o.context=o.context.prev;r.eat('}')} +while((l=r.next())!=null){if(l==e&&(i||!a)){o.tokenize.pop();break};if(n&&l=='#'&&!a){if(r.eat('{')){if(e=='}'){o.context={prev:o.context,type:'read-quoted-paused'}};o.tokenize.push(f());break} +else if(/[@\$]/.test(r.peek())){o.tokenize.push(c());break}};a=!a&&l=='\\'};return t}};function p(e){return function(t,n){if(t.match(e))n.tokenize.pop();else t.skipToEnd();return'string'}};function k(e,t){if(e.sol()&&e.match('=end')&&e.eol())t.tokenize.pop();e.skipToEnd();return'comment'};return{startState:function(){return{tokenize:[r],indented:0,context:{type:'top',indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(n,e){t=null;if(n.sol())e.indented=n.indentation();var i=e.tokenize[e.tokenize.length-1](n,e),o,a=t;if(i=='ident'){var r=n.current();i=e.lastTok=='.'?'property':l.propertyIsEnumerable(n.current())?'keyword':/^[A-Z]/.test(r)?'tag':(e.lastTok=='def'||e.lastTok=='class'||e.varList)?'def':'variable';if(i=='keyword'){a=r;if(u.propertyIsEnumerable(r))o='indent';else if(s.propertyIsEnumerable(r))o='dedent';else if((r=='if'||r=='unless')&&n.column()==n.indentation())o='indent';else if(r=='do'&&e.context.indented<e.indented)o='indent'}};if(t||(i&&i!='comment'))e.lastTok=a;if(t=='|')e.varList=!e.varList;if(o=='indent'||/[\(\[\{]/.test(t))e.context={prev:e.context,type:t||i,indented:e.indented};else if((o=='dedent'||/[\)\]\}]/.test(t))&&e.context.prev)e.context=e.context.prev;if(n.eol())e.continuedLine=(t=='\\'||i=='operator');return i},indent:function(t,n){if(t.tokenize[t.tokenize.length-1]!=r)return 0;var a=n&&n.charAt(0),i=t.context,f=i.type==o[a]||i.type=='keyword'&&/^(?:end|until|else|elsif|when|rescue)\b/.test(n);return i.indented+(f?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricInput:/^\s*(?:end|rescue|elsif|else|\})$/,lineComment:'#',fold:'indent'}});e.defineMIME('text/x-ruby','ruby')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('css',function(r,t){var y=t.inline;if(!t.propertyKeywords)t=e.resolveMode('text/css');var p=r.indentUnit,m=t.tokenHooks,x=t.documentTypes||{},z=t.mediaTypes||{},j=t.mediaFeatures||{},P=t.mediaValueKeywords||{},f=t.propertyKeywords||{},h=t.nonStandardPropertyKeywords||{},q=t.fontProperties||{},K=t.counterDescriptors||{},g=t.colorKeywords||{},b=t.valueKeywords||{},c=t.allowNested,C=t.lineComment,B=t.supportsAtComponent===!0;var u,i;function n(e,t){u=t;return e};function T(e,t){var r=e.next();if(m[r]){var i=m[r](e,t);if(i!==!1)return i};if(r=='@'){e.eatWhile(/[\w\\\-]/);return n('def',e.current())} +else if(r=='='||(r=='~'||r=='|')&&e.eat('=')){return n(null,'compare')} +else if(r=='"'||r=='\''){t.tokenize=w(r);return t.tokenize(e,t)} +else if(r=='#'){e.eatWhile(/[\w\\\-]/);return n('atom','hash')} +else if(r=='!'){e.match(/^\s*\w*/);return n('keyword','important')} +else if(/\d/.test(r)||r=='.'&&e.eat(/\d/)){e.eatWhile(/[\w.%]/);return n('number','unit')} +else if(r==='-'){if(/[\d.]/.test(e.peek())){e.eatWhile(/[\w.%]/);return n('number','unit')} +else if(e.match(/^-[\w\\\-]+/)){e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,!1))return n('variable-2','variable-definition');return n('variable-2','variable')} +else if(e.match(/^\w+-/)){return n('meta','meta')}} +else if(/[,+>*\/]/.test(r)){return n(null,'select-op')} +else if(r=='.'&&e.match(/^-?[_a-z][_a-z0-9-]*/i)){return n('qualifier','qualifier')} +else if(/[:;{}\[\]\(\)]/.test(r)){return n(null,r)} +else if((r=='u'&&e.match(/rl(-prefix)?\(/))||(r=='d'&&e.match('omain('))||(r=='r'&&e.match('egexp('))){e.backUp(1);t.tokenize=O;return n('property','word')} +else if(/[\w\\\-]/.test(r)){e.eatWhile(/[\w\\\-]/);return n('property','word')} +else{return n(null,null)}};function w(e){return function(t,r){var i=!1,o;while((o=t.next())!=null){if(o==e&&!i){if(e==')')t.backUp(1);break};i=!i&&o=='\\'};if(o==e||!i&&e!=')')r.tokenize=null;return n('string','string')}};function O(e,t){e.next();if(!e.match(/\s*["')]/,!1))t.tokenize=w(')');else t.tokenize=null;return n(null,'(')};function k(e,t,r){this.type=e;this.indent=t;this.prev=r};function a(e,t,r,i){e.context=new k(r,t.indentation()+(i===!1?0:p),e.context);return r};function l(e){if(e.context.prev)e.context=e.context.prev;return e.context.type};function d(e,t,r){return o[r.context.type](e,t,r)};function s(e,t,r,i){for(var o=i||1;o>0;o--)r.context=r.context.prev;return d(e,t,r)};function v(e){var t=e.current().toLowerCase();if(b.hasOwnProperty(t))i='atom';else if(g.hasOwnProperty(t))i='keyword';else i='variable'};var o={};o.top=function(e,t,r){if(e=='{'){return a(r,t,'block')} +else if(e=='}'&&r.context.prev){return l(r)} +else if(B&&/@component/.test(e)){return a(r,t,'atComponentBlock')} +else if(/^@(-moz-)?document$/.test(e)){return a(r,t,'documentTypes')} +else if(/^@(media|supports|(-moz-)?document|import)$/.test(e)){return a(r,t,'atBlock')} +else if(/^@(font-face|counter-style)/.test(e)){r.stateArg=e;return'restricted_atBlock_before'} +else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e)){return'keyframes'} +else if(e&&e.charAt(0)=='@'){return a(r,t,'at')} +else if(e=='hash'){i='builtin'} +else if(e=='word'){i='tag'} +else if(e=='variable-definition'){return'maybeprop'} +else if(e=='interpolation'){return a(r,t,'interpolation')} +else if(e==':'){return'pseudo'} +else if(c&&e=='('){return a(r,t,'parens')};return r.context.type};o.block=function(e,t,r){if(e=='word'){var a=t.current().toLowerCase();if(f.hasOwnProperty(a)){i='property';return'maybeprop'} +else if(h.hasOwnProperty(a)){i='string-2';return'maybeprop'} +else if(c){i=t.match(/^\s*:(?:\s|$)/,!1)?'property':'tag';return'block'} +else{i+=' error';return'maybeprop'}} +else if(e=='meta'){return'block'} +else if(!c&&(e=='hash'||e=='qualifier')){i='error';return'block'} +else{return o.top(e,t,r)}};o.maybeprop=function(e,t,r){if(e==':')return a(r,t,'prop');return d(e,t,r)};o.prop=function(e,t,r){if(e==';')return l(r);if(e=='{'&&c)return a(r,t,'propBlock');if(e=='}'||e=='{')return s(e,t,r);if(e=='(')return a(r,t,'parens');if(e=='hash'&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){i+=' error'} +else if(e=='word'){v(t)} +else if(e=='interpolation'){return a(r,t,'interpolation')};return'prop'};o.propBlock=function(e,t,r){if(e=='}')return l(r);if(e=='word'){i='property';return'maybeprop'};return r.context.type};o.parens=function(e,t,r){if(e=='{'||e=='}')return s(e,t,r);if(e==')')return l(r);if(e=='(')return a(r,t,'parens');if(e=='interpolation')return a(r,t,'interpolation');if(e=='word')v(t);return'parens'};o.pseudo=function(e,t,r){if(e=='meta')return'pseudo';if(e=='word'){i='variable-3';return r.context.type};return d(e,t,r)};o.documentTypes=function(e,t,r){if(e=='word'&&x.hasOwnProperty(t.current())){i='tag';return r.context.type} +else{return o.atBlock(e,t,r)}};o.atBlock=function(e,t,r){if(e=='(')return a(r,t,'atBlock_parens');if(e=='}'||e==';')return s(e,t,r);if(e=='{')return l(r)&&a(r,t,c?'block':'top');if(e=='interpolation')return a(r,t,'interpolation');if(e=='word'){var o=t.current().toLowerCase();if(o=='only'||o=='not'||o=='and'||o=='or')i='keyword';else if(z.hasOwnProperty(o))i='attribute';else if(j.hasOwnProperty(o))i='property';else if(P.hasOwnProperty(o))i='keyword';else if(f.hasOwnProperty(o))i='property';else if(h.hasOwnProperty(o))i='string-2';else if(b.hasOwnProperty(o))i='atom';else if(g.hasOwnProperty(o))i='keyword';else i='error'};return r.context.type};o.atComponentBlock=function(e,t,r){if(e=='}')return s(e,t,r);if(e=='{')return l(r)&&a(r,t,c?'block':'top',!1);if(e=='word')i='error';return r.context.type};o.atBlock_parens=function(e,t,r){if(e==')')return l(r);if(e=='{'||e=='}')return s(e,t,r,2);return o.atBlock(e,t,r)};o.restricted_atBlock_before=function(e,t,r){if(e=='{')return a(r,t,'restricted_atBlock');if(e=='word'&&r.stateArg=='@counter-style'){i='variable';return'restricted_atBlock_before'};return d(e,t,r)};o.restricted_atBlock=function(e,t,r){if(e=='}'){r.stateArg=null;return l(r)};if(e=='word'){if((r.stateArg=='@font-face'&&!q.hasOwnProperty(t.current().toLowerCase()))||(r.stateArg=='@counter-style'&&!K.hasOwnProperty(t.current().toLowerCase())))i='error';else i='property';return'maybeprop'};return'restricted_atBlock'};o.keyframes=function(e,t,r){if(e=='word'){i='variable';return'keyframes'};if(e=='{')return a(r,t,'top');return d(e,t,r)};o.at=function(e,t,r){if(e==';')return l(r);if(e=='{'||e=='}')return s(e,t,r);if(e=='word')i='tag';else if(e=='hash')i='builtin';return'at'};o.interpolation=function(e,t,r){if(e=='}')return l(r);if(e=='{'||e==';')return s(e,t,r);if(e=='word')i='variable';else if(e!='variable'&&e!='('&&e!=')')i='error';return'interpolation'};return{startState:function(e){return{tokenize:null,state:y?'block':'top',stateArg:null,context:new k(y?'block':'top',e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||T)(e,t);if(r&&typeof r=='object'){u=r[1];r=r[0]};i=r;if(u!='comment')t.state=o[t.state](u,e,t);return i},indent:function(e,t){var r=e.context,i=t&&t.charAt(0),o=r.indent;if(r.type=='prop'&&(i=='}'||i==')'))r=r.prev;if(r.prev){if(i=='}'&&(r.type=='block'||r.type=='top'||r.type=='interpolation'||r.type=='restricted_atBlock')){r=r.prev;o=r.indent} +else if(i==')'&&(r.type=='parens'||r.type=='atBlock_parens')||i=='{'&&(r.type=='at'||r.type=='atBlock')){o=Math.max(0,r.indent-p)}};return o},electricChars:'}',blockCommentStart:'/*',blockCommentEnd:'*/',blockCommentContinue:' * ',lineComment:C,fold:'brace'}});function t(e){var r={};for(var t=0;t<e.length;++t){r[e[t].toLowerCase()]=!0};return r};var u=['domain','regexp','url','url-prefix'],p=t(u),m=['all','aural','braille','handheld','print','projection','screen','tty','tv','embossed'],i=t(m),f=['width','min-width','max-width','height','min-height','max-height','device-width','min-device-width','max-device-width','device-height','min-device-height','max-device-height','aspect-ratio','min-aspect-ratio','max-aspect-ratio','device-aspect-ratio','min-device-aspect-ratio','max-device-aspect-ratio','color','min-color','max-color','color-index','min-color-index','max-color-index','monochrome','min-monochrome','max-monochrome','resolution','min-resolution','max-resolution','scan','grid','orientation','device-pixel-ratio','min-device-pixel-ratio','max-device-pixel-ratio','pointer','any-pointer','hover','any-hover'],o=t(f),h=['landscape','portrait','none','coarse','fine','on-demand','hover','interlace','progressive'],d=t(h),g=['align-content','align-items','align-self','alignment-adjust','alignment-baseline','anchor-point','animation','animation-delay','animation-direction','animation-duration','animation-fill-mode','animation-iteration-count','animation-name','animation-play-state','animation-timing-function','appearance','azimuth','backface-visibility','background','background-attachment','background-blend-mode','background-clip','background-color','background-image','background-origin','background-position','background-repeat','background-size','baseline-shift','binding','bleed','bookmark-label','bookmark-level','bookmark-state','bookmark-target','border','border-bottom','border-bottom-color','border-bottom-left-radius','border-bottom-right-radius','border-bottom-style','border-bottom-width','border-collapse','border-color','border-image','border-image-outset','border-image-repeat','border-image-slice','border-image-source','border-image-width','border-left','border-left-color','border-left-style','border-left-width','border-radius','border-right','border-right-color','border-right-style','border-right-width','border-spacing','border-style','border-top','border-top-color','border-top-left-radius','border-top-right-radius','border-top-style','border-top-width','border-width','bottom','box-decoration-break','box-shadow','box-sizing','break-after','break-before','break-inside','caption-side','caret-color','clear','clip','color','color-profile','column-count','column-fill','column-gap','column-rule','column-rule-color','column-rule-style','column-rule-width','column-span','column-width','columns','content','counter-increment','counter-reset','crop','cue','cue-after','cue-before','cursor','direction','display','dominant-baseline','drop-initial-after-adjust','drop-initial-after-align','drop-initial-before-adjust','drop-initial-before-align','drop-initial-size','drop-initial-value','elevation','empty-cells','fit','fit-position','flex','flex-basis','flex-direction','flex-flow','flex-grow','flex-shrink','flex-wrap','float','float-offset','flow-from','flow-into','font','font-feature-settings','font-family','font-kerning','font-language-override','font-size','font-size-adjust','font-stretch','font-style','font-synthesis','font-variant','font-variant-alternates','font-variant-caps','font-variant-east-asian','font-variant-ligatures','font-variant-numeric','font-variant-position','font-weight','grid','grid-area','grid-auto-columns','grid-auto-flow','grid-auto-rows','grid-column','grid-column-end','grid-column-gap','grid-column-start','grid-gap','grid-row','grid-row-end','grid-row-gap','grid-row-start','grid-template','grid-template-areas','grid-template-columns','grid-template-rows','hanging-punctuation','height','hyphens','icon','image-orientation','image-rendering','image-resolution','inline-box-align','justify-content','justify-items','justify-self','left','letter-spacing','line-break','line-height','line-stacking','line-stacking-ruby','line-stacking-shift','line-stacking-strategy','list-style','list-style-image','list-style-position','list-style-type','margin','margin-bottom','margin-left','margin-right','margin-top','marks','marquee-direction','marquee-loop','marquee-play-count','marquee-speed','marquee-style','max-height','max-width','min-height','min-width','move-to','nav-down','nav-index','nav-left','nav-right','nav-up','object-fit','object-position','opacity','order','orphans','outline','outline-color','outline-offset','outline-style','outline-width','overflow','overflow-style','overflow-wrap','overflow-x','overflow-y','padding','padding-bottom','padding-left','padding-right','padding-top','page','page-break-after','page-break-before','page-break-inside','page-policy','pause','pause-after','pause-before','perspective','perspective-origin','pitch','pitch-range','place-content','place-items','place-self','play-during','position','presentation-level','punctuation-trim','quotes','region-break-after','region-break-before','region-break-inside','region-fragment','rendering-intent','resize','rest','rest-after','rest-before','richness','right','rotation','rotation-point','ruby-align','ruby-overhang','ruby-position','ruby-span','shape-image-threshold','shape-inside','shape-margin','shape-outside','size','speak','speak-as','speak-header','speak-numeral','speak-punctuation','speech-rate','stress','string-set','tab-size','table-layout','target','target-name','target-new','target-position','text-align','text-align-last','text-decoration','text-decoration-color','text-decoration-line','text-decoration-skip','text-decoration-style','text-emphasis','text-emphasis-color','text-emphasis-position','text-emphasis-style','text-height','text-indent','text-justify','text-outline','text-overflow','text-shadow','text-size-adjust','text-space-collapse','text-transform','text-underline-position','text-wrap','top','transform','transform-origin','transform-style','transition','transition-delay','transition-duration','transition-property','transition-timing-function','unicode-bidi','user-select','vertical-align','visibility','voice-balance','voice-duration','voice-family','voice-pitch','voice-range','voice-rate','voice-stress','voice-volume','volume','white-space','widows','width','will-change','word-break','word-spacing','word-wrap','z-index','clip-path','clip-rule','mask','enable-background','filter','flood-color','flood-opacity','lighting-color','stop-color','stop-opacity','pointer-events','color-interpolation','color-interpolation-filters','color-rendering','fill','fill-opacity','fill-rule','image-rendering','marker','marker-end','marker-mid','marker-start','shape-rendering','stroke','stroke-dasharray','stroke-dashoffset','stroke-linecap','stroke-linejoin','stroke-miterlimit','stroke-opacity','stroke-width','text-rendering','baseline-shift','dominant-baseline','glyph-orientation-horizontal','glyph-orientation-vertical','text-anchor','writing-mode'],a=t(g),b=['scrollbar-arrow-color','scrollbar-base-color','scrollbar-dark-shadow-color','scrollbar-face-color','scrollbar-highlight-color','scrollbar-shadow-color','scrollbar-3d-light-color','scrollbar-track-color','shape-inside','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','zoom'],n=t(b),v=['font-family','src','unicode-range','font-variant','font-feature-settings','font-stretch','font-weight','font-style'],l=t(v),x=['additive-symbols','fallback','negative','pad','prefix','range','speak-as','suffix','symbols','system'],y=t(x),w=['aliceblue','antiquewhite','aqua','aquamarine','azure','beige','bisque','black','blanchedalmond','blue','blueviolet','brown','burlywood','cadetblue','chartreuse','chocolate','coral','cornflowerblue','cornsilk','crimson','cyan','darkblue','darkcyan','darkgoldenrod','darkgray','darkgreen','darkkhaki','darkmagenta','darkolivegreen','darkorange','darkorchid','darkred','darksalmon','darkseagreen','darkslateblue','darkslategray','darkturquoise','darkviolet','deeppink','deepskyblue','dimgray','dodgerblue','firebrick','floralwhite','forestgreen','fuchsia','gainsboro','ghostwhite','gold','goldenrod','gray','grey','green','greenyellow','honeydew','hotpink','indianred','indigo','ivory','khaki','lavender','lavenderblush','lawngreen','lemonchiffon','lightblue','lightcoral','lightcyan','lightgoldenrodyellow','lightgray','lightgreen','lightpink','lightsalmon','lightseagreen','lightskyblue','lightslategray','lightsteelblue','lightyellow','lime','limegreen','linen','magenta','maroon','mediumaquamarine','mediumblue','mediumorchid','mediumpurple','mediumseagreen','mediumslateblue','mediumspringgreen','mediumturquoise','mediumvioletred','midnightblue','mintcream','mistyrose','moccasin','navajowhite','navy','oldlace','olive','olivedrab','orange','orangered','orchid','palegoldenrod','palegreen','paleturquoise','palevioletred','papayawhip','peachpuff','peru','pink','plum','powderblue','purple','rebeccapurple','red','rosybrown','royalblue','saddlebrown','salmon','sandybrown','seagreen','seashell','sienna','silver','skyblue','slateblue','slategray','snow','springgreen','steelblue','tan','teal','thistle','tomato','turquoise','violet','wheat','white','whitesmoke','yellow','yellowgreen'],s=t(w),k=['above','absolute','activeborder','additive','activecaption','afar','after-white-space','ahead','alias','all','all-scroll','alphabetic','alternate','always','amharic','amharic-abegede','antialiased','appworkspace','arabic-indic','armenian','asterisks','attr','auto','auto-flow','avoid','avoid-column','avoid-page','avoid-region','background','backwards','baseline','below','bidi-override','binary','bengali','blink','block','block-axis','bold','bolder','border','border-box','both','bottom','break','break-all','break-word','bullets','button','button-bevel','buttonface','buttonhighlight','buttonshadow','buttontext','calc','cambodian','capitalize','caps-lock-indicator','caption','captiontext','caret','cell','center','checkbox','circle','cjk-decimal','cjk-earthly-branch','cjk-heavenly-stem','cjk-ideographic','clear','clip','close-quote','col-resize','collapse','color','color-burn','color-dodge','column','column-reverse','compact','condensed','contain','content','contents','content-box','context-menu','continuous','copy','counter','counters','cover','crop','cross','crosshair','currentcolor','cursive','cyclic','darken','dashed','decimal','decimal-leading-zero','default','default-button','dense','destination-atop','destination-in','destination-out','destination-over','devanagari','difference','disc','discard','disclosure-closed','disclosure-open','document','dot-dash','dot-dot-dash','dotted','double','down','e-resize','ease','ease-in','ease-in-out','ease-out','element','ellipse','ellipsis','embed','end','ethiopic','ethiopic-abegede','ethiopic-abegede-am-et','ethiopic-abegede-gez','ethiopic-abegede-ti-er','ethiopic-abegede-ti-et','ethiopic-halehame-aa-er','ethiopic-halehame-aa-et','ethiopic-halehame-am-et','ethiopic-halehame-gez','ethiopic-halehame-om-et','ethiopic-halehame-sid-et','ethiopic-halehame-so-et','ethiopic-halehame-ti-er','ethiopic-halehame-ti-et','ethiopic-halehame-tig','ethiopic-numeric','ew-resize','exclusion','expanded','extends','extra-condensed','extra-expanded','fantasy','fast','fill','fixed','flat','flex','flex-end','flex-start','footnotes','forwards','from','geometricPrecision','georgian','graytext','grid','groove','gujarati','gurmukhi','hand','hangul','hangul-consonant','hard-light','hebrew','help','hidden','hide','higher','highlight','highlighttext','hiragana','hiragana-iroha','horizontal','hsl','hsla','hue','icon','ignore','inactiveborder','inactivecaption','inactivecaptiontext','infinite','infobackground','infotext','inherit','initial','inline','inline-axis','inline-block','inline-flex','inline-grid','inline-table','inset','inside','intrinsic','invert','italic','japanese-formal','japanese-informal','justify','kannada','katakana','katakana-iroha','keep-all','khmer','korean-hangul-formal','korean-hanja-formal','korean-hanja-informal','landscape','lao','large','larger','left','level','lighter','lighten','line-through','linear','linear-gradient','lines','list-item','listbox','listitem','local','logical','loud','lower','lower-alpha','lower-armenian','lower-greek','lower-hexadecimal','lower-latin','lower-norwegian','lower-roman','lowercase','ltr','luminosity','malayalam','match','matrix','matrix3d','media-controls-background','media-current-time-display','media-fullscreen-button','media-mute-button','media-play-button','media-return-to-realtime-button','media-rewind-button','media-seek-back-button','media-seek-forward-button','media-slider','media-sliderthumb','media-time-remaining-display','media-volume-slider','media-volume-slider-container','media-volume-sliderthumb','medium','menu','menulist','menulist-button','menulist-text','menulist-textfield','menutext','message-box','middle','min-intrinsic','mix','mongolian','monospace','move','multiple','multiply','myanmar','n-resize','narrower','ne-resize','nesw-resize','no-close-quote','no-drop','no-open-quote','no-repeat','none','normal','not-allowed','nowrap','ns-resize','numbers','numeric','nw-resize','nwse-resize','oblique','octal','opacity','open-quote','optimizeLegibility','optimizeSpeed','oriya','oromo','outset','outside','outside-shape','overlay','overline','padding','padding-box','painted','page','paused','persian','perspective','plus-darker','plus-lighter','pointer','polygon','portrait','pre','pre-line','pre-wrap','preserve-3d','progress','push-button','radial-gradient','radio','read-only','read-write','read-write-plaintext-only','rectangle','region','relative','repeat','repeating-linear-gradient','repeating-radial-gradient','repeat-x','repeat-y','reset','reverse','rgb','rgba','ridge','right','rotate','rotate3d','rotateX','rotateY','rotateZ','round','row','row-resize','row-reverse','rtl','run-in','running','s-resize','sans-serif','saturation','scale','scale3d','scaleX','scaleY','scaleZ','screen','scroll','scrollbar','scroll-position','se-resize','searchfield','searchfield-cancel-button','searchfield-decoration','searchfield-results-button','searchfield-results-decoration','self-start','self-end','semi-condensed','semi-expanded','separate','serif','show','sidama','simp-chinese-formal','simp-chinese-informal','single','skew','skewX','skewY','skip-white-space','slide','slider-horizontal','slider-vertical','sliderthumb-horizontal','sliderthumb-vertical','slow','small','small-caps','small-caption','smaller','soft-light','solid','somali','source-atop','source-in','source-out','source-over','space','space-around','space-between','space-evenly','spell-out','square','square-button','start','static','status-bar','stretch','stroke','sub','subpixel-antialiased','super','sw-resize','symbolic','symbols','system-ui','table','table-caption','table-cell','table-column','table-column-group','table-footer-group','table-header-group','table-row','table-row-group','tamil','telugu','text','text-bottom','text-top','textarea','textfield','thai','thick','thin','threeddarkshadow','threedface','threedhighlight','threedlightshadow','threedshadow','tibetan','tigre','tigrinya-er','tigrinya-er-abegede','tigrinya-et','tigrinya-et-abegede','to','top','trad-chinese-formal','trad-chinese-informal','transform','translate','translate3d','translateX','translateY','translateZ','transparent','ultra-condensed','ultra-expanded','underline','unset','up','upper-alpha','upper-armenian','upper-greek','upper-hexadecimal','upper-latin','upper-norwegian','upper-roman','uppercase','urdu','url','var','vertical','vertical-text','visible','visibleFill','visiblePainted','visibleStroke','visual','w-resize','wait','wave','wider','window','windowframe','windowtext','words','wrap','wrap-reverse','x-large','x-small','xor','xx-large','xx-small'],c=t(k),z=u.concat(m).concat(f).concat(h).concat(g).concat(b).concat(w).concat(k);e.registerHelper('hintWords','css',z);function r(e,t){var i=!1,r;while((r=e.next())!=null){if(i&&r=='/'){t.tokenize=null;break};i=(r=='*')};return['comment','comment']};e.defineMIME('text/css',{documentTypes:p,mediaTypes:i,mediaFeatures:o,mediaValueKeywords:d,propertyKeywords:a,nonStandardPropertyKeywords:n,fontProperties:l,counterDescriptors:y,colorKeywords:s,valueKeywords:c,tokenHooks:{'/':function(e,t){if(!e.eat('*'))return!1;t.tokenize=r;return r(e,t)}},name:'css'});e.defineMIME('text/x-scss',{mediaTypes:i,mediaFeatures:o,mediaValueKeywords:d,propertyKeywords:a,nonStandardPropertyKeywords:n,colorKeywords:s,valueKeywords:c,fontProperties:l,allowNested:!0,lineComment:'//',tokenHooks:{'/':function(e,t){if(e.eat('/')){e.skipToEnd();return['comment','comment']} +else if(e.eat('*')){t.tokenize=r;return r(e,t)} +else{return['operator','operator']}},':':function(e){if(e.match(/\s*\{/,!1))return[null,null];return!1},'$':function(e){e.match(/^[\w-]+/);if(e.match(/^\s*:/,!1))return['variable-2','variable-definition'];return['variable-2','variable']},'#':function(e){if(!e.eat('{'))return!1;return[null,'interpolation']}},name:'css',helperType:'scss'});e.defineMIME('text/x-less',{mediaTypes:i,mediaFeatures:o,mediaValueKeywords:d,propertyKeywords:a,nonStandardPropertyKeywords:n,colorKeywords:s,valueKeywords:c,fontProperties:l,allowNested:!0,lineComment:'//',tokenHooks:{'/':function(e,t){if(e.eat('/')){e.skipToEnd();return['comment','comment']} +else if(e.eat('*')){t.tokenize=r;return r(e,t)} +else{return['operator','operator']}},'@':function(e){if(e.eat('{'))return[null,'interpolation'];if(e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1))return!1;e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,!1))return['variable-2','variable-definition'];return['variable-2','variable']},'&':function(){return['atom','atom']}},name:'css',helperType:'less'});e.defineMIME('text/x-gss',{documentTypes:p,mediaTypes:i,mediaFeatures:o,propertyKeywords:a,nonStandardPropertyKeywords:n,fontProperties:l,counterDescriptors:y,colorKeywords:s,valueKeywords:c,supportsAtComponent:!0,tokenHooks:{'/':function(e,t){if(!e.eat('*'))return!1;t.tokenize=r;return r(e,t)}},name:'css',helperType:'gss'})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../haskell/haskell'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../haskell/haskell'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('haskell-literate',function(t,n){var i=e.getMode(t,(n&&n.base)||'haskell');return{startState:function(){return{inCode:!1,baseState:e.startState(i)}},token:function(e,t){if(e.sol()){if(t.inCode=e.eat('>'))return'meta'};if(t.inCode){return i.token(e,t.baseState)} +else{e.skipToEnd();return'comment'}},innerMode:function(e){return e.inCode?{state:e.baseState,mode:i}:null}}},'haskell');e.defineMIME('text/x-literate-haskell','haskell-literate')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';var r=['From','Sender','Reply-To','To','Cc','Bcc','Message-ID','In-Reply-To','References','Resent-From','Resent-Sender','Resent-To','Resent-Cc','Resent-Bcc','Resent-Message-ID','Return-Path','Received'],n=['Date','Subject','Comments','Keywords','Resent-Date'];e.registerHelper('hintWords','mbox',r.concat(n));var t=/^[ \t]/,i=/^From /,a=new RegExp('^('+r.join('|')+'): '),o=new RegExp('^('+n.join('|')+'): '),d=/^[^:]+:/,c=/^[^ ]+@[^ ]+/,m=/^.*?(?=[^ ]+?@[^ ]+)/,s=/^<.*?>/,u=/^.*?(?=<.*>)/;function f(e){if(e==='Subject')return'header';return'string'};function l(r,e){if(r.sol()){e.inSeparator=!1;if(e.inHeader&&r.match(t)){return null} +else{e.inHeader=!1;e.header=null};if(r.match(i)){e.inHeaders=!0;e.inSeparator=!0;return'atom'};var n,p=!1;if((n=r.match(o))||(p=!0)&&(n=r.match(a))){e.inHeaders=!0;e.inHeader=!0;e.emailPermitted=p;e.header=n[1];return'atom'};if(e.inHeaders&&(n=r.match(d))){e.inHeader=!0;e.emailPermitted=!0;e.header=n[1];return'atom'};e.inHeaders=!1;r.skipToEnd();return null};if(e.inSeparator){if(r.match(c))return'link';if(r.match(m))return'atom';r.skipToEnd();return'atom'};if(e.inHeader){var l=f(e.header);if(e.emailPermitted){if(r.match(s))return l+' link';if(r.match(u))return l};r.skipToEnd();return l};r.skipToEnd();return null};e.defineMode('mbox',function(){return{startState:function(){return{inSeparator:!1,inHeader:!1,emailPermitted:!1,header:null,inHeaders:!1}},token:l,blankLine:function(e){e.inHeaders=e.inSeparator=e.inHeader=!1}}});e.defineMIME('application/mbox','mbox')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('dtd',function(t){var l=t.indentUnit,e;function n(t,n){e=n;return t};function r(e,r){var t=e.next();if(t=='<'&&e.eat('!')){if(e.eatWhile(/[\-]/)){r.tokenize=i;return i(e,r)} +else if(e.eatWhile(/[\w]/))return n('keyword','doindent')} +else if(t=='<'&&e.eat('?')){r.tokenize=s('meta','?>');return n('meta',t)} +else if(t=='#'&&e.eatWhile(/[\w]/))return n('atom','tag');else if(t=='|')return n('keyword','seperator');else if(t.match(/[\(\)\[\]\-\.,\+\?>]/))return n(null,t);else if(t.match(/[\[\]]/))return n('rule',t);else if(t=='"'||t=='\''){r.tokenize=u(t);return r.tokenize(e,r)} +else if(e.eatWhile(/[a-zA-Z\?\+\d]/)){var l=e.current();if(l.substr(l.length-1,l.length).match(/\?|\+/)!==null)e.backUp(1);return n('tag','tag')} +else if(t=='%'||t=='*')return n('number','number');else{e.eatWhile(/[\w\\\-_%.{,]/);return n(null,null)}};function i(e,t){var i=0,l;while((l=e.next())!=null){if(i>=2&&l=='>'){t.tokenize=r;break};i=(l=='-')?i+1:0};return n('comment','comment')};function u(e){return function(t,i){var l=!1,u;while((u=t.next())!=null){if(u==e&&!l){i.tokenize=r;break};l=!l&&u=='\\'};return n('string','tag')}};function s(e,t){return function(n,i){while(!n.eol()){if(n.match(t)){i.tokenize=r;break};n.next()};return e}};return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(t,n){if(t.eatSpace())return null;var r=n.tokenize(t,n),i=n.stack[n.stack.length-1];if(t.current()=='['||e==='doindent'||e=='[')n.stack.push('rule');else if(e==='endtag')n.stack[n.stack.length-1]='endtag';else if(t.current()==']'||e==']'||(e=='>'&&i=='rule'))n.stack.pop();else if(e=='[')n.stack.push('[');return r},indent:function(t,n){var r=t.stack.length;if(n.match(/\]\s+|\]/))r=r-1;else if(n.substr(n.length-1,n.length)==='>'){if(n.substr(0,1)==='<'){} +else if(e=='doindent'&&n.length>1){} +else if(e=='doindent')r--;else if(e=='>'&&n.length>1){} +else if(e=='tag'&&n!=='>'){} +else if(e=='tag'&&t.stack[t.stack.length-1]=='rule')r--;else if(e=='tag')r++;else if(n==='>'&&t.stack[t.stack.length-1]=='rule'&&e==='>')r--;else if(n==='>'&&t.stack[t.stack.length-1]=='rule'){} +else if(n.substr(0,1)!=='<'&&n.substr(0,1)==='>')r=r-1;else if(n==='>'){} +else r=r-1;if(e==null||e==']')r--};return t.baseIndent+r*l},electricChars:']>'}});e.defineMIME('application/xml-dtd','dtd')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMIME('text/x-erlang','erlang');e.defineMode('erlang',function(r){'use strict';var h=['-type','-spec','-export_type','-opaque'],y=['after','begin','catch','case','cond','end','fun','if','let','of','query','receive','try','when'],v=/[\->,;]/,w=['->',';',','],x=['and','andalso','band','bnot','bor','bsl','bsr','bxor','div','not','or','orelse','rem','xor'],S=/[\+\-\*\/<>=\|:!]/,z=['=','+','-','*','/','>','>=','<','=<','=:=','==','=/=','/=','||','<-','!'],W=/[<\(\[\{]/,c=['<<','(','[','{'],U=/[>\)\]\}]/,f=['}',']',')','>>'],E=['is_atom','is_binary','is_bitstring','is_boolean','is_float','is_function','is_integer','is_list','is_number','is_pid','is_port','is_record','is_reference','is_tuple','atom','binary','bitstring','boolean','function','integer','list','number','pid','port','record','reference','tuple'],A=['abs','adler32','adler32_combine','alive','apply','atom_to_binary','atom_to_list','binary_to_atom','binary_to_existing_atom','binary_to_list','binary_to_term','bit_size','bitstring_to_list','byte_size','check_process_code','contact_binary','crc32','crc32_combine','date','decode_packet','delete_module','disconnect_node','element','erase','exit','float','float_to_list','garbage_collect','get','get_keys','group_leader','halt','hd','integer_to_list','internal_bif','iolist_size','iolist_to_binary','is_alive','is_atom','is_binary','is_bitstring','is_boolean','is_float','is_function','is_integer','is_list','is_number','is_pid','is_port','is_process_alive','is_record','is_reference','is_tuple','length','link','list_to_atom','list_to_binary','list_to_bitstring','list_to_existing_atom','list_to_float','list_to_integer','list_to_pid','list_to_tuple','load_module','make_ref','module_loaded','monitor_node','node','node_link','node_unlink','nodes','notalive','now','open_port','pid_to_list','port_close','port_command','port_connect','port_control','pre_loaded','process_flag','process_info','processes','purge_module','put','register','registered','round','self','setelement','size','spawn','spawn_link','spawn_monitor','spawn_opt','split_binary','statistics','term_to_binary','time','throw','tl','trunc','tuple_size','tuple_to_list','unlink','unregister','whereis'],u=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,Z=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;function M(e,r){if(r.in_string){r.in_string=(!d(e));return t(r,e,'string')};if(r.in_atom){r.in_atom=(!b(e));return t(r,e,'atom')};if(e.eatSpace()){return t(r,e,'whitespace')};if(!a(r)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)){if(n(e.current(),h)){return t(r,e,'type')} +else{return t(r,e,'attribute')}};var i=e.next();if(i=='%'){e.skipToEnd();return t(r,e,'comment')};if(i==':'){return t(r,e,'colon')};if(i=='?'){e.eatSpace();e.eatWhile(u);return t(r,e,'macro')};if(i=='#'){e.eatSpace();e.eatWhile(u);return t(r,e,'record')};if(i=='$'){if(e.next()=='\\'&&!e.match(Z)){return t(r,e,'error')};return t(r,e,'number')};if(i=='.'){return t(r,e,'dot')};if(i=='\''){if(!(r.in_atom=(!b(e)))){if(e.match(/\s*\/\s*[0-9]/,!1)){e.match(/\s*\/\s*[0-9]/,!0);return t(r,e,'fun')};if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1)){return t(r,e,'function')}};return t(r,e,'atom')};if(i=='"'){r.in_string=(!d(e));return t(r,e,'string')};if(/[A-Z_Ø-ÞÀ-Ö]/.test(i)){e.eatWhile(u);return t(r,e,'variable')};if(/[a-z_ß-öø-ÿ]/.test(i)){e.eatWhile(u);if(e.match(/\s*\/\s*[0-9]/,!1)){e.match(/\s*\/\s*[0-9]/,!0);return t(r,e,'fun')};var o=e.current();if(n(o,y)){return t(r,e,'keyword')} +else if(n(o,x)){return t(r,e,'operator')} +else if(e.match(/\s*\(/,!1)){if(n(o,A)&&((a(r).token!=':')||(a(r,2).token=='erlang'))){return t(r,e,'builtin')} +else if(n(o,E)){return t(r,e,'guard')} +else{return t(r,e,'function')}} +else if(P(e)==':'){if(o=='erlang'){return t(r,e,'builtin')} +else{return t(r,e,'function')}} +else if(n(o,['true','false'])){return t(r,e,'boolean')} +else{return t(r,e,'atom')}};var s=/[0-9]/,l=/[0-9a-zA-Z]/;if(s.test(i)){e.eatWhile(s);if(e.eat('#')){if(!e.eatWhile(l)){e.backUp(1)}} +else if(e.eat('.')){if(!e.eatWhile(s)){e.backUp(1)} +else{if(e.eat(/[eE]/)){if(e.eat(/[-+]/)){if(!e.eatWhile(s)){e.backUp(2)}} +else{if(!e.eatWhile(s)){e.backUp(1)}}}}};return t(r,e,'number')};if(p(e,W,c)){return t(r,e,'open_paren')};if(p(e,U,f)){return t(r,e,'close_paren')};if(m(e,v,w)){return t(r,e,'separator')};if(m(e,S,z)){return t(r,e,'operator')};return t(r,e,null)};function p(e,t,r){if(e.current().length==1&&t.test(e.current())){e.backUp(1);while(t.test(e.peek())){e.next();if(n(e.current(),r)){return!0}};e.backUp(e.current().length-1)};return!1};function m(e,t,r){if(e.current().length==1&&t.test(e.current())){while(t.test(e.peek())){e.next()} +while(0<e.current().length){if(n(e.current(),r)){return!0} +else{e.backUp(1)}};e.next()};return!1};function d(e){return g(e,'"','\\')};function b(e){return g(e,'\'','\\')};function g(e,t,r){while(!e.eol()){var n=e.next();if(n==t){return!0} +else if(n==r){e.next()}};return!1};function P(e){var t=e.match(/([\n\s]+|%[^\n]*\n)*(.)/,!1);return t?t.pop():''};function n(e,t){return(-1<t.indexOf(e))};function t(e,t,r){j(e,q(r,t));switch(r){case'atom':return'atom';case'attribute':return'attribute';case'boolean':return'atom';case'builtin':return'builtin';case'close_paren':return null;case'colon':return null;case'comment':return'comment';case'dot':return null;case'error':return'error';case'fun':return'meta';case'function':return'tag';case'guard':return'property';case'keyword':return'keyword';case'macro':return'variable-2';case'number':return'number';case'open_paren':return null;case'operator':return'operator';case'record':return'bracket';case'separator':return null;case'string':return'string';case'type':return'def';case'variable':return'variable';default:return null}};function k(e,t,r,n){return{token:e,column:t,indent:r,type:n}};function q(e,t){return k(t.current(),t.column(),t.indentation(),e)};function C(e){return k(e,0,0,e)};function a(e,t){var r=e.tokenStack.length,n=(t?t:1);if(r<n){return!1} +else{return e.tokenStack[r-n]}};function j(e,t){if(!(t.type=='comment'||t.type=='whitespace')){e.tokenStack=I(e.tokenStack,t);e.tokenStack=O(e.tokenStack)}};function I(e,t){var r=e.length-1;if(0<r&&e[r].type==='record'&&t.type==='dot'){e.pop()} +else if(0<r&&e[r].type==='group'){e.pop();e.push(t)} +else{e.push(t)};return e};function O(e){if(!e.length)return e;var t=e.length-1;if(e[t].type==='dot'){return[]};if(t>1&&e[t].type==='fun'&&e[t-1].token==='fun'){return e.slice(0,t-1)};switch(e[t].token){case'}':return i(e,{g:['{']});case']':return i(e,{i:['[']});case')':return i(e,{i:['(']});case'>>':return i(e,{i:['<<']});case'end':return i(e,{i:['begin','case','fun','if','receive','try']});case',':return i(e,{e:['begin','try','when','->',',','(','[','{','<<']});case'->':return i(e,{r:['when'],m:['try','if','case','receive']});case';':return i(e,{E:['case','fun','if','receive','try','when']});case'catch':return i(e,{e:['try']});case'of':return i(e,{e:['case']});case'after':return i(e,{e:['receive','try']});default:return e}};function i(e,t){for(var a in t){var o=e.length-1,u=t[a];for(var r=o-1;-1<r;r--){if(n(e[r].token,u)){var i=e.slice(0,r);switch(a){case'm':return i.concat(e[r]).concat(e[o]);case'r':return i.concat(e[o]);case'i':return i;case'g':return i.concat(C('group'));case'E':return i.concat(e[r]);case'e':return i.concat(e[r])}}}};return(a=='E'?[]:e)};function T(t,i){var u,p=r.indentUnit,m=ee(i),s=a(t,1),d=a(t,2);if(t.in_string||t.in_atom){return e.Pass} +else if(!d){return 0} +else if(s.token=='when'){return s.column+p} +else if(m==='when'&&d.type==='function'){return d.indent+p} +else if(m==='('&&s.token==='fun'){return s.column+3} +else if(m==='catch'&&(u=l(t,['try']))){return u.column} +else if(n(m,['end','after','of'])){u=l(t,['begin','case','fun','if','receive','try']);return u?u.column:e.Pass} +else if(n(m,f)){u=l(t,c);return u?u.column:e.Pass} +else if(n(s.token,[',','|','||'])||n(m,[',','|','||'])){u=te(t);return u?u.column+u.token.length:p} +else if(s.token=='->'){if(n(d.token,['receive','case','if','try'])){return d.column+p+p} +else{return d.column+p}} +else if(n(s.token,c)){return s.column+s.token.length} +else{u=re(t);return o(u)?u.column+p:0}};function ee(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return o(t)&&(t.index===0)?t[0]:''};function te(e){var t=e.tokenStack.slice(0,-1),r=s(t,'type',['open_paren']);return o(t[r])?t[r]:!1};function re(e){var r=e.tokenStack,t=s(r,'type',['open_paren','separator','keyword']),n=s(r,'type',['operator']);if(o(t)&&o(n)&&t<n){return r[t+1]} +else if(o(t)){return r[t]} +else{return!1}};function l(e,t){var r=e.tokenStack,n=s(r,'token',t);return o(r[n])?r[n]:!1};function s(e,t,r){for(var i=e.length-1;-1<i;i--){if(n(e[i][t],r)){return i}};return!1};function o(e){return(e!==!1)&&(e!=null)};return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return M(e,t)},indent:function(e,t){return T(e,t)},lineComment:'%'}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('turtle',function(e){var f=e.indentUnit,t;function l(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var u=l([]),i=l(['@prefix','@base','a']),o=/[*+\-<>=&|]/;function c(e,r){var n=e.next();t=null;if(n=='<'&&!e.match(/^[\s\u00a0=]/,!1)){e.match(/^[^\s\u00a0>]*>?/);return'atom'} +else if(n=='"'||n=='\''){r.tokenize=a(n);return r.tokenize(e,r)} +else if(/[{}\(\),\.;\[\]]/.test(n)){t=n;return null} +else if(n=='#'){e.skipToEnd();return'comment'} +else if(o.test(n)){e.eatWhile(o);return null} +else if(n==':'){return'operator'} +else{e.eatWhile(/[_\w\d]/);if(e.peek()==':'){return'variable-3'} +else{var l=e.current();if(i.test(l)){return'meta'};if(n>='A'&&n<='Z'){return'comment'} +else{return'keyword'}};var l=e.current();if(u.test(l))return null;else if(i.test(l))return'meta';else return'variable'}};function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=c;break};r=!r&&i=='\\'};return'string'}};function n(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}};function r(e){e.indent=e.context.indent;e.context=e.context.prev};return{startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(i,e){if(i.sol()){if(e.context&&e.context.align==null)e.context.align=!1;e.indent=i.indentation()};if(i.eatSpace())return null;var o=e.tokenize(i,e);if(o!='comment'&&e.context&&e.context.align==null&&e.context.type!='pattern'){e.context.align=!0};if(t=='(')n(e,')',i.column());else if(t=='[')n(e,']',i.column());else if(t=='{')n(e,'}',i.column());else if(/[\]\}\)]/.test(t)){while(e.context&&e.context.type=='pattern')r(e);if(e.context&&t==e.context.type)r(e)} +else if(t=='.'&&e.context&&e.context.type=='pattern')r(e);else if(/atom|string|variable/.test(o)&&e.context){if(/[\}\]]/.test(e.context.type))n(e,'pattern',i.column());else if(e.context.type=='pattern'&&!e.context.align){e.context.align=!0;e.context.col=i.column()}};return o},indent:function(t,n){var i=n&&n.charAt(0),e=t.context;if(/[\]\}]/.test(i))while(e&&e.type=='pattern')e=e.prev;var r=e&&i==e.type;if(!e)return 0;else if(e.type=='pattern')return e.col;else if(e.align)return e.col+(r?0:1);else return e.indent+(r?0:f)},lineComment:'#'}});e.defineMIME('text/turtle','turtle')});(function(t){if(typeof exports=='object'&&typeof module=='object')t(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],t);else t(CodeMirror)})(function(t){'use strict';t.defineMode('troff',function(){var t={};function e(e){if(e.eatSpace())return null;var i=e.sol(),r=e.next();if(r==='\\'){if(e.match('fB')||e.match('fR')||e.match('fI')||e.match('u')||e.match('d')||e.match('%')||e.match('&')){return'string'};if(e.match('m[')){e.skipTo(']');e.next();return'string'};if(e.match('s+')||e.match('s-')){e.eatWhile(/[\d-]/);return'string'};if(e.match('\(')||e.match('*\(')){e.eatWhile(/[\w-]/);return'string'};return'string'};if(i&&(r==='.'||r==='\'')){if(e.eat('\\')&&e.eat('"')){e.skipToEnd();return'comment'}};if(i&&r==='.'){if(e.match('B ')||e.match('I ')||e.match('R ')){return'attribute'};if(e.match('TH ')||e.match('SH ')||e.match('SS ')||e.match('HP ')){e.skipToEnd();return'quote'};if((e.match(/[A-Z]/)&&e.match(/[A-Z]/))||(e.match(/[a-z]/)&&e.match(/[a-z]/))){return'attribute'}};e.eatWhile(/[\w-]/);var n=e.current();return t.hasOwnProperty(n)?t[n]:null};function r(t,r){return(r.tokens[0]||e)(t,r)};return{startState:function(){return{tokens:[]}},token:function(t,e){return r(t,e)}}});t.defineMIME('text/troff','troff');t.defineMIME('text/x-troff','troff');t.defineMIME('application/x-troff','troff')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('jinja2',function(){var n=['and','as','block','endblock','by','cycle','debug','else','elif','extends','filter','endfilter','firstof','for','endfor','if','endif','ifchanged','endifchanged','ifequal','endifequal','ifnotequal','endifnotequal','in','include','load','not','now','or','parsed','regroup','reversed','spaceless','endspaceless','ssi','templatetag','openblock','closeblock','openvariable','closevariable','openbrace','closebrace','opencomment','closecomment','widthratio','url','with','endwith','get_current_language','trans','endtrans','noop','blocktrans','endblocktrans','get_available_languages','get_current_language_bidi','plural'],i=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,e=['true','false'],t=/^(\d[+\-\*\/])?\d+(\.\d+)?/;n=new RegExp('(('+n.join(')|(')+'))\\b');e=new RegExp('(('+e.join(')|(')+'))\\b');function o(o,a){var f=o.peek();if(a.incomment){if(!o.skipTo('#}')){o.skipToEnd()} +else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} +else if(a.intag){if(a.operator){a.operator=!1;if(o.match(e)){return'atom'};if(o.match(t)){return'number'}};if(a.sign){a.sign=!1;if(o.match(e)){return'atom'};if(o.match(t)){return'number'}};if(a.instring){if(f==a.instring){a.instring=!1};o.next();return'string'} +else if(f=='\''||f=='"'){a.instring=f;o.next();return'string'} +else if(o.match(a.intag+'}')||o.eat('-')&&o.match(a.intag+'}')){a.intag=!1;return'tag'} +else if(o.match(i)){a.operator=!0;return'operator'} +else if(o.match(r)){a.sign=!0} +else{if(o.eat(' ')||o.sol()){if(o.match(n)){return'keyword'};if(o.match(e)){return'atom'};if(o.match(t)){return'number'};if(o.sol()){o.next()}} +else{o.next()}};return'variable'} +else if(o.eat('{')){if(o.eat('#')){a.incomment=!0;if(!o.skipTo('#}')){o.skipToEnd()} +else{o.eatWhile(/\#|}/);a.incomment=!1};return'comment'} +else if(f=o.eat(/\{|%/)){a.intag=f;if(f=='{'){a.intag='}'};o.eat('-');return'tag'}};o.next()};return{startState:function(){return{tokenize:o}},token:function(e,n){return n.tokenize(e,n)}}})});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('diff',function(){var e={'+':'positive','-':'negative','@':'meta'};return{token:function(i){var r=i.string.search(/[\t ]+?$/);if(!i.sol()||r===0){i.skipToEnd();return('error '+(e[i.string.charAt(0)]||'')).replace(/ $/,'')};var o=e[i.peek()]||i.skipToEnd();if(r===-1){i.skipToEnd()} +else{i.pos=r};return o}}});e.defineMIME('text/x-diff','diff')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'),require('../clike/clike'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror','../clike/clike'],e);else e(CodeMirror)})(function(e){'use strict';var r=('this super static final const abstract class extends external factory implements get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as').split(' '),c='try catch finally do else for if switch while'.split(' '),o='true false null'.split(' '),a='void bool num int double dynamic var String'.split(' ');function t(e){var n={};for(var t=0;t<e.length;++t)n[e[t]]=!0;return n};function u(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)};function l(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()};function f(e){return e.interpolationStack?e.interpolationStack.length:0};e.defineMIME('application/dart',{name:'clike',keywords:t(r),blockKeywords:t(c),builtin:t(a),atoms:t(o),hooks:{'@':function(e){e.eatWhile(/[\w\$_\.]/);return'meta'},'\'':function(e,t){return n('\'',e,t,!1)},'"':function(e,t){return n('"',e,t,!1)},'r':function(e,t){var i=e.peek();if(i=='\''||i=='"'){return n(e.next(),e,t,!0)};return!1},'}':function(e,t){if(f(t)>0){t.tokenize=l(t);return null};return!1},'/':function(e,t){if(!e.eat('*'))return!1;t.tokenize=i(1);return t.tokenize(e,t)}}});function n(e,t,n,i){var r=!1;if(t.eat(e)){if(t.eat(e))r=!0;else return'string'};function o(t,n){var o=!1;while(!t.eol()){if(!i&&!o&&t.peek()=='$'){u(n);n.tokenize=s;return'string'};var a=t.next();if(a==e&&!o&&(!r||t.match(e+e))){n.tokenize=null;break};o=!i&&!o&&a=='\\'};return'string'};n.tokenize=o;return o(t,n)};function s(e,t){e.eat('$');if(e.eat('{')){t.tokenize=null} +else{t.tokenize=k};return null};function k(e,t){e.eatWhile(/[\w_]/);t.tokenize=l(t);return'variable'};function i(e){return function(t,n){var r;while(r=t.next()){if(r=='*'&&t.eat('/')){if(e==1){n.tokenize=null;break} +else{n.tokenize=i(e-1);return n.tokenize(t,n)}} +else if(r=='/'&&t.eat('*')){n.tokenize=i(e+1);return n.tokenize(t,n)}};return'comment'}};e.registerHelper('hintWords','application/dart',r.concat(o).concat(a));e.defineMode('dart',function(t){return e.getMode(t,'application/dart')},'clike')});(function(e){if(typeof exports=="object"&&typeof module=="object")e(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],e);else e(CodeMirror)})(function(e){"use strict";e.defineMode("shell",function(){var t={};function n(e,n){var i=n.split(" ");for(var r=0;r<i.length;r++){t[i[r]]=e}};n("atom","true false");n("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function");n("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep hg kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo svn tee telnet top touch vi vim wall wc wget who write yes zsh");function o(n,s){if(n.eatSpace())return null;var u=n.sol(),o=n.next();if(o==="\\"){n.next();return null};if(o==="'"||o==="\""||o==="`"){s.tokens.unshift(r(o,o==="`"?"quote":"string"));return e(n,s)};if(o==="#"){if(u&&n.eat("!")){n.skipToEnd();return"meta"};n.skipToEnd();return"comment"};if(o==="$"){s.tokens.unshift(i);return e(n,s)};if(o==="+"||o==="="){return"operator"};if(o==="-"){n.eat("-");n.eatWhile(/\w/);return"attribute"};if(/\d/.test(o)){n.eatWhile(/\d/);if(n.eol()||!/\w/.test(n.peek())){return"number"}};n.eatWhile(/[\w-]/);var f=n.current();if(n.peek()==="="&&/\w+/.test(f))return"def";return t.hasOwnProperty(f)?t[f]:null};function r(t,n){var o=t=="("?")":t=="{"?"}":t;return function(s,f){var l,a=!1,u=!1;while((l=s.next())!=null){if(l===o&&!u){a=!0;break};if(l==="$"&&!u&&t!=="'"){u=!0;s.backUp(1);f.tokens.unshift(i);break};if(!u&&l===t&&t!==o){f.tokens.unshift(r(t,n));return e(s,f)};u=!u&&l==="\\"};if(a)f.tokens.shift();return n}};var i=function(t,n){if(n.tokens.length>1)t.eat("$");var i=t.next();if(/['"({]/.test(i)){n.tokens[0]=r(i,i=="("?"quote":i=="{"?"def":"string");return e(t,n)};if(!/\d/.test(i))t.eatWhile(/\w/);n.tokens.shift();return"def"};function e(e,t){return(t.tokens[0]||o)(e,t)};return{startState:function(){return{tokens:[]}},token:function(t,n){return e(t,n)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}});e.defineMIME("text/x-sh","shell");e.defineMIME("application/x-sh","shell")});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('lua',function(e,t){var f=e.indentUnit;function d(e){return new RegExp('^(?:'+e.join('|')+')','i')};function n(e){return new RegExp('^(?:'+e.join('|')+')$','i')};var o=n(t.specials||[]),u=n(['_G','_VERSION','assert','collectgarbage','dofile','error','getfenv','getmetatable','ipairs','load','loadfile','loadstring','module','next','pairs','pcall','print','rawequal','rawget','rawset','require','select','setfenv','setmetatable','tonumber','tostring','type','unpack','xpcall','coroutine.create','coroutine.resume','coroutine.running','coroutine.status','coroutine.wrap','coroutine.yield','debug.debug','debug.getfenv','debug.gethook','debug.getinfo','debug.getlocal','debug.getmetatable','debug.getregistry','debug.getupvalue','debug.setfenv','debug.sethook','debug.setlocal','debug.setmetatable','debug.setupvalue','debug.traceback','close','flush','lines','read','seek','setvbuf','write','io.close','io.flush','io.input','io.lines','io.open','io.output','io.popen','io.read','io.stderr','io.stdin','io.stdout','io.tmpfile','io.type','io.write','math.abs','math.acos','math.asin','math.atan','math.atan2','math.ceil','math.cos','math.cosh','math.deg','math.exp','math.floor','math.fmod','math.frexp','math.huge','math.ldexp','math.log','math.log10','math.max','math.min','math.modf','math.pi','math.pow','math.rad','math.random','math.randomseed','math.sin','math.sinh','math.sqrt','math.tan','math.tanh','os.clock','os.date','os.difftime','os.execute','os.exit','os.getenv','os.remove','os.rename','os.setlocale','os.time','os.tmpname','package.cpath','package.loaded','package.loaders','package.loadlib','package.path','package.preload','package.seeall','string.byte','string.char','string.dump','string.find','string.format','string.gmatch','string.gsub','string.len','string.lower','string.match','string.rep','string.reverse','string.sub','string.upper','table.concat','table.insert','table.maxn','table.remove','table.sort']),l=n(['and','break','elseif','false','nil','not','or','return','true','function','end','if','then','else','do','while','repeat','until','for','in','local']),s=n(['function','if','repeat','do','\\(','{']),c=n(['end','until','\\)','}']),m=d(['end','until','\\)','}','else','elseif']);function i(e){var t=0;while(e.eat('='))++t;e.eat('[');return t};function r(e,t){var n=e.next();if(n=='-'&&e.eat('-')){if(e.eat('[')&&e.eat('['))return(t.cur=a(i(e),'comment'))(e,t);e.skipToEnd();return'comment'};if(n=='"'||n=='\'')return(t.cur=g(n))(e,t);if(n=='['&&/[\[=]/.test(e.peek()))return(t.cur=a(i(e),'string'))(e,t);if(/\d/.test(n)){e.eatWhile(/[\w.%]/);return'number'};if(/[\w_]/.test(n)){e.eatWhile(/[\w\\\-_.]/);return'variable'};return null};function a(e,t){return function(n,i){var a=null,o;while((o=n.next())!=null){if(a==null){if(o==']')a=0} +else if(o=='=')++a;else if(o==']'&&a==e){i.cur=r;break} +else a=null};return t}};function g(e){return function(t,n){var i=!1,a;while((a=t.next())!=null){if(a==e&&!i)break;i=!i&&a=='\\'};if(!i)n.cur=r;return'string'}};return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:r}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();if(n=='variable'){if(l.test(r))n='keyword';else if(u.test(r))n='builtin';else if(o.test(r))n='variable-2'};if((n!='comment')&&(n!='string')){if(s.test(r))++t.indentDepth;else if(c.test(r))--t.indentDepth};return n},indent:function(e,t){var n=m.test(t);return e.basecol+f*(e.indentDepth-(n?1:0))},lineComment:'--',blockCommentStart:'--[[',blockCommentEnd:']]'}});e.defineMIME('text/x-lua','lua')});(function(e){if(typeof exports=='object'&&typeof module=='object')e(require('../../lib/codemirror'));else if(typeof define=='function'&&define.amd)define(['../../lib/codemirror'],e);else e(CodeMirror)})(function(e){'use strict';e.defineMode('groovy',function(t){function i(e){var n={},r=e.split(' ');for(var t=0;t<r.length;++t)n[r[t]]=!0;return n};var c=i('abstract as assert boolean break byte case catch char class const continue def default do double else enum extends final finally float for goto if implements import in instanceof int interface long native new package private protected public return short static strictfp super switch synchronized threadsafe throw throws trait transient try void volatile while'),p=i('catch class def do else enum finally for if interface switch trait try while'),d=i('return break continue'),m=i('null true false this'),n;function a(e,t){var r=e.next();if(r=='"'||r=='\''){return s(r,e,t)};if(/[\[\]{}\(\),;\:\.]/.test(r)){n=r;return null};if(/\d/.test(r)){e.eatWhile(/[\w\.]/);if(e.eat(/eE/)){e.eat(/\+\-/);e.eatWhile(/\d/)};return'number'};if(r=='/'){if(e.eat('*')){t.tokenize.push(f);return f(e,t)};if(e.eat('/')){e.skipToEnd();return'comment'};if(l(t.lastToken,!1)){return s(r,e,t)}};if(r=='-'&&e.eat('>')){n='->';return null};if(/[+\-*&%=<>!?|\/~]/.test(r)){e.eatWhile(/[+\-*&%=<>|~]/);return'operator'};e.eatWhile(/[\w\$_]/);if(r=='@'){e.eatWhile(/[\w\$_\.]/);return'meta'};if(t.lastToken=='.')return'property';if(e.eat(':')){n='proplabel';return'property'};var i=e.current();if(m.propertyIsEnumerable(i)){return'atom'};if(c.propertyIsEnumerable(i)){if(p.propertyIsEnumerable(i))n='newstatement';else if(d.propertyIsEnumerable(i))n='standalone';return'keyword'};return'variable'};a.isBase=!0;function s(e,t,n){var r=!1;if(e!='/'&&t.eat(e)){if(t.eat(e))r=!0;else return'string'};function i(t,n){var i=!1,o,a=!r;while((o=t.next())!=null){if(o==e&&!i){if(!r){break};if(t.match(e+e)){a=!0;break}};if(e=='"'&&o=='$'&&!i&&t.eat('{')){n.tokenize.push(h());return'string'};i=!i&&o=='\\'};if(a)n.tokenize.pop();return'string'};n.tokenize.push(i);return i(t,n)};function h(){var e=1;function t(t,n){if(t.peek()=='}'){e--;if(e==0){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)}} +else if(t.peek()=='{'){e++};return a(t,n)};t.isBase=!0;return t};function f(e,t){var r=!1,n;while(n=e.next()){if(n=='/'&&r){t.tokenize.pop();break};r=(n=='*')};return'comment'};function l(e,t){return!e||e=='operator'||e=='->'||/[\.\[\{\(,;:]/.test(e)||e=='newstatement'||e=='keyword'||e=='proplabel'||(e=='standalone'&&!t)};function u(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i};function o(e,t,n){return e.context=new u(e.indented,t,n,null,e.context)};function r(e){var t=e.context.type;if(t==')'||t==']'||t=='}')e.indented=e.context.indented;return e.context=e.context.prev};return{startState:function(e){return{tokenize:[a],context:new u((e||0)-t.indentUnit,0,'top',!1),indented:0,startOfLine:!0,lastToken:null}},token:function(t,e){var i=e.context;if(t.sol()){if(i.align==null)i.align=!1;e.indented=t.indentation();e.startOfLine=!0;if(i.type=='statement'&&!l(e.lastToken,!0)){r(e);i=e.context}};if(t.eatSpace())return null;n=null;var a=e.tokenize[e.tokenize.length-1](t,e);if(a=='comment')return a;if(i.align==null)i.align=!0;if((n==';'||n==':')&&i.type=='statement')r(e);else if(n=='->'&&i.type=='statement'&&i.prev.type=='}'){r(e);e.context.align=!1} +else if(n=='{')o(e,t.column(),'}');else if(n=='[')o(e,t.column(),']');else if(n=='(')o(e,t.column(),')');else if(n=='}'){while(i.type=='statement')i=r(e);if(i.type=='}')i=r(e);while(i.type=='statement')i=r(e)} +else if(n==i.type)r(e);else if(i.type=='}'||i.type=='top'||(i.type=='statement'&&n=='newstatement'))o(e,t.column(),'statement');e.startOfLine=!1;e.lastToken=n||a;return a},indent:function(n,r){if(!n.tokenize[n.tokenize.length-1].isBase)return e.Pass;var a=r&&r.charAt(0),i=n.context;if(i.type=='statement'&&!l(n.lastToken,!0))i=i.prev;var o=a==i.type;if(i.type=='statement')return i.indented+(a=='{'?0:t.indentUnit);else if(i.align)return i.column+(o?0:1);else return i.indented+(o?0:t.indentUnit)},electricChars:'{}',closeBrackets:{triples:'\'"'},fold:'brace'}});e.defineMIME('text/x-groovy','groovy')});/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SimpleMDE=e()}}(function(){var e;return function t(e,n,r){function i(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";function r(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;n>t;++t)s[t]=e[t],c[e.charCodeAt(t)]=t;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63}function i(e){var t,n,r,i,o,a,l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[l-2]?2:"="===e[l-1]?1:0,a=new u(3*l/4-o),r=o>0?l-4:l;var s=0;for(t=0,n=0;r>t;t+=4,n+=3)i=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[s++]=i>>16&255,a[s++]=i>>8&255,a[s++]=255&i;return 2===o?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[s++]=255&i):1===o&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[s++]=i>>8&255,a[s++]=255&i),a}function o(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,i=[],a=t;n>a;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(o(r));return i.join("")}function l(e){for(var t,n=e.length,r=n%3,i="",o=[],l=16383,c=0,u=n-r;u>c;c+=l)o.push(a(e,c,c+l>u?u:c+l));return 1===r?(t=e[n-1],i+=s[t>>2],i+=s[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=s[t>>10],i+=s[t>>4&63],i+=s[t<<2&63],i+="="),o.push(i),o.join("")}n.toByteArray=i,n.fromByteArray=l;var s=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array;r()},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function i(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?d(e,t,n,r):"string"==typeof t?f(e,t,n):p(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function c(e,t,n,r){return s(t),0>=t?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}function u(e,t){if(s(t),e=o(e,0>t?0:0|m(t)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function f(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,n);return e=o(e,r),e.write(t,n),e}function h(e,t){var n=0|m(t.length);e=o(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function d(e,t,n,r){if(t.byteLength,0>n||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=h(e,t),e}function p(e,t){if(a.isBuffer(t)){var n=0|m(t.length);return e=o(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||K(t.length)?o(e,0):h(e,t);if("Buffer"===t.type&&J(t.data))return h(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,t>=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return N(this,t,n);case"ascii":return E(this,t,n);case"binary":return O(this,t,n);case"base64":return M(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,l=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}for(var s=-1,c=0;a>n+c;c++)if(i(e,n+c)===i(t,-1===s?0:c-s)){if(-1===s&&(s=c),c-s+1===l)return(n+s)*o}else-1!==s&&(c-=c-s),s=-1;return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var l=parseInt(t.substr(2*a,2),16);if(isNaN(l))return a;e[n+a]=l}return a}function k(e,t,n,r){return V(q(t,e.length-n),e,n,r)}function S(e,t,n,r){return V(G(t),e,n,r)}function C(e,t,n,r){return S(e,t,n,r)}function L(e,t,n,r){return V($(t),e,n,r)}function T(e,t,n,r){return V(Y(t,e.length-n),e,n,r)}function M(e,t,n){return 0===t&&n===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,n))}function N(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var o=e[i],a=null,l=o>239?4:o>223?3:o>191?2:1;if(n>=i+l){var s,c,u,f;switch(l){case 1:128>o&&(a=o);break;case 2:s=e[i+1],128===(192&s)&&(f=(31&o)<<6|63&s,f>127&&(a=f));break;case 3:s=e[i+1],c=e[i+2],128===(192&s)&&128===(192&c)&&(f=(15&o)<<12|(63&s)<<6|63&c,f>2047&&(55296>f||f>57343)&&(a=f));break;case 4:s=e[i+1],c=e[i+2],u=e[i+3],128===(192&s)&&128===(192&c)&&128===(192&u)&&(f=(15&o)<<18|(63&s)<<12|(63&c)<<6|63&u,f>65535&&1114112>f&&(a=f))}}null===a?(a=65533,l=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=l}return A(r)}function A(e){var t=e.length;if(Q>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Q));return n}function E(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function I(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=U(e[o]);return i}function P(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||o>t)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function H(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);o>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function W(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);o>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function _(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,n,r,52,8),n+8}function z(e){if(e=j(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function j(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function U(e){return 16>e?"0"+e.toString(16):e.toString(16)}function q(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;r>a;a++){if(n=e.charCodeAt(a),n>55295&&57344>n){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(56320>n){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function G(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function Y(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);a++)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function $(e){return X.toByteArray(z(e))}function V(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function K(e){return e!==e}var X=e("base64-js"),Z=e("ieee754"),J=e("isarray");n.Buffer=a,n.SlowBuffer=g,n.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,n){return l(null,e,t,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,n){return c(null,e,t,n)},a.allocUnsafe=function(e){return u(null,e)},a.allocUnsafeSlow=function(e){return u(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);o>i;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return r>n?-1:n>r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!J(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=a.allocUnsafe(t),i=0;for(n=0;n<e.length;n++){var o=e[n];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)x(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?N(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,r,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),0>t||n>e.length||0>r||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var o=i-r,l=n-t,s=Math.min(o,l),c=this.slice(r,i),u=e.slice(t,n),f=0;s>f;++f)if(c[f]!==u[f]){o=c[f],l=u[f];break}return l>o?-1:o>l?1:0},a.prototype.indexOf=function(e,t,n){if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(this,e,t,n);if("number"==typeof e)return a.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):b(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return k(this,e,t,n);case"ascii":return S(this,e,t,n);case"binary":return C(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;a.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=a.prototype;else{var i=t-e;r=new a(i,void 0);for(var o=0;i>o;o++)r[o]=this[o+e]}return r},a.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},a.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},a.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),Z.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),Z.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},a.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t=0|t,n=0|n,!r){var i=Math.pow(2,8*n)-1;D(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):W(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=0,a=1,l=0;for(this[t]=255&e;++o<n&&(a*=256);)0>e&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=n-1,a=1,l=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)0>e&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=(e/a>>0)-l&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):H(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):H(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):W(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||D(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):W(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,n){return _(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return _(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&t>n&&r>t)for(i=o-1;i>=0;i--)e[i+t]=this[i+n];else if(1e3>o||!a.TYPED_ARRAY_SUPPORT)for(i=0;o>i;i++)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);256>i&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e=255&e);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(t>=n)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;n>o;o++)this[o]=e;else{var l=a.isBuffer(e)?e:q(new a(e,r).toString()),s=l.length;for(o=0;n-t>o;o++)this[o+t]=l[o%s]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:15,isarray:16}],4:[function(e,t,n){"use strict";function r(e){return e=e||{},"function"!=typeof e.codeMirrorInstance||"function"!=typeof e.codeMirrorInstance.defineMode?void console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`"):(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),void e.codeMirrorInstance.defineMode("spell-checker",function(t){if(!r.aff_loading){r.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(r.aff_data=n.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},n.send(null)}if(!r.dic_loading){r.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(r.dic_data=o.responseText,r.num_loaded++,2==r.num_loaded&&(r.typo=new i("en_US",r.aff_data,r.dic_data,{platform:"any"})))},o.send(null)}var a='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',l={token:function(e){var t=e.peek(),n="";if(a.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!a.includes(t);)n+=t,e.next();return r.typo&&!r.typo.check(n)?"spell-error":null}},s=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(s,l,!0)}))}var i=e("typo-js");r.num_loaded=0,r.aff_loading=!1,r.dic_loading=!1,r.aff_data="",r.dic_data="",r.typo,t.exports=r},{"typo-js":18}],5:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})})},{"../../lib/codemirror":10}],6:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var l=a&&a!=e.Init;if(o&&!l)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&l){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var s=n.getWrapperElement();s.className=s.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})})},{"../../lib/codemirror":10}],7:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],l=0;l<o.length;l++){var s=o[l].head,c=i.getStateAfter(s.line),u=c.list!==!1,f=0!==c.quote,h=i.getLine(s.line),d=t.exec(h);if(!o[l].empty()||!u&&!f||!d)return void i.execCommand("newlineAndIndent");if(n.test(h))i.replaceRange("",{line:s.line,ch:0},{line:s.line,ch:s.ch+1}),a[l]="\n";else{var p=d[1],m=d[5],g=r.test(d[2])||d[2].indexOf(">")>=0?d[2]:parseInt(d[3],10)+1+d[4];a[l]="\n"+p+g+m}}i.replaceSelections(a)}})},{"../../lib/codemirror":10}],8:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)<e.start)&&(i.streamSeen=e,i.basePos=i.overlayPos=e.start),e.start==i.basePos&&(i.baseCur=t.token(e,i.base),i.basePos=e.pos),e.start==i.overlayPos&&(e.pos=e.start,i.overlayCur=n.token(e,i.overlay),i.overlayPos=e.pos),e.pos=Math.min(i.basePos,i.overlayPos),null==i.overlayCur?i.baseCur:null!=i.baseCur&&i.overlay.combineTokens||r&&null==i.overlay.combineTokens?i.baseCur+" "+i.overlayCur:i.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}})},{"../../lib/codemirror":10}],9:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";function t(e){e.operation(function(){a(e)})}function n(e){e.state.markedSelection.length&&e.operation(function(){i(e)})}function r(e,t,n,r){if(0!=c(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,a=t.line;;){var u=a==t.line?t:s(a,0),f=a+l,h=f>=n.line,d=h?n:s(f,0),p=e.markText(u,d,{className:o});if(null==r?i.push(p):i.splice(r++,0,p),h)break;a=f}}function i(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function o(e){i(e);for(var t=e.listSelections(),n=0;n<t.length;n++)r(e,t[n].from(),t[n].to())}function a(e){if(!e.somethingSelected())return i(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),a=e.state.markedSelection;if(!a.length)return r(e,t,n);var s=a[0].find(),u=a[a.length-1].find();if(!s||!u||n.line-t.line<l||c(t,u.to)>=0||c(n,s.from)<=0)return o(e);for(;c(t,s.from)>0;)a.shift().clear(),s=a[0].find();for(c(t,s.from)<0&&(s.to.line-t.line<l?(a.shift().clear(),r(e,t,s.to,0)):r(e,t,s.from,0));c(n,u.to)<0;)a.pop().clear(),u=a[a.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<l?(a.pop().clear(),r(e,u.from,n)):r(e,u.to,n))}e.defineOption("styleSelectedText",!1,function(r,a,l){var s=l&&l!=e.Init;a&&!s?(r.state.markedSelection=[],r.state.markedSelectionStyle="string"==typeof a?a:"CodeMirror-selectedtext",o(r),r.on("cursorActivity",t),r.on("change",n)):!a&&s&&(r.off("cursorActivity",t),r.off("change",n),i(r),r.state.markedSelection=r.state.markedSelectionStyle=null)});var l=8,s=e.Pos,c=e.cmpPos})},{"../../lib/codemirror":10}],10:[function(t,n,r){!function(t){if("object"==typeof r&&"object"==typeof n)n.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);(this||window).CodeMirror=t()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Wi(r):{},Wi(ea,r,!1),d(r);var i=r.value;"string"==typeof i&&(i=new Ca(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),l(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!Ao&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ei,keySeq:null,specialChars:null};var s=this;xo&&11>bo&&setTimeout(function(){s.display.input.reset(!0)},20),jt(this),Ki(),bt(this),this.curOp.forceUpdate=!0,Xr(this,i),r.autofocus&&!Ao||s.hasFocus()?setTimeout(Bi(vn,this),20):yn(this);for(var u in ta)ta.hasOwnProperty(u)&&ta[u](this,r[u],na);k(this),r.finishInit&&r.finishInit(this);for(var f=0;f<aa.length;++f)aa[f](this);kt(this),wo&&r.lineWrapping&&"optimizelegibility"==getComputedStyle(a.lineDiv).textRendering&&(a.lineDiv.style.textRendering="auto")}function t(e,t,n){var r=this;this.input=n,r.scrollbarFiller=ji("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=ji("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ji("div",null,"CodeMirror-code"),r.selectionDiv=ji("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=ji("div",null,"CodeMirror-cursors"),r.measure=ji("div",null,"CodeMirror-measure"),r.lineMeasure=ji("div",null,"CodeMirror-measure"),r.lineSpace=ji("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=ji("div",[ji("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=ji("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=ji("div",null,null,"position: absolute; height: "+Da+"px; width: 1px;"),r.gutters=ji("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=ji("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=ji("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),xo&&8>bo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),wo||go&&Ao||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null, +r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,_e(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function i(e){e.options.lineWrapping?(Ja(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Za(e.display.wrapper,"CodeMirror-wrap"),h(e)),a(e),Dt(e),lt(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/xt(e.display)-3);return function(i){if(kr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function a(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&ei(e,t)})}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),lt(e)}function s(e){c(e),Dt(e),setTimeout(function(){w(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Ui(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(ji("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=mr(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=gr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,r=i.to.line,n+=r.text.length-i.to.ch}return n}function h(e){var t=e.display,n=e.doc;t.maxLine=Zr(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function d(e){var t=Pi(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+qe(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ye(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=ji("div",[ji("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=ji("div",[ji("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Ea(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ea(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&8>bo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Za(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ea(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Ja(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var n=e.display.barWidth,r=e.display.barHeight;x(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&O(e),x(e,p(e)),n=e.display.barWidth,r=e.display.barHeight}function x(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function b(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Ue(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ni(t,r),a=ni(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;o>l?(o=l,a=ni(t,ri(Zr(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=ni(t,ri(Zr(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function w(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&n[a].gutter&&(n[a].gutter.style.left=o);var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function k(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=S(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(ji("div",[ji("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",u(e),!0}return!1}function S(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function L(e,t,n){var r=e.display;this.viewport=t,this.visible=b(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=$e(e),this.force=n,this.dims=P(e),this.events=[]}function T(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ye(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ye(e)+"px",t.scrollbarsClipped=!0)}function M(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Wt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zt(e))return!1;k(e)&&(Wt(e),t.dims=P(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Wo&&(o=br(e.doc,o),a=wr(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=ri(Zr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=zt(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Gi();return s>4&&(n.lineDiv.style.display="none"),R(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Gi()!=c&&c.offsetHeight&&c.focus(),Ui(n.cursorDiv),Ui(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,_e(e,400)),n.updateLineNumbers=null,!0}function N(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=$e(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qe(e.display)-Ve(e),n.top)}),t.visible=b(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&M(e,t);r=!1){O(e);var i=p(e);Re(e),y(e,i),E(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new L(e,t);if(M(e,n)){O(e),N(e,n);var r=p(e);Re(e),y(e,r),E(e,r),n.finish()}}function E(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ye(e)+"px"}function O(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o=t.view[r];if(!o.hidden){if(xo&&8>bo){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var l=o.node.getBoundingClientRect();i=l.bottom-l.top}var s=o.line.height-i;if(2>i&&(i=yt(t)),(s>.001||-.001>s)&&(ei(o.line,i),I(o.line),o.rest))for(var c=0;c<o.rest.length;c++)I(o.rest[c])}}}function I(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function P(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function R(e,t,n){function r(t){var n=t.nextSibling;return wo&&Eo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var i=e.display,o=e.options.lineNumbers,a=i.lineDiv,l=a.firstChild,s=i.view,c=i.viewFrom,u=0;u<s.length;u++){var f=s[u];if(f.hidden);else if(f.node&&f.node.parentNode==a){for(;l!=f.node;)l=r(l);var h=o&&null!=t&&c>=t&&f.lineNumber;f.changes&&(Pi(f.changes,"gutter")>-1&&(h=!1),D(e,f,c,n)),h&&(Ui(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(S(e.options,c)))),l=f.node.nextSibling}else{var d=U(e,f,c,n);a.insertBefore(d,l)}c+=f.size}for(;l;)l=r(l)}function D(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?_(e,t):"gutter"==o?z(e,t,n,r):"class"==o?F(t):"widget"==o&&j(e,t,r)}t.changes=null}function H(e){return e.node==e.text&&(e.node=ji("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),xo&&8>bo&&(e.node.style.zIndex=2)),e.node}function W(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=H(e);e.background=n.insertBefore(ji("div",null,t),n.firstChild)}}function B(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Br(e,t)}function _(e,t){var n=t.text.className,r=B(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,F(t)):n&&(t.text.className=n)}function F(e){W(e),e.line.wrapClass?H(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function z(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=H(t);t.gutterBackground=ji("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=H(t),a=t.gutter=ji("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(ji("div",S(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.options.gutters.length;++l){var s=e.options.gutters[l],c=o.hasOwnProperty(s)&&o[s];c&&a.appendChild(ji("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[s]+"px; width: "+r.gutterWidth[s]+"px"))}}}function j(e,t,n){t.alignable&&(t.alignable=null);for(var r,i=t.node.firstChild;i;i=r){var r=i.nextSibling;"CodeMirror-linewidget"==i.className&&t.node.removeChild(i)}q(e,t,n)}function U(e,t,n,r){var i=B(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),F(t),z(e,t,n,r),q(e,t,r),t.node}function q(e,t,n){if(G(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)G(e,t.rest[r],t,n,!1)}function G(e,t,n,r,i){if(t.widgets)for(var o=H(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=ji("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Y(s,c,n,r),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),Ci(s,"redraw")}}function Y(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function $(e){return Bo(e.line,e.ch)}function V(e,t){return _o(e,t)<0?t:e}function K(e,t){return _o(e,t)<0?e:t}function X(e){e.state.focused||(e.display.input.focus(),vn(e))}function Z(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=e.state.pasteIncoming||"paste"==i,l=o.splitLines(t),s=null;if(a&&r.ranges.length>1)if(Fo&&Fo.text.join("\n")==t){if(r.ranges.length%Fo.text.length==0){s=[];for(var c=0;c<Fo.text.length;c++)s.push(o.splitLines(Fo.text[c]))}}else l.length==r.ranges.length&&(s=Ri(l,function(e){return[e]}));for(var c=r.ranges.length-1;c>=0;c--){var u=r.ranges[c],f=u.from(),h=u.to();u.empty()&&(n&&n>0?f=Bo(f.line,f.ch-n):e.state.overwrite&&!a?h=Bo(h.line,Math.min(Zr(o,h.line).text.length,h.ch+Ii(l).length)):Fo&&Fo.lineWise&&Fo.text.join("\n")==t&&(f=h=Bo(f.line,0)));var d=e.curOp.updateInput,p={from:f,to:h,text:s?s[c%s.length]:l,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,p),Ci(e,"inputRead",e,p)}t&&!a&&Q(e,t),Bn(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||At(t,function(){Z(t,n,0,null,"paste")}),!0):void 0}function Q(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Zr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Ci(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:Bo(i,0),head:Bo(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ne(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ei,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function re(){var e=ji("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=ji("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return wo?e.style.width="1000px":e.setAttribute("wrap","off"),No&&(e.style.border="1px solid black"),te(e),t}function ie(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ei,this.gracePeriod=!1}function oe(e,t){var n=Qe(e,t.line);if(!n||n.hidden)return null;var r=Zr(e.doc,t.line),i=Xe(n,r,t.line),o=ii(r),a="left";if(o){var l=co(o,t.ch);a=l%2?"right":"left"}var s=nt(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ae(e,t){return t&&(e.bad=!0),e}function le(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ae(e.clipPos(Bo(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return se(o,t,n)}}function se(e,t,n){function r(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=0>i?c.map:u[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var s=ti(0>i?e.line:e.rest[i]),f=o[a]+r;return(0>r||l!=t)&&(f=o[a+(r?1:0)]),Bo(s,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Va(i,t))return ae(Bo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?Ii(e.rest):e.line;return ae(Bo(ti(a),a.text.length),o)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var c=e.measure,u=c.maps,f=r(l,s,n);if(f)return ae(f,o);for(var h=s.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=r(h,h.firstChild,0))return ae(Bo(f.line,f.ch-d),o);d+=h.textContent.length}for(var p=s.previousSibling,d=n;p;p=p.previousSibling){if(f=r(p,p.firstChild,-1))return ae(Bo(f.line,f.ch+d),o);d+=h.textContent.length}}function ce(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(l+=n);var u,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(Bo(r,0),Bo(i+1,0),o(+f));return void(h.length&&(u=h[0].find())&&(l+=Jr(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)a(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;s&&(l+=c,s=!1),l+=p}}for(var l="",s=!1,c=e.doc.lineSeparator();a(t),t!=n;)t=t.nextSibling;return l}function ue(e,t){this.ranges=e,this.primIndex=t}function fe(e,t){this.anchor=e,this.head=t}function he(e,t){var n=e[t];e.sort(function(e,t){return _o(e.from(),t.from())}),t=Pi(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(_o(o.to(),i.from())>=0){var a=K(o.from(),i.from()),l=V(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(s?l:a,s?a:l))}}return new ue(e,t)}function de(e,t){return new ue([new fe(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.line<e.first)return Bo(e.first,0);var n=e.first+e.size-1;return t.line>n?Bo(n,Zr(e,n).text.length):ge(t,Zr(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Bo(e.line,t):0>n?Bo(e.line,0):e}function ve(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=me(e,t[r]);return n}function xe(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=_o(n,i)<0;o!=_o(r,i)<0?(i=n,n=r):o!=_o(n,r)<0&&(n=r)}return new fe(i,n)}return new fe(r||n,n)}function be(e,t,n,r){Te(e,new ue([xe(e,e.sel.primary(),t,n)],0),r)}function we(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=xe(e,e.sel.ranges[i],t[i],null);var o=he(r,e.sel.primIndex);Te(e,o,n)}function ke(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Te(e,he(i,e.sel.primIndex),r)}function Se(e,t,n,r){Te(e,de(t,n),r)}function Ce(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new fe(me(e,t[n].anchor),me(e,t[n].head))},origin:n&&n.origin};return Pa(e,"beforeSelectionChange",e,r),e.cm&&Pa(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?he(r.ranges,r.ranges.length-1):t}function Le(e,t,n){var r=e.history.done,i=Ii(r);i&&i.ranges?(r[r.length-1]=t,Me(e,t,n)):Te(e,t,n)}function Te(e,t,n){Me(e,t,n),fi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Me(e,t,n){(Ni(e,"beforeSelectionChange")||e.cm&&Ni(e.cm,"beforeSelectionChange"))&&(t=Ce(e,t,n));var r=n&&n.bias||(_o(t.primary().head,e.sel.primary().head)<0?-1:1);Ne(e,Ee(e,t,r,!0)),n&&n.scroll===!1||!e.cm||Bn(e.cm)}function Ne(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Mi(e.cm)),Ci(e,"cursorActivity",e))}function Ae(e){Ne(e,Ee(e,e.sel,null,!1),Wa)}function Ee(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ie(e,a.anchor,l&&l.anchor,n,r),c=Ie(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new fe(s,c))}return i?he(i,t.primIndex):t}function Oe(e,t,n,r,i){var o=Zr(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker;if((null==l.from||(s.inclusiveLeft?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(s.inclusiveRight?l.to>=t.ch:l.to>t.ch))){if(i&&(Pa(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var c,u=s.find(0>r?1:-1);if((0>r?s.inclusiveRight:s.inclusiveLeft)&&(u=Pe(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=_o(u,n))&&(0>r?0>c:c>0))return Oe(e,u,t,r,i)}var f=s.find(0>r?-1:1);return(0>r?s.inclusiveLeft:s.inclusiveRight)&&(f=Pe(e,f,r,f.line==t.line?o:null)),f?Oe(e,f,t,r,i):null}}return t}function Ie(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,Bo(e.first,0))}function Pe(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,Bo(t.line-1)):null:n>0&&t.ch==(r||Zr(e,t.line)).text.length?t.line<e.first+e.size-1?Bo(t.line+1,0):null:new Bo(t.line,t.ch+n)}function Re(e){e.display.input.showSelection(e.display.input.prepareSelection())}function De(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t!==!1||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&He(e,l.head,i),s||We(e,l,o)}}return r}function He(e,t,n){var r=dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(ji("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(ji("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function We(e,t,n){function r(e,t,n,r){0>t&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(ji("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return ht(e,Bo(t,n),"div",f,r)}var l,s,f=Zr(a,t),h=f.text.length;return eo(ii(f),n||0,null==i?h:i,function(e,t,a){var f,d,p,m=o(e,"left");if(e==t)f=m,d=p=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var g=m;m=f,f=g}d=m.left,p=f.right}null==n&&0==e&&(d=c),f.top-m.top>3&&(r(d,m.top,null,m.bottom),d=c,m.bottom<f.top&&r(d,m.bottom,null,f.top)),null==i&&t==h&&(p=u),(!l||m.top<l.top||m.top==l.top&&m.left<l.left)&&(l=m),(!s||f.bottom>s.bottom||f.bottom==s.bottom&&f.right>s.right)&&(s=f),c+1>d&&(d=c),r(d,f.top,p-d,f.bottom)}),{start:l,end:s}}var o=e.display,a=e.doc,l=document.createDocumentFragment(),s=Ge(e.display),c=s.left,u=Math.max(o.sizerWidth,$e(e)-o.sizer.offsetLeft)-s.right,f=t.from(),h=t.to();if(f.line==h.line)i(f.line,f.ch,h.ch);else{var d=Zr(a,f.line),p=Zr(a,h.line),m=yr(d)==yr(p),g=i(f.line,f.ch,m?d.text.length+1:null).end,v=i(h.line,m?0:null,h.ch).start;m&&(g.top<v.top-2?(r(g.right,g.top,null,g.bottom),r(c,v.top,v.left,v.bottom)):r(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&r(c,g.bottom,null,v.top)}n.appendChild(l)}function Be(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function _e(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Bi(Fe,e))}function Fe(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=sa(t.mode,je(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength,s=Rr(e,o,l?sa(t.mode,r):r,!0);o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<a.length;++h)f=a[h]!=o.styles[h];f&&i.push(t.frontier),o.stateAfter=l?r:sa(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&Hr(e,o.text,r),o.stateAfter=t.frontier%5==0?sa(t.mode,r):null;return++t.frontier,+new Date>n?(_e(e,e.options.workDelay),!0):void 0}),i.length&&At(e,function(){for(var t=0;t<i.length;t++)Ht(e,i[t],"text")})}}function ze(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Zr(o,l-1);if(s.stateAfter&&(!n||l<=o.frontier))return l;var c=Fa(s.text,null,e.options.tabSize);(null==i||r>c)&&(i=l-1,r=c)}return i}function je(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=ze(e,t,n),a=o>r.first&&Zr(r,o-1).stateAfter;return a=a?sa(r.mode,a):ca(r.mode),r.iter(o,t,function(n){Hr(e,n.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=l?sa(r.mode,a):null,++o}),n&&(r.frontier=o),a}function Ue(e){return e.lineSpace.offsetTop}function qe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ge(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=qi(e.measure,ji("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Ye(e){return Da-e.display.nativeBarWidth}function $e(e){return e.display.scroller.clientWidth-Ye(e)-e.display.barWidth}function Ve(e){return e.display.scroller.clientHeight-Ye(e)-e.display.barHeight}function Ke(e,t,n){var r=e.options.lineWrapping,i=r&&$e(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Xe(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(ti(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ze(e,t){t=yr(t);var n=ti(t),r=e.display.externalMeasured=new Pt(e.doc,t,n);r.lineN=n;var i=r.built=Br(e,r);return r.text=i.pre,qi(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return tt(e,et(e,t),n,r)}function Qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Bt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function et(e,t){var n=ti(t),r=Qe(e,n);r&&!r.text?r=null:r&&r.changes&&(D(e,r,n,P(e)),e.curOp.forceUpdate=!0),r||(r=Ze(e,t));var i=Xe(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function tt(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ke(e,t.view,t.rect),t.hasHeights=!0),o=rt(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function nt(e,t,n){for(var r,i,o,a,l=0;l<e.length;l+=3){var s=e[l],c=e[l+1];if(s>t?(i=0,o=1,a="left"):c>t?(i=t-s,o=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(o=c-s,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],a="left";if("right"==n&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],a="right";break}}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:c}}function rt(e,t,n,r){var i,o=nt(t.map,n,r),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;4>u;u++){for(;l&&zi(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&zi(t.line.text.charAt(o.coverStart+s));)++s;if(xo&&9>bo&&0==l&&s==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(xo&&e.options.lineWrapping){var f=qa(a,l,s).getClientRects();i=f.length?f["right"==r?f.length-1:0]:qo}else i=qa(a,l,s).getBoundingClientRect()||qo;if(i.left||i.right||0==l)break;s=l,l-=1,c="right"}xo&&11>bo&&(i=it(e.display.measure,i))}else{l>0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(xo&&9>bo&&!l&&(!i||!i.left&&!i.right)){var h=a.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+xt(e.display),top:h.top,bottom:h.bottom}:qo}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,m=(d+p)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:v,bottom:y};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=d,x.rbottom=p),x}function it(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Qi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function at(e){e.display.externalMeasure=null,Ui(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function lt(e){at(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function st(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ct(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Lr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=ri(t);if("local"==r?a+=Ue(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==r?0:ct());var s=l.left+("window"==r?0:st());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function ft(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=st(), +i-=ct();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function ht(e,t,n,r,i){return r||(r=Zr(e.doc,t.line)),ut(e,r,Je(e,r,t.ch,i),n)}function dt(e,t,n,r,i,o){function a(t,a){var l=tt(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,ut(e,r,l,n)}function l(e,t){var n=s[t],r=n.level%2;return e==to(n)&&t&&n.level<s[t-1].level?(n=s[--t],e=no(n)-(n.level%2?0:1),r=!0):e==no(n)&&t<s.length-1&&n.level<s[t+1].level&&(n=s[++t],e=to(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?a(e-1):a(e,r)}r=r||Zr(e.doc,t.line),i||(i=et(e,r));var s=ii(r),c=t.ch;if(!s)return a(c);var u=co(s,c),f=l(c,u);return null!=al&&(f.other=l(c,al)),f}function pt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Zr(e.doc,t.line),i=ri(r)+Ue(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=Bo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function gt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ni(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Zr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Zr(r,i);;){var l=vt(e,a,i,t,n),s=gr(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))return l;i=ti(a=c.to.line)}}function vt(e,t,n,r,i){function o(r){var i=dt(e,Bo(n,r),"line",t,c);return l=!0,a>i.bottom?i.left-s:a<i.top?i.left+s:(l=!1,i.left)}var a=i-ri(t),l=!1,s=2*e.display.wrapper.clientWidth,c=et(e,t),u=ii(t),f=t.text.length,h=ro(t),d=io(t),p=o(h),m=l,g=o(d),v=l;if(r>g)return mt(n,d,v,1);for(;;){if(u?d==h||d==fo(t,h,1):1>=d-h){for(var y=p>r||g-r>=r-p?h:d,x=r-(y==h?p:g);zi(t.text.charAt(y));)++y;var b=mt(n,y,y==h?m:v,-1>x?-1:x>1?1:0);return b}var w=Math.ceil(f/2),k=h+w;if(u){k=h;for(var S=0;w>S;++S)k=fo(t,k,1)}var C=o(k);C>r?(d=k,g=C,(v=l)&&(g+=1e3),f=w):(h=k,p=C,m=l,f-=w)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==zo){zo=ji("pre");for(var t=0;49>t;++t)zo.appendChild(document.createTextNode("x")),zo.appendChild(ji("br"));zo.appendChild(document.createTextNode("x"))}qi(e.measure,zo);var n=zo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ui(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ji("span","xxxxxxxxxx"),n=ji("pre",[t]);qi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yo},Go?Go.ops.push(e.curOp):e.curOp.ownsGroup=Go={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function kt(e){var t=e.curOp,n=t.ownsGroup;if(n)try{wt(n)}finally{Go=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;St(n)}}function St(e){for(var t=e.ops,n=0;n<t.length;n++)Ct(t[n]);for(var n=0;n<t.length;n++)Lt(t[n]);for(var n=0;n<t.length;n++)Tt(t[n]);for(var n=0;n<t.length;n++)Mt(t[n]);for(var n=0;n<t.length;n++)Nt(t[n])}function Ct(e){var t=e.cm,n=t.display;T(t),e.updateMaxLine&&h(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new L(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&M(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&O(t),e.barMeasure=p(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ye(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-$e(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Mt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&on(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Gi()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.updatedDisplay&&E(t,e.barMeasure),e.selectionChanged&&Be(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&X(e.cm)}function Nt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&N(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,w(t)),e.scrollToPos){var i=Rn(t,me(r,e.scrollToPos.from),me(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Pn(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Pa(o[l],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&Pa(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pa(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function At(e,t){if(e.curOp)return t();bt(e);try{return t()}finally{kt(e)}}function Et(e,t){return function(){if(e.curOp)return t.apply(e,arguments);bt(e);try{return t.apply(e,arguments)}finally{kt(e)}}}function Ot(e){return function(){if(this.curOp)return e.apply(this,arguments);bt(this);try{return e.apply(this,arguments)}finally{kt(this)}}}function It(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);bt(t);try{return e.apply(this,arguments)}finally{kt(t)}}}function Pt(e,t,n){this.line=t,this.rest=xr(t),this.size=this.rest?ti(Ii(this.rest))-n+1:1,this.node=this.text=null,this.hidden=kr(e,t)}function Rt(e,t,n){for(var r,i=[],o=t;n>o;o=r){var a=new Pt(e.doc,Zr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function Dt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Wo&&br(e.doc,t)<i.viewTo&&Wt(e);else if(n<=i.viewFrom)Wo&&wr(e.doc,n+r)>i.viewFrom?Wt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Wt(e);else if(t<=i.viewFrom){var o=_t(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Wt(e)}else if(n>=i.viewTo){var o=_t(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Wt(e)}else{var a=_t(e,t,t,-1),l=_t(e,n,n+r,1);a&&l?(i.view=i.view.slice(0,a.index).concat(Rt(e,a.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Wt(e)}var s=i.externalMeasured;s&&(n<s.lineN?s.lineN+=r:t<s.lineN+s.size&&(i.externalMeasured=null))}function Ht(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Bt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Pi(a,n)&&a.push(n)}}}function Wt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Bt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,0>t)return r}function _t(e,t,n,r){var i,o=Bt(e,t),a=e.display.view;if(!Wo||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=0,s=e.display.viewFrom;o>l;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;br(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Rt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rt(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Bt(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Rt(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Bt(e,n)))),r.viewTo=n}function zt(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function jt(e){function t(){i.activeTouch&&(o=setTimeout(function(){i.activeTouch=null},1e3),a=i.activeTouch,a.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function r(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var i=e.display;Ea(i.scroller,"mousedown",Et(e,$t)),xo&&11>bo?Ea(i.scroller,"dblclick",Et(e,function(t){if(!Ti(e,t)){var n=Yt(e,t);if(n&&!Jt(e,t)&&!Gt(e.display,t)){Ma(t);var r=e.findWordAt(n);be(e.doc,r.anchor,r.head)}}})):Ea(i.scroller,"dblclick",function(t){Ti(e,t)||Ma(t)}),Do||Ea(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};Ea(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ea(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ea(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Gt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,l=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(l,l):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(l):new fe(Bo(l.line,0),me(e.doc,Bo(l.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ma(n)}t()}),Ea(i.scroller,"touchcancel",t),Ea(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rn(e,i.scroller.scrollTop),on(e,i.scroller.scrollLeft,!0),Pa(e,"scroll",e))}),Ea(i.scroller,"mousewheel",function(t){an(e,t)}),Ea(i.scroller,"DOMMouseScroll",function(t){an(e,t)}),Ea(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Aa(t)},over:function(t){Ti(e,t)||(tn(e,t),Aa(t))},start:function(t){en(e,t)},drop:Et(e,Qt),leave:function(t){Ti(e,t)||nn(e)}};var l=i.input.getField();Ea(l,"keyup",function(t){pn.call(e,t)}),Ea(l,"keydown",Et(e,hn)),Ea(l,"keypress",Et(e,mn)),Ea(l,"focus",Bi(vn,e)),Ea(l,"blur",Bi(yn,e))}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Ea:Ia;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function qt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Gt(e,t){for(var n=wi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Yt(e,t,n,r){var i=e.display;if(!n&&"true"==wi(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=gt(e,o,a);if(r&&1==c.xRel&&(s=Zr(e.doc,c.line).text).length==c.ch){var u=Fa(s,s.length,e.options.tabSize)-s.length;c=Bo(c.line,Math.max(0,Math.round((o-Ge(e.display).left)/xt(e.display))-u))}return c}function $t(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Gt(n,e))return void(wo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Jt(t,e)){var r=Yt(t,e);switch(window.focus(),ki(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Vt(t,e,r):wi(e)==n.scroller&&Ma(e);break;case 2:wo&&(t.state.lastMiddleDown=+new Date),r&&be(t.doc,r),setTimeout(function(){n.input.focus()},20),Ma(e);break;case 3:Do?xn(t,e):gn(t)}}}}function Vt(e,t,n){xo?setTimeout(Bi(X,e),0):e.curOp.focus=Gi();var r,i=+new Date;Uo&&Uo.time>i-400&&0==_o(Uo.pos,n)?r="triple":jo&&jo.time>i-400&&0==_o(jo.pos,n)?(r="double",Uo={time:i,pos:n}):(r="single",jo={time:i,pos:n});var o,a=e.doc.sel,l=Eo?t.metaKey:t.ctrlKey;e.options.dragDrop&&el&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(_o((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(_o(o.to(),n)>0||n.xRel<0)?Kt(e,t,n,l):Xt(e,t,n,r,l)}function Kt(e,t,n,r){var i=e.display,o=+new Date,a=Et(e,function(l){wo&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ia(document,"mouseup",a),Ia(i.scroller,"drop",a),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Ma(l),!r&&+new Date-200<o&&be(e.doc,n),wo||xo&&9==bo?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});wo&&(i.scroller.draggable=!0),e.state.draggingText=a,i.scroller.dragDrop&&i.scroller.dragDrop(),Ea(document,"mouseup",a),Ea(i.scroller,"drop",a)}function Xt(e,t,n,r,i){function o(t){if(0!=_o(g,t))if(g=t,"rect"==r){for(var i=[],o=e.options.tabSize,a=Fa(Zr(c,n.line).text,n.ch,o),l=Fa(Zr(c,t.line).text,t.ch,o),s=Math.min(a,l),d=Math.max(a,l),p=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=p;p++){var v=Zr(c,p).text,y=za(v,s,o);s==d?i.push(new fe(Bo(p,y),Bo(p,y))):v.length>y&&i.push(new fe(Bo(p,y),Bo(p,za(v,d,o))))}i.length||i.push(new fe(n,n)),Te(c,he(h.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=u,b=x.anchor,w=t;if("single"!=r){if("double"==r)var k=e.findWordAt(t);else var k=new fe(Bo(t.line,0),me(c,Bo(t.line+1,0)));_o(k.anchor,b)>0?(w=k.head,b=K(x.from(),k.anchor)):(w=k.anchor,b=V(x.to(),k.head))}var i=h.ranges.slice(0);i[f]=new fe(me(c,b),w),Te(c,he(i,f),Ba)}}function a(t){var n=++y,i=Yt(e,t,!0,"rect"==r);if(i)if(0!=_o(i,g)){e.curOp.focus=Gi(),o(i);var l=b(s,c);(i.line>=l.to||i.line<l.from)&&setTimeout(Et(e,function(){y==n&&a(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Et(e,function(){y==n&&(s.scroller.scrollTop+=u,a(t))}),50)}}function l(t){e.state.selectingText=!1,y=1/0,Ma(t),s.input.focus(),Ia(document,"mousemove",x),Ia(document,"mouseup",w),c.history.lastSelOrigin=null}var s=e.display,c=e.doc;Ma(t);var u,f,h=c.sel,d=h.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?d[f]:new fe(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),Oo?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new fe(n,n)),n=Yt(e,t,!0,!0),f=-1;else if("double"==r){var p=e.findWordAt(n);u=e.display.shift||c.extend?xe(c,u,p.anchor,p.head):p}else if("triple"==r){var m=new fe(Bo(n.line,0),me(c,Bo(n.line+1,0)));u=e.display.shift||c.extend?xe(c,u,m.anchor,m.head):m}else u=xe(c,u,n);i?-1==f?(f=d.length,Te(c,he(d.concat([u]),f),{scroll:!1,origin:"*mouse"})):d.length>1&&d[f].empty()&&"single"==r&&!t.shiftKey?(Te(c,he(d.slice(0,f).concat(d.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),h=c.sel):ke(c,f,u,Ba):(f=0,Te(c,new ue([u],0),Ba),h=c.sel);var g=n,v=s.wrapper.getBoundingClientRect(),y=0,x=Et(e,function(e){ki(e)?a(e):l(e)}),w=Et(e,l);e.state.selectingText=w,Ea(document,"mousemove",x),Ea(document,"mouseup",w)}function Zt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ma(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!Ni(e,n))return bi(t);o-=l.top-a.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i){var u=ni(e.doc,o),f=e.options.gutters[s];return Pa(e,n,e,u,f,t),bi(t)}}}function Jt(e,t){return Zt(e,t,"gutterClick",!0)}function Qt(e){var t=this;if(nn(t),!Ti(t,e)&&!Gt(t.display,e)){Ma(e),xo&&($o=+new Date);var n=Yt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=Pi(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Et(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=me(t.doc,n);var s={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,s),Le(t.doc,de(n,Qo(s)))}}),l.readAsText(e)}},s=0;i>s;++s)l(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Eo?e.altKey:e.ctrlKey))var c=t.listSelections();if(Me(t.doc,de(n,n)),c)for(var s=0;s<c.length;++s)In(t.doc,"",c[s].anchor,c[s].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function en(e,t){if(xo&&(!e.state.draggingText||+new Date-$o<100))return void Aa(t);if(!Ti(e,t)&&!Gt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Lo)){var n=ji("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Co&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),Co&&n.parentNode.removeChild(n)}}function tn(e,t){var n=Yt(e,t);if(n){var r=document.createDocumentFragment();He(e,n,r),e.display.dragCursor||(e.display.dragCursor=ji("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),qi(e.display.dragCursor,r)}}function nn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function rn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,go||A(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),go&&A(e),_e(e,100))}function on(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,w(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function an(e,t){var n=Xo(t),r=n.x,i=n.y,o=e.display,a=o.scroller,l=a.scrollWidth>a.clientWidth,s=a.scrollHeight>a.clientHeight;if(r&&l||i&&s){if(i&&Eo&&wo)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f<u.length;f++)if(u[f].node==c){e.display.currentWheelTarget=c;break e}if(r&&!go&&!Co&&null!=Ko)return i&&s&&rn(e,Math.max(0,Math.min(a.scrollTop+i*Ko,a.scrollHeight-a.clientHeight))),on(e,Math.max(0,Math.min(a.scrollLeft+r*Ko,a.scrollWidth-a.clientWidth))),(!i||i&&s)&&Ma(t),void(o.wheelStartX=null);if(i&&null!=Ko){var h=i*Ko,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;0>h?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),A(e,{top:d,bottom:p})}20>Vo&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Ko=(Ko*Vo+n)/(Vo+1),++Vo)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function ln(e,t,n){if("string"==typeof t&&(t=ua[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ha}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function sn(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=ha(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&ha(t,e.options.extraKeys,n,e)||ha(t,e.options.keyMap,n,e)}function cn(e,t,n,r){var i=e.state.keySeq;if(i){if(da(t))return"handled";Zo.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var o=sn(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ci(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(Ma(n),Be(e)),i&&!o&&/\'$/.test(t)?(Ma(n),!0):!!o}function un(e,t){var n=pa(t,!0);return n?t.shiftKey&&!e.state.keySeq?cn(e,"Shift-"+n,t,function(t){return ln(e,t,!0)})||cn(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?ln(e,t):void 0}):cn(e,n,t,function(t){return ln(e,t)}):!1}function fn(e,t,n){return cn(e,"'"+n+"'",t,function(t){return ln(e,t,!0)})}function hn(e){var t=this;if(t.curOp.focus=Gi(),!Ti(t,e)){xo&&11>bo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=un(t,e);Co&&(Jo=r?n:null,!r&&88==n&&!rl&&(Eo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||dn(t)}}function dn(e){function t(e){18!=e.keyCode&&e.altKey||(Za(n,"CodeMirror-crosshair"),Ia(document,"keyup",t),Ia(document,"mouseover",t))}var n=e.display.lineDiv;Ja(n,"CodeMirror-crosshair"),Ea(document,"keyup",t),Ea(document,"mouseover",t)}function pn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ti(this,e)}function mn(e){var t=this;if(!(Gt(t.display,e)||Ti(t,e)||e.ctrlKey&&!e.altKey||Eo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Co&&n==Jo)return Jo=null,void Ma(e);if(!Co||e.which&&!(e.which<10)||!un(t,e)){var i=String.fromCharCode(null==r?n:r);fn(t,e,i)||t.display.input.onKeyPress(e)}}}function gn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function vn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Pa(e,"focus",e),e.state.focused=!0,Ja(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Be(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(Pa(e,"blur",e),e.state.focused=!1,Za(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function xn(e,t){Gt(e.display,t)||bn(e,t)||Ti(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function bn(e,t){return Ni(e,"gutterContextMenu")?Zt(e,t,"gutterContextMenu",!1):!1}function wn(e,t){if(_o(e,t.from)<0)return e;if(_o(e,t.to)<=0)return Qo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Qo(t).ch-t.to.ch),Bo(n,r)}function kn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new fe(wn(i.anchor,t),wn(i.head,t)))}return he(n,e.sel.primIndex)}function Sn(e,t,n){return e.line==t.line?Bo(n.line,e.ch-t.ch+n.ch):Bo(n.line+(e.line-t.line),e.ch)}function Cn(e,t,n){for(var r=[],i=Bo(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Sn(l.from,i,o),c=Sn(Qo(l),i,o);if(i=l.to,o=c,"around"==n){var u=e.sel.ranges[a],f=_o(u.head,u.anchor)<0;r[a]=new fe(f?c:s,f?s:c)}else r[a]=new fe(s,s)}return new ue(r,e.sel.primIndex)}function Ln(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=me(e,t)),n&&(this.to=me(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),Pa(e,"beforeChange",e,r),e.cm&&Pa(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Tn(e,t,n){if(e.cm){if(!e.cm.curOp)return Et(e.cm,Tn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"))||(t=Ln(e,t,!0))){var r=Ho&&!n&&sr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Mn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Mn(e,t)}}function Mn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=_o(t.from,t.to)){var n=kn(e,t);ci(e,t,n,e.cm?e.cm.curOp.id:NaN),En(e,t,n,or(e,t));var r=[];Kr(e,function(e,n){n||-1!=Pi(r,e.history)||(xi(e.history,t),r.push(e.history)),En(e,t,null,or(e,t))})}}function Nn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,l="undo"==t?i.undone:i.done,s=0;s<a.length&&(r=a[s],n?!r.ranges||r.equals(e.sel):r.ranges);s++);if(s!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;r=a.pop(),r.ranges;){if(hi(r,l),n&&!r.equals(e.sel))return void Te(e,r,{clearRedo:!1});o=r}var c=[];hi(o,l),l.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=Ni(e,"beforeChange")||e.cm&&Ni(e.cm,"beforeChange"),s=r.changes.length-1;s>=0;--s){var f=r.changes[s];if(f.origin=t,u&&!Ln(e,f,!1))return void(a.length=0);c.push(ai(e,f));var h=s?kn(e,f):Ii(a);En(e,f,h,lr(e,f)),!s&&e.cm&&e.cm.scrollIntoView({from:f.from,to:Qo(f)});var d=[];Kr(e,function(e,t){t||-1!=Pi(d,e.history)||(xi(e.history,f),d.push(e.history)),En(e,f,null,lr(e,f))})}}}}function An(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(Ri(e.sel.ranges,function(e){return new fe(Bo(e.anchor.line+t,e.anchor.ch),Bo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Ht(e.cm,r,"gutter")}}function En(e,t,n,r){if(e.cm&&!e.cm.curOp)return Et(e.cm,En)(e,t,n,r);if(t.to.line<e.first)return void An(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);An(e,i),t={from:Bo(e.first,0),to:Bo(t.to.line+i,t.to.ch),text:[Ii(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Bo(o,Zr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Jr(e,t.from,t.to),n||(n=kn(e,t)),e.cm?On(e.cm,t,r):Yr(e,t,r),Me(e,n,Wa)}}function On(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=ti(yr(Zr(r,a.line))),r.iter(c,l.line+1,function(e){return e==i.maxLine?(s=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Mi(e),Yr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),_e(e,400);var u=t.text.length-(l.line-a.line)-1;t.full?Dt(e):a.line!=l.line||1!=t.text.length||Gr(e.doc,t)?Dt(e,a.line,l.line+1,u):Ht(e,a.line,"text");var h=Ni(e,"changes"),d=Ni(e,"change");if(d||h){var p={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};d&&Ci(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function In(e,t,n,r,i){if(r||(r=n),_o(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function Pn(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Mo){var o=ji("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ue(e.display))+"px; height: "+(t.bottom-t.top+Ye(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Rn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=dt(e,t),l=n&&n!=t?dt(e,n):a,s=Hn(e,Math.min(a.left,l.left),Math.min(a.top,l.top)-r,Math.max(a.left,l.left),Math.max(a.bottom,l.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=s.scrollTop&&(rn(e,s.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=s.scrollLeft&&(on(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function Dn(e,t,n,r,i){var o=Hn(e,t,n,r,i);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function Hn(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var l=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=Ve(e),c={};i-n>s&&(i=n+s);var u=e.doc.height+qe(o),f=a>n,h=i>u-a;if(l>n)c.scrollTop=f?0:n;else if(i>l+s){var d=Math.min(n,(h?u:i)-s);d!=l&&(c.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=$e(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),10>t?c.scrollLeft=0:p>t?c.scrollLeft=Math.max(0,t-(g?0:10)):r>m+p-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Wn(e,t,n){null==t&&null==n||_n(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Bn(e){_n(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Bo(t.line,t.ch-1):t,r=Bo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function _n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pt(e,t.from),r=pt(e,t.to),i=Hn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=je(e,t):n="prev");var a=e.options.tabSize,l=Zr(o,t),s=Fa(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(r||/\S/.test(l.text)){if("smart"==n&&(c=o.mode.indent(i,l.text.slice(u.length),l.text),c==Ha||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Fa(Zr(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/a);d;--d)h+=a,f+=" ";if(c>h&&(f+=Oi(c-h)),f!=u)return In(o,f,Bo(t,0),Bo(t,u.length),"+input"),l.stateAfter=null,!0;for(var d=0;d<o.sel.ranges.length;d++){var p=o.sel.ranges[d];if(p.head.line==t&&p.head.ch<u.length){var h=Bo(t,u.length);ke(o,d,new fe(h,h));break}}}function zn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Zr(e,pe(e,t)):i=ti(t),null==i?null:(r(o,i)&&e.cm&&Ht(e.cm,i,n),o)}function jn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&_o(o.from,Ii(r).to)<=0;){var a=r.pop();if(_o(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}At(e,function(){for(var t=r.length-1;t>=0;t--)In(e.doc,"",r[t].from,r[t].to,"+delete");Bn(e)})}function Un(e,t,n,r,i){function o(){var t=l+n;return t<e.first||t>=e.first+e.size?!1:(l=t,u=Zr(e,t))}function a(e){var t=(i?fo:ho)(u,s,n,!0);if(null==t){if(e||!o())return!1;s=i?(0>n?io:ro)(u):0>n?u.text.length:0}else s=t;return!0}var l=t.line,s=t.ch,c=n,u=Zr(e,l);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>n)||a(!p);p=!1){var m=u.text.charAt(s)||"\n",g=_i(m,d)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),f&&f!=g){0>n&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!p))break}var v=Ie(e,Bo(l,s),t,c,!0);return _o(t,v)||(v.hitSide=!0),v}function qn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(l-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var s=gt(e,a,i);if(!s.outside)break;if(0>n?0>=i:i>=o.height){s.hitSide=!0;break}i+=5*n}return s}function Gn(t,n,r,i){e.defaults[t]=n,r&&(ta[t]=i?function(e,t,n){n!=na&&r(e,t,n)}:r)}function Yn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{ +if(!/^s(hift)$/i.test(l))throw new Error("Unrecognized modifier name: "+l);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function $n(e){return"string"==typeof e?fa[e]:e}function Vn(e,t,n,r,i){if(r&&r.shared)return Kn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Et(e.cm,Vn)(e,t,n,r,i);var o=new va(e,i),a=_o(t,n);if(r&&Wi(r,o,!1),a>0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ji("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vr(e,t.line,t,n,o)||t.line!=n.line&&vr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wo=!0}o.addToHistory&&ci(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&yr(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&ei(e,0),nr(e,new Qn(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s}),o.collapsed&&e.iter(t.line,n.line+1,function(t){kr(e,t)&&ei(t,0)}),o.clearOnEnter&&Ea(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Ho=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ga,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Dt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Ht(c,u,"text");o.atomic&&Ae(c.doc),Ci(c,"markerAdded",c,o)}return o}function Kn(e,t,n,r,i){r=Wi(r),r.shared=!1;var o=[Vn(e,t,n,r,i)],a=o[0],l=r.widgetNode;return Kr(e,function(e){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Vn(e,me(e,t),me(e,n),r,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Ii(o)}),new ya(o,a)}function Xn(e){return e.findMarks(Bo(e.first,0),e.clipPos(Bo(e.lastLine())),function(e){return e.parent})}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(_o(o,a)){var l=Vn(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Jn(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];Kr(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Pi(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Qn(e,t,n){this.marker=e,this.from=t,this.to=n}function er(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function tr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function nr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function rr(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Qn(a,o.from,s?null:o.to))}}return r}function ir(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Qn(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}function or(e,t){if(t.full)return null;var n=ve(e,t.from.line)&&Zr(e,t.from.line).markedSpans,r=ve(e,t.to.line)&&Zr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==_o(t.from,t.to),l=rr(n,i,a),s=ir(r,o,a),c=1==t.text.length,u=Ii(t.text).length+(c?i:0);if(l)for(var f=0;f<l.length;++f){var h=l[f];if(null==h.to){var d=er(s,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null!=h.to&&(h.to+=u),null==h.from){var d=er(l,h.marker);d||(h.from=u,c&&(l||(l=[])).push(h))}else h.from+=u,c&&(l||(l=[])).push(h)}l&&(l=ar(l)),s&&s!=l&&(s=ar(s));var p=[l];if(!c){var m,g=t.text.length-2;if(g>0&&l)for(var f=0;f<l.length;++f)null==l[f].to&&(m||(m=[])).push(new Qn(l[f].marker,null,null));for(var f=0;g>f;++f)p.push(m);p.push(s)}return p}function ar(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function lr(e,t){var n=mi(e,t),r=or(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function sr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Pi(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(_o(c.to,l.from)<0||_o(c.from,l.to)>0)){var u=[s,1],f=_o(c.from,l.from),h=_o(c.to,l.to);(0>f||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-1}}return i}function cr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ur(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function fr(e){return e.inclusiveLeft?-1:0}function hr(e){return e.inclusiveRight?1:0}function dr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=_o(r.from,i.from)||fr(e)-fr(t);if(o)return-o;var a=_o(r.to,i.to)||hr(e)-hr(t);return a?a:t.id-e.id}function pr(e,t){var n,r=Wo&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||dr(n,i.marker)<0)&&(n=i.marker);return n}function mr(e){return pr(e,!0)}function gr(e){return pr(e,!1)}function vr(e,t,n,r,i){var o=Zr(e,t),a=Wo&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=_o(c.from,n)||fr(s.marker)-fr(i),f=_o(c.to,r)||hr(s.marker)-hr(i);if(!(u>=0&&0>=f||0>=u&&f>=0)&&(0>=u&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.to,n)>=0:_o(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?_o(c.from,r)<=0:_o(c.from,r)<0)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=gr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function br(e,t){var n=Zr(e,t),r=yr(n);return n==r?t:ti(r)}function wr(e,t){if(t>e.lastLine())return t;var n,r=Zr(e,t);if(!kr(e,r))return t;for(;n=gr(r);)r=n.find(1,!0).line;return ti(r)+1}function kr(e,t){var n=Wo&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Sr(e,t,r))return!0}}function Sr(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Sr(e,r.line,er(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Sr(e,t,i))return!0}function Cr(e,t,n){ri(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Wn(e,null,n)}function Lr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Va(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),qi(t.display.measure,ji("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Tr(e,t,n,r){var i=new xa(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),zn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!kr(e,t)){var r=ri(t)<e.scrollTop;ei(t,t.height+Lr(i)),r&&Wn(o,null,i.height),o.curOp.forceUpdate=!0}return!0}),i}function Mr(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),cr(e),ur(e,n);var i=r?r(e):1;i!=e.height&&ei(e,i)}function Nr(e){e.parent=null,cr(e)}function Ar(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Er(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var r=e.innerMode(t,n);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Or(t,n,r,i){for(var o=0;10>o;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Ir(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?sa(a.mode,u):u}}var o,a=e.doc,l=a.mode;t=me(a,t);var s,c=Zr(a,t.line),u=je(e,t.line,n),f=new ma(c.text,e.options.tabSize);for(r&&(s=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,o=Or(l,f,u),r&&s.push(i(!0));return r?s:i()}function Pr(e,t,n,r,i,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,f=new ma(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&Ar(Er(n,r),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,a&&Hr(e,t,r,f.pos),f.pos=t.length,s=null):s=Ar(Or(n,f,r,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!l||u!=s){for(;c<f.start;)c=Math.min(f.start,c+5e4),i(c,u);u=s}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e4);i(p,u),c=p}}function Rr(e,t,n,r){var i=[e.state.modeGen],o={};Pr(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},o,r);for(var a=0;a<e.state.overlays.length;++a){var l=e.state.overlays[a],s=1,c=0;Pr(e,t.text,l.mode,!0,function(e,t){for(var n=s;e>c;){var r=i[s];r>e&&i.splice(s,1,e,i[s+1],r),s+=2,c=Math.min(e,r)}if(t)if(l.opaque)i.splice(n,s-n,e,"cm-overlay "+t),s=n+2;else for(;s>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=je(e,ti(t)),i=Rr(e,t,t.text.length>e.options.maxHighlightLength?sa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Hr(e,t,n,r){var i=e.doc.mode,o=new ma(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Er(i,n);!o.eol();)Or(i,o,n),o.start=o.pos}function Wr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?ka:wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Br(e,t){var n=ji("span",null,null,wo?"padding-right: .1px":null),r={pre:ji("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(xo||wo)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,Ji(e.display.measure)&&(o=ii(a))&&(r.addToken=jr(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&ti(a);qr(a,r,Dr(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=$i(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=$i(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Zi(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(wo){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Pa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=$i(r.pre.className,r.textClass||"")),r}function _r(e){var t=ji("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?t.replace(/ {3,}/g,zr):t,s=e.cm.state.specialChars,c=!1;if(s.test(t))for(var u=document.createDocumentFragment(),f=0;;){s.lastIndex=f;var h=s.exec(t),d=h?h.index-f:t.length-f;if(d){var p=document.createTextNode(l.slice(f,f+d));xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+d,p),e.col+=d,e.pos+=d}if(!h)break;if(f+=d+1," "==h[0]){var m=e.cm.options.tabSize,g=m-e.col%m,p=u.appendChild(ji("span",Oi(g),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text"," "),e.col+=g}else if("\r"==h[0]||"\n"==h[0]){var p=u.appendChild(ji("span","\r"==h[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",h[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(h[0]);p.setAttribute("cm-text",h[0]),xo&&9>bo?u.appendChild(ji("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(l);e.map.push(e.pos,e.pos+t.length,u),xo&&9>bo&&(c=!0),e.pos+=t.length}if(n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=ji("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function zr(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function jr(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=0;f<t.length;f++){var h=t[f];if(h.to>c&&h.from<=c)break}if(h.to>=u)return e(n,r,i,o,a,l,s);e(n,r.slice(0,h.to-c),i,o,null,l,s),o=null,r=r.slice(h.to-c),c=h.to}}}function Ur(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function qr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,l,s,c,u,f,h,d=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=u=f=l="",h=null,v=1/0;for(var y,x=[],b=0;b<r.length;++b){var w=r[b],k=w.marker;"bookmark"==k.type&&w.from==p&&k.widgetNode?x.push(k):w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(s+=" "+k.className),k.css&&(l=(l?l+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y||(y=[])).push(k.endStyle,w.to),k.title&&!f&&(f=k.title),k.collapsed&&(!h||dr(h.marker,k)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(var b=0;b<y.length;b+=2)y[b+1]==v&&(c+=" "+y[b]);if(!h||h.from==p)for(var b=0;b<x.length;++b)Ur(t,0,x[b]);if(h&&(h.from||0)==p){if(Ur(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var S=Math.min(d,v);;){if(g){var C=p+g.length;if(!h){var L=C>S?g.slice(0,S-p):g;t.addToken(t,L,a?a+s:s,u,p+L.length==v?c:"",f,l)}if(C>=S){g=g.slice(S-p),p=S;break}p=C,u=""}g=i.slice(o,o=n[m++]),a=Wr(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),Wr(n[m+1],t.cm.options))}function Gr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Ii(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Yr(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){Mr(e,n,i,r),Ci(e,"change",e,t)}function a(e,t){for(var n=e,o=[];t>n;++n)o.push(new ba(c[n],i(n),r));return o}var l=t.from,s=t.to,c=t.text,u=Zr(e,l.line),f=Zr(e,s.line),h=Ii(c),d=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Gr(e,t)){var m=a(0,c.length-1);o(f,f.text,d),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,l.ch)+h+u.text.slice(s.ch),d);else{var m=a(1,c.length-1);m.push(new ba(h+u.text.slice(s.ch),d,r)),o(u,u.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+f.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(u,u.text.slice(0,l.ch)+c[0],i(0)),o(f,h+f.text.slice(s.ch),d);var m=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,m)}Ci(e,"change",e,t)}function $r(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Vr(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function Kr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),r(l.doc,e,s))}}}r(e,null,!0)}function Xr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,a(e),n(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,Dt(e)}function Zr(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(o>t){n=i;break}t-=o}return n.lines[t]}function Jr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Qr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ei(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ti(e){if(null==e.parent)return null;for(var t=e.parent,n=Pi(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function ni(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(o>t){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var a=e.lines[r],l=a.height;if(l>t)break;t-=l}return n+r}function ri(e){e=yr(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var r=0;r<o.children.length;++r){var a=o.children[r];if(a==n)break;t+=a.height}return t}function ii(e){var t=e.order;return null==t&&(t=e.order=ll(e.text)),t}function oi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ai(e,t){var n={from:$(t.from),to:Qo(t),text:Jr(e,t.from,t.to)};return di(e,n,t.from.line,t.to.line+1),Kr(e,function(e){di(e,n,t.from.line,t.to.line+1)},!0),n}function li(e){for(;e.length;){var t=Ii(e);if(!t.ranges)break;e.pop()}}function si(e,t){return t?(li(e.done),Ii(e.done)):e.done.length&&!Ii(e.done).ranges?Ii(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ii(e.done)):void 0}function ci(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=si(i,i.lastOp==r))){var l=Ii(o.changes);0==_o(t.from,t.to)&&0==_o(t.from,l.to)?l.to=Qo(t):o.changes.push(ai(e,t))}else{var s=Ii(i.done);for(s&&s.ranges||hi(e.sel,i.done),o={changes:[ai(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Pa(e,"historyAdded")}function ui(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ui(e,o,Ii(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&li(i.undone)}function hi(e,t){var n=Ii(t);n&&n.ranges&&n.equals(e)||t.push(e)}function di(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function pi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function mi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(pi(n[r]));return i}function gi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?ue.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c,u=a[s];if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&Pi(t,Number(c[1]))>-1&&(Ii(l)[f]=u[f],delete u[f])}}}return i}function vi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function yi(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)vi(o.ranges[l].anchor,t,n,r),vi(o.ranges[l].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var s=o.changes[l];if(n<s.from.line)s.from=Bo(s.from.line+r,s.from.ch),s.to=Bo(s.to.line+r,s.to.ch);else if(t<=s.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;yi(e.done,n,r,i),yi(e.undone,n,r,i)}function bi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function wi(e){return e.target||e.srcElement}function ki(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Eo&&e.ctrlKey&&1==t&&(t=3),t}function Si(e,t,n){var r=e._handlers&&e._handlers[t];return n?r&&r.length>0?r.slice():Oa:r||Oa}function Ci(e,t){function n(e){return function(){e.apply(null,o)}}var r=Si(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Go?i=Go.delayedCallbacks:Ra?i=Ra:(i=Ra=[],setTimeout(Li,0));for(var a=0;a<r.length;++a)i.push(n(r[a]))}}function Li(){var e=Ra;Ra=null;for(var t=0;t<e.length;++t)e[t]()}function Ti(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pa(e,n||t.type,e,t),bi(t)||t.codemirrorIgnore}function Mi(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Pi(n,t[r])&&n.push(t[r])}function Ni(e,t){return Si(e,t).length>0}function Ai(e){e.prototype.on=function(e,t){Ea(this,e,t)},e.prototype.off=function(e,t){Ia(this,e,t)}}function Ei(){this.id=null}function Oi(e){for(;ja.length<=e;)ja.push(Ii(ja)+" ");return ja[e]}function Ii(e){return e[e.length-1]}function Pi(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Ri(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Di(){}function Hi(e,t){var n;return Object.create?n=Object.create(e):(Di.prototype=e,n=new Di),t&&Wi(t,n),n}function Wi(e,t,n){t||(t={});for(var r in e)!e.hasOwnProperty(r)||n===!1&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Bi(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function _i(e,t){return t?t.source.indexOf("\\w")>-1&&Ya(e)?!0:t.test(e):Ya(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function zi(e){return e.charCodeAt(0)>=768&&$a.test(e)}function ji(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Ui(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function qi(e,t){return Ui(e).appendChild(t)}function Gi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Yi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function $i(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Yi(n[r]).test(t)&&(t+=" "+n[r]);return t}function Vi(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Ki(){Qa||(Xi(),Qa=!0)}function Xi(){var e;Ea(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Vi(qt)},100))}),Ea(window,"blur",function(){Vi(yn)})}function Zi(e){if(null==Ka){var t=ji("span","​");qi(e,ji("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ka=t.offsetWidth<=1&&t.offsetHeight>2&&!(xo&&8>bo))}var n=Ka?ji("span","​"):ji("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ji(e){if(null!=Xa)return Xa;var t=qi(e,document.createTextNode("AخA")),n=qa(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=qa(t,1,2).getBoundingClientRect();return Xa=r.right-n.right<3}function Qi(e){if(null!=il)return il;var t=qi(e,ji("span","x")),n=t.getBoundingClientRect(),r=qa(t,0,1).getBoundingClientRect();return il=Math.abs(n.left-r.left)>1}function eo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function ro(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?no(Ii(t)):e.text.length}function oo(e,t){var n=Zr(e.doc,t),r=yr(n);r!=n&&(t=ti(r));var i=ii(r),o=i?i[0].level%2?io(r):ro(r):0;return Bo(t,o)}function ao(e,t){for(var n,r=Zr(e.doc,t);n=gr(r);)r=n.find(1,!0).line,t=null;var i=ii(r),o=i?i[0].level%2?ro(r):io(r):r.text.length;return Bo(null==t?ti(r):t,o)}function lo(e,t){var n=oo(e,t.line),r=Zr(e.doc,n.line),i=ii(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Bo(n.line,a?0:o)}return n}function so(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function co(e,t){al=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return so(e,i.level,e[n].level)?(i.from!=i.to&&(al=n),r):(i.from!=i.to&&(al=r),n);n=r}}return n}function uo(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&zi(e.text.charAt(t)));return t}function fo(e,t,n,r){var i=ii(e);if(!i)return ho(e,t,n,r);for(var o=co(i,t),a=i[o],l=uo(e,t,a.level%2?-n:n,r);;){if(l>a.from&&l<a.to)return l;if(l==a.from||l==a.to)return co(i,l)==o?l:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;l=n>0==a.level%2?uo(e,a.to,-1,r):uo(e,a.from,1,r)}}function ho(e,t,n,r){var i=t+n;if(r)for(;i>0&&zi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var po=navigator.userAgent,mo=navigator.platform,go=/gecko\/\d/i.test(po),vo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),xo=vo||yo,bo=xo&&(vo?document.documentMode||6:yo[1]),wo=/WebKit\//.test(po),ko=wo&&/Qt\/\d+\.\d+/.test(po),So=/Chrome\//.test(po),Co=/Opera\//.test(po),Lo=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Mo=/PhantomJS/.test(po),No=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Ao=No||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Eo=No||/Mac/.test(mo),Oo=/\bCrOS\b/.test(po),Io=/win/i.test(mo),Po=Co&&po.match(/Version\/(\d*\.\d*)/);Po&&(Po=Number(Po[1])),Po&&Po>=15&&(Co=!1,wo=!0);var Ro=Eo&&(ko||Co&&(null==Po||12.11>Po)),Do=go||xo&&bo>=9,Ho=!1,Wo=!1;m.prototype=Wi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Eo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ei,this.disableVert=new Ei},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Wi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},L.prototype.signal=function(e,t){Ni(e,t)&&this.events.push(arguments)},L.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pa.apply(null,this.events[e])};var Bo=e.Pos=function(e,t){return this instanceof Bo?(this.line=e,void(this.ch=t)):new Bo(e,t)},_o=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Fo=null;ne.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=Fo.text.join("\n"),Ua(o));else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type?r.setSelections(t.ranges,null,Wa):(n.prevInput="",o.value=t.text.join("\n"),Ua(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}var n=this,r=this.cm,i=this.wrapper=re(),o=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),No&&(o.style.width="0px"),Ea(o,"input",function(){xo&&bo>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Ea(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Ea(o,"cut",t),Ea(o,"copy",t),Ea(e.scroller,"paste",function(t){Gt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Ea(e.lineSpace,"selectstart",function(t){Gt(e,t)||Ma(t)}),Ea(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ea(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var i=dt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;qi(n.cursorDiv,e.cursors),qi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=rl&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&Ua(this.textarea),xo&&bo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",xo&&bo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Ao||Gi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0; +},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||nl(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&bo>=9&&this.hasSelection===r||Eo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=this;return At(e,function(){Z(e,r.slice(o),n.length-o,null,l.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=l.prevInput="":l.prevInput=r,l.composing&&(l.composing.range.clear(),l.composing.range=e.markText(l.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&bo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,xo&&9>bo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=a.selectionStart){(!xo||xo&&9>bo)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Et(i,ua.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,l=Yt(i,e),s=o.scroller.scrollTop;if(l&&!Co){var c=i.options.resetSelectionOnContextMenu;c&&-1==i.doc.sel.contains(l)&&Et(i,Te)(i.doc,de(l),Wa);var u=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var h=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",wo)var d=window.scrollY;if(o.input.focus(),wo&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&bo>=9&&t(),Do){Aa(e);var p=function(){Ia(window,"mouseup",p),setTimeout(n,20)};Ea(window,"mouseup",p)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Di,needsContentAttribute:!1},ne.prototype),ie.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fo={lineWise:!0,text:t.text},"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Wa),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!No)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Fo.text.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Fo.text.join("\n");var o=document.activeElement;Ua(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;te(i),Ea(i,"paste",function(e){Ti(r,e)||J(e,r)}),Ea(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=de(Bo(i.head.line,a),Bo(i.head.line,a+t.length)))}}),Ea(i,"compositionupdate",function(e){n.composing.data=e.data}),Ea(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Ea(i,"touchstart",function(){n.forceCompositionEnd()}),Ea(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||At(n.cm,function(){Dt(r)})}),Ea(i,"copy",t),Ea(i,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=_o(K(n,r),t.from())||0!=_o(V(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var s=a[a.length-1].measure,c=s.maps?s.maps[s.maps.length-1]:s.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=qa(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(!go&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),l&&null==e.anchorNode?e.addRange(l):go&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){qi(this.cm.display.cursorDiv,e.cursors),qi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Va(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():At(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&At(t,function(){Te(t.doc,de(n,r),Wa),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Bt(e,r.line)))var a=ti(t.view[0].line),l=t.view[0].node;else var a=ti(t.view[o].line),l=t.view[o-1].node.nextSibling;var s=Bt(e,i.line);if(s==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ti(t.view[s+1].line)-1,u=t.view[s+1].node.previousSibling;for(var f=e.doc.splitLines(ce(e,l,u,a,c)),h=Jr(e.doc,Bo(a,0),Bo(c,Zr(e.doc,c).text.length));f.length>1&&h.length>1;)if(Ii(f)==Ii(h))f.pop(),h.pop(),c--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),a++}for(var d=0,p=0,m=f[0],g=h[0],v=Math.min(m.length,g.length);v>d&&m.charCodeAt(d)==g.charCodeAt(d);)++d;for(var y=Ii(f),x=Ii(h),b=Math.min(y.length-(1==f.length?d:0),x.length-(1==h.length?d:0));b>p&&y.charCodeAt(y.length-p-1)==x.charCodeAt(x.length-p-1);)++p;f[f.length-1]=y.slice(0,y.length-p),f[0]=f[0].slice(d);var w=Bo(a,d),k=Bo(c,h.length?Ii(h).length-p:0);return f.length>1||f[0]||_o(w,k)?(In(e.doc,f,w,k,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Et(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Et(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Et(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Di,resetPosition:Di,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=_o(n.anchor,r.anchor)||0!=_o(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new fe($(this.ranges[t].anchor),$(this.ranges[t].head));return new ue(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(_o(t,r.from())>=0&&_o(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return V(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var zo,jo,Uo,qo={left:0,right:0,top:0,bottom:0},Go=null,Yo=0,$o=0,Vo=0,Ko=null;xo?Ko=-.53:go?Ko=15:So?Ko=-.7:Lo&&(Ko=-1/3);var Xo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Xo(e);return t.x*=Ko,t.y*=Ko,t};var Zo=new Ei,Jo=null,Qo=e.changeEnd=function(e){return e.text?Bo(e.from.line+e.text.length-1,Ii(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ta.hasOwnProperty(e)&&Et(this,ta[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($n(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ot(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,Dt(this)}),removeOverlay:Ot(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Dt(this)}}),indentLine:Ot(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ve(this.doc,e)&&Fn(this,e,t,n)}),indentSelection:Ot(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Bn(this));else{var o=i.from(),a=i.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;n>s;++s)Fn(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&ke(this.doc,r,new fe(o,c[r].to()),Wa)}}}),getTokenAt:function(e,t){return Ir(this,e,t)},getLineTokens:function(e,t){return Ir(this,Bo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Zr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var l=t?t.indexOf("cm-overlay "):-1;return 0>l?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!la.hasOwnProperty(t))return n;var r=la[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var a=r[i[t][o]];a&&n.push(a)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var o=0;o<r._global.length;o++){var l=r._global[o];l.pred(i,this)&&-1==Pi(n,l.val)&&n.push(l.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=pe(n,null==e?n.first+n.size-1:e),je(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?me(this.doc,e):e?r.from():r.to(),dt(this,n,t||"page")},charCoords:function(e,t){return ht(this,me(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ft(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ft(this,{top:e,left:0},t||"page").top,ni(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Zr(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ri(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:Ot(function(e,t,n){return zn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Ht(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Zr(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=dt(this,me(this.doc,e));var a=e.bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&Dn(this,l,a,l+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(hn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:pn,execCommand:function(e){return ua.hasOwnProperty(e)?ua[e].call(null,this):void 0},triggerElectric:Ot(function(e){Q(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=me(this.doc,e);t>o&&(a=Un(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Un(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},_a)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):jn(this,function(n){var i=Un(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,l=me(this.doc,e);t>a;++a){var s=dt(this,l,"div");if(null==o?o=s.left:s.left=o,l=qn(this,s,i,n),l.hitSide)break}return l},moveV:Ot(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var l=dt(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=qn(n,l,e,t);return"page"==t&&a==r.sel.primary()&&Wn(n,null,ht(n,s,"div").top-l.top),s},_a),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]}),findWordAt:function(e){var t=this.doc,n=Zr(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;for(var a=n.charAt(r),l=_i(a,o)?function(e){return _i(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!_i(e)};r>0&&l(n.charAt(r-1));)--r;for(;i<n.length&&l(n.charAt(i));)++i}return new fe(Bo(e.line,r),Bo(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ja(this.display.cursorDiv,"CodeMirror-overwrite"):Za(this.display.cursorDiv,"CodeMirror-overwrite"),Pa(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Gi()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ot(function(e,t){null==e&&null==t||_n(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ye(this)-this.display.barHeight,width:e.scrollWidth-Ye(this)-this.display.barWidth,clientHeight:Ve(this),clientWidth:$e(this)}},scrollIntoView:Ot(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Bo(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)_n(this),this.curOp.scrollToPos=e;else{var n=Hn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:Ot(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&at(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Ht(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,Pa(r,"refresh",this)}),operation:function(e){return At(this,e)},refresh:Ot(function(){var e=this.display.cachedTextHeight;Dt(this),this.curOp.forceUpdate=!0,lt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-yt(this.display))>.5)&&a(this),Pa(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Xr(this,e),lt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ci(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ai(e);var ea=e.defaults={},ta=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Gn("value","",function(e,t){e.setValue(t)},!0),Gn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Gn("indentUnit",2,n,!0),Gn("indentWithTabs",!1),Gn("smartIndent",!0),Gn("tabSize",4,function(e){r(e),lt(e),Dt(e)},!0),Gn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Bo(r,o))}r++});for(var i=n.length-1;i>=0;i--)In(e.doc,t,n[i],Bo(n[i].line,n[i].ch+t.length))}}),Gn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Gn("specialCharPlaceholder",_r,function(e){e.refresh()},!0),Gn("electricChars",!0),Gn("inputStyle",Ao?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Gn("rtlMoveVisually",!Io),Gn("wholeLineUpdateBefore",!0),Gn("theme","default",function(e){l(e),s(e)},!0),Gn("keyMap","default",function(t,n,r){var i=$n(n),o=r!=e.Init&&$n(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Gn("extraKeys",null),Gn("lineWrapping",!1,i,!0),Gn("gutters",[],function(e){d(e.options),s(e)},!0),Gn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Gn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Gn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Gn("lineNumbers",!1,function(e){d(e.options),s(e)},!0),Gn("firstLineNumber",1,s,!0),Gn("lineNumberFormatter",function(e){return e},s,!0),Gn("showCursorWhenSelecting",!1,Re,!0),Gn("resetSelectionOnContextMenu",!0),Gn("lineWiseCopyCut",!0),Gn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Gn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Gn("dragDrop",!0,Ut),Gn("allowDropFileTypes",null),Gn("cursorBlinkRate",530),Gn("cursorScrollMargin",0),Gn("cursorHeight",1,Re,!0),Gn("singleCursorHeightPerLine",!0,Re,!0),Gn("workTime",100),Gn("workDelay",100),Gn("flattenSpans",!0,r,!0),Gn("addModeClass",!1,r,!0),Gn("pollInterval",100),Gn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Gn("historyEventDelay",1250),Gn("viewportMargin",10,function(e){e.refresh()},!0),Gn("maxHighlightLength",1e4,r,!0),Gn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Gn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Gn("autofocus",null);var ra=e.modes={},ia=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),ra[t]=n},e.defineMIME=function(e,t){ia[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ia.hasOwnProperty(t))t=ia[t];else if(t&&"string"==typeof t.name&&ia.hasOwnProperty(t.name)){var n=ia[t.name];"string"==typeof n&&(n={name:n}),t=Hi(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=ra[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(oa.hasOwnProperty(n.name)){var o=oa[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var oa=e.modeExtensions={};e.extendMode=function(e,t){var n=oa.hasOwnProperty(e)?oa[e]:oa[e]={};Wi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Ca.prototype[e]=t},e.defineOption=Gn;var aa=[];e.defineInitHook=function(e){aa.push(e)};var la=e.helpers={};e.registerHelper=function(t,n,r){la.hasOwnProperty(t)||(la[t]=e[t]={_global:[]}),la[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),la[t]._global.push({pred:r,val:i})};var sa=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},ca=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ua=e.commands={selectAll:function(e){e.setSelection(Bo(e.firstLine(),0),Bo(e.lastLine()),Wa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Wa)},killLine:function(e){jn(e,function(t){if(t.empty()){var n=Zr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Bo(t.head.line+1,0)}:{from:t.head,to:Bo(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){jn(e,function(t){return{from:Bo(t.from().line,0),to:me(e.doc,Bo(t.to().line+1,0))}})},delLineLeft:function(e){jn(e,function(e){return{from:Bo(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){jn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Bo(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Bo(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return lo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return ao(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},_a)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},_a)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?lo(e,t.head):r},_a)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Fa(e.getLine(o.line),o.ch,r);t.push(Oi(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){At(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Zr(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new Bo(i.line,i.ch-1)),i.ch>0)i=new Bo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Bo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Zr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Bo(i.line-1,a.length-1),Bo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){At(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Bn(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},fa=e.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fa["default"]=Eo?fa.macDefault:fa.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Ri(n.split(" "),Yn),o=0;o<i.length;o++){var a,l;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e};var ha=e.lookupKey=function(e,t,n,r){t=$n(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return ha(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=ha(e,t.fallthrough[o],n,r); +if(a)return a}}},da=e.isModifierKey=function(e){var t="string"==typeof e?e:ol[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},pa=e.keyName=function(e,t){if(Co&&34==e.keyCode&&e["char"])return!1;var n=ol[e.keyCode],r=n;return null==r||e.altGraphKey?!1:(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(Ro?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(Ro?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};e.fromTextArea=function(t,n){function r(){t.value=c.getValue()}if(n=n?Wi(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var i=Gi();n.autofocus=i==t||null!=t.getAttribute("autofocus")&&i==document.body}if(t.form&&(Ea(t.form,"submit",r),!n.leaveSubmitMethodAlone)){var o=t.form,a=o.submit;try{var l=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=l}}catch(s){}}n.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(Ia(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=a))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ma=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ma.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Fa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Fa(this.string,null,this.tabSize)-(this.lineStart?Fa(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ga=0,va=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ga};Ai(va),va.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&bt(e),Ni(this,"clear")){var n=this.find();n&&Ci(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=er(a.markedSpans,this);e&&!this.collapsed?Ht(e,ti(a),"text"):e&&(null!=l.to&&(i=ti(a)),null!=l.from&&(r=ti(a))),a.markedSpans=tr(a.markedSpans,l),null==l.from&&this.collapsed&&!kr(this.doc,a)&&e&&ei(a,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var s=yr(this.lines[o]),c=f(s);c>e.display.maxLineLength&&(e.display.maxLine=s,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&Ci(e,"markerCleared",e,this),t&&kt(e),this.parent&&this.parent.clear()}},va.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=er(o.markedSpans,this);if(null!=a.from&&(n=Bo(t?o:ti(o),a.from),-1==e))return n;if(null!=a.to&&(r=Bo(t?o:ti(o),a.to),1==e))return r}return n&&{from:n,to:r}},va.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&At(n,function(){var r=e.line,i=ti(e.line),o=Qe(n,i);if(o&&(ot(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!kr(t.doc,r)&&null!=t.height){var a=t.height;t.height=null;var l=Lr(t)-a;l&&ei(r,r.height+l)}})},va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Pi(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},va.prototype.detachLine=function(e){if(this.lines.splice(Pi(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var ga=0,ya=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Ai(ya),ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ci(this,"clear")}},ya.prototype.find=function(e,t){return this.primary.find(e,t)};var xa=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Ai(xa),xa.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ti(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Lr(this);ei(n,Math.max(0,n.height-o)),e&&At(e,function(){Cr(e,n,-o),Ht(e,r,"widget")})}},xa.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Lr(this)-e;r&&(ei(n,n.height+r),t&&At(t,function(){t.curOp.forceUpdate=!0,Cr(t,n,r)}))};var ba=e.Line=function(e,t,n){this.text=e,ur(this,t),this.height=n?n(this):1};Ai(ba),ba.prototype.lineNo=function(){return ti(this)};var wa={},ka={};$r.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;r>n;++n){var i=this.lines[n];this.height-=i.height,Nr(i),Ci(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},Vr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof $r))){var l=[];this.collapse(l),this.children=[new $r(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new $r(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Vr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Pi(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Vr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(o>e){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var Sa=0,Ca=e.Doc=function(e,t,n,r){if(!(this instanceof Ca))return new Ca(e,t,n,r);null==n&&(n=0),Vr.call(this,[new $r([new ba("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=Bo(n,0);this.sel=de(i),this.history=new oi(null),this.id=++Sa,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Yr(this,{from:i,to:i,text:e}),Te(this,de(i),Wa)};Ca.prototype=Hi(Vr.prototype,{constructor:Ca,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:It(function(e){var t=Bo(this.first,0),n=this.first+this.size-1;Tn(this,{from:t,to:Bo(n,Zr(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Te(this,de(t))}),replaceRange:function(e,t,n,r){t=me(this,t),n=n?me(this,n):t,In(this,e,t,n,r)},getRange:function(e,t,n){var r=Jr(this,me(this,e),me(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ve(this,e)?Zr(this,e):void 0},getLineNumber:function(e){return ti(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Zr(this,e)),yr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return me(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:It(function(e,t,n){Se(this,me(this,"number"==typeof e?Bo(e,t||0):e),null,n)}),setSelection:It(function(e,t,n){Se(this,me(this,e),me(this,t||e),n)}),extendSelection:It(function(e,t,n){be(this,me(this,e),t&&me(this,t),n)}),extendSelections:It(function(e,t){we(this,ye(this,e),t)}),extendSelectionsBy:It(function(e,t){var n=Ri(this.sel.ranges,e);we(this,ye(this,n),t)}),setSelections:It(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new fe(me(this,e[r].anchor),me(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,he(i,t),n)}}),addSelection:It(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new fe(me(this,e),me(this,t||e))),Te(this,he(r,r.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Jr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:It(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&Cn(this,r,t),o=r.length-1;o>=0;o--)Tn(this,r[o]);l?Le(this,l):this.cm&&Bn(this.cm)}),undo:It(function(){Nn(this,"undo")}),redo:It(function(){Nn(this,"redo")}),undoSelection:It(function(){Nn(this,"undo",!0)}),redoSelection:It(function(){Nn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new oi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:gi(this.history.done),undone:gi(this.history.undone)}},setHistory:function(e){var t=this.history=new oi(this.history.maxGeneration);t.done=gi(e.done.slice(0),null,!0),t.undone=gi(e.undone.slice(0),null,!0)},addLineClass:It(function(e,t,n){return zn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(Yi(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:It(function(e,t,n){return zn(this,e,"gutter"==t?"gutter":"class",function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(Yi(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:It(function(e,t,n){return Tr(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vn(this,me(this,e),me(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=me(this,e),Vn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=me(this,e);var t=[],n=Zr(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||n&&!n(s.marker)||r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;return o>e?(t=e,!0):(e-=o,void++n)}),me(this,Bo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Ca(Qr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ca(Qr(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Zn(r,Xn(this)),r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Jn(Xn(this));break}}if(t.history==this.history){var i=[t.id];Kr(t,function(e){i.push(e.id)},!0),t.history=new oi(null),t.history.done=gi(this.history.done,i),t.history.undone=gi(this.history.undone,i)}},iterLinkedDocs:function(e){Kr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):tl(e)},lineSeparator:function(){return this.lineSep||"\n"}}),Ca.prototype.eachLine=Ca.prototype.iter;var La="iter insert remove copy getEditor constructor".split(" ");for(var Ta in Ca.prototype)Ca.prototype.hasOwnProperty(Ta)&&Pi(La,Ta)<0&&(e.prototype[Ta]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ca.prototype[Ta]));Ai(Ca);var Ma=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Na=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Aa=e.e_stop=function(e){Ma(e),Na(e)},Ea=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Oa=[],Ia=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var r=Si(e,t,!1),i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}},Pa=e.signal=function(e,t){var n=Si(e,t,!0);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Ra=null,Da=30,Ha=e.Pass={toString:function(){return"CodeMirror.Pass"}},Wa={scroll:!1},Ba={origin:"*mouse"},_a={origin:"+move"};Ei.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Fa=e.countColumn=function(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(0>l||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}},za=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},ja=[""],Ua=function(e){e.select()};No?Ua=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&(Ua=function(e){try{e.select()}catch(t){}});var qa,Ga=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ya=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ga.test(e))},$a=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;qa=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Va=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&11>bo&&(Gi=function(){try{return document.activeElement}catch(e){return document.body}});var Ka,Xa,Za=e.rmClass=function(e,t){var n=e.className,r=Yi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},Ja=e.addClass=function(e,t){var n=e.className;Yi(t).test(n)||(e.className+=(n?" ":"")+t)},Qa=!1,el=function(){if(xo&&9>bo)return!1;var e=ji("div");return"draggable"in e||"dragDrop"in e}(),tl=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},nl=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rl=function(){var e=ji("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),il=null,ol=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)ol[e+48]=ol[e+96]=String(e);for(var e=65;90>=e;e++)ol[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)ol[e+111]=ol[e+63235]="F"+e}();var al,ll=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],h=0;u>h;++h)f.push(r=e(n.charCodeAt(h)));for(var h=0,d=c;u>h;++h){var r=f[h];"m"==r?f[h]=d:d=r}for(var h=0,p=c;u>h;++h){var r=f[h];"1"==r&&"r"==p?f[h]="n":a.test(r)&&(p=r,"r"==r&&(f[h]="R"))}for(var h=1,d=f[0];u-1>h;++h){var r=f[h];"+"==r&&"1"==d&&"1"==f[h+1]?f[h]="1":","!=r||d!=f[h+1]||"1"!=d&&"n"!=d||(f[h]=d),d=r}for(var h=0;u>h;++h){var r=f[h];if(","==r)f[h]="N";else if("%"==r){for(var m=h+1;u>m&&"%"==f[m];++m);for(var g=h&&"!"==f[h-1]||u>m&&"1"==f[m]?"1":"N",v=h;m>v;++v)f[v]=g;h=m-1}}for(var h=0,p=c;u>h;++h){var r=f[h];"L"==p&&"1"==r?f[h]="L":a.test(r)&&(p=r)}for(var h=0;u>h;++h)if(o.test(f[h])){for(var m=h+1;u>m&&o.test(f[m]);++m);for(var y="L"==(h?f[h-1]:c),x="L"==(u>m?f[m]:c),g=y||x?"L":"R",v=h;m>v;++v)f[v]=g;h=m-1}for(var b,w=[],h=0;u>h;)if(l.test(f[h])){var k=h;for(++h;u>h&&l.test(f[h]);++h);w.push(new t(0,k,h))}else{var S=h,C=w.length;for(++h;u>h&&"L"!=f[h];++h);for(var v=S;h>v;)if(s.test(f[v])){v>S&&w.splice(C,0,new t(1,S,v));var L=v;for(++v;h>v&&s.test(f[v]);++v);w.splice(C,0,new t(2,L,v)),S=v}else++v;h>S&&w.splice(C,0,new t(1,S,h))}return 1==w[0].level&&(b=n.match(/^\s+/))&&(w[0].from=b[0].length,w.unshift(new t(0,0,b[0].length))),1==Ii(w).level&&(b=n.match(/\s+$/))&&(Ii(w).to-=b[0].length,w.push(new t(0,u-b[0].length,u))),2==w[0].level&&w.unshift(new t(1,w[0].to,w[0].to)),w[0].level!=Ii(w).level&&w.push(new t(w[0].level,u,u)),w}}();return e.version="5.15.2",e})},{}],11:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],i):i(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},l={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var s in r)l[s]=r[s];return l.name="markdown",e.overlayMode(e.getMode(n,l),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../xml/xml","../meta"],i):i(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function l(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,k&&e.f==c&&(e.f=p,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function s(t,o){var l=t.sol(),s=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,s&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var f=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,S.code):null;if(t.eatSpace())return null;if((f=t.match(A))&&f[1].length<=6)return o.header=f[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(!(a(o.prevLine)||o.quote||s||c)&&(f=t.match(E)))return o.header="="==f[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(t.eat(">"))return o.quote=l?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),h(o);if("["===t.peek())return i(t,o,y);if(t.match(L,!0))return o.hr=!0,S.hr;if((a(o.prevLine)||s)&&(t.match(T,!1)||t.match(M,!1))){var d=null;for(t.match(T,!0)?d="ul":(t.match(M,!0),d="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()<o.listStack[o.listStack.length-1];)o.listStack.pop();return o.listStack.push(o.indentation),n.taskLists&&t.match(N,!1)&&(o.taskList=!0),o.f=o.inline,n.highlightFormatting&&(o.formatting=["list","list-"+d]),h(o)}return n.fencedCodeBlocks&&(f=t.match(I,!0))?(o.fencedChars=f[1],o.localMode=r(f[2]),o.localMode&&(o.localState=e.startState(o.localMode)),o.f=o.block=u,n.highlightFormatting&&(o.formatting="code-block"),o.code=-1,h(o)):i(t,o,o.inline)}function c(t,n){var r=w.token(t,n.htmlState);if(!k){var i=e.innerMode(w,n.htmlState);("xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=p,n.block=s,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S.code)}function f(e,t){e.match(t.fencedChars),t.block=s,t.f=p,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=h(t);return t.code=0,r}function h(e){var t=[];if(e.formatting){t.push(S.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(S.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(S.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(S.linkHref,"url"):(e.strong&&t.push(S.strong),e.em&&t.push(S.em),e.strikethrough&&t.push(S.strikethrough),e.linkText&&t.push(S.linkText),e.code&&t.push(S.code)),e.header&&t.push(S.header,S.header+"-"+e.header),e.quote&&(t.push(S.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(S.quote+"-"+e.quote):t.push(S.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(S.list2):t.push(S.list3):t.push(S.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function d(e,t){return e.match(O,!0)?h(t):void 0}function p(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,h(r);if(r.taskList){var a="x"!==t.match(N,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,h(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"), +h(r);var l=t.sol(),s=t.next();if(r.linkTitle){r.linkTitle=!1;var u=s;"("===s&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),!0))return S.linkHref}if("`"===s){var d=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0==r.code)return r.code=p,h(r);if(p==r.code){var v=h(r);return r.code=0,v}return r.formatting=d,h(r)}if(r.code)return h(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var y=h(r),x=S.formatting+"-escape";return y?y+" "+x:x}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=g,S.image;if("["===s&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),h(r);if("]"===s&&r.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=h(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkInline}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=h(r);return y?y+=" ":y="",y+S.linkEmail}if("<"===s&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(-1!=b){var k=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(k)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(w),o(t,r,c)}if("<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var L=t.pos-2;if(L>=0){var T=t.string.charAt(L);"_"!==T&&T.match(/(\w)/,!1)&&(C=!0)}}if("*"===s||"_"===s&&!C)if(l&&" "===t.peek());else{if(r.strong===s&&t.eat(s)){n.highlightFormatting&&(r.formatting="strong");var v=h(r);return r.strong=!1,v}if(!r.strong&&t.eat(s))return r.strong=s,n.highlightFormatting&&(r.formatting="strong"),h(r);if(r.em===s){n.highlightFormatting&&(r.formatting="em");var v=h(r);return r.em=!1,v}if(!r.em)return r.em=s,n.highlightFormatting&&(r.formatting="em"),h(r)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return h(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=h(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),h(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return h(r);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),h(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var i=h(t);return i?i+=" ":i="",i+S.linkInline}return e.match(/^[^>]+/,!0),S.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,h(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=p,n.highlightFormatting&&(r.formatting="link-string");var o=h(r);return r.linkHref=!1,o}return t.match(P[e]),r.linkHref=!0,h(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=x,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,h(t)):i(e,t,p)}function x(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=b,n.highlightFormatting&&(t.formatting="link");var r=h(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function b(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,S.linkHref+" url")}var w=e.getMode(t,"text/html"),k="null"==w.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var S={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in S)S.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(S[C]=n.tokenTypeOverrides[C]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,M=/^[0-9]+([.)])\s+/,N=/^\[(x| )\](?=\s)/,A=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,O=/^[^#!\[\]*_\\<>` "'(~]+/,I=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},R={startState:function(){return{f:s,prevLine:null,thisLine:null,block:s,htmlState:null,indentation:0,inline:p,text:d,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(l(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:R}},blankLine:l,getType:h,fold:"markdown"};return R},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../lib/codemirror")):"function"==typeof e&&e.amd?e(["../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}})},{"../lib/codemirror":10}],14:[function(t,n,r){!function(i){"object"==typeof r&&"object"==typeof n?i(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],i):i(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(s("atom","]]>")):null:e.match("--")?n(s("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=d,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=l(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(S.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!S.contextGrabbers.hasOwnProperty(n)||!S.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function d(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:d}function p(e,t,n){return"word"==e?(n.tagName=t.current(),M="tag",y):(M="error",p)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&S.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||S.matchClosing===!1?(M="tag",g):(M="tag error",v)}return M="error",v}function g(e,t,n){return"endTag"!=e?(M="error",g):(f(n),d)}function v(e,t,n){return M="error",g(e,t,n)}function y(e,t,n){if("word"==e)return M="attribute",x;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||S.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new u(n,r,i==n.indented)),d}return M="error",y}function x(e,t,n){return"equals"==e?b:(S.allowMissing||(M="error"),y(e,t,n))}function b(e,t,n){return"string"==e?w:"word"==e&&S.allowUnquoted?(M="string",y):(M="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var k=r.indentUnit,S={},C=i.htmlMode?t:n;for(var L in C)S[L]=C[L];for(var L in i)S[L]=i[L];var T,M;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:d,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(M=null,t.state=t.state(T||n,e,t),M&&(n="error"==M?n+" error":M)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+k;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return S.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+k*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var l=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(l&&l[1])for(;i;){if(i.tagName==l[2]){i=i.prev;break}if(!S.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(l)for(;i;){var s=S.contextGrabbers[i.tagName];if(!s||!s.hasOwnProperty(l[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+k:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(e){e.state==b&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,l=8*i-r-1,s=(1<<l)-1,c=s>>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=l;u>0;o=256*o+e[t+f],f+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===s)return a?NaN:(d?-1:1)*(1/0);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,l,s,c=8*o-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),t+=a+f>=1?h/s:h*Math.pow(2,1-f),t*s>=2&&(a++,s/=2),a+f>=u?(l=0,a=u):a+f>=1?(l=(t*s-1)*Math.pow(2,i),a+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&l,d+=p,l/=256,i-=8);for(a=a<<i|l,c+=i;c>0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},{}],16:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],17:[function(t,n,r){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=d.normal,this.options.gfm&&(this.options.tables?this.rules=d.tables:this.rules=d.gfm)}function i(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function o(e){this.options=e||{}}function a(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}function l(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function s(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function f(e){for(var t,n,r=1;r<arguments.length;r++){t=arguments[r];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function h(e,n,r){if(r||"function"==typeof n){r||(r=n,n=null),n=f({},h.defaults,n||{});var i,o,s=n.highlight,c=0;try{i=t.lex(e,n)}catch(u){return r(u)}o=i.length;var d=function(e){if(e)return n.highlight=s,r(e);var t;try{t=a.parse(i,n)}catch(o){e=o}return n.highlight=s,e?r(e):r(null,t)};if(!s||s.length<3)return d();if(delete n.highlight,!o)return d();for(;c<i.length;c++)!function(e){return"code"!==e.type?--o||d():s(e.text,e.lang,function(t,n){return t?d(t):null==n||n===e.text?--o||d():(e.text=n,e.escaped=!0,void(--o||d()))})}(i[c])}else try{return n&&(n=f({},h.defaults,n)),a.parse(t.lex(e,n),n)}catch(u){if(u.message+="\nPlease report this to https://github.com/chjj/marked.",(n||h.defaults).silent)return"<p>An error occured:</p><pre>"+l(u.message+"",!0)+"</pre>";throw u}}var d={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};d.bullet=/(?:[*+-]|\d+\.)/,d.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,d.item=c(d.item,"gm")(/bull/g,d.bullet)(),d.list=c(d.list)(/bull/g,d.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+d.def.source+")")(),d.blockquote=c(d.blockquote)("def",d.def)(),d._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",d.html=c(d.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,d._tag)(),d.paragraph=c(d.paragraph)("hr",d.hr)("heading",d.heading)("lheading",d.lheading)("blockquote",d.blockquote)("tag","<"+d._tag)("def",d.def)(),d.normal=f({},d),d.gfm=f({},d.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),d.gfm.paragraph=c(d.paragraph)("(?!","(?!"+d.gfm.fences.source.replace("\\1","\\2")+"|"+d.list.source.replace("\\1","\\3")+"|")(),d.tables=f({},d.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=d,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,a,l,s,c,u,f,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),s={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].split(/ *\| */);this.tokens.push(s)}else if(o=this.rules.lheading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(this.rules.item),r=!1,f=o.length,u=0;f>u;u++)s=o[u],c=s.length,s=s.replace(/^ *([*+-]|\d+\.) +/,""),~s.indexOf("\n ")&&(c-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==f-1&&(l=d.bullet.exec(o[u+1])[0],a===l||a.length>1&&l.length>1||(e=o.slice(u+1).join("\n")+e,u=f-1)),i=r||/\n\n(?!\s*$)/.test(s),u!==f-1&&(r="\n"===s.charAt(s.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),s={type:"table", +header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<s.align.length;u++)/^ *-+: *$/.test(s.align[u])?s.align[u]="right":/^ *:-+: *$/.test(s.align[u])?s.align[u]="center":/^ *:-+ *$/.test(s.align[u])?s.align[u]="left":s.align[u]=null;for(u=0;u<s.cells.length;u++)s.cells[u]=s.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(s)}else if(t&&(o=this.rules.paragraph.exec(e)))e=e.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var p={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};p._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,p._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=c(p.link)("inside",p._inside)("href",p._href)(),p.reflink=c(p.reflink)("inside",p._inside)(),p.normal=f({},p),p.pedantic=f({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=f({},p.normal,{escape:c(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=f({},p.gfm,{br:c(p.br)("{2,}","*")(),text:c(p.gfm.text)("{2,}","*")()}),i.rules=p,i.output=function(e,t,n){var r=new i(t,n);return r.output(e)},i.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=l(i[1]),r=n),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):l(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(l(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(l(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=l(i[1]),r=n,o+=this.renderer.link(r,null,n);return o},i.prototype.outputLink=function(e,t){var n=l(t.href),r=t.title?l(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,l(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+l(t,!0)+'">'+(n?e:l(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:l(e,!0))+"\n</code></pre>"},o.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},o.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},o.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},o.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},o.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},o.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},o.prototype.strong=function(e){return"<strong>"+e+"</strong>"},o.prototype.em=function(e){return"<em>"+e+"</em>"},o.prototype.codespan=function(e){return"<code>"+e+"</code>"},o.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},o.prototype.del=function(e){return"<del>"+e+"</del>"},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(s(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>"},o.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},o.prototype.text=function(e){return e},a.parse=function(e,t,n){var r=new a(t,n);return r.parse(e)},a.prototype.parse=function(e){this.inline=new i(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},a.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",a="";for(n="",e=0;e<this.token.header.length;e++)r={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(o+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",i=0;i<t.length;i++)n+=this.renderer.tablecell(this.inline.output(t[i]),{header:!1,align:this.token.align[i]});a+=this.renderer.tablerow(n)}return this.renderer.table(o,a);case"blockquote_start":for(var a="";"blockquote_end"!==this.next().type;)a+=this.tok();return this.renderer.blockquote(a);case"list_start":for(var a="",l=this.token.ordered;"list_end"!==this.next().type;)a+=this.tok();return this.renderer.list(a,l);case"list_item_start":for(var a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(a);case"loose_item_start":for(var a="";"list_item_end"!==this.next().type;)a+=this.tok();return this.renderer.listitem(a);case"html":var s=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(s);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},u.exec=u,h.options=h.setOptions=function(e){return f(h.defaults,e),h},h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new o,xhtml:!1},h.Parser=a,h.parser=a.parse,h.Renderer=o,h.Lexer=t,h.lexer=t.lex,h.InlineLexer=i,h.inlineLexer=i.output,h.parse=h,"undefined"!=typeof n&&"object"==typeof r?n.exports=h:"function"==typeof e&&e.amd?e(function(){return h}):this.marked=h}).call(function(){return this||("undefined"!=typeof window?window:t)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(e,t,n){(function(n,r){"use strict";var i=function(e,t,n,i){if(i=i||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=i.flags||{},e){if(this.dictionary=e,"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension)t||(t=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".aff"))),n||(n=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".dic")));else{if(i.dictionaryPath)var o=i.dictionaryPath;else if("undefined"!=typeof r)var o=r+"/dictionaries";else var o="./dictionaries";t||(t=this._readFile(o+"/"+e+"/"+e+".aff")),n||(n=this._readFile(o+"/"+e+"/"+e+".dic"))}this.rules=this._parseAFF(t),this.compoundRuleCodes={};for(var a=0,l=this.compoundRules.length;l>a;a++)for(var s=this.compoundRules[a],c=0,u=s.length;u>c;c++)this.compoundRuleCodes[s[c]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n);for(var a in this.compoundRuleCodes)0==this.compoundRuleCodes[a].length&&delete this.compoundRuleCodes[a];for(var a=0,l=this.compoundRules.length;l>a;a++){for(var f=this.compoundRules[a],h="",c=0,u=f.length;u>c;c++){var d=f[c];h+=d in this.compoundRuleCodes?"("+this.compoundRuleCodes[d].join("|")+")":d}this.compoundRules[a]=new RegExp(h,"i")}}return this};i.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(t,r){if(r||(r="utf8"),"undefined"!=typeof XMLHttpRequest){var i=new XMLHttpRequest;return i.open("GET",t,!1),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+r),i.send(null),i.responseText}if("undefined"!=typeof e){var o=e("fs");try{if(o.existsSync(t)){var a=o.statSync(t),l=o.openSync(t,"r"),s=new n(a.size);return o.readSync(l,s,0,s.length,null),s.toString(r,0,s.length)}console.log("Path "+t+" does not exist.")}catch(c){return console.log(c),""}}},_parseAFF:function(e){var t={};e=this._removeAffixComments(e);for(var n=e.split("\n"),r=0,i=n.length;i>r;r++){var o=n[r],a=o.split(/\s+/),l=a[0];if("PFX"==l||"SFX"==l){for(var s=a[1],c=a[2],u=parseInt(a[3],10),f=[],h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/),m=p[2],g=p[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),x=p[4],b={};b.add=v,y.length>0&&(b.continuationClasses=y),"."!==x&&("SFX"===l?b.match=new RegExp(x+"$"):b.match=new RegExp("^"+x)),"0"!=m&&("SFX"===l?b.remove=new RegExp(m+"$"):b.remove=m),f.push(b)}t[s]={type:l,combineable:"Y"==c,entries:f},r+=u}else if("COMPOUNDRULE"===l){for(var u=parseInt(a[1],10),h=r+1,d=r+1+u;d>h;h++){var o=n[h],p=o.split(/\s+/);this.compoundRules.push(p[1])}r+=u}else if("REP"===l){var p=o.split(/\s+/);3===p.length&&this.replacementTable.push([p[1],p[2]])}else this.flags[l]=a[1]}return t},_removeAffixComments:function(e){return e=e.replace(/#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in r&&"object"==typeof r[e]||(r[e]=[]),r[e].push(t)}e=this._removeDicComments(e);for(var n=e.split("\n"),r={},i=1,o=n.length;o>i;i++){var a=n[i],l=a.split("/",2),s=l[0];if(l.length>1){var c=this.parseRuleCodes(l[1]);"NEEDAFFIX"in this.flags&&-1!=c.indexOf(this.flags.NEEDAFFIX)||t(s,c);for(var u=0,f=c.length;f>u;u++){var h=c[u],d=this.rules[h];if(d)for(var p=this._applyRule(s,d),m=0,g=p.length;g>m;m++){var v=p[m];if(t(v,[]),d.combineable)for(var y=u+1;f>y;y++){var x=c[y],b=this.rules[x];if(b&&b.combineable&&d.type!=b.type)for(var w=this._applyRule(v,b),k=0,S=w.length;S>k;k++){var C=w[k];t(C,[])}}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(s)}}else t(s.trim(),[])}return r},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,r=e.length;r>n;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?textCode.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;o>i;i++){var a=n[i];if(!a.match||e.match(a.match)){var l=e;if(a.remove&&(l=l.replace(a.remove,"")),"SFX"===t.type?l+=a.add:l=a.add+l,r.push(l),"continuationClasses"in a)for(var s=0,c=a.continuationClasses.length;c>s;s++){var u=this.rules[a.continuationClasses[s]];u&&(r=r.concat(this._applyRule(l,u)))}}}return r},check:function(e){var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var r=t.toLowerCase();if(r!==t){if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if("undefined"==typeof t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;r>n;n++)if(e.match(this.compoundRules[n]))return!0;return!1}if("object"==typeof t){for(var n=0,r=t.length;r>n;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1}},hasFlag:function(e,t,n){if(t in this.flags){if("undefined"==typeof n)var n=Array.prototype.concat.apply([],this.dictionaryTable[e]);if(n&&-1!==n.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(e,t){function n(e){for(var t=[],n=0,r=e.length;r>n;n++){for(var i=e[n],o=[],a=0,l=i.length+1;l>a;a++)o.push([i.substring(0,a),i.substring(a,i.length)]);for(var s=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1]&&s.push(u[0]+u[1].substring(1))}for(var f=[],a=0,l=o.length;l>a;a++){var u=o[a];u[1].length>1&&f.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2))}for(var h=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1].substring(1))}for(var m=[],a=0,l=o.length;l>a;a++){var u=o[a];if(u[1])for(var d=0,p=c.alphabet.length;p>d;d++)h.push(u[0]+c.alphabet[d]+u[1])}t=t.concat(s),t=t.concat(f),t=t.concat(h),t=t.concat(m)}return t}function r(e){for(var t=[],n=0;n<e.length;n++)c.check(e[n])&&t.push(e[n]);return t}function i(e){function i(e,t){return e[1]<t[1]?-1:1}for(var o=n([e]),a=n(o),l=r(o).concat(r(a)),s={},u=0,f=l.length;f>u;u++)l[u]in s?s[l[u]]+=1:s[l[u]]=1;var h=[];for(var u in s)h.push([u,s[u]]);h.sort(i).reverse();for(var d=[],u=0,f=Math.min(t,h.length);f>u;u++)c.hasFlag(h[u][0],"NOSUGGEST")||d.push(h[u][0]);return d}if(t||(t=5),this.check(e))return[];for(var o=0,a=this.replacementTable.length;a>o;o++){var l=this.replacementTable[o];if(-1!==e.indexOf(l[0])){var s=e.replace(l[0],l[1]);if(this.check(s))return[s]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",i(e)}},"undefined"!=typeof t&&(t.exports=i)}).call(this,e("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(e,t,n){var r=e("codemirror");r.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentMore");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}},r.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,r=e.getStateAfter(n.line),i=r.list!==!1;if(i)return void e.execCommand("indentLess");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}}},{codemirror:10}],20:[function(e,t,n){"use strict";function r(e){return e=U?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function i(e,t,n){e=e||{};var r=document.createElement("a");return t=void 0==t?!0:t,e.title&&t&&(r.title=a(e.title,e.action,n),U&&(r.title=r.title.replace("Ctrl","⌘"),r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=e.className,r}function o(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function a(e,t,n){var i,o=e;return t&&(i=Y(t),n[i]&&(o+=" ("+r(n[i])+")")),o}function l(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),a={},l=0;l<o.length;l++)r=o[l],"strong"===r?a.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===r?a.quote=!0:"em"===r?a.italic=!0:"quote"===r?a.quote=!0:"strikethrough"===r?a.strikethrough=!0:"comment"===r?a.code=!0:"link"===r?a.link=!0:"tag"===r?a.image=!0:r.match(/^header(\-[1-6])?$/)&&(a[r.replace("header","heading")]=!0);return a}function s(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(V=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=V;var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen";var r=e.toolbarElements.fullscreen;/active/.test(r.className)?r.className=r.className.replace(/\s*active\s*/g,""):r.className+=" active";var i=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(i.className)&&N(e)}function c(e){P(e,"bold",e.options.blockStyles.bold)}function u(e){P(e,"italic",e.options.blockStyles.italic)}function f(e){P(e,"strikethrough","~~")}function h(e){function t(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function n(e){return e.state.base.base||e.state.base}function r(e,r,i,o,a){i=i||e.getLineHandle(r),o=o||e.getTokenAt({line:r,ch:1}),a=a||!!i.text&&e.getTokenAt({line:r,ch:i.text.length-1});var l=o.type?o.type.split(" "):[];return a&&n(a).indentedCode?"indented":-1===l.indexOf("comment")?!1:n(o).fencedChars||n(a).fencedChars||t(i)?"fenced":"single"}function i(e,t,n,r){var i=t.line+1,o=n.line+1,a=t.line!==n.line,l=r+"\n",s="\n"+r;a&&o++,a&&0===n.ch&&(s=r+"\n",o--),E(e,!1,[l,s]),e.setSelection({line:i,ch:0},{line:o,ch:0})}var o,a,l,s=e.options.blockStyles.code,c=e.codemirror,u=c.getCursor("start"),f=c.getCursor("end"),h=c.getTokenAt({line:u.line,ch:u.ch||1}),d=c.getLineHandle(u.line),p=r(c,u.line,d,h);if("single"===p){var m=d.text.slice(0,u.ch).replace("`",""),g=d.text.slice(u.ch).replace("`","");c.replaceRange(m+g,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),u.ch--,u!==f&&f.ch--,c.setSelection(u,f),c.focus()}else if("fenced"===p)if(u.line!==f.line||u.ch!==f.ch){for(o=u.line;o>=0&&(d=c.getLineHandle(o),!t(d));o--);var v,y,x,b,w=c.getTokenAt({line:o,ch:1}),k=n(w).fencedChars;t(c.getLineHandle(u.line))?(v="",y=u.line):t(c.getLineHandle(u.line-1))?(v="",y=u.line-1):(v=k+"\n",y=u.line),t(c.getLineHandle(f.line))?(x="",b=f.line,0===f.ch&&(b+=1)):0!==f.ch&&t(c.getLineHandle(f.line+1))?(x="",b=f.line+1):(x=k+"\n",b=f.line+1),0===f.ch&&(b-=1),c.operation(function(){c.replaceRange(x,{line:b,ch:0},{line:b+(x?0:1),ch:0}),c.replaceRange(v,{line:y,ch:0},{line:y+(v?0:1),ch:0})}),c.setSelection({line:y+(v?1:0),ch:0},{line:b+(v?1:-1),ch:0}),c.focus()}else{var S=u.line;if(t(c.getLineHandle(u.line))&&("fenced"===r(c,u.line+1)?(o=u.line,S=u.line+1):(a=u.line,S=u.line-1)),void 0===o)for(o=S;o>=0&&(d=c.getLineHandle(o),!t(d));o--);if(void 0===a)for(l=c.lineCount(),a=S;l>a&&(d=c.getLineHandle(a),!t(d));a++);c.operation(function(){c.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),c.replaceRange("",{line:a-1,ch:0},{line:a,ch:0})}),c.focus()}else if("indented"===p){if(u.line!==f.line||u.ch!==f.ch)o=u.line,a=f.line,0===f.ch&&a--;else{for(o=u.line;o>=0;o--)if(d=c.getLineHandle(o),!d.text.match(/^\s*$/)&&"indented"!==r(c,o,d)){o+=1;break}for(l=c.lineCount(),a=u.line;l>a;a++)if(d=c.getLineHandle(a),!d.text.match(/^\s*$/)&&"indented"!==r(c,a,d)){a-=1;break}}var C=c.getLineHandle(a+1),L=C&&c.getTokenAt({line:a+1,ch:C.text.length-1}),T=L&&n(L).indentedCode;T&&c.replaceRange("\n",{line:a+1,ch:0});for(var M=o;a>=M;M++)c.indentLine(M,"subtract");c.focus()}else{var N=u.line===f.line&&u.ch===f.ch&&0===u.ch,A=u.line!==f.line;N||A?i(c,u,f,s):E(c,!1,["`","`"])}}function d(e){var t=e.codemirror;I(t,"quote")}function p(e){var t=e.codemirror;O(t,"smaller")}function m(e){var t=e.codemirror;O(t,"bigger")}function g(e){var t=e.codemirror;O(t,void 0,1)}function v(e){var t=e.codemirror;O(t,void 0,2)}function y(e){var t=e.codemirror;O(t,void 0,3)}function x(e){var t=e.codemirror;I(t,"unordered-list")}function b(e){var t=e.codemirror;I(t,"ordered-list")}function w(e){var t=e.codemirror;R(t)}function k(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.link),!i)?!1:void E(t,n.link,r.insertTexts.link,i)}function S(e){var t=e.codemirror,n=l(t),r=e.options,i="http://";return r.promptURLs&&(i=prompt(r.promptTexts.image),!i)?!1:void E(t,n.image,r.insertTexts.image,i)}function C(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.table,r.insertTexts.table)}function L(e){var t=e.codemirror,n=l(t),r=e.options;E(t,n.image,r.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function M(e){var t=e.codemirror;t.redo(),t.focus()}function N(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||s(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);var a=n.lastChild;if(/editor-preview-active/.test(a.className)){a.className=a.className.replace(/\s*editor-preview-active\s*/g,"");var l=e.toolbarElements.preview,c=n.previousSibling;l.className=l.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}var u=function(){r.innerHTML=e.options.previewRender(e.value(),r)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=u),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function A(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=e.options.toolbar?e.toolbarElements.preview:!1,o=n.lastChild;o&&/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var a=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(a.className)&&N(e)}function E(e,t,n,r){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var i,o=n[0],a=n[1],l=e.getCursor("start"),s=e.getCursor("end");r&&(a=a.replace("#url#",r)),t?(i=e.getLine(l.line),o=i.slice(0,l.ch),a=i.slice(l.ch),e.replaceRange(o+a,{line:l.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+a),l.ch+=o.length,l!==s&&(s.ch+=o.length)),e.setSelection(l,s),e.focus()}}function O(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)!function(r){var i=e.getLine(r),o=i.search(/[^#]/);i=void 0!==t?0>=o?"bigger"==t?"###### "+i:"# "+i:6==o&&"smaller"==t?i.substr(7):1==o&&"bigger"==t?i.substr(2):"bigger"==t?i.substr(1):"#"+i:1==n?0>=o?"# "+i:o==n?i.substr(o+1):"# "+i.substr(o+1):2==n?0>=o?"## "+i:o==n?i.substr(o+1):"## "+i.substr(o+1):0>=o?"### "+i:o==n?i.substr(o+1):"### "+i.substr(o+1),e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(o);e.focus()}}function I(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=l(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)!function(r){var i=e.getLine(r);i=n[t]?i.replace(o[t],"$1"):a[t]+i,e.replaceRange(i,{line:r,ch:0},{line:r,ch:99999999999999})}(s);e.focus()}}function P(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r="undefined"==typeof r?n:r;var i,o=e.codemirror,a=l(o),s=n,c=r,u=o.getCursor("start"),f=o.getCursor("end");a[t]?(i=o.getLine(u.line),s=i.slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==f&&(f.ch-=2)):"italic"==t&&(u.ch-=1,u!==f&&(f.ch-=1))):(i=o.getSelection(),"bold"==t?(i=i.split("**").join(""),i=i.split("__").join("")):"italic"==t?(i=i.split("*").join(""),i=i.split("_").join("")):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,f.ch=u.ch+i.length),o.setSelection(u,f),o.focus()}}function R(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=e.getLine(i),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}function D(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=D(e[n]||{},t[n]):e[n]=t[n]);return e}function H(e){for(var t=1;t<arguments.length;t++)e=D(e,arguments[t]);return e}function W(e){var t=/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),r=0;if(null===n)return r;for(var i=0;i<n.length;i++)r+=n[i].charCodeAt(0)>=19968?n[i].length:1;return r}function B(e){e=e||{},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var i=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar){e.toolbar=[];for(var o in K)K.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(K[o]["default"]===!0||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=H({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=H({},X,e.insertTexts||{}),e.promptTexts=Z,e.blockStyles=H({},J,e.blockStyles||{}),e.shortcuts=H({},G,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}function _(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var F=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var z=e("codemirror-spell-checker"),j=e("marked"),U=/Mac/.test(navigator.platform),q={toggleBold:c,toggleItalic:u,drawLink:k,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:S,toggleBlockquote:d,toggleOrderedList:b,toggleUnorderedList:x,toggleCodeBlock:h,togglePreview:A,toggleStrikethrough:f,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:C,drawHorizontalRule:L,undo:T,redo:M,toggleSideBySide:N,toggleFullScreen:s},G={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Y=function(e){for(var t in q)if(q[t]===e)return t;return null},$=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0); +}(navigator.userAgent||navigator.vendor||window.opera),e},V="",K={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:f,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:d,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:x,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:b,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:k,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:S,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:C,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:L,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:A,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:N,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:s,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:M,className:"fa fa-repeat no-disable",title:"Redo"}},X={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text | Text | Text |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Z={link:"URL for the link:",image:"URL of the image:"},J={bold:"**",code:"```",italic:"*"};B.prototype.markdown=function(e){if(j){var t={};return this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),j.setOptions(t),j(e)}},B.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,i={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==q[o]&&!function(e){i[r(t.shortcuts[e])]=function(){q[e](n)}}(o);i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(e){e.getOption("fullScreen")&&s(n)},document.addEventListener("keydown",function(e){e=e||window.event,27==e.keyCode&&n.codemirror.getOption("fullScreen")&&s(n)},!1);var a,l;if(t.spellChecker!==!1?(a="spell-checker",l=t.parsingConfig,l.name="gfm",l.gitHubSpice=!1,z({codeMirrorInstance:F})):(a=t.parsingConfig,a.name="gfm",a.gitHubSpice=!1),this.codemirror=F.fromTextArea(e,{mode:a,backdrop:l,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:i,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:void 0!=t.styleSelectedText?t.styleSelectedText:!0}),t.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var u=this.codemirror;setTimeout(function(){u.refresh()}.bind(u),0)}},B.prototype.autosave=function(){if(_()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,r=n.getHours(),i=n.getMinutes(),o="am",a=r;a>=12&&(a=r-12,o="pm"),0==a&&(a=12),i=10>i?"0"+i:i,t.innerHTML="Autosaved: "+a+":"+i+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.clearAutosavedValue=function(){if(_()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")},B.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var r=!1,i=!1;return e.on("scroll",function(e){if(r)return void(r=!1);i=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,a=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=a}),n.onscroll=function(){if(i)return void(i=!1);r=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,a=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,a)},n},B.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t;for(t=0;t<e.length;t++)void 0!=K[e[t]]&&(e[t]=K[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var r=this,a={};for(r.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||r.options.toolbarGuideIcon!==!1)&&!(r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&$())){if("|"===e[t]){for(var s=!1,c=t+1;c<e.length;c++)"|"===e[c]||r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[c].name)||(s=!0);if(!s)continue}!function(e){var t;t="|"===e?o():i(e,r.options.toolbarTips,r.options.shortcuts),e.action&&("function"==typeof e.action?t.onclick=function(t){t.preventDefault(),e.action(r)}:"string"==typeof e.action&&(t.href=e.action,t.target="_blank")),a[e.name||e]=t,n.appendChild(t)}(e[t])}r.toolbarElements=a;var u=this.codemirror;u.on("cursorActivity",function(){var e=l(u);for(var t in a)!function(t){var n=a[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)});var f=u.getWrapperElement();return f.parentNode.insertBefore(n,f),n}},B.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var r,i,o,a=[];for(r=0;r<e.length;r++)if(i=void 0,o=void 0,"object"==typeof e[r])a.push({className:e[r].className,defaultValue:e[r].defaultValue,onUpdate:e[r].onUpdate});else{var l=e[r];"words"===l?(o=function(e){e.innerHTML=W(n.getValue())},i=function(e){e.innerHTML=W(n.getValue())}):"lines"===l?(o=function(e){e.innerHTML=n.lineCount()},i=function(e){e.innerHTML=n.lineCount()}):"cursor"===l?(o=function(e){e.innerHTML="0:0"},i=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===l&&(o=function(e){void 0!=t.autosave&&t.autosave.enabled===!0&&e.setAttribute("id","autosaved")}),a.push({className:l,defaultValue:o,onUpdate:i})}var s=document.createElement("div");for(s.className="editor-statusbar",r=0;r<a.length;r++){var c=a[r],u=document.createElement("span");u.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(u),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(u,c)),s.appendChild(u)}var f=this.codemirror.getWrapperElement();return f.parentNode.insertBefore(s,f.nextSibling),s}},B.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},B.toggleBold=c,B.toggleItalic=u,B.toggleStrikethrough=f,B.toggleBlockquote=d,B.toggleHeadingSmaller=p,B.toggleHeadingBigger=m,B.toggleHeading1=g,B.toggleHeading2=v,B.toggleHeading3=y,B.toggleCodeBlock=h,B.toggleUnorderedList=x,B.toggleOrderedList=b,B.cleanBlock=w,B.drawLink=k,B.drawImage=S,B.drawTable=C,B.drawHorizontalRule=L,B.undo=T,B.redo=M,B.togglePreview=A,B.toggleSideBySide=N,B.toggleFullScreen=s,B.prototype.toggleBold=function(){c(this)},B.prototype.toggleItalic=function(){u(this)},B.prototype.toggleStrikethrough=function(){f(this)},B.prototype.toggleBlockquote=function(){d(this)},B.prototype.toggleHeadingSmaller=function(){p(this)},B.prototype.toggleHeadingBigger=function(){m(this)},B.prototype.toggleHeading1=function(){g(this)},B.prototype.toggleHeading2=function(){v(this)},B.prototype.toggleHeading3=function(){y(this)},B.prototype.toggleCodeBlock=function(){h(this)},B.prototype.toggleUnorderedList=function(){x(this)},B.prototype.toggleOrderedList=function(){b(this)},B.prototype.cleanBlock=function(){w(this)},B.prototype.drawLink=function(){k(this)},B.prototype.drawImage=function(){S(this)},B.prototype.drawTable=function(){C(this)},B.prototype.drawHorizontalRule=function(){L(this)},B.prototype.undo=function(){T(this)},B.prototype.redo=function(){M(this)},B.prototype.togglePreview=function(){A(this)},B.prototype.toggleSideBySide=function(){N(this)},B.prototype.toggleFullScreen=function(){s(this)},B.prototype.isPreviewActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.lastChild;return/editor-preview-active/.test(n.className)},B.prototype.isSideBySideActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;return/editor-preview-active-side/.test(n.className)},B.prototype.isFullscreenActive=function(){var e=this.codemirror;return e.getOption("fullScreen")},B.prototype.getState=function(){var e=this.codemirror;return l(e)},B.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement();t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=B},{"./codemirror/tablist":19,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,marked:17}]},{},[20])(20)});;jQuery.trumbowyg={langs:{en:{viewHTML:'View HTML',undo:'Undo',redo:'Redo',formatting:'Formatting',p:'Paragraph',blockquote:'Quote',code:'Code',header:'Header',bold:'Bold',italic:'Italic',strikethrough:'Stroke',underline:'Underline',strong:'Strong',em:'Emphasis',del:'Deleted',superscript:'Superscript',subscript:'Subscript',unorderedList:'Unordered list',orderedList:'Ordered list',insertImage:'Insert Image',link:'Link',createLink:'Insert link',unlink:'Remove link',justifyLeft:'Align Left',justifyCenter:'Align Center',justifyRight:'Align Right',justifyFull:'Align Justify',horizontalRule:'Insert horizontal rule',removeformat:'Remove format',fullscreen:'Fullscreen',close:'Close',submit:'Confirm',reset:'Cancel',required:'Required',description:'Description',title:'Title',text:'Text',target:'Target',width:'Width'}},plugins:{},svgPath:null,hideButtonTexts:null};Object.defineProperty(jQuery.trumbowyg,'defaultOptions',{value:{lang:'en',fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,prefix:'trumbowyg-',semantic:!0,resetCss:!1,removeformatPasted:!1,tagsToRemove:[],btns:[['viewHTML'],['undo','redo'],['formatting'],['strong','em','del'],['superscript','subscript'],['link'],['insertImage'],['justifyLeft','justifyCenter','justifyRight','justifyFull'],['unorderedList','orderedList'],['horizontalRule'],['removeformat'],['fullscreen']],btnsDef:{},inlineElementsSelector:'a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u',pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1},writable:!1,enumerable:!0,configurable:!1});(function(t,n,a,e){'use strict';var i='tbwconfirm',r='tbwcancel';e.fn.trumbowyg=function(t,n){var r='trumbowyg';if(t===Object(t)||!t){return this.each(function(){if(!e(this).data(r)){e(this).data(r,new o(this,t))}})};if(this.length===1){try{var a=e(this).data(r);switch(t){case'execCmd':return a.execCmd(n.cmd,n.param,n.forceCss);case'openModal':return a.openModal(n.title,n.content);case'closeModal':return a.closeModal();case'openModalInsert':return a.openModalInsert(n.title,n.fields,n.callback);case'saveRange':return a.saveRange();case'getRange':return a.range;case'getRangeText':return a.getRangeText();case'restoreRange':return a.restoreRange();case'enable':return a.setDisabled(!1);case'disable':return a.setDisabled(!0);case'toggle':return a.toggle();case'destroy':return a.destroy();case'empty':return a.empty();case'html':return a.html(n)}}catch(i){}};return!1};var o=function(i,o){var r=this,m='trumbowyg-icons',s=e.trumbowyg;r.doc=i.ownerDocument||a;r.$ta=e(i);r.$c=e(i);o=o||{};if(o.lang!=null||s.langs[o.lang]!=null){r.lang=e.extend(!0,{},s.langs.en,s.langs[o.lang])} +else{r.lang=s.langs.en};r.hideButtonTexts=s.hideButtonTexts!=null?s.hideButtonTexts:o.hideButtonTexts;var l=s.svgPath!=null?s.svgPath:o.svgPath;r.hasSvg=l!==!1;r.svgPath=!!r.doc.querySelector('base')?n.location.href.split('#')[0]:'';if(e('#'+m,r.doc).length===0&&l!==!1){if(l==null){var p=a.getElementsByTagName('script');for(var f=0;f<p.length;f+=1){var u=p[f].src,h=u.match('trumbowyg(\.min)?\.js');if(h!=null){l=u.substring(0,u.indexOf(h[0]))+'ui/icons.svg'}};if(l==null){console.warn('You must define svgPath: https://goo.gl/CfTY9U')}};var c=r.doc.createElement('div');c.id=m;r.doc.body.insertBefore(c,r.doc.body.childNodes[0]);e.ajax({async:!0,type:'GET',contentType:'application/x-www-form-urlencoded; charset=UTF-8',dataType:'xml',crossDomain:!0,url:l,data:null,beforeSend:null,complete:null,success:function(e){c.innerHTML=new XMLSerializer().serializeToString(e.documentElement)}})};var d=r.lang.header,g=function(){return(n.chrome||(n.Intl&&Intl.v8BreakIterator))&&'CSS' in n};r.btnsDef={viewHTML:{fn:'toggle'},undo:{isSupported:g,key:'Z'},redo:{isSupported:g,key:'Y'},p:{fn:'formatBlock'},blockquote:{fn:'formatBlock'},h1:{fn:'formatBlock',title:d+' 1'},h2:{fn:'formatBlock',title:d+' 2'},h3:{fn:'formatBlock',title:d+' 3'},h4:{fn:'formatBlock',title:d+' 4'},subscript:{tag:'sub'},superscript:{tag:'sup'},bold:{key:'B',tag:'b'},italic:{key:'I',tag:'i'},underline:{tag:'u'},strikethrough:{tag:'strike'},strong:{fn:'bold',key:'B'},em:{fn:'italic',key:'I'},del:{fn:'strikethrough'},createLink:{key:'K',tag:'a'},unlink:{},insertImage:{},justifyLeft:{tag:'left',forceCss:!0},justifyCenter:{tag:'center',forceCss:!0},justifyRight:{tag:'right',forceCss:!0},justifyFull:{tag:'justify',forceCss:!0},unorderedList:{fn:'insertUnorderedList',tag:'ul'},orderedList:{fn:'insertOrderedList',tag:'ol'},horizontalRule:{fn:'insertHorizontalRule'},removeformat:{},fullscreen:{class:'trumbowyg-not-disable'},close:{fn:'destroy',class:'trumbowyg-not-disable'},formatting:{dropdown:['p','blockquote','h1','h2','h3','h4'],ico:'p'},link:{dropdown:['createLink','unlink']}};r.o=e.extend(!0,{},s.defaultOptions,o);if(!r.o.hasOwnProperty('imgDblClickHandler')){r.o.imgDblClickHandler=r.getDefaultImgDblClickHandler()};r.urlPrefix=r.setupUrlPrefix();r.disabled=r.o.disabled||(i.nodeName==='TEXTAREA'&&i.disabled);if(o.btns){r.o.btns=o.btns} +else if(!r.o.semantic){r.o.btns[3]=['bold','italic','underline','strikethrough']};e.each(r.o.btnsDef,function(e,t){r.addBtnDef(e,t)});r.eventNamespace='trumbowyg-event';r.keys=[];r.tagToButton={};r.tagHandlers=[];r.pasteHandlers=[].concat(r.o.pasteHandlers);r.isIE=(t.userAgent.indexOf('MSIE')!==-1||t.appVersion.indexOf('Trident/')!==-1);r.init()};o.prototype={DEFAULT_SEMANTIC_MAP:{'b':'strong','i':'em','s':'del','strike':'del','div':'p'},init:function(){var e=this;e.height=e.$ta.height();e.initPlugins();try{e.doc.execCommand('enableObjectResizing',!1,!1);e.doc.execCommand('defaultParagraphSeparator',!1,'p')}catch(t){};e.buildEditor();e.buildBtnPane();e.fixedBtnPaneEvents();e.buildOverlay();setTimeout(function(){if(e.disabled){e.setDisabled(!0)};e.$c.trigger('tbwinit')})},addBtnDef:function(e,t){this.btnsDef[e]=t},setupUrlPrefix:function(){var e=this.o.urlProtocol;if(!e){return};if(typeof(e)!=='string'){return'https://'};return/:\/\/$/.test(e)?e:e+'://'},buildEditor:function(){var t=this,a=t.o.prefix,r='';t.$box=e('<div/>',{class:a+'box '+a+'editor-visible '+a+t.o.lang+' trumbowyg'});t.isTextarea=t.$ta.is('textarea');if(t.isTextarea){r=t.$ta.val();t.$ed=e('<div/>');t.$box.insertAfter(t.$ta).append(t.$ed,t.$ta)} +else{t.$ed=t.$ta;r=t.$ed.html();t.$ta=e('<textarea/>',{name:t.$ta.attr('id'),height:t.height}).val(r);t.$box.insertAfter(t.$ed).append(t.$ta,t.$ed);t.syncCode()};t.$ta.addClass(a+'textarea').attr('tabindex',-1);t.$ed.addClass(a+'editor').attr({contenteditable:!0,dir:t.lang._dir||'ltr'}).html(r);if(t.o.tabindex){t.$ed.attr('tabindex',t.o.tabindex)};if(t.$c.is('[placeholder]')){t.$ed.attr('placeholder',t.$c.attr('placeholder'))};if(t.$c.is('[spellcheck]')){t.$ed.attr('spellcheck',t.$c.attr('spellcheck'))};if(t.o.resetCss){t.$ed.addClass(a+'reset-css')};if(!t.o.autogrow){t.$ta.add(t.$ed).css({height:t.height})};t.semanticCode();if(t.o.autogrowOnEnter){t.$ed.addClass(a+'autogrow-on-enter')};var i=!1,o=!1,s,l='keyup';t.$ed.on('dblclick','img',t.o.imgDblClickHandler).on('keydown',function(e){if((e.ctrlKey||e.metaKey)&&!e.altKey){i=!0;var a=t.keys[String.fromCharCode(e.which).toUpperCase()];try{t.execCmd(a.fn,a.param);return!1}catch(n){}}}).on('compositionstart compositionupdate',function(){o=!0}).on(l+' compositionend',function(e){if(e.type==='compositionend'){o=!1} +else if(o){return};var n=e.which;if(n>=37&&n<=40){return};if((e.ctrlKey||e.metaKey)&&(n===89||n===90)){t.$c.trigger('tbwchange')} +else if(!i&&n!==17){var a=t.isIE?e.type==='compositionend':!0;t.semanticCode(!1,a&&n===13);t.$c.trigger('tbwchange')} +else if(typeof e.which==='undefined'){t.semanticCode(!1,!1,!0)};setTimeout(function(){i=!1},50)}).on('mouseup keydown keyup',function(e){if((!e.ctrlKey&&!e.metaKey)||e.altKey){setTimeout(function(){i=!1},50)};clearTimeout(s);s=setTimeout(function(){t.updateButtonPaneStatus()},50)}).on('focus blur',function(n){t.$c.trigger('tbw'+n.type);if(n.type==='blur'){e('.'+a+'active-button',t.$btnPane).removeClass(a+'active-button '+a+'active')};if(t.o.autogrowOnEnter){if(t.autogrowOnEnterDontClose){return};if(n.type==='focus'){t.autogrowOnEnterWasFocused=!0;t.autogrowEditorOnEnter()} +else if(!t.o.autogrow){t.$ed.css({height:t.$ed.css('min-height')});t.$c.trigger('tbwresize')}}}).on('cut',function(){setTimeout(function(){t.semanticCode(!1,!0);t.$c.trigger('tbwchange')},0)}).on('paste',function(a){if(t.o.removeformatPasted){a.preventDefault();if(n.getSelection&&n.getSelection().deleteFromDocument){n.getSelection().deleteFromDocument()};try{var r=n.clipboardData.getData('Text');try{t.doc.selection.createRange().pasteHTML(r)}catch(i){t.doc.getSelection().getRangeAt(0).insertNode(t.doc.createTextNode(r))};t.$c.trigger('tbwchange',a)}catch(i){t.execCmd('insertText',(a.originalEvent||a).clipboardData.getData('text/plain'))}};e.each(t.pasteHandlers,function(e,t){t(a)});setTimeout(function(){t.semanticCode(!1,!0);t.$c.trigger('tbwpaste',a)},0)});t.$ta.on('keyup',function(){t.$c.trigger('tbwchange')}).on('paste',function(){setTimeout(function(){t.$c.trigger('tbwchange')},0)});t.$box.on('keydown',function(n){if(n.which===27&&e('.'+a+'modal-box',t.$box).length===1){t.closeModal();return!1}})},autogrowEditorOnEnter:function(){var e=this;e.$ed.removeClass('autogrow-on-enter');var n=e.$ed[0].clientHeight;e.$ed.height('auto');var t=e.$ed[0].scrollHeight;e.$ed.addClass('autogrow-on-enter');if(n!==t){e.$ed.height(n);setTimeout(function(){e.$ed.css({height:t});e.$c.trigger('tbwresize')},0)}},buildBtnPane:function(){var t=this,n=t.o.prefix,a=t.$btnPane=e('<div/>',{class:n+'button-pane'});e.each(t.o.btns,function(i,r){if(!e.isArray(r)){r=[r]};var o=e('<div/>',{class:n+'button-group '+((r.indexOf('fullscreen')>=0)?n+'right':'')});e.each(r,function(e,n){try{if(t.isSupportedBtn(n)){o.append(t.buildBtn(n))}}catch(a){}});if(o.html().trim().length>0){a.append(o)}});t.$box.prepend(a)},buildBtn:function(t){var a=this,i=a.o.prefix,n=a.btnsDef[t],r=n.dropdown,d=n.hasIcon!=null?n.hasIcon:!0,u=a.lang[t]||t,c=e('<button/>',{type:'button',class:i+t+'-button '+(n.class||'')+(!d?' '+i+'textual-button':''),html:a.hasSvg&&d?'<svg><use xlink:href="'+a.svgPath+'#'+i+(n.ico||t).replace(/([A-Z]+)/g,'-$1').toLowerCase()+'"/></svg>':a.hideButtonTexts?'':(n.text||n.title||a.lang[t]||t),title:(n.title||n.text||u)+((n.key)?' (Ctrl + '+n.key+')':''),tabindex:-1,mousedown:function(){if(!r||e('.'+t+'-'+i+'dropdown',a.$box).is(':hidden')){e('body',a.doc).trigger('mousedown')};if((a.$btnPane.hasClass(i+'disable')||a.$box.hasClass(i+'disabled'))&&!e(this).hasClass(i+'active')&&!e(this).hasClass(i+'not-disable')){return!1};a.execCmd((r?'dropdown':!1)||n.fn||t,n.param||t,n.forceCss);return!1}});if(r){c.addClass(i+'open-dropdown');var o=i+'dropdown',l={class:o+'-'+t+' '+o+' '+i+'fixed-top'};l['data-'+o]=t;var s=e('<div/>',l);e.each(r,function(e,t){if(a.btnsDef[t]&&a.isSupportedBtn(t)){s.append(a.buildSubBtn(t))}});a.$box.append(s.hide())} +else if(n.key){a.keys[n.key]={fn:n.fn||t,param:n.param||t}};if(!r){a.tagToButton[(n.tag||t).toLowerCase()]=t};return c},buildSubBtn:function(t){var a=this,i=a.o.prefix,n=a.btnsDef[t],r=n.hasIcon!=null?n.hasIcon:!0;if(n.key){a.keys[n.key]={fn:n.fn||t,param:n.param||t}};a.tagToButton[(n.tag||t).toLowerCase()]=t;return e('<button/>',{type:'button',class:i+t+'-dropdown-button'+(n.ico?' '+i+n.ico+'-button':''),html:a.hasSvg&&r?'<svg><use xlink:href="'+a.svgPath+'#'+i+(n.ico||t).replace(/([A-Z]+)/g,'-$1').toLowerCase()+'"/></svg>'+(n.text||n.title||a.lang[t]||t):(n.text||n.title||a.lang[t]||t),title:((n.key)?' (Ctrl + '+n.key+')':null),style:n.style||null,mousedown:function(){e('body',a.doc).trigger('mousedown');a.execCmd(n.fn||t,n.param||t,n.forceCss);return!1}})},isSupportedBtn:function(e){try{return this.btnsDef[e].isSupported()}catch(t){};return!0},buildOverlay:function(){var t=this;t.$overlay=e('<div/>',{class:t.o.prefix+'overlay'}).appendTo(t.$box);return t.$overlay},showOverlay:function(){var t=this;e(n).trigger('scroll');t.$overlay.fadeIn(200);t.$box.addClass(t.o.prefix+'box-blur')},hideOverlay:function(){var e=this;e.$overlay.fadeOut(50);e.$box.removeClass(e.o.prefix+'box-blur')},fixedBtnPaneEvents:function(){var t=this,i=t.o.fixedFullWidth,a=t.$box;if(!t.o.fixedBtnPane){return};t.isFixed=!1;e(n).on('scroll.'+t.eventNamespace+' resize.'+t.eventNamespace,function(){if(!a){return};t.syncCode();var o=e(n).scrollTop(),s=a.offset().top+1,r=t.$btnPane,l=r.outerHeight()-2;if((o-s>0)&&((o-s-t.height)<0)){if(!t.isFixed){t.isFixed=!0;r.css({position:'fixed',top:0,left:i?'0':'auto',zIndex:7});e([t.$ta,t.$ed]).css({marginTop:r.height()})};r.css({width:i?'100%':((a.width()-1)+'px')});e('.'+t.o.prefix+'fixed-top',a).css({position:i?'fixed':'absolute',top:i?l:l+(o-s)+'px',zIndex:15})} +else if(t.isFixed){t.isFixed=!1;r.removeAttr('style');e([t.$ta,t.$ed]).css({marginTop:0});e('.'+t.o.prefix+'fixed-top',a).css({position:'absolute',top:l})}})},setDisabled:function(e){var t=this,n=t.o.prefix;t.disabled=e;if(e){t.$ta.attr('disabled',!0)} +else{t.$ta.removeAttr('disabled')};t.$box.toggleClass(n+'disabled',e);t.$ed.attr('contenteditable',!e)},destroy:function(){var t=this,a=t.o.prefix;if(t.isTextarea){t.$box.after(t.$ta.css({height:''}).val(t.html()).removeClass(a+'textarea').show())} +else{t.$box.after(t.$ed.css({height:''}).removeClass(a+'editor').removeAttr('contenteditable').removeAttr('dir').html(t.html()).show())};t.$ed.off('dblclick','img');t.destroyPlugins();t.$box.remove();t.$c.removeData('trumbowyg');e('body').removeClass(a+'body-fullscreen');t.$c.trigger('tbwclose');e(n).off('scroll.'+t.eventNamespace+' resize.'+t.eventNamespace)},empty:function(){this.$ta.val('');this.syncCode(!0)},toggle:function(){var t=this,n=t.o.prefix;if(t.o.autogrowOnEnter){t.autogrowOnEnterDontClose=!t.$box.hasClass(n+'editor-hidden')};t.semanticCode(!1,!0);setTimeout(function(){t.doc.activeElement.blur();t.$box.toggleClass(n+'editor-hidden '+n+'editor-visible');t.$btnPane.toggleClass(n+'disable');e('.'+n+'viewHTML-button',t.$btnPane).toggleClass(n+'active');if(t.$box.hasClass(n+'editor-visible')){t.$ta.attr('tabindex',-1)} +else{t.$ta.removeAttr('tabindex')};if(t.o.autogrowOnEnter&&!t.autogrowOnEnterDontClose){t.autogrowEditorOnEnter()}},0)},dropdown:function(t){var a=this,o=a.doc,i=a.o.prefix,s=e('[data-'+i+'dropdown='+t+']',a.$box),r=e('.'+i+t+'-button',a.$btnPane),d=s.is(':hidden');e('body',o).trigger('mousedown');if(d){var l=r.offset().left;r.addClass(i+'active');s.css({position:'absolute',top:r.offset().top-a.$btnPane.offset().top+r.outerHeight(),left:(a.o.fixedFullWidth&&a.isFixed)?l+'px':(l-a.$btnPane.offset().left)+'px'}).show();e(n).trigger('scroll');e('body',o).on('mousedown.'+a.eventNamespace,function(t){if(!s.is(t.target)){e('.'+i+'dropdown',a.$box).hide();e('.'+i+'active',a.$btnPane).removeClass(i+'active');e('body',o).off('mousedown.'+a.eventNamespace)}})}},html:function(e){var t=this;if(e!=null){t.$ta.val(e);t.syncCode(!0);t.$c.trigger('tbwchange');return t};return t.$ta.val()},syncTextarea:function(){var e=this;e.$ta.val(e.$ed.text().trim().length>0||e.$ed.find('hr,img,embed,iframe,input').length>0?e.$ed.html():'')},syncCode:function(t){var n=this;if(!t&&n.$ed.is(':visible')){n.syncTextarea()} +else{var r=e('<div>').html(n.$ta.val()),i=e('<div>').append(r);e(n.o.tagsToRemove.join(','),i).remove();n.$ed.html(i.contents().html())};if(n.o.autogrow){n.height=n.$ed.height();if(n.height!==n.$ta.css('height')){n.$ta.css({height:n.height});n.$c.trigger('tbwresize')}};if(n.o.autogrowOnEnter){n.$ed.height('auto');var a=n.autogrowOnEnterWasFocused?n.$ed[0].scrollHeight:n.$ed.css('min-height');if(a!==n.$ta.css('height')){n.$ed.css({height:a});n.$c.trigger('tbwresize')}}},semanticCode:function(t,n,i){var a=this;a.saveRange();a.syncCode(t);if(a.o.semantic){a.semanticTag('b');a.semanticTag('i');a.semanticTag('s');a.semanticTag('strike');if(n){var r=a.o.inlineElementsSelector,s=':not('+r+')';a.$ed.contents().filter(function(){return this.nodeType===3&&this.nodeValue.trim().length>0}).wrap('<span data-tbw/>');var o=function(e){if(e.length!==0){var t=e.nextUntil(s).addBack().wrapAll('<p/>').parent(),n=t.nextAll(r).first();t.next('br').remove();o(n)}};o(a.$ed.children(r).first());a.semanticTag('div',!0);a.$ed.find('p').filter(function(){if(a.range&&this===a.range.startContainer){return!1};return e(this).text().trim().length===0&&e(this).children().not('br,span').length===0}).contents().unwrap();e('[data-tbw]',a.$ed).contents().unwrap();a.$ed.find('p:empty').remove()};if(!i){a.restoreRange()};a.syncTextarea()}},semanticTag:function(t,n){var a;if(this.o.semantic!=null&&typeof this.o.semantic==='object'&&this.o.semantic.hasOwnProperty(t)){a=this.o.semantic[t]} +else if(this.o.semantic===!0&&this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(t)){a=this.DEFAULT_SEMANTIC_MAP[t]} +else{return};e(t,this.$ed).each(function(){var t=e(this);t.wrap('<'+a+'/>');if(n){e.each(t.prop('attributes'),function(){t.parent().attr(this.name,this.value)})};t.contents().unwrap()})},createLink:function(){var t=this,i=t.doc.getSelection(),n=i.focusNode,s=new XMLSerializer().serializeToString(i.getRangeAt(0).cloneContents()),l,d,c;while(['A','DIV'].indexOf(n.nodeName)<0){n=n.parentNode};if(n&&n.nodeName==='A'){var a=e(n);s=a.text();l=a.attr('href');if(!t.o.minimalLinks){d=a.attr('title');c=a.attr('target')};var o=t.doc.createRange();o.selectNode(n);i.removeAllRanges();i.addRange(o)};t.saveRange();var r={url:{label:'URL',required:!0,value:l},text:{label:t.lang.text,value:s}};if(!t.o.minimalLinks){Object.assign(r,{title:{label:t.lang.title,value:d},target:{label:t.lang.target,value:c}})};t.openModalInsert(t.lang.createLink,r,function(n){var i=t.prependUrlPrefix(n.url);if(!i.length){return!1};var a=e(['<a href="',n.url,'">',n.text||n.url,'</a>'].join(''));if(!t.o.minimalLinks){if(n.title.length>0){a.attr('title',n.title)};if(n.target.length>0){a.attr('target',n.target)}};t.range.deleteContents();t.range.insertNode(a[0]);t.syncCode();t.$c.trigger('tbwchange');return!0})},prependUrlPrefix:function(e){var t=this;if(!t.urlPrefix){return e};const VALID_LINK_PREFIX=/^([a-z][-+.a-z0-9]*:|\/|#)/i;if(VALID_LINK_PREFIX.test(e)){return e};const SIMPLE_EMAIL_REGEX=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;if(SIMPLE_EMAIL_REGEX.test(e)){return'mailto:'+e};return t.urlPrefix+e},unlink:function(){var n=this,t=n.doc.getSelection(),e=t.focusNode;if(t.isCollapsed){while(['A','DIV'].indexOf(e.nodeName)<0){e=e.parentNode};if(e&&e.nodeName==='A'){var a=n.doc.createRange();a.selectNode(e);t.removeAllRanges();t.addRange(a)}};n.execCmd('unlink',undefined,undefined,!0)},insertImage:function(){var t=this;t.saveRange();var n={url:{label:'URL',required:!0},alt:{label:t.lang.description,value:t.getRangeText()}};if(t.o.imageWidthModalEdit){n.width={}};t.openModalInsert(t.lang.insertImage,n,function(n){t.execCmd('insertImage',n.url);var a=e('img[src="'+n.url+'"]:not([alt])',t.$box);a.attr('alt',n.alt);if(t.o.imageWidthModalEdit){a.attr({width:n.width})};t.syncCode();t.$c.trigger('tbwchange');return!0})},fullscreen:function(){var t=this,i=t.o.prefix,r=i+'fullscreen',a;t.$box.toggleClass(r);a=t.$box.hasClass(r);e('body').toggleClass(i+'body-fullscreen',a);e(n).trigger('scroll');t.$c.trigger('tbw'+(a?'open':'close')+'fullscreen')},execCmd:function(e,t,i,r){var a=this;r=!!r||'';if(e!=='dropdown'){a.$ed.focus()};try{a.doc.execCommand('styleWithCSS',!1,i||!1)}catch(n){};try{a[e+r](t)}catch(n){try{e(t)}catch(n){if(e==='insertHorizontalRule'){t=undefined} +else if(e==='formatBlock'&&a.isIE){t='<'+t+'>'};a.doc.execCommand(e,!1,t);a.syncCode();a.semanticCode(!1,!0)};if(e!=='dropdown'){a.updateButtonPaneStatus();a.$c.trigger('tbwchange')}}},openModal:function(t,a){var o=this,l=o.o.prefix;if(e('.'+l+'modal-box',o.$box).length>0){return!1};if(o.o.autogrowOnEnter){o.autogrowOnEnterDontClose=!0};o.saveRange();o.showOverlay();o.$btnPane.addClass(l+'disable');var s=e('<div/>',{class:l+'modal '+l+'fixed-top'}).css({top:o.$btnPane.height()}).appendTo(o.$box);o.$overlay.one('click',function(){s.trigger(r);return!1});var c=e('<form/>',{action:'',html:a}).on('submit',function(){s.trigger(i);return!1}).on('reset',function(){s.trigger(r);return!1}).on('submit reset',function(){if(o.o.autogrowOnEnter){o.autogrowOnEnterDontClose=!1}});var d=e('<div/>',{class:l+'modal-box',html:c}).css({top:'-'+o.$btnPane.outerHeight()+'px',opacity:0}).appendTo(s).animate({top:0,opacity:1},100);e('<span/>',{text:t,class:l+'modal-title'}).prependTo(d);s.height(d.outerHeight()+10);e('input:first',d).focus();o.buildModalBtn('submit',d);o.buildModalBtn('reset',d);e(n).trigger('scroll');return s},buildModalBtn:function(t,n){var a=this,i=a.o.prefix;return e('<button/>',{class:i+'modal-button '+i+'modal-'+t,type:t,text:a.lang[t]||t}).appendTo(e('form',n))},closeModal:function(){var t=this,a=t.o.prefix;t.$btnPane.removeClass(a+'disable');t.$overlay.off();var n=e('.'+a+'modal-box',t.$box);n.animate({top:'-'+n.height()},100,function(){n.parent().remove();t.hideOverlay()});t.restoreRange()},openModalInsert:function(t,n,o){var a=this,d=a.o.prefix,s=a.lang,l='';e.each(n,function(e,t){var n=t.label||e,r=t.name||e,a=t.attributes||{};var i=Object.keys(a).map(function(e){return e+'="'+a[e]+'"'}).join(' ');l+='<label><input type="'+(t.type||'text')+'" name="'+r+'"'+(t.type==='checkbox'&&t.value?' checked="checked"':' value="'+(t.value||'').replace(/"/g,'&quot;'))+'"'+i+'><span class="'+d+'input-infos"><span>'+(s[n]?s[n]:n)+'</span></span></label>'});return a.openModal(t,l).on(i,function(){var s=e('form',e(this)),r=!0,t={};e.each(n,function(n,i){var o=i.name||n,l=e('input[name="'+o+'"]',s),d=l.attr('type');switch(d.toLowerCase()){case'checkbox':t[o]=l.is(':checked');break;case'radio':t[o]=l.filter(':checked').val();break;default:t[o]=e.trim(l.val());break};if(i.required&&t[o]===''){r=!1;a.addErrorOnModalField(l,a.lang.required)} +else if(i.pattern&&!i.pattern.test(t[o])){r=!1;a.addErrorOnModalField(l,i.patternError)}});if(r){a.restoreRange();if(o(t,n)){a.syncCode();a.$c.trigger('tbwchange');a.closeModal();e(this).off(i)}}}).one(r,function(){e(this).off(i);a.closeModal()})},addErrorOnModalField:function(t,n){var a=this.o.prefix,i=t.parent();t.on('change keyup',function(){i.removeClass(a+'input-error')});i.addClass(a+'input-error').find('input+span').append(e('<span/>',{class:a+'msg-error',text:n}))},getDefaultImgDblClickHandler:function(){var t=this;return function(){var n=e(this),a=n.attr('src'),r='(Base64)';if(a.indexOf('data:image')===0){a=r};var i={url:{label:'URL',value:a,required:!0},alt:{label:t.lang.description,value:n.attr('alt')}};if(t.o.imageWidthModalEdit){i.width={value:n.attr('width')?n.attr('width'):''}};t.openModalInsert(t.lang.insertImage,i,function(e){if(e.src!==r){n.attr({src:e.url})};n.attr({alt:e.alt});if(t.o.imageWidthModalEdit){if(parseInt(e.width)>0){n.attr({width:e.width})} +else{n.removeAttr('width')}};return!0});return!1}},saveRange:function(){var e=this,i=e.doc.getSelection();e.range=null;if(i.rangeCount){var t=e.range=i.getRangeAt(0),n=e.doc.createRange(),a;n.selectNodeContents(e.$ed[0]);n.setEnd(t.startContainer,t.startOffset);a=(n+'').length;e.metaRange={start:a,end:a+(t+'').length}}},restoreRange:function(){var a=this,e=a.metaRange,u=a.range,f=a.doc.getSelection(),i;if(!u){return};if(e&&e.start!==e.end){var t=0,d=[a.$ed[0]],n,s=!1,c=!1;i=a.doc.createRange();while(!c&&(n=d.pop())){if(n.nodeType===3){var o=t+n.length;if(!s&&e.start>=t&&e.start<=o){i.setStart(n,e.start-t);s=!0};if(s&&e.end>=t&&e.end<=o){i.setEnd(n,e.end-t);c=!0};t=o} +else{var l=n.childNodes,r=l.length;while(r>0){r-=1;d.push(l[r])}}}};f.removeAllRanges();f.addRange(i||u)},getRangeText:function(){return this.range+''},updateButtonPaneStatus:function(){var t=this,n=t.o.prefix,i=t.getTagsRecursive(t.doc.getSelection().focusNode),a=n+'active-button '+n+'active';e('.'+n+'active-button',t.$btnPane).removeClass(a);e.each(i,function(i,r){var l=t.tagToButton[r.toLowerCase()],s=e('.'+n+l+'-button',t.$btnPane);if(s.length>0){s.addClass(a)} +else{try{s=e('.'+n+'dropdown .'+n+l+'-dropdown-button',t.$box);var d=s.parent().data('dropdown');e('.'+n+d+'-button',t.$box).addClass(a)}catch(o){}}})},getTagsRecursive:function(t,n){var i=this;n=n||(t&&t.tagName?[t.tagName]:[]);if(t&&t.parentNode){t=t.parentNode} +else{return n};var a=t.tagName;if(a==='DIV'){return n};if(a==='P'&&t.style.textAlign!==''){n.push(t.style.textAlign)};e.each(i.tagHandlers,function(e,a){n=n.concat(a(t,i))});n.push(a);return i.getTagsRecursive(t,n).filter(function(e){return e!=null})},initPlugins:function(){var t=this;t.loadedPlugins=[];e.each(e.trumbowyg.plugins,function(e,n){if(!n.shouldInit||n.shouldInit(t)){n.init(t);if(n.tagHandler){t.tagHandlers.push(n.tagHandler)};t.loadedPlugins.push(n)}})},destroyPlugins:function(){e.each(this.loadedPlugins,function(e,t){if(t.destroy){t.destroy()}})}}})(navigator,window,document,jQuery);;window.Openrat={};;Openrat.View=function(e,t,i,r){this.action=e;this.method=t;this.id=i;this.params=r;this.before=function(){};this.start=function(e){this.before();this.element=e;this.loadView()};this.afterLoad=function(){};this.close=function(){};function n(e){Openrat.Workbench.afterViewLoadedHandler.fire(e);let f=$(e).data('afterViewLoaded');if(f instanceof Function)f(e)};this.loadView=function(){let url=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!1);let element=this.element;let view=this;let loadViewHtmlPromise=$.ajax(url);$(this.element).addClass('loader');loadViewHtmlPromise.done(function(e,t){if(!e)e='';$(element).html(e).removeClass('loader');$(element).find('form').each(function(){let form=new Openrat.Form();form.close=function(){view.close()};form.initOnElement(this)});n(element)});loadViewHtmlPromise.fail(function(e,t,i){$(element).html('');Openrat.Workbench.notify('','','error','Server Error',['Server Error while requesting url '+url,t])});let apiUrl=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!0);loadViewHtmlPromise.done(function(){})};Openrat.View.createUrl=function(e,subaction,i,extraid={},api=!1){let url='./';if(api)url+='api/';url+='?';if(e)url+='&action='+e;if(subaction)url+='&subaction='+subaction;if(i)url+='&id='+i;if(typeof extraid==='string'){extraid=extraid.replace(/'/g,'"');let extraObject=jQuery.parseJSON(extraid);jQuery.each(extraObject,function(e,t){url=url+'&'+e+'='+t})} +else if(typeof extraid==='object'){jQuery.each(extraid,function(e,t){url=url+'&'+e+'='+t})} +else{};return url}};;Openrat.Form=function(){const modes={showBrowserNotice:1,keepOpen:2,closeAfterSubmit:4,closeAfterSuccess:8,};this.setLoadStatus=function(e){$(this.element).closest('div.content').toggleClass('loader',e)};this.initOnElement=function(e){this.element=e;let form=this;if($(this.element).data('autosave')){$(this.element).find('input[type="checkbox"]').click(function(){form.submit(modes.keepOpen)});$(this.element).find('select').change(function(){form.submit(modes.keepOpen)})};$(e).find('.or-form-btn--cancel').click(function(){form.cancel()});$(e).find('.or-form-btn--reset').click(function(){form.rollback()});$(e).find('.or-form-btn--apply').click(function(){form.submit(modes.keepOpen)});$(e).submit(function(e){if($(this).data('target')=='view'){form.submit();e.preventDefault()}})};this.cancel=function(){this.close()};this.rollback=function(){this.element.trigger('reset')};this.close=function(){};this.forwardTo=function(e,t,s,o){let view=new Openrat.View(e,t,s,o);view.start($(this.element).closest('.view'))};this.submit=function(e){if(e===undefined)if($(this.element).data('async'))e=modes.closeAfterSubmit;else e=modes.closeAfterSuccess;let status=$('<div class="notice info"><div class="text loader"></div></div>');$('#noticebar').prepend(status);$(status).show();$(this.element).find('.error').removeClass('error');let params=$(this.element).serializeArray();let data={};$(params).each(function(e,t){data[t.name]=t.value});if(!data.id)data.id=Openrat.Workbench.state.id;if(!data.action)data.action=Openrat.Workbench.state.action;let formMethod=$(this.element).attr('method').toUpperCase();if(formMethod=='GET'){this.forwardTo(data.action,data.subaction,data.id,data);$(status).remove()} +else{let url='./api/';this.setLoadStatus(!0);url+='';data.output='json';if(e==modes.closeAfterSubmit)this.close();let form=this;$.ajax({'type':'POST',url:url,data:data,success:function(t,s,o){form.setLoadStatus(!1);$(status).remove();form.doResponse(t,s,form.element,function(){if(e==modes.closeAfterSuccess){form.close();$(form.element).closest('div.panel').find('div.header ul.views li.action.active').removeClass('dirty')};let afterSuccess=$(form.element).data('afterSuccess');let async=$(form.element).data('async');if(afterSuccess){if(afterSuccess=='reloadAll'){Openrat.Workbench.reloadAll()}} +else{if(async);else Openrat.Workbench.reloadViews()}})},error:function(e,t,s){form.setLoadStatus(!1);$(status).remove();try{let error=jQuery.parseJSON(e.responseText);Openrat.Workbench.notify('','','error',error.error,[error.description])}catch(o){let msg=e.responseText;Openrat.Workbench.notify('','','error','Server Error',[msg])}}});$(form.element).fadeIn()}};this.doResponse=function(e,t,s,onSuccess=$.noop){if(t!='success'){alert('Server error: '+t);return};let form=this;$.each(e['notices'],function(t,e){let notifyBrowser=$(s).data('async');Openrat.Workbench.notify(e.type,e.name,e.status,e.text,e.log,notifyBrowser);if(e.status=='ok'){onSuccess();Openrat.Workbench.dataChangedHandler.fire()} +else{}});$.each(e['errors'],function(e,t){$('input[name='+t+']').addClass('error').parent().addClass('error').parents('fieldset').addClass('show').addClass('open')});if(e.control.redirect)window.location.href=e.control.redirect}};;Openrat.Workbench=new function(){'use strict';this.state={};this.initialize=function(){this.initializePingTimer();this.initializeState();this.openModalDialog()};this.openModalDialog=function(){if($('#dialog').data('action')){startDialog('',$('#dialog').data('action'),$('#dialog').data('action'),0,{})}};this.initializeState=function(){let parts=window.location.hash.split('/');let state={action:'index',id:0};if(parts.length>=2)state.action=parts[1].toLowerCase();if(parts.length>=3)state.id=parts[2].replace(/[^0-9_]/gim,'');Openrat.Workbench.state=state;$('#editor').attr('data-action',state.action);$('#editor').attr('data-id',state.id);$('#editor').attr('data-extra','{}');Openrat.Navigator.toActualHistory(state)};this.initializePingTimer=function(){let ping=function(){let pingPromise=$.getJSON(Openrat.View.createUrl('profile','ping',0,{},!0));pingPromise.fail(function(){console.warn('The server ping has failed.')})};let timeoutMinutes=5;window.setInterval(ping,timeoutMinutes*60*1000)};this.loadNewActionState=function(t){Openrat.Workbench.state=t;Openrat.Workbench.loadNewAction(t.action,t.id,t.data);this.afterNewActionHandler.fire()};this.afterNewActionHandler=$.Callbacks();this.loadNewAction=function(t,e,i){$('#editor').attr('data-action',t);$('#editor').attr('data-id',e);$('#editor').attr('data-extra',JSON.stringify(i));this.reloadViews()};this.reloadViews=function(){$('#workbench section.closed .view-loader').empty();Openrat.Workbench.loadViews($('#workbench section.open .view-loader'))};this.reloadAll=function(){$('#workbench .view').empty();Openrat.Workbench.loadViews($('#workbench .view.view-loader, #workbench .view.view-static'));this.loadUserStyle();this.loadLanguage();this.loadUISettings()};this.loadUserStyle=function(){let url=Openrat.View.createUrl('profile','userinfo',0,{},!0);$.getJSON(url,function(t){let style=t.output['style'];Openrat.Workbench.setUserStyle(style);let color=t.output['theme-color'];Openrat.Workbench.setThemeColor(color)})};this.settings={};this.language={};this.loadLanguage=function(){let url=Openrat.View.createUrl('profile','language',0,{},!0);$.getJSON(url,function(t){Openrat.Workbench.language=t.output.language})};this.loadUISettings=function(){let url=Openrat.View.createUrl('profile','uisettings',0,{},!0);$.getJSON(url,function(t){Openrat.Workbench.settings=t.output.settings.settings})};this.loadViews=function(t){t.each(function(t){let $targetDOMElement=$(this);Openrat.Workbench.loadNewActionIntoElement($targetDOMElement)})};this.loadNewActionIntoElement=function(t){let action;if(t.is('.view-static'))action=t.attr('data-action');else action=$('#editor').attr('data-action');let id=$('#editor').attr('data-id');let params=$('#editor').attr('data-extra');let method=t.data('method');let view=new Openrat.View(action,method,id,params);view.start(t)};this.setUserStyle=function(t){var e=$('html'),i=e.attr('class').split(/\s+/);$.each(i,function(t,i){if(i.startsWith('theme-')){e.removeClass(i)}});e.addClass('theme-'+t.toLowerCase())};this.setThemeColor=function(t){$('#theme-color').attr('content',t)};let notifyBrowser=function(t){if(!('Notification' in window)){return} +else if(Notification.permission==='granted'){let notification=new Notification(t)} +else if(Notification.permission!=='denied'){Notification.requestPermission(function(e){if(e==='granted'){let notification=new Notification(t)}})}};this.notify=function(t,i,e,o,log=[],notifyTheBrowser=!1){if(notifyTheBrowser)notifyBrowser(o);let notice=$('<div class="notice '+e+'"></div>');let toolbar=$('<div class="or-notice-toolbar"></div>');if(log.length)$(toolbar).append('<i class="or-action-full image-icon image-icon--menu-fullscreen"></i>');$(toolbar).append('<i class="or-action-close image-icon image-icon--menu-close"></i>');$(notice).append(toolbar);let id=0;if(i)$(notice).append('<div class="name clickable"><a href="" data-type="open" data-action="'+t+'" data-id="'+id+'"><i class="or-action-full image-icon image-icon--action-'+t+'"></i> '+i+'</a></div>');$(notice).append('<div class="text">'+htmlEntities(o)+'</div>');if(log.length){let logLi=log.reduce((result,item)=>{result+='<li><pre>'+htmlEntities(item)+'</pre></li>';return result},'');$(notice).append('<div class="log"><ul>'+logLi+'</ul></div>')};$('#noticebar').prepend(notice);$(notice).orLinkify();$(notice).find('.or-action-full').click(function(){$(notice).toggleClass('full')});$(notice).find('.or-action-close').click(function(){$(notice).fadeOut('fast',function(){$(notice).remove()})});let timeout=1;if(e=='ok')timeout=20;if(e=='info')timeout=60;if(e=='warning')timeout=120;if(e=='error')timeout=120;if(timeout>0)setTimeout(function(){$(notice).fadeOut('slow',function(){$(this).remove()})},timeout*1000)};this.dataChangedHandler=$.Callbacks();this.dataChangedHandler.add(function(){if(popupWindow!==undefined)popupWindow.location.reload()});this.afterViewLoadedHandler=$.Callbacks();let afterViewFunctions=[];this.registerAfterViewLoaded=function(t){afterViewFunctions.push(t)};this.afterViewLoaded=function(t){afterViewFunctions.forEach(function(e){e(t)})}};;Openrat.Navigator=new function(){'use strict';this.navigateTo=function(t){Openrat.Workbench.loadNewActionState(t)};this.navigateToNew=function(t){this.navigateTo(t);window.history.pushState(t,t.name,this.createShortUrl(t.action,t.id))};this.toActualHistory=function(t){window.history.replaceState(t,t.name,this.createShortUrl(t.action,t.id))};this.createShortUrl=function(t,i){return'./#/'+t+(i?'/'+i:'')}};;var OR_THEMES_EXT_DIR='modules/cms-ui/themes/';$(function(){$('html').removeClass('nojs');$('.initial-hidden').removeClass('initial-hidden');function e(){function e(e){$(e).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};$('div.header').dblclick(function(){e(this)})};e();window.onpopstate=function(e){Openrat.Navigator.navigateTo(e.state)};Openrat.Workbench.initialize();Openrat.Workbench.reloadAll();let registerWorkbenchGlobalEvents=function(){$('.keystroke').each(function(){let keystrokeElement=$(this);let keystroke=keystrokeElement.text();if(keystroke.length==0)return;let keyaction=function(){keystrokeElement.click()};$(document).bind('keydown',keystroke,keyaction)});$('section.toggle-open-close .on-click-open-close').click(function(){var t=$(this).closest('section');if(t.hasClass('disabled'))return;var e=t.find('div.view-loader');if(e.children().length==0)Openrat.Workbench.loadNewActionIntoElement(e)})};$('.or-initial-notice').each(function(){Openrat.Workbench.notify('','','info',$(this).text());$(this).remove()});registerWorkbenchGlobalEvents();let closeMenu=function(){$('body').click(function(){$('.toolbar-icon.menu').parents('.or-menu').removeClass('open')})};closeMenu();Openrat.Workbench.afterNewActionHandler.add(function(){let url='./api/?action=tree&subaction=path&id='+Openrat.Workbench.state.id+'&type='+Openrat.Workbench.state.action+'&output=json';$.getJSON(url,function(e){$('nav .or-navtree-node').removeClass('or-navtree-node--selected');let output=e['output'];$.each(output.path,function(e,t){$nav=$('nav .or-navtree-node[data-type='+t.type+'][data-id='+t.id+'].or-navtree-node--is-closed .or-navtree-node-control');$nav.click()});if(output.actual)$('nav .or-navtree-node[data-type='+output.actual.type+'][data-id='+output.actual.id+']').addClass('or-navtree-node--selected');let $breadcrumb=$('.or-breadcrumb').empty();let items=[];$.each(output.path.concat(output.actual),function(e,t){items.push('<li class="or-breadcrumb-item clickable" tabindex="0"><a href="'+Openrat.Navigator.createShortUrl(t.action,t.id)+'" data-type="open" data-action="'+t.action+'" data-id="'+t.id+'"><i class="image-icon image-icon--action-'+t.action+'" />'+t.name+'</a></li>')});$breadcrumb.append(items.join('<li><i class="tree-icon image-icon image-icon--node-closed"></i></li>'));$('.or-breadcrumb .clickable').orLinkify()}).fail(function(e){console.warn(e);console.warn('failed to load path from '+url)}).always(function(){})})});let filterMenus=function(){let action=Openrat.Workbench.state.action;let id=Openrat.Workbench.state.id;$('div.clickable').addClass('active');$('div.clickable.filtered').removeClass('active').addClass('inactive');$('div.clickable.filtered.on-action-'+action).addClass('active').removeClass('inactive');$('div.clickable.filtered a').attr('data-id',id)};$('#title.view').data('afterViewLoaded',function(){filterMenus()});Openrat.Workbench.afterNewActionHandler.add(function(){filterMenus()});Openrat.Workbench.afterViewLoadedHandler.add(function(e){if(typeof popupWindow!='undefined')$(e).find('a[data-type=\'popup\']').each(function(){popupWindow.location.href=$(this).attr('data-url')})});Openrat.Workbench.afterViewLoadedHandler.add(function(e){var t=$(e).closest('section');t.toggleClass('is-empty',$(e).is(':empty'));if(!$(e).is(':empty'))t.slideDown('fast');else t.slideUp('fast');$(e).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(e).find('.toggle-nav-open-close').click(function(){$('nav').toggleClass('open')});$(e).find('.toggle-nav-small').click(function(){$('nav').toggleClass('small')});$(e).find('div.headermenu > a').each(function(e,t){});$(e).find('div.header > a.back').each(function(t,n){$(n).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo($(e).closest('div.panel').find('div.header div.dropdown').first())});$(e).find('div.selector.tree').each(function(){var e=this;$(this).orTree({type:'project',selectable:$(e).attr('data-types').split(','),id:$(e).attr('data-init-folderid'),onSelect:function(t,n,a){var i=$(e).parent();$(i).find('input[type=text]').attr('value',t);$(i).find('input[type=hidden]').attr('value',a)}})});n(e);$(e).find('input').change(function(){$(this).parent('div.view').addClass('dirty')});$(e).find('.or-theme-chooser').change(function(){Openrat.Workbench.setUserStyle(this.value)});function a(e){$(e).find('.toolbar-icon.menu').click(function(e){e.stopPropagation();$(this).parents('.or-menu').toggleClass('open')});$(e).find('.toolbar-icon.menu').mouseover(function(){$(this).parents('.or-menu').find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')})};function i(e){$(e).find('.search input').orSearch({dropdown:'#title div.search div.dropdown',select:function(e){openNewAction(e.name,e.action,e.id)}})};function o(e){$(e).find('.selector input').orSearch({dropdown:'.dropdown',select:function(t){$(e).find('.or-selector-link-value').val(t.id);$(e).find('.or-selector-link-name').val(t.name).attr('placeholder',t.name)}})};function l(e){$(e).find('.or-navtree-node').orTree()};a(e);i(e);o(e);l(e);function n(e){registerDraggable(e);registerDroppable(e)};n(e)});function registerDraggable(e){$(e).find('.or-draggable').draggable({helper:'clone',opacity:0.7,zIndex:2,distance:10,cursor:'move',revert:'false'})};function registerTreeBranchEvents(e){registerDraggable(e)};function registerDroppable(e){$(e).find('.or-droppable').droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let id=dropped.data('id');let name=dropped.data('name');if(!name)name=id;$(this).find('.or-selector-link-value').val(id);$(this).find('.or-selector-link-name').val(name).attr('placeholder',name)}})};function startDialog(e,t,n,a,i){if(!t)t=$('#editor').attr('data-action');if(!a)a=$('#editor').attr('data-id');let view=new Openrat.View(t,n,a,i);view.before=function(){$('#dialog > .view').html('<div class="header"><img class="icon" title="" src="./themes/default/images/icon/'+n+'.png" />'+e+'</div>');$('#dialog > .view').data('id',a);$('#dialog').removeClass('is-closed').addClass('is-open');let view=this;this.escapeKeyClosingHandler=function(e){if(e.keyCode==27){view.close();$(document).off('keyup')}};$(document).keyup(this.escapeKeyClosingHandler);$('#dialog .filler').click(function(){view.close()})};view.close=function(){if($('div#dialog').hasClass('modal'))return;$('#dialog .view').html('');$('#dialog').removeClass('is-open').addClass('is-closed');$(document).unbind('keyup',this.escapeKeyClosingHandler)};view.start($('div#dialog > .view'))};function setTitle(e){if(e)$('head > title').text(e+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};function openNewAction(e,t,n){$('nav').removeClass('open');setTitle(e);Openrat.Navigator.navigateToNew({'action':t,'id':n})};function insert(e,t,a){var n=document.forms[0].elements[e];n.focus();if(typeof document.selection!='undefined'){var l=document.selection.createRange(),i=l.text;l.text=t+i+a;l=document.selection.createRange();if(i.length==0){l.move('character',-a.length)} +else{l.moveStart('character',t.length+i.length+a.length)};l.select()} +else if(typeof n.selectionStart!='undefined'){var r=n.selectionStart,c=n.selectionEnd,i=n.value.substring(r,c);n.value=n.value.substr(0,r)+t+i+a+n.value.substr(c);var o;if(i.length==0){o=r+t.length} +else{o=r+t.length+i.length+a.length};n.selectionStart=o;n.selectionEnd=o} +else{o=n.value.length;var i=prompt('Text');n.value=n.value.substr(0,o)+t+i+a+n.value.substr(o)}};function help(e,t,n){var a=$(e).closest('div.panel').find('li.action.active').attr('data-action'),i=$(e).closest('div.panel').find('li.action.active').attr('data-method');window.open(t+a+'/'+i+n,'OpenRat_Help','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes')};function htmlEntities(e){return String(e).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;')};function registerOpenClose(e){$(e).children('.on-click-open-close').click(function(){$(this).closest('.toggle-open-close').toggleClass('open closed')})};;Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('textarea').orAutoheight();$(e).find('textarea.editor.code-editor').each(function(){let mode=$(this).data('mode');let mimetype=$(this).data('mimetype');if(mimetype.length>0)mode=mimetype;let textareaEl=this;let editor=CodeMirror.fromTextArea(textareaEl,{lineNumbers:!0,viewportMargin:Infinity,mode:mode});editor.on('change',function(){let newValue=editor.getValue();$(textareaEl).val(newValue)});$(editor.getWrapperElement()).droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let pos=editor.getCursor();editor.setSelection(pos,pos);let insertText=dropped.data('id');let toInsert=''+insertText;editor.replaceSelection(toInsert)}})});$(e).find('textarea.editor.markdown-editor').each(function(){let textarea=this;let toolbar=[{name:'bold',action:SimpleMDE.toggleBold,className:'image-icon image-icon--editor-bold',title:'Bold',},{name:'italic',action:SimpleMDE.toggleItalic,className:'image-icon image-icon--editor-italic',title:'Italic',},{name:'heading',action:SimpleMDE.toggleHeadingBigger,className:'image-icon image-icon--editor-headline',title:'Headline',},'|',{name:'quote',action:SimpleMDE.toggleBlockquote,className:'image-icon image-icon--editor-quote',title:'Quote',},{name:'code',action:SimpleMDE.toggleCodeBlock,className:'image-icon image-icon--editor-code',title:'Code',},'|',{name:'generic list',action:SimpleMDE.toggleUnorderedList,className:'image-icon image-icon--editor-unnumberedlist',title:'Unnumbered list',},{name:'numbered list',action:SimpleMDE.toggleOrderedList,className:'image-icon image-icon--editor-numberedlist',title:'Numbered list',},'|',{name:'table',action:SimpleMDE.drawTable,className:'image-icon image-icon--editor-table',title:'Table',},{name:'horizontalrule',action:SimpleMDE.drawHorizontalRule,className:'image-icon image-icon--editor-horizontalrule',title:'Horizontal rule',},'|',{name:'undo',action:SimpleMDE.undo,className:'image-icon image-icon--editor-undo',title:'Undo',},{name:'redo',action:SimpleMDE.redo,className:'image-icon image-icon--editor-redo',title:'Redo',},'|',{name:'link',action:SimpleMDE.drawLink,className:'image-icon image-icon--editor-link',title:'Link',},{name:'image',action:SimpleMDE.drawImage,className:'image-icon image-icon--editor-image',title:'Image',},'|',{name:'guide',action:'https://simplemde.com/markdown-guide',className:'image-icon image-icon--editor-help',title:'Howto markdown',},];let mde=new SimpleMDE({element:$(this)[0],toolbar:toolbar,autoDownloadFontAwesome:!1});let codemirror=mde.codemirror;$(codemirror.getWrapperElement()).droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let insertText='';let id=dropped.data('id');let url='__OID__'+id+'__';if(dropped.data('type')=='image')insertText='![]('+url+')';else insertText='['+id+']('+url+')';let pos=codemirror.getCursor();codemirror.setSelection(pos,pos);codemirror.replaceSelection(insertText)}});codemirror.on('change',function(){let newValue=codemirror.getValue();$(textarea).val(newValue)})});$(e).find('textarea.editor.html-editor').each(function(){let textarea=this;$.trumbowyg.svgPath='./modules/editor/trumbowyg/ui/icons.svg';$(textarea).trumbowyg();$(textarea).closest('form').find('.trumbowyg-editor').droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let id=dropped.data('id');let url='./?_='+dropped.data('type')+'-'+id+'&subaction=show&embed=1&__OID__'+id+'__='+id;let insertText='';if(dropped.data('type')=='image')insertText='<img src="'+url+'" alt="" />';else insertText='<a href="'+url+'" />'+id+'</a>';$(textarea).trumbowyg('execCmd',{cmd:'insertHTML',param:insertText,forceCss:!1,})}})})});;Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('.clickable').orLinkify()});;Openrat.Workbench.afterViewLoadedHandler.add(function(r){$(r).find('.or-qrcode').mouseover(function(){let r=this;if($(r).children().length>0)return;let wrapper=$('<div class="or-info-popup"></div>');$(r).append(wrapper);var e=$(r).attr('data-qrcode');$(wrapper).qrcode({render:'div',text:e,fill:'currentColor'});wrapper.attr('title','')})});;Openrat.Workbench.afterViewLoadedHandler.add(function(t){$(t).find('table.or-table--sortable > tbody').sortable();$(t).find('table.or-table--sortable > tbody').closest('form').submit(function(){var t=[];$(this).find('table.or-table--sortable').find('tbody > tr.data').each(function(){let objectid=$(this).data('id');t.push(objectid)});$(this).find('input[name=order]').val(t.join(','))});$(t).find('tr.headline > td > input.checkbox').click(function(){$(this).closest('table').find('tr.data > td > input.checkbox').attr('checked',Boolean($(this).attr('checked')))});$(t).find('.or-table-filter > input').keyup(function(){let filterExpression=$(this).val().toLowerCase();let table=$(this).parents('.or-table-wrapper').find('table');table.addClass('loader');setTimeout(()=>{table.find('tr:not(.headline)').filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(filterExpression)>-1)});table.removeClass('loader')},50)});$(t).find('table > tbody > tr.headline > td, table > tbody > tr > th').click(function(){let column=$(this);let table=column.parents('table');table.addClass('loader');let isAscending=!column.hasClass('sort-asc');table.find('tr.headline > td, tr > th').removeClass('sort-asc sort-desc');if(isAscending)column.addClass('sort-asc');else column.addClass('sort-desc');setTimeout(function(){let rows=table.find('tr:gt(0)').toArray().sort(a(column.index()));if(!isAscending){rows=rows.reverse()};for(var t=0;t<rows.length;t++){table.append(rows[t])};table.removeClass('loader')},50)});function a(t){return function(a,l){let valA=e(a,t),valB=e(l,t);return $.isNumeric(valA)&&$.isNumeric(valB)?valA-valB:valA.toString().localeCompare(valB)}};function e(t,e){return $(t).children('td').eq(e).text()}});;Openrat.Workbench.afterViewLoadedHandler.add(function(e){});;;Openrat.Workbench.afterViewLoadedHandler.add(function(e){registerOpenClose($(e).find('.or-group.toggle-open-close'))});;Openrat.Workbench.afterViewLoadedHandler.add(function(e){var o=$(e).find('form'),n=$(e).find('div.or-dropzone-upload > div.input');n.on('dragenter',function(e){e.stopPropagation();e.preventDefault();$(this).css('border','1px dotted gray')});n.on('dragover',function(e){e.stopPropagation();e.preventDefault()});n.on('drop',function(e){$(this).css('border','1px dotted red');e.preventDefault();var n=e.originalEvent.dataTransfer.files;handleFileUpload(o,n)});$(e).find('input[type=file]').change(function(){var e=$(this).prop('files');handleFileUpload(o,e)})});function handleFileUpload(e,a){for(var r=0,t;t=a[r];r++){var n=new FormData();n.append('file',t);n.append('action','folder');n.append('subaction',$(e).data('method'));n.append('output','json');n.append('token',$(e).find('input[name=token]').val());n.append('id',$(e).find('input[name=id]').val());var o=$('<div class="notice info"><div class="text loader"></div></div>');$('#noticebar').prepend(o);$(o).show();$.ajax({'type':'POST',url:'./api/',cache:!1,contentType:!1,processData:!1,data:n,success:function(n,a,r){$(o).remove();let oform=new Openrat.Form();oform.doResponse(n,a,e)},error:function(n,t,d){$(e).closest('div.content').removeClass('loader');$(o).remove();var r;try{var a=jQuery.parseJSON(n.responseText);r=a.error+'/'+a.description+': '+a.reason}catch(i){r=n.responseText};Openrat.Workbench.notify('Upload error',r)}})}};;Openrat.Workbench.afterViewLoadedHandler.add(function(e){});+ \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/common.min.js b/modules/cms/ui/themes/default/script/openrat/common.min.js @@ -1,5 +0,0 @@ -;var OR_THEMES_EXT_DIR='modules/cms-ui/themes/';$(function(){$('html').removeClass('nojs');$('.initial-hidden').removeClass('initial-hidden');function e(){function e(e){$(e).closest('div.panel').fadeOut('fast',function(){$(this).toggleClass('fullscreen').fadeIn('fast')})};$('div.header').dblclick(function(){e(this)})};e();window.onpopstate=function(e){Openrat.Navigator.navigateTo(e.state)};Openrat.Workbench.initialize();Openrat.Workbench.reloadAll();let registerWorkbenchGlobalEvents=function(){$('.keystroke').each(function(){let keystrokeElement=$(this);let keystroke=keystrokeElement.text();if(keystroke.length==0)return;let keyaction=function(){keystrokeElement.click()};$(document).bind('keydown',keystroke,keyaction)});$('section.toggle-open-close .on-click-open-close').click(function(){var t=$(this).closest('section');if(t.hasClass('disabled'))return;var e=t.find('div.view-loader');if(e.children().length==0)Openrat.Workbench.loadNewActionIntoElement(e)})};$('.or-initial-notice').each(function(){Openrat.Workbench.notify('','','info',$(this).text());$(this).remove()});registerWorkbenchGlobalEvents();let closeMenu=function(){$('body').click(function(){$('.toolbar-icon.menu').parents('.or-menu').removeClass('open')})};closeMenu();Openrat.Workbench.afterNewActionHandler.add(function(){let url='./api/?action=tree&subaction=path&id='+Openrat.Workbench.state.id+'&type='+Openrat.Workbench.state.action+'&output=json';$.getJSON(url,function(e){$('nav .or-navtree-node').removeClass('or-navtree-node--selected');let output=e['output'];$.each(output.path,function(e,t){$nav=$('nav .or-navtree-node[data-type='+t.type+'][data-id='+t.id+'].or-navtree-node--is-closed .or-navtree-node-control');$nav.click()});if(output.actual)$('nav .or-navtree-node[data-type='+output.actual.type+'][data-id='+output.actual.id+']').addClass('or-navtree-node--selected');let $breadcrumb=$('.or-breadcrumb').empty();let items=[];$.each(output.path.concat(output.actual),function(e,t){items.push('<li class="or-breadcrumb-item clickable" tabindex="0"><a href="'+Openrat.Navigator.createShortUrl(t.action,t.id)+'" data-type="open" data-action="'+t.action+'" data-id="'+t.id+'"><i class="image-icon image-icon--action-'+t.action+'" />'+t.name+'</a></li>')});$breadcrumb.append(items.join('<li><i class="tree-icon image-icon image-icon--node-closed"></i></li>'));$('.or-breadcrumb .clickable').orLinkify()}).fail(function(e){console.warn(e);console.warn('failed to load path from '+url)}).always(function(){})})});let filterMenus=function(){let action=Openrat.Workbench.state.action;let id=Openrat.Workbench.state.id;$('div.clickable').addClass('active');$('div.clickable.filtered').removeClass('active').addClass('inactive');$('div.clickable.filtered.on-action-'+action).addClass('active').removeClass('inactive');$('div.clickable.filtered a').attr('data-id',id)};$('#title.view').data('afterViewLoaded',function(){filterMenus()});Openrat.Workbench.afterNewActionHandler.add(function(){filterMenus()});Openrat.Workbench.afterViewLoadedHandler.add(function(e){if(typeof popupWindow!='undefined')$(e).find('a[data-type=\'popup\']').each(function(){popupWindow.location.href=$(this).attr('data-url')})});Openrat.Workbench.afterViewLoadedHandler.add(function(e){var t=$(e).closest('section');t.toggleClass('is-empty',$(e).is(':empty'));if(!$(e).is(':empty'))t.slideDown('fast');else t.slideUp('fast');$(e).closest('div.panel').find('div.header div.dropdown div.entry.perview').remove();$(e).find('.toggle-nav-open-close').click(function(){$('nav').toggleClass('open')});$(e).find('.toggle-nav-small').click(function(){$('nav').toggleClass('small')});$(e).find('div.headermenu > a').each(function(e,t){});$(e).find('div.header > a.back').each(function(t,n){$(n).removeClass('button').wrap('<div class="entry perview" />').parent().appendTo($(e).closest('div.panel').find('div.header div.dropdown').first())});$(e).find('div.selector.tree').each(function(){var e=this;$(this).orTree({type:'project',selectable:$(e).attr('data-types').split(','),id:$(e).attr('data-init-folderid'),onSelect:function(t,n,a){var i=$(e).parent();$(i).find('input[type=text]').attr('value',t);$(i).find('input[type=hidden]').attr('value',a)}})});n(e);$(e).find('input').change(function(){$(this).parent('div.view').addClass('dirty')});$(e).find('.or-theme-chooser').change(function(){Openrat.Workbench.setUserStyle(this.value)});function a(e){$(e).find('.toolbar-icon.menu').click(function(e){e.stopPropagation();$(this).parents('.or-menu').toggleClass('open')});$(e).find('.toolbar-icon.menu').mouseover(function(){$(this).parents('.or-menu').find('.toolbar-icon.menu').removeClass('open');$(this).addClass('open')})};function i(e){$(e).find('.search input').orSearch({dropdown:'#title div.search div.dropdown',select:function(e){openNewAction(e.name,e.action,e.id)}})};function o(e){$(e).find('.selector input').orSearch({dropdown:'.dropdown',select:function(t){$(e).find('.or-selector-link-value').val(t.id);$(e).find('.or-selector-link-name').val(t.name).attr('placeholder',t.name)}})};function l(e){$(e).find('.or-navtree-node').orTree()};a(e);i(e);o(e);l(e);function n(e){registerDraggable(e);registerDroppable(e)};n(e)});function registerDraggable(e){$(e).find('.or-draggable').draggable({helper:'clone',opacity:0.7,zIndex:2,distance:10,cursor:'move',revert:'false'})};function registerTreeBranchEvents(e){registerDraggable(e)};function registerDroppable(e){$(e).find('.or-droppable').droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let id=dropped.data('id');let name=dropped.data('name');if(!name)name=id;$(this).find('.or-selector-link-value').val(id);$(this).find('.or-selector-link-name').val(name).attr('placeholder',name)}})};function startDialog(e,t,n,a,i){if(!t)t=$('#editor').attr('data-action');if(!a)a=$('#editor').attr('data-id');let view=new Openrat.View(t,n,a,i);view.before=function(){$('#dialog > .view').html('<div class="header"><img class="icon" title="" src="./themes/default/images/icon/'+n+'.png" />'+e+'</div>');$('#dialog > .view').data('id',a);$('#dialog').removeClass('is-closed').addClass('is-open');let view=this;this.escapeKeyClosingHandler=function(e){if(e.keyCode==27){view.close();$(document).off('keyup')}};$(document).keyup(this.escapeKeyClosingHandler);$('#dialog .filler').click(function(){view.close()})};view.close=function(){if($('div#dialog').hasClass('modal'))return;$('#dialog .view').html('');$('#dialog').removeClass('is-open').addClass('is-closed');$(document).unbind('keyup',this.escapeKeyClosingHandler)};view.start($('div#dialog > .view'))};function setTitle(e){if(e)$('head > title').text(e+' - '+$('head > title').data('default'));else $('head > title').text($('head > title').data('default'))};function openNewAction(e,t,n){$('nav').removeClass('open');setTitle(e);Openrat.Navigator.navigateToNew({'action':t,'id':n})};function insert(e,t,a){var n=document.forms[0].elements[e];n.focus();if(typeof document.selection!='undefined'){var l=document.selection.createRange(),i=l.text;l.text=t+i+a;l=document.selection.createRange();if(i.length==0){l.move('character',-a.length)} -else{l.moveStart('character',t.length+i.length+a.length)};l.select()} -else if(typeof n.selectionStart!='undefined'){var r=n.selectionStart,c=n.selectionEnd,i=n.value.substring(r,c);n.value=n.value.substr(0,r)+t+i+a+n.value.substr(c);var o;if(i.length==0){o=r+t.length} -else{o=r+t.length+i.length+a.length};n.selectionStart=o;n.selectionEnd=o} -else{o=n.value.length;var i=prompt('Text');n.value=n.value.substr(0,o)+t+i+a+n.value.substr(o)}};function help(e,t,n){var a=$(e).closest('div.panel').find('li.action.active').attr('data-action'),i=$(e).closest('div.panel').find('li.action.active').attr('data-method');window.open(t+a+'/'+i+n,'OpenRat_Help','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes')};function htmlEntities(e){return String(e).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;')};function registerOpenClose(e){$(e).children('.on-click-open-close').click(function(){$(this).closest('.toggle-open-close').toggleClass('open closed')})};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/form.min.js b/modules/cms/ui/themes/default/script/openrat/form.min.js @@ -1,4 +0,0 @@ -;Openrat.Form=function(){const modes={showBrowserNotice:1,keepOpen:2,closeAfterSubmit:4,closeAfterSuccess:8,};this.setLoadStatus=function(e){$(this.element).closest('div.content').toggleClass('loader',e)};this.initOnElement=function(e){this.element=e;let form=this;if($(this.element).data('autosave')){$(this.element).find('input[type="checkbox"]').click(function(){form.submit(modes.keepOpen)});$(this.element).find('select').change(function(){form.submit(modes.keepOpen)})};$(e).find('.or-form-btn--cancel').click(function(){form.cancel()});$(e).find('.or-form-btn--reset').click(function(){form.rollback()});$(e).find('.or-form-btn--apply').click(function(){form.submit(modes.keepOpen)});$(e).submit(function(e){if($(this).data('target')=='view'){form.submit();e.preventDefault()}})};this.cancel=function(){this.close()};this.rollback=function(){this.element.trigger('reset')};this.close=function(){};this.forwardTo=function(e,t,s,o){let view=new Openrat.View(e,t,s,o);view.start($(this.element).closest('.view'))};this.submit=function(e){if(e===undefined)if($(this.element).data('async'))e=modes.closeAfterSubmit;else e=modes.closeAfterSuccess;let status=$('<div class="notice info"><div class="text loader"></div></div>');$('#noticebar').prepend(status);$(status).show();$(this.element).find('.error').removeClass('error');let params=$(this.element).serializeArray();let data={};$(params).each(function(e,t){data[t.name]=t.value});if(!data.id)data.id=Openrat.Workbench.state.id;if(!data.action)data.action=Openrat.Workbench.state.action;let formMethod=$(this.element).attr('method').toUpperCase();if(formMethod=='GET'){this.forwardTo(data.action,data.subaction,data.id,data);$(status).remove()} -else{let url='./api/';this.setLoadStatus(!0);url+='';data.output='json';if(e==modes.closeAfterSubmit)this.close();let form=this;$.ajax({'type':'POST',url:url,data:data,success:function(t,s,o){form.setLoadStatus(!1);$(status).remove();form.doResponse(t,s,form.element,function(){if(e==modes.closeAfterSuccess){form.close();$(form.element).closest('div.panel').find('div.header ul.views li.action.active').removeClass('dirty')};let afterSuccess=$(form.element).data('afterSuccess');let async=$(form.element).data('async');if(afterSuccess){if(afterSuccess=='reloadAll'){Openrat.Workbench.reloadAll()}} -else{if(async);else Openrat.Workbench.reloadViews()}})},error:function(e,t,s){form.setLoadStatus(!1);$(status).remove();try{let error=jQuery.parseJSON(e.responseText);Openrat.Workbench.notify('','','error',error.error,[error.description])}catch(o){let msg=e.responseText;Openrat.Workbench.notify('','','error','Server Error',[msg])}}});$(form.element).fadeIn()}};this.doResponse=function(e,t,s,onSuccess=$.noop){if(t!='success'){alert('Server error: '+t);return};let form=this;$.each(e['notices'],function(t,e){let notifyBrowser=$(s).data('async');Openrat.Workbench.notify(e.type,e.name,e.status,e.text,e.log,notifyBrowser);if(e.status=='ok'){onSuccess();Openrat.Workbench.dataChangedHandler.fire()} -else{}});$.each(e['errors'],function(e,t){$('input[name='+t+']').addClass('error').parent().addClass('error').parents('fieldset').addClass('show').addClass('open')});if(e.control.redirect)window.location.href=e.control.redirect}};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/init.min.js b/modules/cms/ui/themes/default/script/openrat/init.min.js @@ -1 +0,0 @@ -;window.Openrat={};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/navigator.min.js b/modules/cms/ui/themes/default/script/openrat/navigator.min.js @@ -1 +0,0 @@ -;Openrat.Navigator=new function(){'use strict';this.navigateTo=function(t){Openrat.Workbench.loadNewActionState(t)};this.navigateToNew=function(t){this.navigateTo(t);window.history.pushState(t,t.name,this.createShortUrl(t.action,t.id))};this.toActualHistory=function(t){window.history.replaceState(t,t.name,this.createShortUrl(t.action,t.id))};this.createShortUrl=function(t,i){return'./#/'+t+(i?'/'+i:'')}};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/view.min.js b/modules/cms/ui/themes/default/script/openrat/view.min.js @@ -1,3 +0,0 @@ -;Openrat.View=function(e,t,i,r){this.action=e;this.method=t;this.id=i;this.params=r;this.before=function(){};this.start=function(e){this.before();this.element=e;this.loadView()};this.afterLoad=function(){};this.close=function(){};function n(e){Openrat.Workbench.afterViewLoadedHandler.fire(e);let f=$(e).data('afterViewLoaded');if(f instanceof Function)f(e)};this.loadView=function(){let url=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!1);let element=this.element;let view=this;let loadViewHtmlPromise=$.ajax(url);$(this.element).addClass('loader');loadViewHtmlPromise.done(function(e,t){if(!e)e='';$(element).html(e).removeClass('loader');$(element).find('form').each(function(){let form=new Openrat.Form();form.close=function(){view.close()};form.initOnElement(this)});n(element)});loadViewHtmlPromise.fail(function(e,t,i){$(element).html('');Openrat.Workbench.notify('','','error','Server Error',['Server Error while requesting url '+url,t])});let apiUrl=Openrat.View.createUrl(this.action,this.method,this.id,this.params,!0);loadViewHtmlPromise.done(function(){})};Openrat.View.createUrl=function(e,subaction,i,extraid={},api=!1){let url='./';if(api)url+='api/';url+='?';if(e)url+='&action='+e;if(subaction)url+='&subaction='+subaction;if(i)url+='&id='+i;if(typeof extraid==='string'){extraid=extraid.replace(/'/g,'"');let extraObject=jQuery.parseJSON(extraid);jQuery.each(extraObject,function(e,t){url=url+'&'+e+'='+t})} -else if(typeof extraid==='object'){jQuery.each(extraid,function(e,t){url=url+'&'+e+'='+t})} -else{};return url}};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/openrat/workbench.min.js b/modules/cms/ui/themes/default/script/openrat/workbench.min.js @@ -1,3 +0,0 @@ -;Openrat.Workbench=new function(){'use strict';this.state={};this.initialize=function(){this.initializePingTimer();this.initializeState();this.openModalDialog()};this.openModalDialog=function(){if($('#dialog').data('action')){startDialog('',$('#dialog').data('action'),$('#dialog').data('action'),0,{})}};this.initializeState=function(){let parts=window.location.hash.split('/');let state={action:'index',id:0};if(parts.length>=2)state.action=parts[1].toLowerCase();if(parts.length>=3)state.id=parts[2].replace(/[^0-9_]/gim,'');Openrat.Workbench.state=state;$('#editor').attr('data-action',state.action);$('#editor').attr('data-id',state.id);$('#editor').attr('data-extra','{}');Openrat.Navigator.toActualHistory(state)};this.initializePingTimer=function(){let ping=function(){let pingPromise=$.getJSON(Openrat.View.createUrl('profile','ping',0,{},!0));pingPromise.fail(function(){console.warn('The server ping has failed.')})};let timeoutMinutes=5;window.setInterval(ping,timeoutMinutes*60*1000)};this.loadNewActionState=function(t){Openrat.Workbench.state=t;Openrat.Workbench.loadNewAction(t.action,t.id,t.data);this.afterNewActionHandler.fire()};this.afterNewActionHandler=$.Callbacks();this.loadNewAction=function(t,e,i){$('#editor').attr('data-action',t);$('#editor').attr('data-id',e);$('#editor').attr('data-extra',JSON.stringify(i));this.reloadViews()};this.reloadViews=function(){$('#workbench section.closed .view-loader').empty();Openrat.Workbench.loadViews($('#workbench section.open .view-loader'))};this.reloadAll=function(){$('#workbench .view').empty();Openrat.Workbench.loadViews($('#workbench .view.view-loader, #workbench .view.view-static'));this.loadUserStyle();this.loadLanguage();this.loadUISettings()};this.loadUserStyle=function(){let url=Openrat.View.createUrl('profile','userinfo',0,{},!0);$.getJSON(url,function(t){let style=t.output['style'];Openrat.Workbench.setUserStyle(style);let color=t.output['theme-color'];Openrat.Workbench.setThemeColor(color)})};this.settings={};this.language={};this.loadLanguage=function(){let url=Openrat.View.createUrl('profile','language',0,{},!0);$.getJSON(url,function(t){Openrat.Workbench.language=t.output.language})};this.loadUISettings=function(){let url=Openrat.View.createUrl('profile','uisettings',0,{},!0);$.getJSON(url,function(t){Openrat.Workbench.settings=t.output.settings.settings})};this.loadViews=function(t){t.each(function(t){let $targetDOMElement=$(this);Openrat.Workbench.loadNewActionIntoElement($targetDOMElement)})};this.loadNewActionIntoElement=function(t){let action;if(t.is('.view-static'))action=t.attr('data-action');else action=$('#editor').attr('data-action');let id=$('#editor').attr('data-id');let params=$('#editor').attr('data-extra');let method=t.data('method');let view=new Openrat.View(action,method,id,params);view.start(t)};this.setUserStyle=function(t){var e=$('html'),i=e.attr('class').split(/\s+/);$.each(i,function(t,i){if(i.startsWith('theme-')){e.removeClass(i)}});e.addClass('theme-'+t.toLowerCase())};this.setThemeColor=function(t){$('#theme-color').attr('content',t)};let notifyBrowser=function(t){if(!('Notification' in window)){return} -else if(Notification.permission==='granted'){let notification=new Notification(t)} -else if(Notification.permission!=='denied'){Notification.requestPermission(function(e){if(e==='granted'){let notification=new Notification(t)}})}};this.notify=function(t,i,e,o,log=[],notifyTheBrowser=!1){if(notifyTheBrowser)notifyBrowser(o);let notice=$('<div class="notice '+e+'"></div>');let toolbar=$('<div class="or-notice-toolbar"></div>');if(log.length)$(toolbar).append('<i class="or-action-full image-icon image-icon--menu-fullscreen"></i>');$(toolbar).append('<i class="or-action-close image-icon image-icon--menu-close"></i>');$(notice).append(toolbar);let id=0;if(i)$(notice).append('<div class="name clickable"><a href="" data-type="open" data-action="'+t+'" data-id="'+id+'"><i class="or-action-full image-icon image-icon--action-'+t+'"></i> '+i+'</a></div>');$(notice).append('<div class="text">'+htmlEntities(o)+'</div>');if(log.length){let logLi=log.reduce((result,item)=>{result+='<li><pre>'+htmlEntities(item)+'</pre></li>';return result},'');$(notice).append('<div class="log"><ul>'+logLi+'</ul></div>')};$('#noticebar').prepend(notice);$(notice).orLinkify();$(notice).find('.or-action-full').click(function(){$(notice).toggleClass('full')});$(notice).find('.or-action-close').click(function(){$(notice).fadeOut('fast',function(){$(notice).remove()})});let timeout=1;if(e=='ok')timeout=20;if(e=='info')timeout=60;if(e=='warning')timeout=120;if(e=='error')timeout=120;if(timeout>0)setTimeout(function(){$(notice).fadeOut('slow',function(){$(this).remove()})},timeout*1000)};this.dataChangedHandler=$.Callbacks();this.dataChangedHandler.add(function(){if(popupWindow!==undefined)popupWindow.location.reload()});this.afterViewLoadedHandler=$.Callbacks();let afterViewFunctions=[];this.registerAfterViewLoaded=function(t){afterViewFunctions.push(t)};this.afterViewLoaded=function(t){afterViewFunctions.forEach(function(e){e(t)})}};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orAutoheight.min.js b/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orAutoheight.min.js @@ -1 +0,0 @@ -;jQuery.fn.orAutoheight=function(){var t=function(t){var n=$(t).val().split('\n').length;$(t).attr('rows',n+3)};$(this).each(function(n){t(this)});return $(this).keypress(function(){t(this)})};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js b/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orLinkify.min.js @@ -1 +0,0 @@ -;var popupWindow;jQuery.fn.orLinkify=function(){$(this).find('a').click(function(t){t.preventDefault()});return $(this).click(function(){$(this).find('a').first().each(function(){let type=$(this).attr('data-type');if($(this).parent().hasClass('inactive'))return;switch(type){case'post':$form=$('<form />').attr('method','POST').addClass('invisible');$form.data('afterSuccess',$(this).data('afterSuccess'));let params=jQuery.parseJSON($(this).attr('data-data'));params.output='json';$.each(params,function(t,a){let $input=$('<input />').attr('type','hidden').attr('name',t).attr('value',a);$form.append($input)});let form=new Openrat.Form();form.initOnElement($form);form.submit();break;case'edit':case'dialog':startDialog($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-method'),$(this).attr('data-id'),$(this).attr('data-extra'));break;case'external':window.open($(this).attr('data-url'),' _blank');break;case'popup':popupWindow=window.open($(this).attr('data-url'),'Popup','location=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes');break;case'help':help(this,$(this).attr('data-url'),$(this).attr('data-suffix'));break;case'fullscreen':fullscreen(this);break;case'open':openNewAction($(this).attr('data-name'),$(this).attr('data-action'),$(this).attr('data-id'));break;default:throw'UI error: Unknown link type: '+type+' in link '+$(this).html()}})})};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orSearch.min.js b/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orSearch.min.js @@ -1,2 +0,0 @@ -;jQuery.fn.orSearch=function(e){var t=$.extend({'dropdown':$(),'select':function(e){}},e);return $(this).on('input',function(){let searchArgument=$(this).val();let dropdownEl=$(t.dropdown);if(searchArgument.length>3){$(dropdownEl).empty();$.ajax({'type':'GET',url:'./api/?action=search&subaction=quicksearch&output=json&search='+searchArgument,data:null,success:function(e,n,r){for(id in e.output.result){let result=e.output.result[id];let div=$('<div class="entry or-search-result" title="'+result.desc+'"></div>');div.data('object',{'name':result.name,'action':result.type,'id':result.id});let link=$('<a />').attr('href',Openrat.Navigator.createShortUrl(result.type,result.id));link.click(function(e){e.preventDefault()});$(link).append('<i class="image-icon image-icon--action-'+result.type+'" />');$(link).append('<span>'+result.name+'</span>');$(div).append(link);$(dropdownEl).append(div)};$(dropdownEl).closest('.or-menu').addClass('open');$(dropdownEl).find('.or-search-result').click(function(e){t.select($(this).data('object'))})}})} -else{$(dropdownEl).empty()}})};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orTree.min.js b/modules/cms/ui/themes/default/script/plugin/jquery-plugin-orTree.min.js @@ -1,4 +0,0 @@ -;jQuery.fn.orTree=function(){$(this).each(function(a,e){$(e).children('.or-navtree-node-control').click(function(){var a=$(this).parent('.or-navtree-node');if($(a).is('.or-navtree-node--is-open')){$(a).children('ul').slideUp('fast').remove();$(a).removeClass('or-navtree-node--is-open').addClass('or-navtree-node--is-closed').find('.tree-icon').removeClass('image-icon--node-open').addClass('image-icon--node-closed')} -else{$(e).closest('div.view').addClass('loader');var i=$(a).data('type'),o=$(a).data('id'),t=$(a).data('extra'),n='./api/?action=tree&subaction=loadBranch&id='+o+'&type='+i+'&output=json';if(typeof t==='string'){jQuery.each(jQuery.parseJSON(t.replace(/'/g,'"')),function(e,a){n=n+'&'+e+'='+a})} -else if(typeof t==='object'){jQuery.each(t,function(e,a){n=n+'&'+e+'='+a})} -else{};$.getJSON(n,function(a){let ul=$('<ul class="or-navtree-list" />');$(e).append(ul);let output=a['output'];$.each(output['branch'],function(a,e){let new_li=$('<li class="or-navtree-node or-navtree-node--is-closed or-draggable or-draggable--type-'+e.type+'" data-name="'+e.text+'" data-id="'+e.internalId+'" data-type="'+e.type+'" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'"><div class="tree or-navtree-node-control"><i class="tree-icon image-icon image-icon--node-closed"></i></div><div class="clickable"><a href="'+Openrat.Navigator.createShortUrl(e.action,e.internalId)+'" class="entry" data-extra="'+JSON.stringify(e.extraId).replace(/"/g,'\'')+'" data-id="'+e.internalId+'" data-action="'+e.action+'" data-type="open" title="'+e.description+'"><i class="image-icon image-icon--action-'+e['icon']+'"></i> '+e.text+'</a></div></li>');$(ul).append(new_li);$(new_li).orTree();$(new_li).find('.clickable').orLinkify();$(new_li).find('.clickable a').click(function(e){e.preventDefault()});registerTreeBranchEvents(ul)});$(ul).slideDown('fast')}).fail(function(){Openrat.Workbench.notify('','','ERROR','failed to load subtree',[],!1)}).always(function(){$(e).closest('div.view').removeClass('loader')});$(a).addClass('or-navtree-node--is-open').removeClass('or-navtree-node--is-closed').find('.tree-icon').addClass('image-icon--node-open').removeClass('image-icon--node-closed')}})})};- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-base.css b/modules/cms/ui/themes/default/style/openrat-base.css @@ -1,205 +0,0 @@ -/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ -/* Customized for OR-CMS */ -html { - font-family: 'Oxygen', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; - font-size: 0.8em; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} -body { - margin: 0; -} -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -nav, -section, -summary { - display: block; -} -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} -audio:not([controls]) { - display: none; - height: 0; -} -[hidden], -template { - display: none; -} -a { - background: transparent; -} -a:active, -a:hover { - outline: 0; -} -abbr[title] { - border-bottom: 1px dotted; -} -b, -strong { - font-weight: bold; -} -dfn { - font-style: italic; -} -h1 { - font-size: 1.2em; - margin: 0.67em 0; -} -mark { - background: #ff0; - color: #000; -} -small { - font-size: 80%; -} -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sup { - top: -0.5em; -} -sub { - bottom: -0.25em; -} -img { - border: 0; -} -svg:not(:root) { - overflow: hidden; -} -figure { - margin: 1em 40px; -} -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} -pre { - overflow: auto; -} -code, -kbd, -pre, -samp { - font-family: 'Source Code Pro', monospace, monospace; - font-size: 1em; -} -button, -input, -optgroup, -select, -textarea { - color: inherit; - background-color: inherit; - font: inherit; - margin: 0; -} -button { - overflow: visible; -} -button, -select { - text-transform: none; -} -button, -html input[type="button"] { - -webkit-appearance: button; - cursor: pointer; -} -button[disabled], -html input[disabled] { - cursor: default; -} -button input::-moz-focus-inner { - border: 0; - padding: 0; -} -input { - line-height: normal; -} -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - padding: 0; -} -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} -input[type="search"] { - -webkit-appearance: textfield; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} -legend { - border: 0; - padding: 0; -} -textarea { - overflow: auto; -} -optgroup { - font-weight: bold; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -td, -th { - padding: 0; - text-align: left; -} -/* Box-Sizing: We are using border-box as this is the most intuitive way for sizing. */ -*, -::before, -::after { - box-sizing: border-box; -} -/* After page loading, all elements are hidden. This class will be removed by javascript. */ -.initial-hidden { - display: none; -} -.sort-value { - display: none; -} -legend { - font-size: 1.1em; - font-weight: bold; - padding: 0 0.5em; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-base.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3BAAKA%3BCACE%2CaAAa%2CUAAU%2C6CAA6C%2CYAAY%2CaAAa%2CUAAU%2CaACvG%2CaAAa%2CcAAc%2C4BAD3B%3BCAEA%3BCACA%3BCACA%3B%3BAAIF%3BCAAO%3B%3BAAMP%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BCACE%3B%3BAAKF%3BAACA%3BAACA%3BAACA%3BCACE%3BCACA%3B%3BAAKF%2CKAAK%2CIAAI%3BCACP%3BCACA%3B%3BAAKF%3BAACA%3BCACE%3B%3BAAKF%3BCACE%3B%3BAAEA%2CCAAC%3BAACD%2CCAAC%3BCACC%3B%3BAAOJ%2CIAAI%3BCAAU%2CyBAAA%3B%3BAAGd%3BAACA%3BCACE%3B%3BAAIF%3BCAAM%3B%3BAAGN%3BCACE%3BCACA%2CgBAAA%3B%3BAAIF%3BCACE%3BCACA%3B%3BAAIF%3BCAAQ%3B%3BAAGR%3BAACA%3BCACE%3BCACA%3BCACA%3BCACA%3B%3BAAGF%3BCAAM%3B%3BAACN%3BCAAM%3B%3BAAIN%3BCAAM%3B%3BAAGN%2CGAAG%2CIAAI%3BCAAU%3B%3BAAIjB%3BCAAS%2CgBAAA%3B%3BAAGT%3BCACE%3BCACA%3BCACA%3B%3BAAIF%3BCAAM%3B%3BAAGN%3BAACA%3BAACA%3BAACA%3BCACE%2CaAAa%2CuCAAb%3BCACA%3B%3BAAWF%3BAACA%3BAACA%3BAACA%3BAACA%3BCACE%3BCACA%3BCACA%3BCACA%3B%3BAAIF%3BCAAS%3B%3BAAMT%3BAACA%3BCACE%3B%3BAAMF%3BAACA%2CIAAK%2CMAAK%3BCACR%3BCACA%3B%3BAAIF%2CMAAM%3BAACN%2CIAAK%2CMAAK%3BCACR%3B%3BAAMA%2CMADF%2CMACG%3BCACC%3BCACA%3B%3BAAKJ%3BCACE%3B%3BAACA%2CKAAC%3BAACD%2CKAAC%3BCACC%3BCACA%3B%3BAAOF%2CKAAC%3BAACD%2CKAAC%3BCACC%3BCACA%3B%3BAAOA%2CKADD%2CeACE%3BAACD%2CKAFD%2CeAEE%3BCACC%3B%3BAAMJ%2CKAAC%3BCACC%3BCACA%3BCACA%3BCACA%3B%3BAAKA%2CKATD%2CeASE%3BAACD%2CKAVD%2CeAUE%3BCACC%3B%3BAAON%3BCACE%2CyBAAA%3BCACA%2CaAAA%3BCACA%2C8BAAA%3B%3BAAKF%3BCACE%3BCACA%3B%3BAAIF%3BCAAW%3B%3BAAIX%3BCAAW%3B%3BAAIX%3BCACE%3BCACA%3B%3BAAGF%3BAACA%3BCACE%3BCACA%3B%3B%3BAAUF%3BAAAG%3BAAAU%3BCACX%3B%3B%3BAAOF%3BCACE%3B%3BAAGF%3BCACE%3B%3BAAKF%3BCACI%3BCACA%3BCACA%2CgBAAA%22%7D */- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-base.min.css b/modules/cms/ui/themes/default/style/openrat-base.min.css @@ -1 +0,0 @@ -/*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family: 'Oxygen', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;font-size: 0.8em;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%}body{margin: 0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display: block}audio,canvas,progress,video{display: inline-block;vertical-align: baseline}audio:not([controls]){display: none;height: 0}[hidden],template{display: none}a{background: transparent}a:active,a:hover{outline: 0}abbr[title]{border-bottom: 1px dotted}b,strong{font-weight: bold}dfn{font-style: italic}h1{font-size: 1.2em;margin: .67em 0}mark{background: #ff0;color: #000}small{font-size: 80%}sub,sup{font-size: 75%;line-height: 0;position: relative;vertical-align: baseline}sup{top: -0.5em}sub{bottom: -0.25em}img{border: 0}svg:not(:root){overflow: hidden}figure{margin: 1em 40px}hr{-moz-box-sizing: content-box;box-sizing: content-box;height: 0}pre{overflow: auto}code,kbd,pre,samp{font-family: 'Source Code Pro', monospace, monospace;font-size: 1em}button,input,optgroup,select,textarea{color: inherit;background-color: inherit;font: inherit;margin: 0}button{overflow: visible}button,select{text-transform: none}button,html input[type="button"]{-webkit-appearance: button;cursor: pointer}button[disabled],html input[disabled]{cursor: default}button input::-moz-focus-inner{border: 0;padding: 0}input{line-height: normal}input[type="reset"],input[type="submit"]{-webkit-appearance: button;cursor: pointer}input[type="checkbox"],input[type="radio"]{box-sizing: border-box;padding: 0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height: auto}input[type="search"]{-webkit-appearance: textfield;-moz-box-sizing: content-box;-webkit-box-sizing: content-box;box-sizing: content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance: none}fieldset{border: 1px solid #c0c0c0;margin: 0 2px;padding: .35em .625em .75em}legend{border: 0;padding: 0}textarea{overflow: auto}optgroup{font-weight: bold}table{border-collapse: collapse;border-spacing: 0}td,th{padding: 0;text-align: left}*,::before,::after{box-sizing: border-box}.initial-hidden{display: none}.sort-value{display: none}legend{font-size: 1.1em;font-weight: bold;padding: 0 .5em}- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-header.css b/modules/cms/ui/themes/default/style/openrat-header.css @@ -1,101 +0,0 @@ -/* H e a d e r */ -#title { - overflow: hidden; - padding: 5px; -} -.or-menu { - display: flex; - justify-content: space-between; - /* Dropdown anzeigen, wenn Titel geöffnet und wenn mit Maus überstrichen */ -} -.or-menu .or-menu-group { - display: flex; - /* Pfeile */ -} -.or-menu .or-menu-group:nth-last-child(1) div.dropdown { - right: 10px; -} -.or-menu .or-menu-group i.image-icon { - width: 1.1em; -} -.or-menu .or-menu-group div > div.arrow-down { - width: 0; - height: 0; - margin: 6px; - padding: 0px; - margin-top: 10px; -} -.or-menu .or-menu-group div.toolbar-icon { - padding: 2px; - margin-left: 10px; - float: left; - /* Bestimmte Menüs sind nach rechts ausgerichet */ - /* D r o p d o w n - M e n u e s */ -} -.or-menu .or-menu-group div.toolbar-icon.user, -.or-menu .or-menu-group div.toolbar-icon.search, -.or-menu .or-menu-group div.toolbar-icon.history { - float: right; - margin-right: 10px; - margin-left: 10px; -} -.or-menu .or-menu-group div.toolbar-icon.menu { - cursor: default; -} -.or-menu .or-menu-group div.toolbar-icon.search .inputholder { - margin: 0; - padding: 0; - border: 0; - display: inline; -} -.or-menu .or-menu-group div.toolbar-icon.search .inputholder input { - border: 0; - margin: 0; - padding: 0; - width: 3em; - display: inline; - transition: width 0.3s ease-in-out; -} -.or-menu .or-menu-group div.toolbar-icon.search .inputholder input:focus { - width: 8em; -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown { - z-index: 120; - min-width: 250px; - display: none; - position: absolute; - padding: 5px 0px; - font-style: normal; - font-weight: normal; - text-decoration: none; -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry { - padding: 0; - /* Außenabstand Text */ -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a { - display: flex; - align-items: center; - padding: 0 0.5em; -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a * { - margin: 0.25em; -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a span:first-of-type { - flex: 1; - /* Menü-Text füllt den Platz auf */ -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > .text { - display: block; - margin: 10px; -} -.or-menu .or-menu-group div.toolbar-icon div.dropdown div.divide { - height: 1px; - width: 100%; - margin-top: 5px; - margin-bottom: 5px; -} -.or-menu.open .toolbar-icon.open > div.dropdown { - display: block; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-header.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3BAACA%3BCAEI%3BCACA%3B%3BAAGJ%3BCAEI%3BCACA%3B%3B%3BAAHJ%2CQAKI%3BCACI%3B%3B%3BAAGA%2CQAJJ%2CeAIK%2CeAAe%2CGACZ%2CIAAG%3BCACC%3B%3BAAXhB%2CQAKI%2CeASI%2CEAAC%3BCAEG%3B%3BAAhBZ%2CQAKI%2CeAcI%2CIAAM%2CMAAG%3BCACL%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAxBZ%2CQAKI%2CeAsBI%2CIAAG%3BCACC%3BCAEA%3BCACA%3B%3B%3B%3BAAGA%2CQA7BR%2CeAsBI%2CIAAG%2CaAOE%3BAACD%2CQA9BR%2CeAsBI%2CIAAG%2CaAQE%3BAACD%2CQA%5C%2FBR%2CeAsBI%2CIAAG%2CaASE%3BCACG%3BCACA%3BCACA%3B%3BAAGJ%2CQArCR%2CeAsBI%2CIAAG%2CaAeE%3BCACG%3B%3BAAEJ%2CQAxCR%2CeAsBI%2CIAAG%2CaAkBE%2COACG%3BCACI%3BCACA%3BCACA%3BCACA%3B%3BAALR%2CQAxCR%2CeAsBI%2CIAAG%2CaAkBE%2COACG%2CaAMI%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%2CkCAAA%3B%3BAACA%2CQAtDpB%2CeAsBI%2CIAAG%2CaAkBE%2COACG%2CaAMI%2CMAOK%3BCACG%3B%3BAA5D5B%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%3BCACC%3BCACA%3BCACA%3BCACA%3BCACA%2CgBAAA%3BCAEA%3BCACA%3BCACA%3B%3BAA%5C%2FEhB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%3BCACC%3B%3B%3BAAlFpB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAGG%3BCACE%3BCACA%3BCACA%2CgBAAA%3B%3BAAvFxB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAGG%2CIAKE%3BCACI%3B%3BAA1F5B%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAGG%2CIASE%2CKAAI%3BCACA%3B%3B%3BAA9F5B%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAkBG%3BCACE%3BCACA%3B%3BAArGxB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAmCC%2CIAAG%3BCACC%3BCACA%3BCACA%3BCACA%3B%3BAAShB%2CQAAC%2CKACG%2CcAAa%2CKACP%2CMAAG%3BCACD%22%7D */- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-header.min.css b/modules/cms/ui/themes/default/style/openrat-header.min.css @@ -1 +0,0 @@ -#title{overflow: hidden;padding: 5px}.or-menu{display: flex;justify-content: space-between}.or-menu .or-menu-group{display: flex}.or-menu .or-menu-group:nth-last-child(1) div.dropdown{right: 10px}.or-menu .or-menu-group i.image-icon{width: 1.1em}.or-menu .or-menu-group div > div.arrow-down{width: 0;height: 0;margin: 6px;padding: 0px;margin-top: 10px}.or-menu .or-menu-group div.toolbar-icon{padding: 2px;margin-left: 10px;float: left}.or-menu .or-menu-group div.toolbar-icon.user,.or-menu .or-menu-group div.toolbar-icon.search,.or-menu .or-menu-group div.toolbar-icon.history{float: right;margin-right: 10px;margin-left: 10px}.or-menu .or-menu-group div.toolbar-icon.menu{cursor: default}.or-menu .or-menu-group div.toolbar-icon.search .inputholder{margin: 0;padding: 0;border: 0;display: inline}.or-menu .or-menu-group div.toolbar-icon.search .inputholder input{border: 0;margin: 0;padding: 0;width: 3em;display: inline;transition: width .3s ease-in-out}.or-menu .or-menu-group div.toolbar-icon.search .inputholder input:focus{width: 8em}.or-menu .or-menu-group div.toolbar-icon div.dropdown{z-index: 120;min-width: 250px;display: none;position: absolute;padding: 5px 0px;font-style: normal;font-weight: normal;text-decoration: none}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry{padding: 0}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a{display: flex;align-items: center;padding: 0 .5em}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a *{margin: 0.25em}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a span:first-of-type{flex: 1}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > .text{display: block;margin: 10px}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.divide{height: 1px;width: 100%;margin-top: 5px;margin-bottom: 5px}.or-menu.open .toolbar-icon.open > div.dropdown{display: block}- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-navigation.css b/modules/cms/ui/themes/default/style/openrat-navigation.css @@ -1,30 +0,0 @@ -/* N a v i g a t i o n */ -#navigation ul.or-navtree-list { - list-style-type: none; - margin: 0; - padding: 0; -} -#navigation ul.or-navtree-list ul { - margin-left: 18px; -} -#navigation ul.or-navtree-list .or-navtree-node-control { - width: 18px; - min-width: 18px; - height: 18px; - float: left; - cursor: pointer; -} -#navigation ul.or-navtree-list .or-navtree-node { - margin: 0; - padding: 0; - line-height: 18px; - font-weight: normal; - white-space: nowrap; -} -#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected { - font-weight: bold; -} -#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected > div > a { - font-weight: bold; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-navigation.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3BAAEA%2CWAEI%2CGAAE%3BCAEE%3BCACA%3BCACA%3B%3BAANR%2CWAEI%2CGAAE%2CgBAME%3BCACI%3B%3BAATZ%2CWAEI%2CGAAE%2CgBASE%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAhBZ%2CWAEI%2CGAAE%2CgBAgBE%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAEA%2CWAvBR%2CGAAE%2CgBAgBE%2CiBAOK%3BCACG%3B%3BAACA%2CWAzBZ%2CGAAE%2CgBAgBE%2CiBAOK%2C0BAEO%2CMAAM%3BCACN%22%7D */- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-navigation.min.css b/modules/cms/ui/themes/default/style/openrat-navigation.min.css @@ -1 +0,0 @@ -#navigation ul.or-navtree-list{list-style-type: none;margin: 0;padding: 0}#navigation ul.or-navtree-list ul{margin-left: 18px}#navigation ul.or-navtree-list .or-navtree-node-control{width: 18px;min-width: 18px;height: 18px;float: left;cursor: pointer}#navigation ul.or-navtree-list .or-navtree-node{margin: 0;padding: 0;line-height: 18px;font-weight: normal;white-space: nowrap}#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected{font-weight: bold}#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected > div > a{font-weight: bold}- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-ui.css b/modules/cms/ui/themes/default/style/openrat-ui.css @@ -1,751 +0,0 @@ -/* Usage to this variable is safe to be removed */ -/* oxygen-regular - latin */ -@font-face { - font-family: 'Oxygen'; - font-style: normal; - font-weight: 400; - src: local('Oxygen Regular'), local('Oxygen-Regular'), url('../font/oxygen-v7-latin-regular.woff') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('../font/oxygen-v7-latin-regular.woff') format('woff'); - - /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ -} -/* source-code-pro-regular - latin */ -@font-face { - font-family: 'Source Code Pro'; - font-style: normal; - font-weight: 400; - src: local('Source Code Pro'), local('SourceCodePro-Regular'), url('../font/source-code-pro-v8-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('../font/source-code-pro-v8-latin-regular.woff') format('woff'); - - /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ -} -@font-face { - font-family: 'Material Icons'; - font-style: normal; - font-weight: 400; - src: local('Material Icons'), local('MaterialIcons-Regular'), url('../font/MaterialIcons-Regular.woff2') format('woff2'), url('../font/MaterialIcons-Regular.woff') format('woff'); -} -.image-icon { - font-family: 'Material Icons'; - font-weight: normal; - font-style: normal; - display: inline-block; - text-transform: none; - letter-spacing: normal; - word-wrap: normal; - white-space: nowrap; - direction: ltr; - /* Support for all WebKit browsers. */ - /* Support for Safari and Chrome. */ - /* Support for Firefox. */ - /* Support for IE. */ - font-feature-settings: 'liga'; -} -.image-icon.image-icon--action-el_text:after { - content: "spellcheck"; -} -.image-icon.image-icon--action-el_longtext:after { - content: "view_headline"; -} -.image-icon.image-icon--action-el_select:after { - content: "list"; -} -.image-icon.image-icon--action-el_number:after { - content: "looks_one"; -} -.image-icon.image-icon--action-el_link:after { - content: "call_made"; -} -.image-icon.image-icon--action-el_date:after { - content: "date_range"; -} -.image-icon.image-icon--action-el_insert:after { - content: "keyboard_return"; -} -.image-icon.image-icon--action-el_copy:after { - content: "flip_to_back"; -} -.image-icon.image-icon--action-el_linkinfo:after { - content: "info"; -} -.image-icon.image-icon--action-el_linkdate:after { - content: "info"; -} -.image-icon.image-icon--action-el_code:after { - content: "code"; -} -.image-icon.image-icon--action-el_dynamic:after { - content: "play_circle_outline"; -} -.image-icon.image-icon--action-el_info:after { - content: "info"; -} -.image-icon.image-icon--action-el_infodate:after { - content: "info"; -} -.image-icon.image-icon--action-el_checkbox:after { - content: "check_box"; -} -.image-icon.image-icon--action-image:after { - content: "image"; -} -.image-icon.image-icon--action-link:after { - content: "call_made"; -} -.image-icon.image-icon--action-url:after { - content: "link"; -} -.image-icon.image-icon--action-alias:after { - content: "bookmark_border"; -} -.image-icon.image-icon--action-text:after { - content: "text_format"; -} -.image-icon.image-icon--action-page:after { - content: "insert_drive_file"; -} -.image-icon.image-icon--action-file:after { - content: "save"; -} -.image-icon.image-icon--action-modellist:after { - content: "device_hub"; -} -.image-icon.image-icon--action-model:after { - content: "device_hub"; -} -.image-icon.image-icon--action-folder:after { - content: "folder_open"; -} -.image-icon.image-icon--action-languagelist:after { - content: "language"; -} -.image-icon.image-icon--action-language:after { - content: "language"; -} -.image-icon.image-icon--action-template:after { - content: "receipt"; -} -.image-icon.image-icon--action-templatelist:after { - content: "receipt"; -} -.image-icon.image-icon--action-groupllist:after { - content: "group"; -} -.image-icon.image-icon--action-group:after { - content: "group"; -} -.image-icon.image-icon--action-userlist:after { - content: "person"; -} -.image-icon.image-icon--action-user:after { - content: "person"; -} -.image-icon.image-icon--action-profile:after { - content: "person_pin"; -} -.image-icon.image-icon--method-settings:after { - content: "settings"; -} -.image-icon.image-icon--action-configuration:after { - content: "settings"; -} -.image-icon.image-icon--action-projectlist:after { - content: "list"; -} -.image-icon.image-icon--action-project:after { - content: "account_balance"; -} -.image-icon.image-icon--action-macro:after { - content: "data_usage"; -} -.image-icon.image-icon--action-membership { - content: "card_membership"; -} -.image-icon.image-icon--method-password:after { - content: "lock"; -} -.image-icon.image-icon--method-publish:after { - content: "cloud_upload"; -} -.image-icon.image-icon--method-show:after { - content: "slideshow"; -} -.image-icon.image-icon--method-src:after { - content: "code"; -} -.image-icon.image-icon--method-acl:after { - content: "https"; -} -.image-icon.image-icon--method-rights:after { - content: "https"; -} -.image-icon.image-icon--method-archive:after { - content: "schedule"; -} -.image-icon.image-icon--method-mail:after { - content: "mail"; -} -.image-icon.image-icon--method-search:after { - content: "search"; -} -.image-icon.image-icon--method-add:after { - content: "add_box"; -} -.image-icon.image-icon--menu-close:after { - content: "close"; -} -.image-icon.image-icon--menu-fullscreen:after { - content: "fullscreen"; -} -.image-icon.image-icon--menu-edit:after { - content: "description"; -} -.image-icon.image-icon--menu-extra:after { - content: "build"; -} -.image-icon.image-icon--menu-menu:after { - content: "menu"; -} -.image-icon.image-icon--menu-minimize:after { - content: "compare_arrows"; -} -.image-icon.image-icon--menu-qrcode:after { - content: "phone_android"; -} -.image-icon.image-icon--node-open:after { - content: "expand_more"; -} -.image-icon.image-icon--node-closed:after { - content: "chevron_right"; -} -.image-icon.image-icon--form-ok:after { - content: "done"; -} -.image-icon.image-icon--form-cancel:after { - content: "clear"; -} -.image-icon.image-icon--editor-bold:after { - content: "format_bold"; -} -.image-icon.image-icon--editor-italic:after { - content: "format_italic"; -} -.image-icon.image-icon--editor-headline:after { - content: "format_size"; -} -.image-icon.image-icon--editor-help:after { - content: "help_outline"; -} -.image-icon.image-icon--editor-fullscreen:after { - content: "fullscreen"; -} -.image-icon.image-icon--editor-quote:after { - content: "format_quote"; -} -.image-icon.image-icon--editor-unnumberedlist:after { - content: "format_list_bulleted"; -} -.image-icon.image-icon--editor-numberedlist:after { - content: "format_list_numbered"; -} -.image-icon.image-icon--editor-preview:after { - content: "desktop_windows"; -} -.image-icon.image-icon--editor-sidebyside:after { - content: "flip"; -} -.image-icon.image-icon--editor-link:after { - content: "link"; -} -.image-icon.image-icon--editor-image:after { - content: "image"; -} -.image-icon.image-icon--editor-undo:after { - content: "undo"; -} -.image-icon.image-icon--editor-redo:after { - content: "redo"; -} -.image-icon.image-icon--editor-code:after { - content: "code"; -} -.image-icon.image-icon--editor-horizontalrule:after { - content: "remove"; -} -.image-icon.image-icon--editor-table:after { - content: "view_comfy"; -} -.editor-toolbar { - font-size: 1.5em; -} -iframe { - width: 100%; - height: 500px; - display: block; -} -div.breadcrumb, -div.breadcrumb a, -div.panel > div.title { - font-weight: bold; -} -div#noticebar { - display: block; - position: fixed; - bottom: 40px; - /*top: 40px;*/ - right: 40px; - width: 25em; - z-index: 113; -} -div#noticebar div.notice { - border: 2px solid #000000; - padding: 1.1em; - margin: 5px; - position: relative; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -khtml-border-radius: 5px; - -webkit-box-shadow: 3px 2px 5px #000000; - -moz-box-shadow: 3px 2px 5px #000000; - box-shadow: 3px 2px 5px #000000; -} -div#noticebar div.notice .or-notice-toolbar { - float: right; - margin: 0 0.2em; - font-size: 2em; - color: gray; - cursor: pointer; -} -div#noticebar div.notice:hover .or-notice-toolbar { - color: black; -} -div#noticebar div.notice.full { - display: block; - position: fixed; - bottom: 10%; - top: 10%; - right: 10%; - left: 10%; - width: 80%; - z-index: 114; -} -div#noticebar div.notice.error div.text { - font-weight: bold; -} -div#noticebar div.notice div.text { - font-size: 1.1em; -} -div#noticebar div.notice:after { - content: ''; - position: absolute; - right: 0; - top: 50%; - width: 0; - height: 0; - border: 1em solid transparent; - border-right: 0; - margin-top: -1em; - margin-right: -1em; -} -div#noticebar div.notice div.log { - display: none; - position: relative; - max-height: 90%; - overflow: auto; - font-family: 'Source Code Pro', Monospace, Monospaced, Courier; -} -div#noticebar div.notice.full div.log { - display: block; -} -div.onrowvisible { - visibility: hidden; - display: inline; -} -/* Vorschau von Text-Inhalten */ -/* Verweise */ -a:link, -a:visited { - font-weight: normal; - text-decoration: none; -} -a:active, -a:hover { - font-weight: normal; - text-decoration: none; -} -/* Icon-Innenabstand */ -img[align=left], -img[align=right] { - padding-right: 1px; - padding-left: 1px; -} -/* Vorformatierter Text */ -/* Lizenzhinweis */ -div.logo h2 { - font-weight: normal; - font-size: 24px; -} -div.logo p { - font-size: 13px; -} -label, -.clickable { - cursor: pointer; -} -/* Drag and Drop */ -.or-droppable--active { - background-color: #2E8B57 !important; - cursor: move; -} -.or-droppable--hover { - background-color: #00d95a !important; - cursor: move; -} -/* T a b s */ -img.icon { - padding: 4px; - width: 16px; - height: 16px; -} -div.panel ul.views li { - vertical-align: middle; - padding: 0px; - cursor: pointer; - border-right: 1px solid #000000; - -moz-border-radius-topleft: 5px; - /* Mozilla */ - -webkit-border-radius-topleft: 5px; - /* Webkit */ - -khtml-border-top-radius-topleft: 5px; - /* Konqui */ - -moz-border-radius-topright: 5px; - /* Mozilla */ - -webkit-border-radius-topright: 5px; - /* Webkit */ - -khtml-border-top-radius-topright: 5px; - /* Konqui */ - border-top-right-radius: 5px; - display: inline; - white-space: nowrap; - float: left; -} -div.panel { - margin: 0px; - padding: 0px; -} -/* S t a t u s z e i l e */ -div.panel div.status { - padding: 10px; -} -div.panel div.status div.error, -div.message.error { - background: url(../images/notice_error.png) no-repeat; - background-position: 5px 7px; -} -div.panel div.status div.warn, -div.message.warn { - background: url(../images/notice_warning.png) no-repeat; - background-position: 5px 7px; -} -div.panel div.status div.ok, -div.message.ok { - background: url(../images/notice_ok.png) no-repeat; - background-position: 5px 7px; -} -div.panel div.status div.info, -div.message.info { - background: url(../images/notice_info.png) no-repeat; - background-position: 5px 7px; -} -div.panel div.status div, -div.message { - border: 1px solid #000000; - padding: 5px 0px 5px 25px; - margin: 10px 10px 20px 10px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -khtml-border-radius: 5px; - border-radius: 5px; -} -#workbench div.panel.fullscreen { - display: block; - z-index: 109; - position: fixed; - top: 0; - left: 0; - background-color: #000000; - margin: 0px; - width: 100% !important; - height: 100% !important; -} -#workbench div.panel.fullscreen > div.content { - width: 100% !important; - height: 100% !important; -} -#workbench div.panel { - border: 1px solid #000000; - margin: 0px; - padding: 0px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -khtml-border-radius: 5px; - border-radius: 5px; -} -#workbench div.container, -#workbench div.panel, -#workbench div.divider { - display: inline; - float: left; - margin: 0px; -} -#workbench div.panel > div.content { - overflow: auto; -} -.invisible { - visibility: hidden; -} -.visible { - visibility: visible; -} -/* - * Formular-Button-Leiste - */ -div.panel { - position: relative; -} -div.content div.bottom { - height: 55px; - width: 100%; - position: absolute; - padding-right: 40px; - bottom: 0px; - right: 0px; - xvisibility: hidden; -} -div.content div.bottom > div.command { - xvisibility: visible; - float: right; - z-index: 20; -} -div.content form[data-autosave='true'] div.command { - display: none; -} -div.content > form { - padding-bottom: 45px; -} -main .or-form .or-form-actionbar { - display: none; -} -/* R e s p o n s i v e f o r m s */ -.or-form { - padding: 1em; - /* Style inputs, select elements and textareas */ - /* Style the label to display next to the inputs */ - /* Style the submit button */ - /* Floating column for labels: 25% width */ - /* Floating column for inputs: 75% width */ - /* Clear floats after the columns */ - /* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */ -} -.or-form input[type=checkbox] + label, -.or-form input[type=radio] + label { - width: 80%; -} -.or-form .headline { - font-size: 1.8em; -} -.or-form div.inputholder > div.dropdown { - width: 70%; -} -.or-form input.submit { - padding: 7px; - border: 0px; - -moz-border-radius: 7px; - /* Mozilla */ - -webkit-border-radius: 7px; - /* Webkit */ - -khtml-border-radius: 7px; - /* Konqui */ - border-radius: 7px; - margin-left: 20px; - cursor: pointer; -} -.or-form input[type=text], -.or-form select, -.or-form textarea { - width: 100%; - padding: 12px; - border: 1px solid #ccc; - border-radius: 4px; - box-sizing: border-box; - resize: vertical; -} -.or-form label { - padding: 12px 12px 12px 0; - display: inline-block; -} -.or-form input[type=submit] { - color: white; - padding: 12px 20px; - border: none; - border-radius: 4px; - cursor: pointer; - float: right; -} -.or-form div.label { - float: left; - width: 25%; - margin-top: 6px; -} -.or-form div.input { - float: left; - width: 75%; - margin-top: 6px; -} -.or-form .line:after { - content: ""; - display: table; - clear: both; -} -.or-form .or-form-row { - display: flex; - align-items: center; -} -.or-form .or-form-row .or-form-label { - width: 25%; -} -.or-form .or-form-row .or-form-input { - width: 75%; -} -.or-form .or-form-actionbar { - position: sticky; - bottom: 0; - left: 0; - right: 0; - display: flex; - justify-content: end; - padding: 1em; - height: auto; -} -.or-form .or-form-actionbar .or-form-btn { - padding: 1em 2em; - margin-left: 1.5em; - min-width: 14em; - border: 0; - border-radius: 0.5em; - -moz-border-radius: 0.5em; - -webkit-border-radius: 0.5em; - -khtml-border-radius: 0.5em; - cursor: pointer; -} -.or-form .or-form-actionbar .or-form-btn--primary { - font-weight: bold; - /* Primäre Aktion in Fettdruck */ -} -@media screen and (max-width: 65rem) { - .or-form div.label, - .or-form div.input { - width: 100%; - margin-top: 0; - } - .or-form .or-form-row { - flex-direction: column; - } - .or-form .or-form-row .or-form-label, - .or-form .or-form-row .or-form-input { - width: 100%; - } - .or-form .or-form-actionbar { - align-items: center; - display: block; - } - .or-form .or-form-actionbar .or-form-btn { - width: 90%; - } -} -.or-link-btn { - padding: 0.5em 1.0em; - min-width: 5em; - border: 0; - border-radius: 0.3em; - -moz-border-radius: 0.3em; - -webkit-border-radius: 0.3em; - -khtml-border-radius: 0.3em; - cursor: pointer; -} -div.search > div.inputholder { - padding-top: 1px; -} -div.inputholder > input, -div.inputholder > textarea, -div.inputholder > select { - padding: 2px; - margin: 0px; -} -/* Eingabfeld fuer Namen */ -fieldset > div input.name, -fieldset > div span.name { - font-weight: bold; -} -/* Eingabfelder fuer Dateiname */ -fieldset > div input.filename, -fieldset > div input.extension, -fieldset > div input.ansidate, -fieldset > div span.filename, -fieldset > div span.extension, -fieldset > div span.ansidate { - font-family: 'Source Code Pro', Monospace, Monospaced, Courier; -} -dl.notice { - padding: 15px; -} -div.content pre, -div.dropdown { - min-width: 150px; - max-width: 450px; -} -img.image-icon { - visibility: hidden; -} -/* Make Codemirror Auto-Resizable */ -.CodeMirror { - height: auto; -} -.or-linklist { - display: flex; - flex-direction: column; - padding: 10% 20%; -} -.or-linklist > .or-linklist-line { - border: 1px solid; - margin-top: 1em; - padding: 1em; - border-radius: 0.5em; - -moz-border-radius: 0.5em; - -webkit-border-radius: 0.5em; - -khtml-border-radius: 0.5em; -} -.or-info { - position: relative; -} -.or-info:hover .or-info-popup { - display: block; -} -.or-info .or-info-popup { - display: none; - position: absolute; - top: 0px; - left: 0px; - overflow: visible; - border: 0.5em; - font-size: 2em; - border-radius: 0.3em; - -moz-border-radius: 0.3em; - -webkit-border-radius: 0.3em; - -khtml-border-radius: 0.3em; - padding: 1.0em; - z-index: 105; -} -.or-info .or-info-popup > div { - display: inline-block; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-ui.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3BAAIA%3BCACE%3BCACA%3BCACA%3BCACA%2CKAAK%2CMAAM%2CmBAAmB%2CMAAM%2CuBAChC%2CwCAAwC%2COAAO%2CuDAC%5C%2FC%2CwCAAwC%2COAAO%2COAFnD%3B%3B%3B%3B%3BAAMF%3BCACE%2CaAAa%2CiBAAb%3BCACA%3BCACA%3BCACA%2CKAAK%2CMAAM%2CoBAAoB%2CMAAM%2C8BACjC%2CkDAAkD%2COAAO%2CuDACzD%2CiDAAiD%2COAAO%2COAF5D%3B%3B%3B%3BAAKF%3BCACE%2CaAAa%2CgBAAb%3BCACA%3BCACA%3BCACA%2CKAAK%2CMAAM%2CmBACX%2CMAAM%2C8BACF%2CuCAAuC%2COAAO%2CcAC9C%2CsCAAsC%2COAAO%2COAHjD%3B%3BAAMF%3BCACE%2CaAAa%2CgBAAb%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3B%3B%3B%3BCAYA%3B%3BAAGA%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2C%2BBAA%2BB%3BCAAS%2CSAAS%2CeAAT%3B%3BAACzC%2CWAAC%2C6BAA6B%3BCAAS%3B%3BAACvC%2CWAAC%2C6BAA6B%3BCAAS%2CSAAS%2CWAAT%3B%3BAACvC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CWAAT%3B%3BAACrC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CYAAT%3B%3BAACrC%2CWAAC%2C6BAA6B%3BCAAS%2CSAAS%2CiBAAT%3B%3BAACvC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CcAAT%3B%3BAACrC%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2C8BAA8B%3BCAAS%2CSAAS%2CqBAAT%3B%3BAACxC%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C%2BBAA%2BB%3BCAAS%2CSAAS%2CWAAT%3B%3BAAEzC%2CWAAC%2CyBAAyB%3BCAAS%3B%3BAACnC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CWAAT%3B%3BAAClC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CiBAAT%3B%3BAACnC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CaAAT%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CmBAAT%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2C6BAA6B%3BCAAS%2CSAAS%2CYAAT%3B%3BAACvC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CYAAT%3B%3BAACnC%2CWAAC%2C0BAA0B%3BCAAS%2CSAAS%2CaAAT%3B%3BAACpC%2CWAAC%2CgCAAgC%3BCAAS%3B%3BAAC1C%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CgCAAgC%3BCAAS%3B%3BAAC1C%2CWAAC%2C8BAA8B%3BCAAS%3B%3BAACxC%2CWAAC%2CyBAAyB%3BCAAS%3B%3BAACnC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CYAAT%3B%3BAACrC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CiCAAiC%3BCAAS%3B%3BAAC3C%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CiBAAT%3B%3BAAErC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CYAAT%3B%3BAAEnC%2CWAAC%3BCAAiC%2CSAAS%2CiBAAT%3B%3BAAClC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CcAAT%3B%3BAACrC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2C0BAA0B%3BCAAS%3B%3BAACpC%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2C0BAA0B%3BCAAS%3B%3BAACpC%2CWAAC%2CuBAAuB%3BCAAS%2CSAAS%2CSAAT%3B%3BAACjC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CsBAAsB%3BCAAS%3B%3BAAChC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAAEjC%2CWAAC%2CsBAAsB%3BCAAS%3B%3BAAChC%2CWAAC%2C0BAA0B%3BCAAS%2CSAAS%2CgBAAT%3B%3BAACpC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CeAAT%3B%3BAAElC%2CWAAC%2CsBAAsB%3BCAAS%2CSAAS%2CaAAT%3B%3BAAChC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CeAAT%3B%3BAAElC%2CWAAC%2CoBAAoB%3BCAAS%3B%3BAAC9B%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAElC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CaAAT%3B%3BAAClC%2CWAAC%2C0BAA0B%3BCAAS%2CSAAS%2CeAAT%3B%3BAACpC%2CWAAC%2C4BAA4B%3BCAAS%2CSAAS%2CaAAT%3B%3BAACtC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CcAAT%3B%3BAAClC%2CWAAC%2C8BAA8B%3BCAAS%3B%3BAACxC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CcAAT%3B%3BAACnC%2CWAAC%2CkCAAkC%3BCAAS%2CSAAS%2CsBAAT%3B%3BAAC5C%2CWAAC%2CgCAAgC%3BCAAS%2CSAAS%2CsBAAT%3B%3BAAC1C%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CiBAAT%3B%3BAACrC%2CWAAC%2C8BAA8B%3BCAAS%3B%3BAACxC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CyBAAyB%3BCAAS%3B%3BAACnC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CkCAAkC%3BCAAS%3B%3BAAC5C%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CYAAT%3B%3BAAGrC%3BCACE%3B%3BAAgBF%3BCACE%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%3BAACH%2CGAAG%2CWAAY%3BAACf%2CGAAG%2CMAAS%2CMAAG%3BCACb%3B%3BAAGF%2CGAAG%3BCAED%3BCACA%3BCACA%3B%3BCAEA%3BCACA%3BCACA%3B%3BAARF%2CGAAG%2CUAWD%2CIAAG%3BCACD%2CyBAAA%3BCACA%3BCACA%3BCACA%3BCAvCF%2CkBAAA%3BCACA%2CuBAAA%3BCACA%2C0BAAA%3BCACA%2CyBAAA%3BCAGA%2CuCAAA%3BCACA%2CoCAAA%3BCACA%2C%2BBAAA%3B%3BAAgBF%2CGAAG%2CUAWD%2CIAAG%2COASD%3BCACE%3BCACA%2CeAAA%3BCACA%3BCACA%3BCACA%3B%3BAAGF%2CGA5BD%2CUAWD%2CIAAG%2COAiBA%2CMACC%3BCACE%3B%3BAAIJ%2CGAlCD%2CUAWD%2CIAAG%2COAuBA%3BCACC%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAIF%2CGA9CD%2CUAWD%2CIAAG%2COAmCA%2CMAEC%2CIAAG%3BCACD%3B%3BAAjDR%2CGAAG%2CUAWD%2CIAAG%2COA0CD%2CIAAG%3BCACD%3B%3BAAGF%2CGAzDD%2CUAWD%2CIAAG%2COA8CA%3BCACC%2CSAAS%2CEAAT%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%2C6BAAA%3BCACA%3BCACA%3BCACA%3B%3BAAnEN%2CGAAG%2CUAWD%2CIAAG%2COA2DD%2CIAAG%3BCACD%3BCACA%3BCACA%3BCACA%3BCACA%2CaAAa%2CiDAAb%3B%3BAAGF%2CGA9ED%2CUAWD%2CIAAG%2COAmEA%2CKACC%2CIAAG%3BCACD%3B%3BAAmBR%2CGAAG%3BCACD%3BCACA%3B%3B%3B%3BAAQF%2CCAAC%3BAACD%2CCAAC%3BCACC%3BCACA%3B%3BAAGF%2CCAAC%3BAACD%2CCAAC%3BCACC%3BCACA%3B%3B%3BAAIF%2CGAAG%3BAACH%2CGAAG%3BCACD%3BCACA%3B%3B%3B%3BAAaF%2CGAAG%2CKAAM%3BCACP%3BCACA%3B%3BAAGF%2CGAAG%2CKAAM%3BCACP%3B%3BAAGF%3BAACA%3BCACE%3B%3B%3BAAQA%2CaAAC%3BCAEC%3BCACA%3B%3BAAGF%2CaAAC%3BCACC%3BCACA%3B%3B%3BAAOJ%2CGAAG%3BCACD%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%2CMAAO%2CGAAE%2CMAAO%3BCACjB%3BCACA%3BCAEA%3BCAEA%2C%2BBAAA%3BCAEA%3B%3BCACA%3B%3BCACA%3B%3BCAEA%3B%3BCACA%3B%3BCACA%3B%3BCACA%3BCAEA%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%3BCACD%3BCACA%3B%3B%3BAAOF%2CGAAG%2CMAAO%2CIAAG%3BCACX%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CqDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CuDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CkDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CoDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%3BAACrB%2CGAAG%3BCACD%2CyBAAA%3BCACA%2CyBAAA%3BCACA%2C2BAAA%3BCAEA%3BCACA%3BCACA%3BCACA%3B%3BAAIF%2CUACE%2CIAAG%2CMAAM%3BCACP%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%2CyBAAA%3BCACA%3BCACA%3BCACA%3B%3BAAVJ%2CUAaE%2CIAAG%2CMAAM%2CWAAc%2CMAAG%3BCACxB%3BCACA%3B%3BAAfJ%2CUAkBE%2CIAAG%3BCACD%2CyBAAA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAzBJ%2CUA4BE%2CIAAG%3BAA5BL%2CUA4BiB%2CIAAG%3BAA5BpB%2CUA4B4B%2CIAAG%3BCAC3B%3BCACA%3BCACA%3B%3BAA%5C%2FBJ%2CUAkCE%2CIAAG%2CMAAS%2CMAAG%3BCACb%3B%3BAAIJ%3BCACE%3B%3BAAGF%3BCACE%3B%3B%3B%3B%3BAAMF%2CGAAG%3BCACD%3B%3BAAGF%2CGAAG%2CQAAS%2CIAAG%3BCACb%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%2CQAAS%2CIAAG%2COAAU%2CMAAG%3BCAC1B%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%2CQAAS%2CKAAI%2CsBAAuB%2CIAAG%3BCACxC%3B%3BAAGF%2CGAAG%2CQAAW%3BCACZ%3B%3BAAQF%2CIAAK%2CSAAS%3BCACZ%3B%3B%3BAAKF%3BCA%2BBE%3B%3B%3B%3B%3B%3B%3B%3B%3BAA%5C%2FBF%2CQACE%2CMAAK%2CeAAkB%3BAADzB%2CQAEE%2CMAAK%2CYAAe%3BCAClB%3B%3BAAHJ%2CQAME%3BCACE%3B%3BAAPJ%2CQAcE%2CIAAG%2CYAAe%2CMAAG%3BCACnB%3B%3BAAfJ%2CQAkBE%2CMAAK%3BCACH%3BCACA%3BCACA%3B%3BCACA%3B%3BCACA%3B%3BCACA%3BCACA%3BCACA%3B%3BAA1BJ%2CQAkCE%2CMAAK%3BAAlCP%2CQAkCoB%3BAAlCpB%2CQAkC4B%3BCACxB%3BCACA%3BCACA%2CsBAAA%3BCACA%3BCACA%3BCACA%3B%3BAAxCJ%2CQA4CE%3BCACE%2CyBAAA%3BCACA%3B%3BAA9CJ%2CQAkDE%2CMAAK%3BCACH%3BCACA%2CkBAAA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAxDJ%2CQA4DE%2CIAAG%3BCACD%3BCACA%3BCACA%3B%3BAA%5C%2FDJ%2CQAmEE%2CIAAG%3BCACD%3BCACA%3BCACA%3B%3BAAtEJ%2CQA0EE%2CMAAK%3BCACH%2CSAAS%2CEAAT%3BCACA%3BCACA%3B%3BAA7EJ%2CQAgFE%3BCACE%3BCACA%3B%3BAAlFJ%2CQAgFE%2CaAIE%3BCACE%3B%3BAArFN%2CQAgFE%2CaAOE%3BCACE%3B%3BAAxFN%2CQA%2BFE%3BCAEE%3BCACA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3BCACA%3B%3BAAzGJ%2CQA%2BFE%2CmBAaC%3BCACE%2CgBAAA%3BCACA%3BCACA%3BCACA%3BCA3dH%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3BCA2dG%3B%3BAAEA%2CQAtBH%2CmBAaC%2CaASG%3BCACC%3B%3B%3BAAoCP%2CmBA1BuC%3BCA0BvC%2CQAxBI%2CIAAG%3BCAwBP%2CQAxBe%2CIAAG%3BEACZ%3BEACA%3B%3BCAsBN%2CQAnBI%3BEACC%3B%3BCAkBL%2CQAnBI%2CaAEE%3BCAiBN%2CQAnBI%2CaAGE%3BEACE%3B%3BCAeR%2CQAXI%3BEAEE%3BEACA%3B%3BCAQN%2CQAXI%2CmBAKE%3BEACE%3B%3B%3BAASR%3BCACE%2CoBAAA%3BCACA%3BCACA%3BCA5gBA%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3BCA4gBA%3B%3BAAOF%2CGAAG%2COAAU%2CMAAG%3BCACd%3B%3BAAGF%2CGAAG%2CYAAe%3BAAClB%2CGAAG%2CYAAe%3BAAClB%2CGAAG%2CYAAe%3BCAChB%3BCACA%3B%3B%3BAAIF%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CKAAI%3BCACjB%3B%3B%3BAAIF%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CKAAI%3BAACnB%2CQAAW%2CMAAI%2CKAAI%3BAACnB%2CQAAW%2CMAAI%2CKAAI%3BCACjB%2CaAAa%2CiDAAb%3B%3BAAGF%2CEAAE%3BCACA%3B%3BAAIF%2CGAAG%2CQAAS%3BAACZ%2CGAAG%3BCACD%3BCACA%3B%3BAAGF%2CGAAG%3BCACD%3B%3B%3BAAIF%3BCACE%3B%3BAAGF%3BCACE%3BCACA%3BCACA%2CgBAAA%3B%3BAAHF%2CYAKI%3BCACA%2CiBAAA%3BCACA%3BCACA%3BCA7kBF%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3B%3BAAglBF%3BCAEE%3B%3BAAEA%2CQAAC%2CMACC%3BCACE%3B%3BAANN%2CQAUE%3BCACE%3BCACA%3BCACA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCArmBF%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3BCAomBE%3BCAEA%3B%3BAAtBJ%2CQAUE%2CeAcI%3BCACA%22%7D */- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-ui.min.css b/modules/cms/ui/themes/default/style/openrat-ui.min.css @@ -1 +0,0 @@ -@font-face{font-family: 'Oxygen';font-style: normal;font-weight: 400;src: local('Oxygen Regular'), local('Oxygen-Regular'), url('../font/oxygen-v7-latin-regular.woff') format('woff2'), url('../font/oxygen-v7-latin-regular.woff') format('woff')}@font-face{font-family: 'Source Code Pro';font-style: normal;font-weight: 400;src: local('Source Code Pro'), local('SourceCodePro-Regular'), url('../font/source-code-pro-v8-latin-regular.woff2') format('woff2'), url('../font/source-code-pro-v8-latin-regular.woff') format('woff')}@font-face{font-family: 'Material Icons';font-style: normal;font-weight: 400;src: local('Material Icons'), local('MaterialIcons-Regular'), url('../font/MaterialIcons-Regular.woff2') format('woff2'), url('../font/MaterialIcons-Regular.woff') format('woff')}.image-icon{font-family: 'Material Icons';font-weight: normal;font-style: normal;display: inline-block;text-transform: none;letter-spacing: normal;word-wrap: normal;white-space: nowrap;direction: ltr;font-feature-settings: 'liga'}.image-icon.image-icon--action-el_text:after{content: "spellcheck"}.image-icon.image-icon--action-el_longtext:after{content: "view_headline"}.image-icon.image-icon--action-el_select:after{content: "list"}.image-icon.image-icon--action-el_number:after{content: "looks_one"}.image-icon.image-icon--action-el_link:after{content: "call_made"}.image-icon.image-icon--action-el_date:after{content: "date_range"}.image-icon.image-icon--action-el_insert:after{content: "keyboard_return"}.image-icon.image-icon--action-el_copy:after{content: "flip_to_back"}.image-icon.image-icon--action-el_linkinfo:after{content: "info"}.image-icon.image-icon--action-el_linkdate:after{content: "info"}.image-icon.image-icon--action-el_code:after{content: "code"}.image-icon.image-icon--action-el_dynamic:after{content: "play_circle_outline"}.image-icon.image-icon--action-el_info:after{content: "info"}.image-icon.image-icon--action-el_infodate:after{content: "info"}.image-icon.image-icon--action-el_checkbox:after{content: "check_box"}.image-icon.image-icon--action-image:after{content: "image"}.image-icon.image-icon--action-link:after{content: "call_made"}.image-icon.image-icon--action-url:after{content: "link"}.image-icon.image-icon--action-alias:after{content: "bookmark_border"}.image-icon.image-icon--action-text:after{content: "text_format"}.image-icon.image-icon--action-page:after{content: "insert_drive_file"}.image-icon.image-icon--action-file:after{content: "save"}.image-icon.image-icon--action-modellist:after{content: "device_hub"}.image-icon.image-icon--action-model:after{content: "device_hub"}.image-icon.image-icon--action-folder:after{content: "folder_open"}.image-icon.image-icon--action-languagelist:after{content: "language"}.image-icon.image-icon--action-language:after{content: "language"}.image-icon.image-icon--action-template:after{content: "receipt"}.image-icon.image-icon--action-templatelist:after{content: "receipt"}.image-icon.image-icon--action-groupllist:after{content: "group"}.image-icon.image-icon--action-group:after{content: "group"}.image-icon.image-icon--action-userlist:after{content: "person"}.image-icon.image-icon--action-user:after{content: "person"}.image-icon.image-icon--action-profile:after{content: "person_pin"}.image-icon.image-icon--method-settings:after{content: "settings"}.image-icon.image-icon--action-configuration:after{content: "settings"}.image-icon.image-icon--action-projectlist:after{content: "list"}.image-icon.image-icon--action-project:after{content: "account_balance"}.image-icon.image-icon--action-macro:after{content: "data_usage"}.image-icon.image-icon--action-membership{content: "card_membership"}.image-icon.image-icon--method-password:after{content: "lock"}.image-icon.image-icon--method-publish:after{content: "cloud_upload"}.image-icon.image-icon--method-show:after{content: "slideshow"}.image-icon.image-icon--method-src:after{content: "code"}.image-icon.image-icon--method-acl:after{content: "https"}.image-icon.image-icon--method-rights:after{content: "https"}.image-icon.image-icon--method-archive:after{content: "schedule"}.image-icon.image-icon--method-mail:after{content: "mail"}.image-icon.image-icon--method-search:after{content: "search"}.image-icon.image-icon--method-add:after{content: "add_box"}.image-icon.image-icon--menu-close:after{content: "close"}.image-icon.image-icon--menu-fullscreen:after{content: "fullscreen"}.image-icon.image-icon--menu-edit:after{content: "description"}.image-icon.image-icon--menu-extra:after{content: "build"}.image-icon.image-icon--menu-menu:after{content: "menu"}.image-icon.image-icon--menu-minimize:after{content: "compare_arrows"}.image-icon.image-icon--menu-qrcode:after{content: "phone_android"}.image-icon.image-icon--node-open:after{content: "expand_more"}.image-icon.image-icon--node-closed:after{content: "chevron_right"}.image-icon.image-icon--form-ok:after{content: "done"}.image-icon.image-icon--form-cancel:after{content: "clear"}.image-icon.image-icon--editor-bold:after{content: "format_bold"}.image-icon.image-icon--editor-italic:after{content: "format_italic"}.image-icon.image-icon--editor-headline:after{content: "format_size"}.image-icon.image-icon--editor-help:after{content: "help_outline"}.image-icon.image-icon--editor-fullscreen:after{content: "fullscreen"}.image-icon.image-icon--editor-quote:after{content: "format_quote"}.image-icon.image-icon--editor-unnumberedlist:after{content: "format_list_bulleted"}.image-icon.image-icon--editor-numberedlist:after{content: "format_list_numbered"}.image-icon.image-icon--editor-preview:after{content: "desktop_windows"}.image-icon.image-icon--editor-sidebyside:after{content: "flip"}.image-icon.image-icon--editor-link:after{content: "link"}.image-icon.image-icon--editor-image:after{content: "image"}.image-icon.image-icon--editor-undo:after{content: "undo"}.image-icon.image-icon--editor-redo:after{content: "redo"}.image-icon.image-icon--editor-code:after{content: "code"}.image-icon.image-icon--editor-horizontalrule:after{content: "remove"}.image-icon.image-icon--editor-table:after{content: "view_comfy"}.editor-toolbar{font-size: 1.5em}iframe{width: 100%;height: 500px;display: block}div.breadcrumb,div.breadcrumb a,div.panel > div.title{font-weight: bold}div#noticebar{display: block;position: fixed;bottom: 40px;right: 40px;width: 25em;z-index: 113}div#noticebar div.notice{border: 2px solid #000;padding: 1.1em;margin: 5px;position: relative;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;-webkit-box-shadow: 3px 2px 5px #000;-moz-box-shadow: 3px 2px 5px #000;box-shadow: 3px 2px 5px #000}div#noticebar div.notice .or-notice-toolbar{float: right;margin: 0 .2em;font-size: 2em;color: gray;cursor: pointer}div#noticebar div.notice:hover .or-notice-toolbar{color: black}div#noticebar div.notice.full{display: block;position: fixed;bottom: 10%;top: 10%;right: 10%;left: 10%;width: 80%;z-index: 114}div#noticebar div.notice.error div.text{font-weight: bold}div#noticebar div.notice div.text{font-size: 1.1em}div#noticebar div.notice:after{content: '';position: absolute;right: 0;top: 50%;width: 0;height: 0;border: 1em solid transparent;border-right: 0;margin-top: -1em;margin-right: -1em}div#noticebar div.notice div.log{display: none;position: relative;max-height: 90%;overflow: auto;font-family: 'Source Code Pro', Monospace, Monospaced, Courier}div#noticebar div.notice.full div.log{display: block}div.onrowvisible{visibility: hidden;display: inline}a:link,a:visited{font-weight: normal;text-decoration: none}a:active,a:hover{font-weight: normal;text-decoration: none}img[align=left],img[align=right]{padding-right: 1px;padding-left: 1px}div.logo h2{font-weight: normal;font-size: 24px}div.logo p{font-size: 13px}label,.clickable{cursor: pointer}.or-droppable--active{background-color: #2E8B57 !important;cursor: move}.or-droppable--hover{background-color: #00d95a !important;cursor: move}img.icon{padding: 4px;width: 16px;height: 16px}div.panel ul.views li{vertical-align: middle;padding: 0px;cursor: pointer;border-right: 1px solid #000;-moz-border-radius-topleft: 5px;-webkit-border-radius-topleft: 5px;-khtml-border-top-radius-topleft: 5px;-moz-border-radius-topright: 5px;-webkit-border-radius-topright: 5px;-khtml-border-top-radius-topright: 5px;border-top-right-radius: 5px;display: inline;white-space: nowrap;float: left}div.panel{margin: 0px;padding: 0px}div.panel div.status{padding: 10px}div.panel div.status div.error,div.message.error{background: url(../images/notice_error.png) no-repeat;background-position: 5px 7px}div.panel div.status div.warn,div.message.warn{background: url(../images/notice_warning.png) no-repeat;background-position: 5px 7px}div.panel div.status div.ok,div.message.ok{background: url(../images/notice_ok.png) no-repeat;background-position: 5px 7px}div.panel div.status div.info,div.message.info{background: url(../images/notice_info.png) no-repeat;background-position: 5px 7px}div.panel div.status div,div.message{border: 1px solid #000;padding: 5px 0px 5px 25px;margin: 10px 10px 20px 10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border-radius: 5px}#workbench div.panel.fullscreen{display: block;z-index: 109;position: fixed;top: 0;left: 0;background-color: #000;margin: 0px;width: 100% !important;height: 100% !important}#workbench div.panel.fullscreen > div.content{width: 100% !important;height: 100% !important}#workbench div.panel{border: 1px solid #000;margin: 0px;padding: 0px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border-radius: 5px}#workbench div.container,#workbench div.panel,#workbench div.divider{display: inline;float: left;margin: 0px}#workbench div.panel > div.content{overflow: auto}.invisible{visibility: hidden}.visible{visibility: visible}div.panel{position: relative}div.content div.bottom{height: 55px;width: 100%;position: absolute;padding-right: 40px;bottom: 0px;right: 0px;xvisibility: hidden}div.content div.bottom > div.command{xvisibility: visible;float: right;z-index: 20}div.content form[data-autosave='true'] div.command{display: none}div.content > form{padding-bottom: 45px}main .or-form .or-form-actionbar{display: none}.or-form{padding: 1em}.or-form input[type=checkbox] + label,.or-form input[type=radio] + label{width: 80%}.or-form .headline{font-size: 1.8em}.or-form div.inputholder > div.dropdown{width: 70%}.or-form input.submit{padding: 7px;border: 0px;-moz-border-radius: 7px;-webkit-border-radius: 7px;-khtml-border-radius: 7px;border-radius: 7px;margin-left: 20px;cursor: pointer}.or-form input[type=text],.or-form select,.or-form textarea{width: 100%;padding: 12px;border: 1px solid #ccc;border-radius: 4px;box-sizing: border-box;resize: vertical}.or-form label{padding: 12px 12px 12px 0;display: inline-block}.or-form input[type=submit]{color: white;padding: 12px 20px;border: none;border-radius: 4px;cursor: pointer;float: right}.or-form div.label{float: left;width: 25%;margin-top: 6px}.or-form div.input{float: left;width: 75%;margin-top: 6px}.or-form .line:after{content: "";display: table;clear: both}.or-form .or-form-row{display: flex;align-items: center}.or-form .or-form-row .or-form-label{width: 25%}.or-form .or-form-row .or-form-input{width: 75%}.or-form .or-form-actionbar{position: sticky;bottom: 0;left: 0;right: 0;display: flex;justify-content: end;padding: 1em;height: auto}.or-form .or-form-actionbar .or-form-btn{padding: 1em 2em;margin-left: 1.5em;min-width: 14em;border: 0;border-radius: .5em;-moz-border-radius: .5em;-webkit-border-radius: .5em;-khtml-border-radius: .5em;cursor: pointer}.or-form .or-form-actionbar .or-form-btn--primary{font-weight: bold}@media screen and (max-width: 65rem){.or-form div.label,.or-form div.input{width: 100%;margin-top: 0}.or-form .or-form-row{flex-direction: column}.or-form .or-form-row .or-form-label,.or-form .or-form-row .or-form-input{width: 100%}.or-form .or-form-actionbar{align-items: center;display: block}.or-form .or-form-actionbar .or-form-btn{width: 90%}}.or-link-btn{padding: .5em 1em;min-width: 5em;border: 0;border-radius: .3em;-moz-border-radius: .3em;-webkit-border-radius: .3em;-khtml-border-radius: .3em;cursor: pointer}div.search > div.inputholder{padding-top: 1px}div.inputholder > input,div.inputholder > textarea,div.inputholder > select{padding: 2px;margin: 0px}fieldset > div input.name,fieldset > div span.name{font-weight: bold}fieldset > div input.filename,fieldset > div input.extension,fieldset > div input.ansidate,fieldset > div span.filename,fieldset > div span.extension,fieldset > div span.ansidate{font-family: 'Source Code Pro', Monospace, Monospaced, Courier}dl.notice{padding: 15px}div.content pre,div.dropdown{min-width: 150px;max-width: 450px}img.image-icon{visibility: hidden}.CodeMirror{height: auto}.or-linklist{display: flex;flex-direction: column;padding: 10% 20%}.or-linklist > .or-linklist-line{border: 1px solid;margin-top: 1em;padding: 1em;border-radius: .5em;-moz-border-radius: .5em;-webkit-border-radius: .5em;-khtml-border-radius: .5em}.or-info{position: relative}.or-info:hover .or-info-popup{display: block}.or-info .or-info-popup{display: none;position: absolute;top: 0px;left: 0px;overflow: visible;border: 0.5em;font-size: 2em;border-radius: .3em;-moz-border-radius: .3em;-webkit-border-radius: .3em;-khtml-border-radius: .3em;padding: 1.0em;z-index: 105}.or-info .or-info-popup > div{display: inline-block}- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-workbench.css b/modules/cms/ui/themes/default/style/openrat-workbench.css @@ -1,335 +0,0 @@ -/* -OpenRat Content Management System -Copyright (C) 2002-2010 Jan Dankert - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ -/* -Basis-Style for Openrat. -*/ -div#dialog { - /* Modale Dialoge */ -} -div#dialog > .view { - overflow: auto; - /*width:60%;*/ - position: absolute; - top: 5%; - left: 10%; - width: 80%; - height: 80%; - z-index: 110; - border: 1px solid !important; -} -@media only screen and (max-width: 55rem) { - div#dialog > .view { - top: 2.5%; - left: 2.5%; - width: 95%; - height: 95%; - } -} -div#dialog.is-closed { - display: none; - width: 0; -} -div#dialog .filler { - position: absolute; - z-index: 100; - top: 0; - left: 0; - height: 100%; - width: 100%; - opacity: 0.5; -} -div#dialog .filler span.icon { - opacity: 1; - font-size: 3em; - font-weight: bold; - text-align: center; - width: 40px; - height: 40px; - position: absolute; - right: 20px; - top: 20px; -} -.arrow { - width: 0; - height: 0; - margin: 6px; - padding: 0; - font-size: 0; -} -.arrow.arrow-down { - border-right: 6px solid transparent; - border-top: 6px solid; - border-left: 6px solid transparent; - border-bottom: 4px solid transparent; - margin-top: 10px; -} -.arrow.arrow-right { - border-top: 6px solid transparent; - border-left: 6px solid; - border-bottom: 6px solid transparent; - border-right: 4px solid transparent; - margin-left: 10px; -} -#editor .dirty { - font-weight: bold; -} -.visible-for-nojs { - display: none; -} -html.nojs .noscript { - display: block; -} -.toggle-open-close { - display: flex; - flex-direction: column; - /* Geschlossen */ - /* Offen */ -} -.toggle-open-close .on-click-open-close { - cursor: pointer; - font-weight: normal; -} -.toggle-open-close > .closable { - transition: opacity 0.3s ease-out; - flex: 1; - display: block; -} -.toggle-open-close.closed > .on-click-open-close > .on-closed { - display: inline; -} -.toggle-open-close.closed > .on-click-open-close > .on-open { - display: none; -} -.toggle-open-close.closed > .closable { - opacity: 0; - max-height: 0; - overflow: hidden; -} -.toggle-open-close.open > .closable { - height: auto; -} -.toggle-open-close.open > .on-click-open-close > .on-closed { - display: none; -} -.toggle-open-close.open > .on-click-open-close > .on-open { - display: inline; -} -html, -body { - width: 100%; - height: 100%; -} -div#workbench { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; - /* - - div.panel.modal { - position: relative; - z-index: 101; - border: 1px solid !important; - } - */ - /* vertikale Flex-Box zwischen Header und Hauptbereich */ -} -div#workbench > header { - height: 3.0rem; -} -div#workbench > header .toolbar-icon .arrow-down { - display: inline; -} -@media only screen and (max-width: 55rem) { - div#workbench > header .toolbar-icon span.label, - div#workbench > header .toolbar-icon .arrow-down { - display: none; - } -} -div#workbench > .or-main-area { - flex: 1; - /* Horizontale Flexbox */ - /* - https://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox - Whenever you've got an element with overflow: [hidden|scroll|auto] inside of a flex item, you need to give its ancestor flex item min-width:0 (in a horizontal flex container) or min-height:0 (in a vertical flex container), to disable this min-sizing behavior, or else the flex item will refuse to shrink smaller than the child's min-content size. - */ - min-height: 0; - padding-top: 0.5em; -} -div#workbench > .or-main-area > * { - min-width: 0; - min-height: 0; - overflow-y: auto; - overflow-x: hidden; - height: 100%; -} -div#workbench > .or-main-area > nav { - width: 33%; - transition: width 0.15s ease-in-out; - position: fixed; - height: calc(100% - 3.0rem - 0.5em); -} -@media only screen and (max-width: 55rem) { - div#workbench > .or-main-area > nav { - width: 0; - } -} -div#workbench > .or-main-area > nav.small { - width: 5%; - opacity: 0.5; - overflow-y: hidden; -} -div#workbench > .or-main-area > nav.small:hover { - width: 33%; - overflow-y: auto; - opacity: 1; - background-color: inherit; - border-right: 1px solid inherit; -} -div#workbench > .or-main-area > nav.small ~ .or-workplace { - margin-left: 5%; -} -div#workbench > .or-main-area > nav.open { - overflow-y: auto; -} -@media only screen and (max-width: 55rem) { - div#workbench > .or-main-area > nav.open { - width: 95%; - border-right: 1px solid; - opacity: 0.95; - } -} -@media only screen and (min-width: 75rem) { - div#workbench > .or-main-area > nav { - width: 33%; - overflow-y: auto; - } -} -div#workbench > .or-main-area > nav div.view { - height: 100%; -} -div#workbench > .or-main-area header .or-view-icon, -div#workbench > .or-main-area header .or-view-headline { - margin: 0.3em; - display: inline; - font-size: 1.2em; - line-height: 1.5em; -} -div#workbench > .or-main-area > .or-workplace { - margin-left: 33%; - transition: margin-left 0.15s ease-in-out; -} -@media only screen and (max-width: 55rem) { - div#workbench > .or-main-area > .or-workplace { - margin-left: 0; - } -} -div#workbench > .or-main-area > .or-workplace > #editor { - transition: opacity 0.5s ease; - display: flex; - flex-direction: column; -} -div#workbench > .or-main-area > .or-workplace > #editor.is-closed { - flex: 0.5; - cursor: not-allowed; - pointer-events: none; -} -@media only screen and (max-width: 55rem) { - div#workbench > .or-main-area > .or-workplace > #editor.is-closed { - flex: 0; - } -} -div#workbench > .or-main-area > .or-workplace > #editor > section { - margin: 1.5em; - border: 1px solid; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - -khtml-border-radius: 5px; -} -@media only screen and (max-width: 55rem) { - div#workbench > .or-main-area > .or-workplace > #editor > section { - margin: 0.5em; - } -} -div#workbench > .or-main-area > .or-workplace > #editor > section .view-toolbar { - display: inline; -} -div#workbench > .or-main-area > .or-workplace > #editor > section.closed .view-toolbar { - display: none; -} -#title .toggle-nav-small { - display: inline; -} -@media only screen and (max-width: 55rem) { - #title .toggle-nav-small { - display: none; - } -} -#title .toggle-nav-open-close { - display: none; -} -@media only screen and (max-width: 55rem) { - #title .toggle-nav-open-close { - display: inline; - } -} -@media only screen and (max-width: 55rem) { - #title .toolbar-icon.search input { - width: 3em; - } -} -/* Fortschrittsbalken, fuer alle Elemente verfuegbar. */ -.loader { - background: url(../images/loader.gif) no-repeat; - background-position: center, top; - height: 30px; - opacity: 0.5; - cursor: wait; - pointer-events: none; -} -@media only screen and (max-width: 55rem) { - html { - font-size: 1em; - } -} -/* Navigation over the filler */ -.toggle-nav-small, -.or-navigation { - z-index: 102; -} -.toggle-nav-small:hover, -.or-navigation:hover { - z-index: 112; -} -.or-breadcrumb { - margin-bottom: 0.1em; - margin-left: 1.5em; - line-height: 18px; - font-weight: normal; - white-space: nowrap; -} -.or-breadcrumb li { - display: inline; - margin-right: 0.3em; -} -.or-breadcrumb .or-breadcrumb-item .image-icon { - margin-right: 0.2em; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-workbench.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BAAuCA%2CGAAG%3B%3B%3BAAAH%2CGAAG%2COAEG%3BCACE%3B%3BCAGA%3BCACA%3BCACA%3BCACA%3BCACA%3BCAUA%3BCAEA%2C4BAAA%3B%3BAAFA%3BCAAA%2CGApBL%2COAEG%3BEAWM%3BEACA%3BEACA%3BEACA%3B%3B%3BAASR%2CGAzBD%2COAyBE%3BCACG%3BCACA%3B%3BAA3BR%2CGAAG%2COA%2BBC%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAtCR%2CGAAG%2COA%2BBC%2CQASI%2CKAAI%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3B%3BAAMZ%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAEA%2CMAAC%3BCACG%2CmCAAA%3BCACA%2CqBAAA%3BCACA%2CkCAAA%3BCACA%2CoCAAA%3BCACA%3B%3BAAEJ%2CMAAC%3BCACG%2CiCAAA%3BCACA%2CsBAAA%3BCACA%2CoCAAA%3BCACA%2CmCAAA%3BCACA%3B%3BAAIR%2COAAQ%3BCACJ%3B%3BAAGJ%3BCACI%3B%3BAAGJ%2CIAAI%2CKAAM%3BCACN%3B%3BAAGJ%3BCAEI%3BCACA%3B%3B%3B%3BAAHJ%2CkBAKI%3BCACI%3BCACA%3B%3BAAPR%2CkBAWM%3BCAEE%2CiCAAA%3BCAEA%3BCACA%3B%3BAAKJ%2CkBAAC%2COACK%2CuBAAuB%3BCACrB%3B%3BAAFR%2CkBAAC%2COAIK%2CuBAAuB%3BCACrB%3B%3BAALR%2CkBAAC%2COAOK%3BCAEE%3BCACA%3BCACA%3B%3BAAMR%2CkBAAC%2CKACK%3BCACE%3B%3BAAFR%2CkBAAC%2CKAIK%2CuBAAuB%3BCACrB%3B%3BAALR%2CkBAAC%2CKAOK%2CuBAAuB%3BCACrB%3B%3BAASZ%3BAAAM%3BCAAO%3BCAAY%3B%3BAAEzB%2CGAAG%3BCAEC%3BCACA%3BCACA%3BCACA%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BAALJ%2CGAAG%2CUAqBG%3BCACE%3B%3BAAtBR%2CGAAG%2CUAqBG%2CSAGE%2CcAEI%3BCACI%3B%3BAAOJ%3BCAAA%2CGAlCT%2CUAqBG%2CSAGE%2CcAMI%2CKAAI%3BCAIJ%2CGAlCT%2CUAqBG%2CSAGE%2CcAMgB%3BEAEJ%3B%3B%3BAAhCpB%2CGAAG%2CUAsCG%3BCACE%3B%3B%3B%3B%3B%3BCAWA%3BCAEA%3B%3BAApDR%2CGAAG%2CUAsCG%2CgBAgBI%3BCACE%3BCACA%3BCACA%3BCACA%3BCAEA%3B%3BAA5DZ%2CGAAG%2CUAsCG%2CgBAyBI%3BCACE%3BCACA%2CmCAAA%3BCACA%3BCACA%2CmCAAA%3B%3BAAOA%3BCAAA%2CGA1ET%2CUAsCG%2CgBAyBI%3BEAOM%3B%3B%3BAAIJ%2CGA1ET%2CUAsCG%2CgBAyBI%2CMAWG%3BCACG%3BCACA%3BCACA%3B%3BAAEA%2CGA%5C%2FEb%2CUAsCG%2CgBAyBI%2CMAWG%2CMAKI%3BCACG%3BCACA%3BCACA%3BCACA%3BCACA%2C%2BBAAA%3B%3BAAGJ%2CGAvFb%2CUAsCG%2CgBAyBI%2CMAWG%2CMAaO%3BCACA%3B%3BAAIR%2CGA5FT%2CUAsCG%2CgBAyBI%2CMA6BG%3BCAEG%3B%3BAAMJ%3BCAAA%2CGApGT%2CUAsCG%2CgBAyBI%2CMA6BG%3BEAIO%3BEACA%2CuBAAA%3BEACA%3B%3B%3BAAUR%3BCAAA%2CGA5GT%2CUAsCG%2CgBAyBI%3BEAwCM%3BEACA%3B%3B%3BAAxGhB%2CGAAG%2CUAsCG%2CgBAyBI%2CMA6CE%2CIAAG%3BCACC%3B%3BAA7GhB%2CGAAG%2CUAsCG%2CgBA2EE%2COAEI%3BAAnHZ%2CGAAG%2CUAsCG%2CgBA2EE%2COAEmB%3BCACX%3BCACA%3BCACA%3BCACA%3B%3BAAvHhB%2CGAAG%2CUAsCG%2CgBAsFI%3BCAEE%3BCACA%2CyCAAA%3B%3BAAMA%3BCAAA%2CGArIT%2CUAsCG%2CgBAsFI%3BEAMM%3B%3B%3BAAlIhB%2CGAAG%2CUAsCG%2CgBAsFI%2CgBASI%3BCAEE%2C6BAAA%3BCACA%3BCACA%3B%3BAAEA%2CGA3Ib%2CUAsCG%2CgBAsFI%2CgBASI%2CUAMG%3BCACG%3BCACA%3BCACA%3B%3BAAOA%3BCAAA%2CGArJjB%2CUAsCG%2CgBAsFI%2CgBASI%2CUAMG%3BEAOO%3B%3B%3BAAlJxB%2CGAAG%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%3BCACE%3BCAKA%2CiBAAA%3BCA5ThB%2CkBAAA%3BCACA%2CuBAAA%3BCACA%2C0BAAA%3BCACA%2CyBAAA%3B%3BAAyTgB%3BCAAA%2CGA9JjB%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%3BEAGM%3B%3B%3BAA3JxB%2CGAAG%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%2CUAWE%3BCACI%3B%3BAAQJ%2CGA5KjB%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%2CUAoBG%2COACG%3BCACI%3B%3BAAqB5B%2CMAEI%3BCACI%3B%3BAAIJ%3BCAAA%2CMALA%3BEAGQ%3B%3B%3BAALZ%2CMASI%3BCACI%3B%3BAAIJ%3BCAAA%2CMALA%3BEAGQ%3B%3B%3BAAcJ%3BCAAA%2CMAVJ%2CcAAa%2COAMT%3BEAEQ%3B%3B%3B%3BAAQhB%3BCAEI%2C%2BCAAA%3BCACA%2CgCAAA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAYJ%3BCANI%3BEACI%3B%3B%3B%3BAAMR%3BAACA%3BCAEI%3B%3BAAEA%2CiBAAC%3BAAAD%2CcAAC%3BCACG%3B%3BAAIR%3BCAEI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAANJ%2CcAQI%3BCACI%3BCACA%3B%3BAAVR%2CcAaI%2CoBAAoB%3BCAChB%22%7D */- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat-workbench.min.css b/modules/cms/ui/themes/default/style/openrat-workbench.min.css @@ -1 +0,0 @@ -div#dialog > .view{overflow: auto;position: absolute;top: 5%;left: 10%;width: 80%;height: 80%;z-index: 110;border: 1px solid !important}@media only screen and (max-width: 55rem){div#dialog > .view{top: 2.5%;left: 2.5%;width: 95%;height: 95%}}div#dialog.is-closed{display: none;width: 0}div#dialog .filler{position: absolute;z-index: 100;top: 0;left: 0;height: 100%;width: 100%;opacity: 0.5}div#dialog .filler span.icon{opacity: 1;font-size: 3em;font-weight: bold;text-align: center;width: 40px;height: 40px;position: absolute;right: 20px;top: 20px}.arrow{width: 0;height: 0;margin: 6px;padding: 0;font-size: 0}.arrow.arrow-down{border-right: 6px solid transparent;border-top: 6px solid;border-left: 6px solid transparent;border-bottom: 4px solid transparent;margin-top: 10px}.arrow.arrow-right{border-top: 6px solid transparent;border-left: 6px solid;border-bottom: 6px solid transparent;border-right: 4px solid transparent;margin-left: 10px}#editor .dirty{font-weight: bold}.visible-for-nojs{display: none}html.nojs .noscript{display: block}.toggle-open-close{display: flex;flex-direction: column}.toggle-open-close .on-click-open-close{cursor: pointer;font-weight: normal}.toggle-open-close > .closable{transition: opacity .3s ease-out;flex: 1;display: block}.toggle-open-close.closed > .on-click-open-close > .on-closed{display: inline}.toggle-open-close.closed > .on-click-open-close > .on-open{display: none}.toggle-open-close.closed > .closable{opacity: 0;max-height: 0;overflow: hidden}.toggle-open-close.open > .closable{height: auto}.toggle-open-close.open > .on-click-open-close > .on-closed{display: none}.toggle-open-close.open > .on-click-open-close > .on-open{display: inline}html,body{width: 100%;height: 100%}div#workbench{width: 100%;height: 100%;display: flex;flex-direction: column}div#workbench > header{height: 3.0rem}div#workbench > header .toolbar-icon .arrow-down{display: inline}@media only screen and (max-width: 55rem){div#workbench > header .toolbar-icon span.label,div#workbench > header .toolbar-icon .arrow-down{display: none}}div#workbench > .or-main-area{flex: 1;min-height: 0;padding-top: 0.5em}div#workbench > .or-main-area > *{min-width: 0;min-height: 0;overflow-y: auto;overflow-x: hidden;height: 100%}div#workbench > .or-main-area > nav{width: 33%;transition: width .15s ease-in-out;position: fixed;height: calc(100% - 3.0rem - 0.5em)}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > nav{width: 0}}div#workbench > .or-main-area > nav.small{width: 5%;opacity: 0.5;overflow-y: hidden}div#workbench > .or-main-area > nav.small:hover{width: 33%;overflow-y: auto;opacity: 1;background-color: inherit;border-right: 1px solid inherit}div#workbench > .or-main-area > nav.small ~ .or-workplace{margin-left: 5%}div#workbench > .or-main-area > nav.open{overflow-y: auto}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > nav.open{width: 95%;border-right: 1px solid;opacity: 0.95}}@media only screen and (min-width: 75rem){div#workbench > .or-main-area > nav{width: 33%;overflow-y: auto}}div#workbench > .or-main-area > nav div.view{height: 100%}div#workbench > .or-main-area header .or-view-icon,div#workbench > .or-main-area header .or-view-headline{margin: 0.3em;display: inline;font-size: 1.2em;line-height: 1.5em}div#workbench > .or-main-area > .or-workplace{margin-left: 33%;transition: margin-left .15s ease-in-out}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace{margin-left: 0}}div#workbench > .or-main-area > .or-workplace > #editor{transition: opacity .5s ease;display: flex;flex-direction: column}div#workbench > .or-main-area > .or-workplace > #editor.is-closed{flex: 0.5;cursor: not-allowed;pointer-events: none}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace > #editor.is-closed{flex: 0}}div#workbench > .or-main-area > .or-workplace > #editor > section{margin: 1.5em;border: 1px solid;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace > #editor > section{margin: 0.5em}}div#workbench > .or-main-area > .or-workplace > #editor > section .view-toolbar{display: inline}div#workbench > .or-main-area > .or-workplace > #editor > section.closed .view-toolbar{display: none}#title .toggle-nav-small{display: inline}@media only screen and (max-width: 55rem){#title .toggle-nav-small{display: none}}#title .toggle-nav-open-close{display: none}@media only screen and (max-width: 55rem){#title .toggle-nav-open-close{display: inline}}@media only screen and (max-width: 55rem){#title .toolbar-icon.search input{width: 3em}}.loader{background: url(../images/loader.gif) no-repeat;background-position: center, top;height: 30px;opacity: 0.5;cursor: wait;pointer-events: none}@media only screen and (max-width: 55rem){html{font-size: 1em}}.toggle-nav-small,.or-navigation{z-index: 102}.toggle-nav-small:hover,.or-navigation:hover{z-index: 112}.or-breadcrumb{margin-bottom: 0.1em;margin-left: 1.5em;line-height: 18px;font-weight: normal;white-space: nowrap}.or-breadcrumb li{display: inline;margin-right: 0.3em}.or-breadcrumb .or-breadcrumb-item .image-icon{margin-right: 0.2em}- \ No newline at end of file diff --git a/modules/cms/ui/themes/default/style/openrat.css b/modules/cms/ui/themes/default/style/openrat.css @@ -0,0 +1,1670 @@ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/style/openrat-base */ +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ +/* Customized for OR-CMS */ +html { + font-family: 'Oxygen', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + font-size: 0.8em; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 1.2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: 'Source Code Pro', monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + background-color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; + text-align: left; +} +/* Box-Sizing: We are using border-box as this is the most intuitive way for sizing. */ +*, +::before, +::after { + box-sizing: border-box; +} +/* After page loading, all elements are hidden. This class will be removed by javascript. */ +.initial-hidden { + display: none; +} +.sort-value { + display: none; +} +legend { + font-size: 1.1em; + font-weight: bold; + padding: 0 0.5em; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-base.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3BAAKA%3BCACE%2CaAAa%2CUAAU%2C6CAA6C%2CYAAY%2CaAAa%2CUAAU%2CaACvG%2CaAAa%2CcAAc%2C4BAD3B%3BCAEA%3BCACA%3BCACA%3B%3BAAIF%3BCAAO%3B%3BAAMP%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BAACA%3BCACE%3B%3BAAKF%3BAACA%3BAACA%3BAACA%3BCACE%3BCACA%3B%3BAAKF%2CKAAK%2CIAAI%3BCACP%3BCACA%3B%3BAAKF%3BAACA%3BCACE%3B%3BAAKF%3BCACE%3B%3BAAEA%2CCAAC%3BAACD%2CCAAC%3BCACC%3B%3BAAOJ%2CIAAI%3BCAAU%2CyBAAA%3B%3BAAGd%3BAACA%3BCACE%3B%3BAAIF%3BCAAM%3B%3BAAGN%3BCACE%3BCACA%2CgBAAA%3B%3BAAIF%3BCACE%3BCACA%3B%3BAAIF%3BCAAQ%3B%3BAAGR%3BAACA%3BCACE%3BCACA%3BCACA%3BCACA%3B%3BAAGF%3BCAAM%3B%3BAACN%3BCAAM%3B%3BAAIN%3BCAAM%3B%3BAAGN%2CGAAG%2CIAAI%3BCAAU%3B%3BAAIjB%3BCAAS%2CgBAAA%3B%3BAAGT%3BCACE%3BCACA%3BCACA%3B%3BAAIF%3BCAAM%3B%3BAAGN%3BAACA%3BAACA%3BAACA%3BCACE%2CaAAa%2CuCAAb%3BCACA%3B%3BAAWF%3BAACA%3BAACA%3BAACA%3BAACA%3BCACE%3BCACA%3BCACA%3BCACA%3B%3BAAIF%3BCAAS%3B%3BAAMT%3BAACA%3BCACE%3B%3BAAMF%3BAACA%2CIAAK%2CMAAK%3BCACR%3BCACA%3B%3BAAIF%2CMAAM%3BAACN%2CIAAK%2CMAAK%3BCACR%3B%3BAAMA%2CMADF%2CMACG%3BCACC%3BCACA%3B%3BAAKJ%3BCACE%3B%3BAACA%2CKAAC%3BAACD%2CKAAC%3BCACC%3BCACA%3B%3BAAOF%2CKAAC%3BAACD%2CKAAC%3BCACC%3BCACA%3B%3BAAOA%2CKADD%2CeACE%3BAACD%2CKAFD%2CeAEE%3BCACC%3B%3BAAMJ%2CKAAC%3BCACC%3BCACA%3BCACA%3BCACA%3B%3BAAKA%2CKATD%2CeASE%3BAACD%2CKAVD%2CeAUE%3BCACC%3B%3BAAON%3BCACE%2CyBAAA%3BCACA%2CaAAA%3BCACA%2C8BAAA%3B%3BAAKF%3BCACE%3BCACA%3B%3BAAIF%3BCAAW%3B%3BAAIX%3BCAAW%3B%3BAAIX%3BCACE%3BCACA%3B%3BAAGF%3BAACA%3BCACE%3BCACA%3B%3B%3BAAUF%3BAAAG%3BAAAU%3BCACX%3B%3B%3BAAOF%3BCACE%3B%3BAAGF%3BCACE%3B%3BAAKF%3BCACI%3BCACA%3BCACA%2CgBAAA%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/style/openrat-ui */ +/* Usage to this variable is safe to be removed */ +/* oxygen-regular - latin */ +@font-face { + font-family: 'Oxygen'; + font-style: normal; + font-weight: 400; + src: local('Oxygen Regular'), local('Oxygen-Regular'), url('../font/oxygen-v7-latin-regular.woff') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('../font/oxygen-v7-latin-regular.woff') format('woff'); + + /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +/* source-code-pro-regular - latin */ +@font-face { + font-family: 'Source Code Pro'; + font-style: normal; + font-weight: 400; + src: local('Source Code Pro'), local('SourceCodePro-Regular'), url('../font/source-code-pro-v8-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('../font/source-code-pro-v8-latin-regular.woff') format('woff'); + + /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ +} +@font-face { + font-family: 'Material Icons'; + font-style: normal; + font-weight: 400; + src: local('Material Icons'), local('MaterialIcons-Regular'), url('../font/MaterialIcons-Regular.woff2') format('woff2'), url('../font/MaterialIcons-Regular.woff') format('woff'); +} +.image-icon { + font-family: 'Material Icons'; + font-weight: normal; + font-style: normal; + display: inline-block; + text-transform: none; + letter-spacing: normal; + word-wrap: normal; + white-space: nowrap; + direction: ltr; + /* Support for all WebKit browsers. */ + /* Support for Safari and Chrome. */ + /* Support for Firefox. */ + /* Support for IE. */ + font-feature-settings: 'liga'; +} +.image-icon.image-icon--action-el_text:after { + content: "spellcheck"; +} +.image-icon.image-icon--action-el_longtext:after { + content: "view_headline"; +} +.image-icon.image-icon--action-el_select:after { + content: "list"; +} +.image-icon.image-icon--action-el_number:after { + content: "looks_one"; +} +.image-icon.image-icon--action-el_link:after { + content: "call_made"; +} +.image-icon.image-icon--action-el_date:after { + content: "date_range"; +} +.image-icon.image-icon--action-el_insert:after { + content: "keyboard_return"; +} +.image-icon.image-icon--action-el_copy:after { + content: "flip_to_back"; +} +.image-icon.image-icon--action-el_linkinfo:after { + content: "info"; +} +.image-icon.image-icon--action-el_linkdate:after { + content: "info"; +} +.image-icon.image-icon--action-el_code:after { + content: "code"; +} +.image-icon.image-icon--action-el_dynamic:after { + content: "play_circle_outline"; +} +.image-icon.image-icon--action-el_info:after { + content: "info"; +} +.image-icon.image-icon--action-el_infodate:after { + content: "info"; +} +.image-icon.image-icon--action-el_checkbox:after { + content: "check_box"; +} +.image-icon.image-icon--action-image:after { + content: "image"; +} +.image-icon.image-icon--action-link:after { + content: "call_made"; +} +.image-icon.image-icon--action-url:after { + content: "link"; +} +.image-icon.image-icon--action-alias:after { + content: "bookmark_border"; +} +.image-icon.image-icon--action-text:after { + content: "text_format"; +} +.image-icon.image-icon--action-page:after { + content: "insert_drive_file"; +} +.image-icon.image-icon--action-file:after { + content: "save"; +} +.image-icon.image-icon--action-modellist:after { + content: "device_hub"; +} +.image-icon.image-icon--action-model:after { + content: "device_hub"; +} +.image-icon.image-icon--action-folder:after { + content: "folder_open"; +} +.image-icon.image-icon--action-languagelist:after { + content: "language"; +} +.image-icon.image-icon--action-language:after { + content: "language"; +} +.image-icon.image-icon--action-template:after { + content: "receipt"; +} +.image-icon.image-icon--action-templatelist:after { + content: "receipt"; +} +.image-icon.image-icon--action-groupllist:after { + content: "group"; +} +.image-icon.image-icon--action-group:after { + content: "group"; +} +.image-icon.image-icon--action-userlist:after { + content: "person"; +} +.image-icon.image-icon--action-user:after { + content: "person"; +} +.image-icon.image-icon--action-profile:after { + content: "person_pin"; +} +.image-icon.image-icon--method-settings:after { + content: "settings"; +} +.image-icon.image-icon--action-configuration:after { + content: "settings"; +} +.image-icon.image-icon--action-projectlist:after { + content: "list"; +} +.image-icon.image-icon--action-project:after { + content: "account_balance"; +} +.image-icon.image-icon--action-macro:after { + content: "data_usage"; +} +.image-icon.image-icon--action-membership { + content: "card_membership"; +} +.image-icon.image-icon--method-password:after { + content: "lock"; +} +.image-icon.image-icon--method-publish:after { + content: "cloud_upload"; +} +.image-icon.image-icon--method-show:after { + content: "slideshow"; +} +.image-icon.image-icon--method-src:after { + content: "code"; +} +.image-icon.image-icon--method-acl:after { + content: "https"; +} +.image-icon.image-icon--method-rights:after { + content: "https"; +} +.image-icon.image-icon--method-archive:after { + content: "schedule"; +} +.image-icon.image-icon--method-mail:after { + content: "mail"; +} +.image-icon.image-icon--method-search:after { + content: "search"; +} +.image-icon.image-icon--method-add:after { + content: "add_box"; +} +.image-icon.image-icon--menu-close:after { + content: "close"; +} +.image-icon.image-icon--menu-fullscreen:after { + content: "fullscreen"; +} +.image-icon.image-icon--menu-edit:after { + content: "description"; +} +.image-icon.image-icon--menu-extra:after { + content: "build"; +} +.image-icon.image-icon--menu-menu:after { + content: "menu"; +} +.image-icon.image-icon--menu-minimize:after { + content: "compare_arrows"; +} +.image-icon.image-icon--menu-qrcode:after { + content: "phone_android"; +} +.image-icon.image-icon--node-open:after { + content: "expand_more"; +} +.image-icon.image-icon--node-closed:after { + content: "chevron_right"; +} +.image-icon.image-icon--form-ok:after { + content: "done"; +} +.image-icon.image-icon--form-cancel:after { + content: "clear"; +} +.image-icon.image-icon--editor-bold:after { + content: "format_bold"; +} +.image-icon.image-icon--editor-italic:after { + content: "format_italic"; +} +.image-icon.image-icon--editor-headline:after { + content: "format_size"; +} +.image-icon.image-icon--editor-help:after { + content: "help_outline"; +} +.image-icon.image-icon--editor-fullscreen:after { + content: "fullscreen"; +} +.image-icon.image-icon--editor-quote:after { + content: "format_quote"; +} +.image-icon.image-icon--editor-unnumberedlist:after { + content: "format_list_bulleted"; +} +.image-icon.image-icon--editor-numberedlist:after { + content: "format_list_numbered"; +} +.image-icon.image-icon--editor-preview:after { + content: "desktop_windows"; +} +.image-icon.image-icon--editor-sidebyside:after { + content: "flip"; +} +.image-icon.image-icon--editor-link:after { + content: "link"; +} +.image-icon.image-icon--editor-image:after { + content: "image"; +} +.image-icon.image-icon--editor-undo:after { + content: "undo"; +} +.image-icon.image-icon--editor-redo:after { + content: "redo"; +} +.image-icon.image-icon--editor-code:after { + content: "code"; +} +.image-icon.image-icon--editor-horizontalrule:after { + content: "remove"; +} +.image-icon.image-icon--editor-table:after { + content: "view_comfy"; +} +.editor-toolbar { + font-size: 1.5em; +} +iframe { + width: 100%; + height: 500px; + display: block; +} +div.breadcrumb, +div.breadcrumb a, +div.panel > div.title { + font-weight: bold; +} +div#noticebar { + display: block; + position: fixed; + bottom: 40px; + /*top: 40px;*/ + right: 40px; + width: 25em; + z-index: 113; +} +div#noticebar div.notice { + border: 2px solid #000000; + padding: 1.1em; + margin: 5px; + position: relative; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + -webkit-box-shadow: 3px 2px 5px #000000; + -moz-box-shadow: 3px 2px 5px #000000; + box-shadow: 3px 2px 5px #000000; +} +div#noticebar div.notice .or-notice-toolbar { + float: right; + margin: 0 0.2em; + font-size: 2em; + color: gray; + cursor: pointer; +} +div#noticebar div.notice:hover .or-notice-toolbar { + color: black; +} +div#noticebar div.notice.full { + display: block; + position: fixed; + bottom: 10%; + top: 10%; + right: 10%; + left: 10%; + width: 80%; + z-index: 114; +} +div#noticebar div.notice.error div.text { + font-weight: bold; +} +div#noticebar div.notice div.text { + font-size: 1.1em; +} +div#noticebar div.notice:after { + content: ''; + position: absolute; + right: 0; + top: 50%; + width: 0; + height: 0; + border: 1em solid transparent; + border-right: 0; + margin-top: -1em; + margin-right: -1em; +} +div#noticebar div.notice div.log { + display: none; + position: relative; + max-height: 90%; + overflow: auto; + font-family: 'Source Code Pro', Monospace, Monospaced, Courier; +} +div#noticebar div.notice.full div.log { + display: block; +} +div.onrowvisible { + visibility: hidden; + display: inline; +} +/* Vorschau von Text-Inhalten */ +/* Verweise */ +a:link, +a:visited { + font-weight: normal; + text-decoration: none; +} +a:active, +a:hover { + font-weight: normal; + text-decoration: none; +} +/* Icon-Innenabstand */ +img[align=left], +img[align=right] { + padding-right: 1px; + padding-left: 1px; +} +/* Vorformatierter Text */ +/* Lizenzhinweis */ +div.logo h2 { + font-weight: normal; + font-size: 24px; +} +div.logo p { + font-size: 13px; +} +label, +.clickable { + cursor: pointer; +} +/* Drag and Drop */ +.or-droppable--active { + background-color: #2E8B57 !important; + cursor: move; +} +.or-droppable--hover { + background-color: #00d95a !important; + cursor: move; +} +/* T a b s */ +img.icon { + padding: 4px; + width: 16px; + height: 16px; +} +div.panel ul.views li { + vertical-align: middle; + padding: 0px; + cursor: pointer; + border-right: 1px solid #000000; + -moz-border-radius-topleft: 5px; + /* Mozilla */ + -webkit-border-radius-topleft: 5px; + /* Webkit */ + -khtml-border-top-radius-topleft: 5px; + /* Konqui */ + -moz-border-radius-topright: 5px; + /* Mozilla */ + -webkit-border-radius-topright: 5px; + /* Webkit */ + -khtml-border-top-radius-topright: 5px; + /* Konqui */ + border-top-right-radius: 5px; + display: inline; + white-space: nowrap; + float: left; +} +div.panel { + margin: 0px; + padding: 0px; +} +/* S t a t u s z e i l e */ +div.panel div.status { + padding: 10px; +} +div.panel div.status div.error, +div.message.error { + background: url(../images/notice_error.png) no-repeat; + background-position: 5px 7px; +} +div.panel div.status div.warn, +div.message.warn { + background: url(../images/notice_warning.png) no-repeat; + background-position: 5px 7px; +} +div.panel div.status div.ok, +div.message.ok { + background: url(../images/notice_ok.png) no-repeat; + background-position: 5px 7px; +} +div.panel div.status div.info, +div.message.info { + background: url(../images/notice_info.png) no-repeat; + background-position: 5px 7px; +} +div.panel div.status div, +div.message { + border: 1px solid #000000; + padding: 5px 0px 5px 25px; + margin: 10px 10px 20px 10px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px; +} +#workbench div.panel.fullscreen { + display: block; + z-index: 109; + position: fixed; + top: 0; + left: 0; + background-color: #000000; + margin: 0px; + width: 100% !important; + height: 100% !important; +} +#workbench div.panel.fullscreen > div.content { + width: 100% !important; + height: 100% !important; +} +#workbench div.panel { + border: 1px solid #000000; + margin: 0px; + padding: 0px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; + border-radius: 5px; +} +#workbench div.container, +#workbench div.panel, +#workbench div.divider { + display: inline; + float: left; + margin: 0px; +} +#workbench div.panel > div.content { + overflow: auto; +} +.invisible { + visibility: hidden; +} +.visible { + visibility: visible; +} +/* + * Formular-Button-Leiste + */ +div.panel { + position: relative; +} +div.content div.bottom { + height: 55px; + width: 100%; + position: absolute; + padding-right: 40px; + bottom: 0px; + right: 0px; + xvisibility: hidden; +} +div.content div.bottom > div.command { + xvisibility: visible; + float: right; + z-index: 20; +} +div.content form[data-autosave='true'] div.command { + display: none; +} +div.content > form { + padding-bottom: 45px; +} +main .or-form .or-form-actionbar { + display: none; +} +/* R e s p o n s i v e f o r m s */ +.or-form { + padding: 1em; + /* Style inputs, select elements and textareas */ + /* Style the label to display next to the inputs */ + /* Style the submit button */ + /* Floating column for labels: 25% width */ + /* Floating column for inputs: 75% width */ + /* Clear floats after the columns */ + /* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */ +} +.or-form input[type=checkbox] + label, +.or-form input[type=radio] + label { + width: 80%; +} +.or-form .headline { + font-size: 1.8em; +} +.or-form div.inputholder > div.dropdown { + width: 70%; +} +.or-form input.submit { + padding: 7px; + border: 0px; + -moz-border-radius: 7px; + /* Mozilla */ + -webkit-border-radius: 7px; + /* Webkit */ + -khtml-border-radius: 7px; + /* Konqui */ + border-radius: 7px; + margin-left: 20px; + cursor: pointer; +} +.or-form input[type=text], +.or-form select, +.or-form textarea { + width: 100%; + padding: 12px; + border: 1px solid #ccc; + border-radius: 4px; + box-sizing: border-box; + resize: vertical; +} +.or-form label { + padding: 12px 12px 12px 0; + display: inline-block; +} +.or-form input[type=submit] { + color: white; + padding: 12px 20px; + border: none; + border-radius: 4px; + cursor: pointer; + float: right; +} +.or-form div.label { + float: left; + width: 25%; + margin-top: 6px; +} +.or-form div.input { + float: left; + width: 75%; + margin-top: 6px; +} +.or-form .line:after { + content: ""; + display: table; + clear: both; +} +.or-form .or-form-row { + display: flex; + align-items: center; +} +.or-form .or-form-row .or-form-label { + width: 25%; +} +.or-form .or-form-row .or-form-input { + width: 75%; +} +.or-form .or-form-actionbar { + position: sticky; + bottom: 0; + left: 0; + right: 0; + display: flex; + justify-content: end; + padding: 1em; + height: auto; +} +.or-form .or-form-actionbar .or-form-btn { + padding: 1em 2em; + margin-left: 1.5em; + min-width: 14em; + border: 0; + border-radius: 0.5em; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; + -khtml-border-radius: 0.5em; + cursor: pointer; +} +.or-form .or-form-actionbar .or-form-btn--primary { + font-weight: bold; + /* Primäre Aktion in Fettdruck */ +} +@media screen and (max-width: 65rem) { + .or-form div.label, + .or-form div.input { + width: 100%; + margin-top: 0; + } + .or-form .or-form-row { + flex-direction: column; + } + .or-form .or-form-row .or-form-label, + .or-form .or-form-row .or-form-input { + width: 100%; + } + .or-form .or-form-actionbar { + align-items: center; + display: block; + } + .or-form .or-form-actionbar .or-form-btn { + width: 90%; + } +} +.or-link-btn { + padding: 0.5em 1.0em; + min-width: 5em; + border: 0; + border-radius: 0.3em; + -moz-border-radius: 0.3em; + -webkit-border-radius: 0.3em; + -khtml-border-radius: 0.3em; + cursor: pointer; +} +div.search > div.inputholder { + padding-top: 1px; +} +div.inputholder > input, +div.inputholder > textarea, +div.inputholder > select { + padding: 2px; + margin: 0px; +} +/* Eingabfeld fuer Namen */ +fieldset > div input.name, +fieldset > div span.name { + font-weight: bold; +} +/* Eingabfelder fuer Dateiname */ +fieldset > div input.filename, +fieldset > div input.extension, +fieldset > div input.ansidate, +fieldset > div span.filename, +fieldset > div span.extension, +fieldset > div span.ansidate { + font-family: 'Source Code Pro', Monospace, Monospaced, Courier; +} +dl.notice { + padding: 15px; +} +div.content pre, +div.dropdown { + min-width: 150px; + max-width: 450px; +} +img.image-icon { + visibility: hidden; +} +/* Make Codemirror Auto-Resizable */ +.CodeMirror { + height: auto; +} +.or-linklist { + display: flex; + flex-direction: column; + padding: 10% 20%; +} +.or-linklist > .or-linklist-line { + border: 1px solid; + margin-top: 1em; + padding: 1em; + border-radius: 0.5em; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; + -khtml-border-radius: 0.5em; +} +.or-info { + position: relative; +} +.or-info:hover .or-info-popup { + display: block; +} +.or-info .or-info-popup { + display: none; + position: absolute; + top: 0px; + left: 0px; + overflow: visible; + border: 0.5em; + font-size: 2em; + border-radius: 0.3em; + -moz-border-radius: 0.3em; + -webkit-border-radius: 0.3em; + -khtml-border-radius: 0.3em; + padding: 1.0em; + z-index: 105; +} +.or-info .or-info-popup > div { + display: inline-block; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-ui.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3BAAIA%3BCACE%3BCACA%3BCACA%3BCACA%2CKAAK%2CMAAM%2CmBAAmB%2CMAAM%2CuBAChC%2CwCAAwC%2COAAO%2CuDAC%5C%2FC%2CwCAAwC%2COAAO%2COAFnD%3B%3B%3B%3B%3BAAMF%3BCACE%2CaAAa%2CiBAAb%3BCACA%3BCACA%3BCACA%2CKAAK%2CMAAM%2CoBAAoB%2CMAAM%2C8BACjC%2CkDAAkD%2COAAO%2CuDACzD%2CiDAAiD%2COAAO%2COAF5D%3B%3B%3B%3BAAKF%3BCACE%2CaAAa%2CgBAAb%3BCACA%3BCACA%3BCACA%2CKAAK%2CMAAM%2CmBACX%2CMAAM%2C8BACF%2CuCAAuC%2COAAO%2CcAC9C%2CsCAAsC%2COAAO%2COAHjD%3B%3BAAMF%3BCACE%2CaAAa%2CgBAAb%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3B%3B%3B%3BCAYA%3B%3BAAGA%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2C%2BBAA%2BB%3BCAAS%2CSAAS%2CeAAT%3B%3BAACzC%2CWAAC%2C6BAA6B%3BCAAS%3B%3BAACvC%2CWAAC%2C6BAA6B%3BCAAS%2CSAAS%2CWAAT%3B%3BAACvC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CWAAT%3B%3BAACrC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CYAAT%3B%3BAACrC%2CWAAC%2C6BAA6B%3BCAAS%2CSAAS%2CiBAAT%3B%3BAACvC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CcAAT%3B%3BAACrC%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2C8BAA8B%3BCAAS%2CSAAS%2CqBAAT%3B%3BAACxC%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C%2BBAA%2BB%3BCAAS%2CSAAS%2CWAAT%3B%3BAAEzC%2CWAAC%2CyBAAyB%3BCAAS%3B%3BAACnC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CWAAT%3B%3BAAClC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CiBAAT%3B%3BAACnC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CaAAT%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CmBAAT%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2C6BAA6B%3BCAAS%2CSAAS%2CYAAT%3B%3BAACvC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CYAAT%3B%3BAACnC%2CWAAC%2C0BAA0B%3BCAAS%2CSAAS%2CaAAT%3B%3BAACpC%2CWAAC%2CgCAAgC%3BCAAS%3B%3BAAC1C%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CgCAAgC%3BCAAS%3B%3BAAC1C%2CWAAC%2C8BAA8B%3BCAAS%3B%3BAACxC%2CWAAC%2CyBAAyB%3BCAAS%3B%3BAACnC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CYAAT%3B%3BAACrC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CiCAAiC%3BCAAS%3B%3BAAC3C%2CWAAC%2C%2BBAA%2BB%3BCAAS%3B%3BAACzC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CiBAAT%3B%3BAAErC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CYAAT%3B%3BAAEnC%2CWAAC%3BCAAiC%2CSAAS%2CiBAAT%3B%3BAAClC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CcAAT%3B%3BAACrC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2C0BAA0B%3BCAAS%3B%3BAACpC%2CWAAC%2C2BAA2B%3BCAAS%3B%3BAACrC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2C0BAA0B%3BCAAS%3B%3BAACpC%2CWAAC%2CuBAAuB%3BCAAS%2CSAAS%2CSAAT%3B%3BAACjC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAACjC%2CWAAC%2C4BAA4B%3BCAAS%3B%3BAACtC%2CWAAC%2CsBAAsB%3BCAAS%3B%3BAAChC%2CWAAC%2CuBAAuB%3BCAAS%3B%3BAAEjC%2CWAAC%2CsBAAsB%3BCAAS%3B%3BAAChC%2CWAAC%2C0BAA0B%3BCAAS%2CSAAS%2CgBAAT%3B%3BAACpC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CeAAT%3B%3BAAElC%2CWAAC%2CsBAAsB%3BCAAS%2CSAAS%2CaAAT%3B%3BAAChC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CeAAT%3B%3BAAElC%2CWAAC%2CoBAAoB%3BCAAS%3B%3BAAC9B%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAElC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CaAAT%3B%3BAAClC%2CWAAC%2C0BAA0B%3BCAAS%2CSAAS%2CeAAT%3B%3BAACpC%2CWAAC%2C4BAA4B%3BCAAS%2CSAAS%2CaAAT%3B%3BAACtC%2CWAAC%2CwBAAwB%3BCAAS%2CSAAS%2CcAAT%3B%3BAAClC%2CWAAC%2C8BAA8B%3BCAAS%3B%3BAACxC%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CcAAT%3B%3BAACnC%2CWAAC%2CkCAAkC%3BCAAS%2CSAAS%2CsBAAT%3B%3BAAC5C%2CWAAC%2CgCAAgC%3BCAAS%2CSAAS%2CsBAAT%3B%3BAAC1C%2CWAAC%2C2BAA2B%3BCAAS%2CSAAS%2CiBAAT%3B%3BAACrC%2CWAAC%2C8BAA8B%3BCAAS%3B%3BAACxC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CyBAAyB%3BCAAS%3B%3BAACnC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CwBAAwB%3BCAAS%3B%3BAAClC%2CWAAC%2CkCAAkC%3BCAAS%3B%3BAAC5C%2CWAAC%2CyBAAyB%3BCAAS%2CSAAS%2CYAAT%3B%3BAAGrC%3BCACE%3B%3BAAgBF%3BCACE%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%3BAACH%2CGAAG%2CWAAY%3BAACf%2CGAAG%2CMAAS%2CMAAG%3BCACb%3B%3BAAGF%2CGAAG%3BCAED%3BCACA%3BCACA%3B%3BCAEA%3BCACA%3BCACA%3B%3BAARF%2CGAAG%2CUAWD%2CIAAG%3BCACD%2CyBAAA%3BCACA%3BCACA%3BCACA%3BCAvCF%2CkBAAA%3BCACA%2CuBAAA%3BCACA%2C0BAAA%3BCACA%2CyBAAA%3BCAGA%2CuCAAA%3BCACA%2CoCAAA%3BCACA%2C%2BBAAA%3B%3BAAgBF%2CGAAG%2CUAWD%2CIAAG%2COASD%3BCACE%3BCACA%2CeAAA%3BCACA%3BCACA%3BCACA%3B%3BAAGF%2CGA5BD%2CUAWD%2CIAAG%2COAiBA%2CMACC%3BCACE%3B%3BAAIJ%2CGAlCD%2CUAWD%2CIAAG%2COAuBA%3BCACC%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAIF%2CGA9CD%2CUAWD%2CIAAG%2COAmCA%2CMAEC%2CIAAG%3BCACD%3B%3BAAjDR%2CGAAG%2CUAWD%2CIAAG%2COA0CD%2CIAAG%3BCACD%3B%3BAAGF%2CGAzDD%2CUAWD%2CIAAG%2COA8CA%3BCACC%2CSAAS%2CEAAT%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%2C6BAAA%3BCACA%3BCACA%3BCACA%3B%3BAAnEN%2CGAAG%2CUAWD%2CIAAG%2COA2DD%2CIAAG%3BCACD%3BCACA%3BCACA%3BCACA%3BCACA%2CaAAa%2CiDAAb%3B%3BAAGF%2CGA9ED%2CUAWD%2CIAAG%2COAmEA%2CKACC%2CIAAG%3BCACD%3B%3BAAmBR%2CGAAG%3BCACD%3BCACA%3B%3B%3B%3BAAQF%2CCAAC%3BAACD%2CCAAC%3BCACC%3BCACA%3B%3BAAGF%2CCAAC%3BAACD%2CCAAC%3BCACC%3BCACA%3B%3B%3BAAIF%2CGAAG%3BAACH%2CGAAG%3BCACD%3BCACA%3B%3B%3B%3BAAaF%2CGAAG%2CKAAM%3BCACP%3BCACA%3B%3BAAGF%2CGAAG%2CKAAM%3BCACP%3B%3BAAGF%3BAACA%3BCACE%3B%3B%3BAAQA%2CaAAC%3BCAEC%3BCACA%3B%3BAAGF%2CaAAC%3BCACC%3BCACA%3B%3B%3BAAOJ%2CGAAG%3BCACD%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%2CMAAO%2CGAAE%2CMAAO%3BCACjB%3BCACA%3BCAEA%3BCAEA%2C%2BBAAA%3BCAEA%3B%3BCACA%3B%3BCACA%3B%3BCAEA%3B%3BCACA%3B%3BCACA%3B%3BCACA%3BCAEA%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%3BCACD%3BCACA%3B%3B%3BAAOF%2CGAAG%2CMAAO%2CIAAG%3BCACX%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CqDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CuDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CkDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%2CIAAG%3BAACxB%2CGAAG%2CQAAQ%3BCACT%2CoDAAA%3BCACA%2C4BAAA%3B%3BAAGF%2CGAAG%2CMAAO%2CIAAG%2COAAQ%3BAACrB%2CGAAG%3BCACD%2CyBAAA%3BCACA%2CyBAAA%3BCACA%2C2BAAA%3BCAEA%3BCACA%3BCACA%3BCACA%3B%3BAAIF%2CUACE%2CIAAG%2CMAAM%3BCACP%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%2CyBAAA%3BCACA%3BCACA%3BCACA%3B%3BAAVJ%2CUAaE%2CIAAG%2CMAAM%2CWAAc%2CMAAG%3BCACxB%3BCACA%3B%3BAAfJ%2CUAkBE%2CIAAG%3BCACD%2CyBAAA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAzBJ%2CUA4BE%2CIAAG%3BAA5BL%2CUA4BiB%2CIAAG%3BAA5BpB%2CUA4B4B%2CIAAG%3BCAC3B%3BCACA%3BCACA%3B%3BAA%5C%2FBJ%2CUAkCE%2CIAAG%2CMAAS%2CMAAG%3BCACb%3B%3BAAIJ%3BCACE%3B%3BAAGF%3BCACE%3B%3B%3B%3B%3BAAMF%2CGAAG%3BCACD%3B%3BAAGF%2CGAAG%2CQAAS%2CIAAG%3BCACb%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%2CQAAS%2CIAAG%2COAAU%2CMAAG%3BCAC1B%3BCACA%3BCACA%3B%3BAAGF%2CGAAG%2CQAAS%2CKAAI%2CsBAAuB%2CIAAG%3BCACxC%3B%3BAAGF%2CGAAG%2CQAAW%3BCACZ%3B%3BAAQF%2CIAAK%2CSAAS%3BCACZ%3B%3B%3BAAKF%3BCA%2BBE%3B%3B%3B%3B%3B%3B%3B%3B%3BAA%5C%2FBF%2CQACE%2CMAAK%2CeAAkB%3BAADzB%2CQAEE%2CMAAK%2CYAAe%3BCAClB%3B%3BAAHJ%2CQAME%3BCACE%3B%3BAAPJ%2CQAcE%2CIAAG%2CYAAe%2CMAAG%3BCACnB%3B%3BAAfJ%2CQAkBE%2CMAAK%3BCACH%3BCACA%3BCACA%3B%3BCACA%3B%3BCACA%3B%3BCACA%3BCACA%3BCACA%3B%3BAA1BJ%2CQAkCE%2CMAAK%3BAAlCP%2CQAkCoB%3BAAlCpB%2CQAkC4B%3BCACxB%3BCACA%3BCACA%2CsBAAA%3BCACA%3BCACA%3BCACA%3B%3BAAxCJ%2CQA4CE%3BCACE%2CyBAAA%3BCACA%3B%3BAA9CJ%2CQAkDE%2CMAAK%3BCACH%3BCACA%2CkBAAA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAxDJ%2CQA4DE%2CIAAG%3BCACD%3BCACA%3BCACA%3B%3BAA%5C%2FDJ%2CQAmEE%2CIAAG%3BCACD%3BCACA%3BCACA%3B%3BAAtEJ%2CQA0EE%2CMAAK%3BCACH%2CSAAS%2CEAAT%3BCACA%3BCACA%3B%3BAA7EJ%2CQAgFE%3BCACE%3BCACA%3B%3BAAlFJ%2CQAgFE%2CaAIE%3BCACE%3B%3BAArFN%2CQAgFE%2CaAOE%3BCACE%3B%3BAAxFN%2CQA%2BFE%3BCAEE%3BCACA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3BCACA%3B%3BAAzGJ%2CQA%2BFE%2CmBAaC%3BCACE%2CgBAAA%3BCACA%3BCACA%3BCACA%3BCA3dH%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3BCA2dG%3B%3BAAEA%2CQAtBH%2CmBAaC%2CaASG%3BCACC%3B%3B%3BAAoCP%2CmBA1BuC%3BCA0BvC%2CQAxBI%2CIAAG%3BCAwBP%2CQAxBe%2CIAAG%3BEACZ%3BEACA%3B%3BCAsBN%2CQAnBI%3BEACC%3B%3BCAkBL%2CQAnBI%2CaAEE%3BCAiBN%2CQAnBI%2CaAGE%3BEACE%3B%3BCAeR%2CQAXI%3BEAEE%3BEACA%3B%3BCAQN%2CQAXI%2CmBAKE%3BEACE%3B%3B%3BAASR%3BCACE%2CoBAAA%3BCACA%3BCACA%3BCA5gBA%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3BCA4gBA%3B%3BAAOF%2CGAAG%2COAAU%2CMAAG%3BCACd%3B%3BAAGF%2CGAAG%2CYAAe%3BAAClB%2CGAAG%2CYAAe%3BAAClB%2CGAAG%2CYAAe%3BCAChB%3BCACA%3B%3B%3BAAIF%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CKAAI%3BCACjB%3B%3B%3BAAIF%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CMAAK%3BAACpB%2CQAAW%2CMAAI%2CKAAI%3BAACnB%2CQAAW%2CMAAI%2CKAAI%3BAACnB%2CQAAW%2CMAAI%2CKAAI%3BCACjB%2CaAAa%2CiDAAb%3B%3BAAGF%2CEAAE%3BCACA%3B%3BAAIF%2CGAAG%2CQAAS%3BAACZ%2CGAAG%3BCACD%3BCACA%3B%3BAAGF%2CGAAG%3BCACD%3B%3B%3BAAIF%3BCACE%3B%3BAAGF%3BCACE%3BCACA%3BCACA%2CgBAAA%3B%3BAAHF%2CYAKI%3BCACA%2CiBAAA%3BCACA%3BCACA%3BCA7kBF%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3B%3BAAglBF%3BCAEE%3B%3BAAEA%2CQAAC%2CMACC%3BCACE%3B%3BAANN%2CQAUE%3BCACE%3BCACA%3BCACA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCArmBF%2CoBAAA%3BCACA%2CyBAAA%3BCACA%2C4BAAA%3BCACA%2C2BAAA%3BCAomBE%3BCAEA%3B%3BAAtBJ%2CQAUE%2CeAcI%3BCACA%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/style/openrat-header */ +/* H e a d e r */ +#title { + overflow: hidden; + padding: 5px; +} +.or-menu { + display: flex; + justify-content: space-between; + /* Dropdown anzeigen, wenn Titel geöffnet und wenn mit Maus überstrichen */ +} +.or-menu .or-menu-group { + display: flex; + /* Pfeile */ +} +.or-menu .or-menu-group:nth-last-child(1) div.dropdown { + right: 10px; +} +.or-menu .or-menu-group i.image-icon { + width: 1.1em; +} +.or-menu .or-menu-group div > div.arrow-down { + width: 0; + height: 0; + margin: 6px; + padding: 0px; + margin-top: 10px; +} +.or-menu .or-menu-group div.toolbar-icon { + padding: 2px; + margin-left: 10px; + float: left; + /* Bestimmte Menüs sind nach rechts ausgerichet */ + /* D r o p d o w n - M e n u e s */ +} +.or-menu .or-menu-group div.toolbar-icon.user, +.or-menu .or-menu-group div.toolbar-icon.search, +.or-menu .or-menu-group div.toolbar-icon.history { + float: right; + margin-right: 10px; + margin-left: 10px; +} +.or-menu .or-menu-group div.toolbar-icon.menu { + cursor: default; +} +.or-menu .or-menu-group div.toolbar-icon.search .inputholder { + margin: 0; + padding: 0; + border: 0; + display: inline; +} +.or-menu .or-menu-group div.toolbar-icon.search .inputholder input { + border: 0; + margin: 0; + padding: 0; + width: 3em; + display: inline; + transition: width 0.3s ease-in-out; +} +.or-menu .or-menu-group div.toolbar-icon.search .inputholder input:focus { + width: 8em; +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown { + z-index: 120; + min-width: 250px; + display: none; + position: absolute; + padding: 5px 0px; + font-style: normal; + font-weight: normal; + text-decoration: none; +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry { + padding: 0; + /* Außenabstand Text */ +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a { + display: flex; + align-items: center; + padding: 0 0.5em; +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a * { + margin: 0.25em; +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a span:first-of-type { + flex: 1; + /* Menü-Text füllt den Platz auf */ +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > .text { + display: block; + margin: 10px; +} +.or-menu .or-menu-group div.toolbar-icon div.dropdown div.divide { + height: 1px; + width: 100%; + margin-top: 5px; + margin-bottom: 5px; +} +.or-menu.open .toolbar-icon.open > div.dropdown { + display: block; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-header.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3BAACA%3BCAEI%3BCACA%3B%3BAAGJ%3BCAEI%3BCACA%3B%3B%3BAAHJ%2CQAKI%3BCACI%3B%3B%3BAAGA%2CQAJJ%2CeAIK%2CeAAe%2CGACZ%2CIAAG%3BCACC%3B%3BAAXhB%2CQAKI%2CeASI%2CEAAC%3BCAEG%3B%3BAAhBZ%2CQAKI%2CeAcI%2CIAAM%2CMAAG%3BCACL%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAxBZ%2CQAKI%2CeAsBI%2CIAAG%3BCACC%3BCAEA%3BCACA%3B%3B%3B%3BAAGA%2CQA7BR%2CeAsBI%2CIAAG%2CaAOE%3BAACD%2CQA9BR%2CeAsBI%2CIAAG%2CaAQE%3BAACD%2CQA%5C%2FBR%2CeAsBI%2CIAAG%2CaASE%3BCACG%3BCACA%3BCACA%3B%3BAAGJ%2CQArCR%2CeAsBI%2CIAAG%2CaAeE%3BCACG%3B%3BAAEJ%2CQAxCR%2CeAsBI%2CIAAG%2CaAkBE%2COACG%3BCACI%3BCACA%3BCACA%3BCACA%3B%3BAALR%2CQAxCR%2CeAsBI%2CIAAG%2CaAkBE%2COACG%2CaAMI%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%2CkCAAA%3B%3BAACA%2CQAtDpB%2CeAsBI%2CIAAG%2CaAkBE%2COACG%2CaAMI%2CMAOK%3BCACG%3B%3BAA5D5B%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%3BCACC%3BCACA%3BCACA%3BCACA%3BCACA%2CgBAAA%3BCAEA%3BCACA%3BCACA%3B%3BAA%5C%2FEhB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%3BCACC%3B%3B%3BAAlFpB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAGG%3BCACE%3BCACA%3BCACA%2CgBAAA%3B%3BAAvFxB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAGG%2CIAKE%3BCACI%3B%3BAA1F5B%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAGG%2CIASE%2CKAAI%3BCACA%3B%3B%3BAA9F5B%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAWC%2CIAAG%2CMAkBG%3BCACE%3BCACA%3B%3BAArGxB%2CQAKI%2CeAsBI%2CIAAG%2CaA2CC%2CIAAG%2CSAmCC%2CIAAG%3BCACC%3BCACA%3BCACA%3BCACA%3B%3BAAShB%2CQAAC%2CKACG%2CcAAa%2CKACP%2CMAAG%3BCACD%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/style/openrat-navigation */ +/* N a v i g a t i o n */ +#navigation ul.or-navtree-list { + list-style-type: none; + margin: 0; + padding: 0; +} +#navigation ul.or-navtree-list ul { + margin-left: 18px; +} +#navigation ul.or-navtree-list .or-navtree-node-control { + width: 18px; + min-width: 18px; + height: 18px; + float: left; + cursor: pointer; +} +#navigation ul.or-navtree-list .or-navtree-node { + margin: 0; + padding: 0; + line-height: 18px; + font-weight: normal; + white-space: nowrap; +} +#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected { + font-weight: bold; +} +#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected > div > a { + font-weight: bold; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-navigation.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3BAAEA%2CWAEI%2CGAAE%3BCAEE%3BCACA%3BCACA%3B%3BAANR%2CWAEI%2CGAAE%2CgBAME%3BCACI%3B%3BAATZ%2CWAEI%2CGAAE%2CgBASE%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAhBZ%2CWAEI%2CGAAE%2CgBAgBE%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAEA%2CWAvBR%2CGAAE%2CgBAgBE%2CiBAOK%3BCACG%3B%3BAACA%2CWAzBZ%2CGAAE%2CgBAgBE%2CiBAOK%2C0BAEO%2CMAAM%3BCACN%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/default/style/openrat-workbench */ +/* +OpenRat Content Management System +Copyright (C) 2002-2010 Jan Dankert + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +/* +Basis-Style for Openrat. +*/ +div#dialog { + /* Modale Dialoge */ +} +div#dialog > .view { + overflow: auto; + /*width:60%;*/ + position: absolute; + top: 5%; + left: 10%; + width: 80%; + height: 80%; + z-index: 110; + border: 1px solid !important; +} +@media only screen and (max-width: 55rem) { + div#dialog > .view { + top: 2.5%; + left: 2.5%; + width: 95%; + height: 95%; + } +} +div#dialog.is-closed { + display: none; + width: 0; +} +div#dialog .filler { + position: absolute; + z-index: 100; + top: 0; + left: 0; + height: 100%; + width: 100%; + opacity: 0.5; +} +div#dialog .filler span.icon { + opacity: 1; + font-size: 3em; + font-weight: bold; + text-align: center; + width: 40px; + height: 40px; + position: absolute; + right: 20px; + top: 20px; +} +.arrow { + width: 0; + height: 0; + margin: 6px; + padding: 0; + font-size: 0; +} +.arrow.arrow-down { + border-right: 6px solid transparent; + border-top: 6px solid; + border-left: 6px solid transparent; + border-bottom: 4px solid transparent; + margin-top: 10px; +} +.arrow.arrow-right { + border-top: 6px solid transparent; + border-left: 6px solid; + border-bottom: 6px solid transparent; + border-right: 4px solid transparent; + margin-left: 10px; +} +#editor .dirty { + font-weight: bold; +} +.visible-for-nojs { + display: none; +} +html.nojs .noscript { + display: block; +} +.toggle-open-close { + display: flex; + flex-direction: column; + /* Geschlossen */ + /* Offen */ +} +.toggle-open-close .on-click-open-close { + cursor: pointer; + font-weight: normal; +} +.toggle-open-close > .closable { + transition: opacity 0.3s ease-out; + flex: 1; + display: block; +} +.toggle-open-close.closed > .on-click-open-close > .on-closed { + display: inline; +} +.toggle-open-close.closed > .on-click-open-close > .on-open { + display: none; +} +.toggle-open-close.closed > .closable { + opacity: 0; + max-height: 0; + overflow: hidden; +} +.toggle-open-close.open > .closable { + height: auto; +} +.toggle-open-close.open > .on-click-open-close > .on-closed { + display: none; +} +.toggle-open-close.open > .on-click-open-close > .on-open { + display: inline; +} +html, +body { + width: 100%; + height: 100%; +} +div#workbench { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + /* + + div.panel.modal { + position: relative; + z-index: 101; + border: 1px solid !important; + } + */ + /* vertikale Flex-Box zwischen Header und Hauptbereich */ +} +div#workbench > header { + height: 3.0rem; +} +div#workbench > header .toolbar-icon .arrow-down { + display: inline; +} +@media only screen and (max-width: 55rem) { + div#workbench > header .toolbar-icon span.label, + div#workbench > header .toolbar-icon .arrow-down { + display: none; + } +} +div#workbench > .or-main-area { + flex: 1; + /* Horizontale Flexbox */ + /* + https://stackoverflow.com/questions/28636832/firefox-overflow-y-not-working-with-nested-flexbox + Whenever you've got an element with overflow: [hidden|scroll|auto] inside of a flex item, you need to give its ancestor flex item min-width:0 (in a horizontal flex container) or min-height:0 (in a vertical flex container), to disable this min-sizing behavior, or else the flex item will refuse to shrink smaller than the child's min-content size. + */ + min-height: 0; + padding-top: 0.5em; +} +div#workbench > .or-main-area > * { + min-width: 0; + min-height: 0; + overflow-y: auto; + overflow-x: hidden; + height: 100%; +} +div#workbench > .or-main-area > nav { + width: 33%; + transition: width 0.15s ease-in-out; + position: fixed; + height: calc(100% - 3.0rem - 0.5em); +} +@media only screen and (max-width: 55rem) { + div#workbench > .or-main-area > nav { + width: 0; + } +} +div#workbench > .or-main-area > nav.small { + width: 5%; + opacity: 0.5; + overflow-y: hidden; +} +div#workbench > .or-main-area > nav.small:hover { + width: 33%; + overflow-y: auto; + opacity: 1; + background-color: inherit; + border-right: 1px solid inherit; +} +div#workbench > .or-main-area > nav.small ~ .or-workplace { + margin-left: 5%; +} +div#workbench > .or-main-area > nav.open { + overflow-y: auto; +} +@media only screen and (max-width: 55rem) { + div#workbench > .or-main-area > nav.open { + width: 95%; + border-right: 1px solid; + opacity: 0.95; + } +} +@media only screen and (min-width: 75rem) { + div#workbench > .or-main-area > nav { + width: 33%; + overflow-y: auto; + } +} +div#workbench > .or-main-area > nav div.view { + height: 100%; +} +div#workbench > .or-main-area header .or-view-icon, +div#workbench > .or-main-area header .or-view-headline { + margin: 0.3em; + display: inline; + font-size: 1.2em; + line-height: 1.5em; +} +div#workbench > .or-main-area > .or-workplace { + margin-left: 33%; + transition: margin-left 0.15s ease-in-out; +} +@media only screen and (max-width: 55rem) { + div#workbench > .or-main-area > .or-workplace { + margin-left: 0; + } +} +div#workbench > .or-main-area > .or-workplace > #editor { + transition: opacity 0.5s ease; + display: flex; + flex-direction: column; +} +div#workbench > .or-main-area > .or-workplace > #editor.is-closed { + flex: 0.5; + cursor: not-allowed; + pointer-events: none; +} +@media only screen and (max-width: 55rem) { + div#workbench > .or-main-area > .or-workplace > #editor.is-closed { + flex: 0; + } +} +div#workbench > .or-main-area > .or-workplace > #editor > section { + margin: 1.5em; + border: 1px solid; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + -khtml-border-radius: 5px; +} +@media only screen and (max-width: 55rem) { + div#workbench > .or-main-area > .or-workplace > #editor > section { + margin: 0.5em; + } +} +div#workbench > .or-main-area > .or-workplace > #editor > section .view-toolbar { + display: inline; +} +div#workbench > .or-main-area > .or-workplace > #editor > section.closed .view-toolbar { + display: none; +} +#title .toggle-nav-small { + display: inline; +} +@media only screen and (max-width: 55rem) { + #title .toggle-nav-small { + display: none; + } +} +#title .toggle-nav-open-close { + display: none; +} +@media only screen and (max-width: 55rem) { + #title .toggle-nav-open-close { + display: inline; + } +} +@media only screen and (max-width: 55rem) { + #title .toolbar-icon.search input { + width: 3em; + } +} +/* Fortschrittsbalken, fuer alle Elemente verfuegbar. */ +.loader { + background: url(../images/loader.gif) no-repeat; + background-position: center, top; + height: 30px; + opacity: 0.5; + cursor: wait; + pointer-events: none; +} +@media only screen and (max-width: 55rem) { + html { + font-size: 1em; + } +} +/* Navigation over the filler */ +.toggle-nav-small, +.or-navigation { + z-index: 102; +} +.toggle-nav-small:hover, +.or-navigation:hover { + z-index: 112; +} +.or-breadcrumb { + margin-bottom: 0.1em; + margin-left: 1.5em; + line-height: 18px; + font-weight: normal; + white-space: nowrap; +} +.or-breadcrumb li { + display: inline; + margin-right: 0.3em; +} +.or-breadcrumb .or-breadcrumb-item .image-icon { + margin-right: 0.2em; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22openrat-workbench.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BAAuCA%2CGAAG%3B%3B%3BAAAH%2CGAAG%2COAEG%3BCACE%3B%3BCAGA%3BCACA%3BCACA%3BCACA%3BCACA%3BCAUA%3BCAEA%2C4BAAA%3B%3BAAFA%3BCAAA%2CGApBL%2COAEG%3BEAWM%3BEACA%3BEACA%3BEACA%3B%3B%3BAASR%2CGAzBD%2COAyBE%3BCACG%3BCACA%3B%3BAA3BR%2CGAAG%2COA%2BBC%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAtCR%2CGAAG%2COA%2BBC%2CQASI%2CKAAI%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3B%3BAAMZ%3BCACI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAEA%2CMAAC%3BCACG%2CmCAAA%3BCACA%2CqBAAA%3BCACA%2CkCAAA%3BCACA%2CoCAAA%3BCACA%3B%3BAAEJ%2CMAAC%3BCACG%2CiCAAA%3BCACA%2CsBAAA%3BCACA%2CoCAAA%3BCACA%2CmCAAA%3BCACA%3B%3BAAIR%2COAAQ%3BCACJ%3B%3BAAGJ%3BCACI%3B%3BAAGJ%2CIAAI%2CKAAM%3BCACN%3B%3BAAGJ%3BCAEI%3BCACA%3B%3B%3B%3BAAHJ%2CkBAKI%3BCACI%3BCACA%3B%3BAAPR%2CkBAWM%3BCAEE%2CiCAAA%3BCAEA%3BCACA%3B%3BAAKJ%2CkBAAC%2COACK%2CuBAAuB%3BCACrB%3B%3BAAFR%2CkBAAC%2COAIK%2CuBAAuB%3BCACrB%3B%3BAALR%2CkBAAC%2COAOK%3BCAEE%3BCACA%3BCACA%3B%3BAAMR%2CkBAAC%2CKACK%3BCACE%3B%3BAAFR%2CkBAAC%2CKAIK%2CuBAAuB%3BCACrB%3B%3BAALR%2CkBAAC%2CKAOK%2CuBAAuB%3BCACrB%3B%3BAASZ%3BAAAM%3BCAAO%3BCAAY%3B%3BAAEzB%2CGAAG%3BCAEC%3BCACA%3BCACA%3BCACA%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BAALJ%2CGAAG%2CUAqBG%3BCACE%3B%3BAAtBR%2CGAAG%2CUAqBG%2CSAGE%2CcAEI%3BCACI%3B%3BAAOJ%3BCAAA%2CGAlCT%2CUAqBG%2CSAGE%2CcAMI%2CKAAI%3BCAIJ%2CGAlCT%2CUAqBG%2CSAGE%2CcAMgB%3BEAEJ%3B%3B%3BAAhCpB%2CGAAG%2CUAsCG%3BCACE%3B%3B%3B%3B%3B%3BCAWA%3BCAEA%3B%3BAApDR%2CGAAG%2CUAsCG%2CgBAgBI%3BCACE%3BCACA%3BCACA%3BCACA%3BCAEA%3B%3BAA5DZ%2CGAAG%2CUAsCG%2CgBAyBI%3BCACE%3BCACA%2CmCAAA%3BCACA%3BCACA%2CmCAAA%3B%3BAAOA%3BCAAA%2CGA1ET%2CUAsCG%2CgBAyBI%3BEAOM%3B%3B%3BAAIJ%2CGA1ET%2CUAsCG%2CgBAyBI%2CMAWG%3BCACG%3BCACA%3BCACA%3B%3BAAEA%2CGA%5C%2FEb%2CUAsCG%2CgBAyBI%2CMAWG%2CMAKI%3BCACG%3BCACA%3BCACA%3BCACA%3BCACA%2C%2BBAAA%3B%3BAAGJ%2CGAvFb%2CUAsCG%2CgBAyBI%2CMAWG%2CMAaO%3BCACA%3B%3BAAIR%2CGA5FT%2CUAsCG%2CgBAyBI%2CMA6BG%3BCAEG%3B%3BAAMJ%3BCAAA%2CGApGT%2CUAsCG%2CgBAyBI%2CMA6BG%3BEAIO%3BEACA%2CuBAAA%3BEACA%3B%3B%3BAAUR%3BCAAA%2CGA5GT%2CUAsCG%2CgBAyBI%3BEAwCM%3BEACA%3B%3B%3BAAxGhB%2CGAAG%2CUAsCG%2CgBAyBI%2CMA6CE%2CIAAG%3BCACC%3B%3BAA7GhB%2CGAAG%2CUAsCG%2CgBA2EE%2COAEI%3BAAnHZ%2CGAAG%2CUAsCG%2CgBA2EE%2COAEmB%3BCACX%3BCACA%3BCACA%3BCACA%3B%3BAAvHhB%2CGAAG%2CUAsCG%2CgBAsFI%3BCAEE%3BCACA%2CyCAAA%3B%3BAAMA%3BCAAA%2CGArIT%2CUAsCG%2CgBAsFI%3BEAMM%3B%3B%3BAAlIhB%2CGAAG%2CUAsCG%2CgBAsFI%2CgBASI%3BCAEE%2C6BAAA%3BCACA%3BCACA%3B%3BAAEA%2CGA3Ib%2CUAsCG%2CgBAsFI%2CgBASI%2CUAMG%3BCACG%3BCACA%3BCACA%3B%3BAAOA%3BCAAA%2CGArJjB%2CUAsCG%2CgBAsFI%2CgBASI%2CUAMG%3BEAOO%3B%3B%3BAAlJxB%2CGAAG%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%3BCACE%3BCAKA%2CiBAAA%3BCA5ThB%2CkBAAA%3BCACA%2CuBAAA%3BCACA%2C0BAAA%3BCACA%2CyBAAA%3B%3BAAyTgB%3BCAAA%2CGA9JjB%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%3BEAGM%3B%3B%3BAA3JxB%2CGAAG%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%2CUAWE%3BCACI%3B%3BAAQJ%2CGA5KjB%2CUAsCG%2CgBAsFI%2CgBASI%2CUAmBI%2CUAoBG%2COACG%3BCACI%3B%3BAAqB5B%2CMAEI%3BCACI%3B%3BAAIJ%3BCAAA%2CMALA%3BEAGQ%3B%3B%3BAALZ%2CMASI%3BCACI%3B%3BAAIJ%3BCAAA%2CMALA%3BEAGQ%3B%3B%3BAAcJ%3BCAAA%2CMAVJ%2CcAAa%2COAMT%3BEAEQ%3B%3B%3B%3BAAQhB%3BCAEI%2C%2BCAAA%3BCACA%2CgCAAA%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAAYJ%3BCANI%3BEACI%3B%3B%3B%3BAAMR%3BAACA%3BCAEI%3B%3BAAEA%2CiBAAC%3BAAAD%2CcAAC%3BCACG%3B%3BAAIR%3BCAEI%3BCACA%3BCACA%3BCACA%3BCACA%3B%3BAANJ%2CcAQI%3BCACI%3BCACA%3B%3BAAVR%2CcAaI%2CoBAAoB%3BCAChB%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/editor/editor */ +.editor__text-editor { + width: 100%; + height: 300px; +} +/* ACE-Editor */ +textarea.editor__code-editor { + display: none; + /* Textarea nicht anzeigen, da durch Editor im DIV ersetzt */ +} +div.editor__code-editor { + position: absolute; + height: 500px; + width: 100%; + font-size: 14px; + z-index: 256; +} +textarea.editor__text-editor, +textarea.editor__wiki-editor, +textarea.editor__html-editor { + width: 100%; +} +a.editorlink:active, +a.editorlink:hover { + font-weight: normal; + text-decoration: none; +} +a.editorlink:link, +a.editorlink:visited { + font-weight: normal; + text-decoration: none; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22editor.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AACA%3BCACC%3BCACA%3B%3B%3BAAID%2CQAAQ%3BCACP%3B%3B%3BAAID%2CGAAG%3BCAED%3BCACE%3BCACA%3BCACA%3BCACA%3B%3BAAKJ%2CQAAQ%3BAACR%2CQAAQ%3BAACR%2CQAAQ%3BCAEP%3B%3BAAID%2CCAAC%2CWAAW%3BAACZ%2CCAAC%2CWAAW%3BCAEX%3BCACA%3B%3BAAGD%2CCAAC%2CWAAW%3BAACZ%2CCAAC%2CWAAW%3BCAEX%3BCACA%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/table/table */ +.or-table-wrapper .or-table-area { + /* Responsive Tables */ + /* T a b l e s */ +} +@media screen and (max-width: 40em) { + .or-table-wrapper .or-table-area { + overflow-x: auto; + } +} +.or-table-wrapper .or-table-area table { + overflow: auto; + border: 2px; + width: 100%; + /* Notizen */ + /* Kalender */ + /* Notizen */ + /* Kalender */ + /* Message of the day */ + /* D i f f */ + /* Hilfe-Texte */ + /* Logo */ +} +.or-table-wrapper .or-table-area table tr.headline > td, +.or-table-wrapper .or-table-area table tr > th { + padding: 3px; + font-weight: bold; +} +.or-table-wrapper .or-table-area table tr.headline > td.sort-asc > span:last-child:after, +.or-table-wrapper .or-table-area table tr > th.sort-asc > span:last-child:after { + content: " \2193"; +} +.or-table-wrapper .or-table-area table tr.headline > td.sort-desc > span:last-child:after, +.or-table-wrapper .or-table-area table tr > th.sort-desc > span:last-child:after { + content: " \2191"; +} +.or-table-wrapper .or-table-area table tr.data > td { + padding: 3px; +} +.or-table-wrapper .or-table-area table tr > td { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + max-width: 0; +} +.or-table-wrapper .or-table-area table td.readonly { + font-style: italic; + font-weight: normal; +} +.or-table-wrapper .or-table-area table td.default { + font-style: normal; + font-weight: normal; +} +.or-table-wrapper .or-table-area table td.changed { + font-style: normal; + font-weight: bold; +} +.or-table-wrapper .or-table-area table td.notice { + margin: 0px; + padding: 5%; + text-align: center; +} +.or-table-wrapper .or-table-area table.notice { + width: 100%; + border: 1px solid; + border-spacing: 0px; +} +.or-table-wrapper .or-table-area table.notice th { + padding: 2px; + white-space: nowrap; + border-bottom: 1px solid #000000; + font-weight: normal; + text-align: left; +} +.or-table-wrapper .or-table-area table.notice tr.warning { + margin: 0px; + padding: 0px; +} +.or-table-wrapper .or-table-area table.calendar { + table-layout: fixed; + border-collapse: collapse; + text-align: center; +} +.or-table-wrapper .or-table-area table.calendar td { + border: 1px dotted; +} +.or-table-wrapper .or-table-area table td.notice { + margin: 0px; + padding: 5%; + text-align: center; +} +.or-table-wrapper .or-table-area table.notice { + width: 100%; + border: 1px solid; + border-spacing: 0px; +} +.or-table-wrapper .or-table-area table.notice th { + padding: 2px; + white-space: nowrap; + border-bottom: 1px solid #000000; + font-weight: normal; + text-align: left; +} +.or-table-wrapper .or-table-area table.notice tr.warning { + margin: 0px; + padding: 0px; +} +.or-table-wrapper .or-table-area table.calendar { + table-layout: fixed; + border-collapse: collapse; + text-align: center; +} +.or-table-wrapper .or-table-area table.calendar td { + border: 1px dotted; +} +.or-table-wrapper .or-table-area table td.motd { + border-left: 3px solid red; + border-right: 3px solid red; + font-weight: bold; + padding: 10px; + margin: 10px; +} +.or-table-wrapper .or-table-area table td:hover > div.onrowvisible { + visibility: visible; +} +.or-table-wrapper .or-table-area table tr.diff { + /* Unveränderter Text */ + /* Entfernter Text */ + /* Hinzugefuegter Text */ + /* Geaenderter Text */ +} +.or-table-wrapper .or-table-area table tr.diff > td.line { + background-color: #000000; + padding-right: 2px; + border-right: 3px solid #000000; + text-align: right; + margin-right: 2px; +} +.or-table-wrapper .or-table-area table tr.diff > td.old { + background-color: red; +} +.or-table-wrapper .or-table-area table tr.diff td.new { + background-color: green; +} +.or-table-wrapper .or-table-area table tr.diff td.notequal { + background-color: yellow; +} +.or-table-wrapper .or-table-area table tr td.help { + font-style: italic; +} +.or-table-wrapper .or-table-area table tr.headline td.help { + /* + border-bottom:1px solid @color-overridden-by-theme; + */ + font-style: normal; +} +.or-table-wrapper .or-table-area table td.logo { + padding: 10px; + margin: 0px; +} +.or-table-wrapper .or-table-filter { + width: 100%; + text-align: right; +} +.or-table-wrapper .or-table-filter input { + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -khtml-border-radius: 3px; + padding: 0.5em; + margin: 1em; + background-color: #000000; + color: #000000; + border: 1px solid #000000; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22table.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AASA%2CiBAEI%3B%3B%3B%3BAAQI%2CmBALoC%3BCAKpC%2CiBARJ%3BEAKQ%3B%3B%3BAAPZ%2CiBAEI%2CeASI%3BCACI%3BCACA%3BCACA%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BAAdZ%2CiBAEI%2CeASI%2CMAKI%2CGAAE%2CSAAY%3BAAhB1B%2CiBAEI%2CeASI%2CMAMI%2CGAAK%3BCAED%3BCACA%3B%3BAAEA%2CiBApBZ%2CeASI%2CMAKI%2CGAAE%2CSAAY%2CKAMT%2CSAAY%2COAAI%2CWAAW%3BAAA5B%2CiBApBZ%2CeASI%2CMAMI%2CGAAK%2CKAKA%2CSAAY%2COAAI%2CWAAW%3BCACxB%2CSAAS%2CQAAT%3B%3BAAEJ%2CiBAvBZ%2CeASI%2CMAKI%2CGAAE%2CSAAY%2CKAST%2CUAAa%2COAAI%2CWAAW%3BAAA7B%2CiBAvBZ%2CeASI%2CMAMI%2CGAAK%2CKAQA%2CUAAa%2COAAI%2CWAAW%3BCACzB%2CSAAS%2CQAAT%3B%3BAA1BpB%2CiBAEI%2CeASI%2CMAmBI%2CGAAE%2CKAAQ%3BCACN%3B%3BAA%5C%2FBhB%2CiBAEI%2CeASI%2CMAuBI%2CGAAK%3BCACD%3BCACA%3BCACA%3BCACA%3B%3BAAtChB%2CiBAEI%2CeASI%2CMA8BI%2CGAAE%3BCACE%3BCACA%3B%3BAA3ChB%2CiBAEI%2CeASI%2CMAkCI%2CGAAE%3BCACE%3BCACA%3B%3BAA%5C%2FChB%2CiBAEI%2CeASI%2CMAsCI%2CGAAE%3BCACE%3BCACA%3B%3BAAnDhB%2CiBAEI%2CeASI%2CMA2CI%2CGAAE%3BCACE%3BCACA%3BCACA%3B%3BAAGJ%2CiBA1DR%2CeASI%2CMAiDK%3BCACG%3BCACA%2CiBAAA%3BCACA%3B%3BAAHJ%2CiBA1DR%2CeASI%2CMAiDK%2COAIG%3BCACI%3BCACA%3BCACA%2CgCAAA%3BCACA%3BCACA%3B%3BAATR%2CiBA1DR%2CeASI%2CMAiDK%2COAeG%2CGAAE%3BCACE%3BCACA%3B%3BAAKR%2CiBAhFR%2CeASI%2CMAuEK%3BCACG%3BCACA%3BCACA%3B%3BAAHJ%2CiBAhFR%2CeASI%2CMAuEK%2CSAKG%3BCACI%2CkBAAA%3B%3BAAxFpB%2CiBAEI%2CeASI%2CMAkFI%2CGAAE%3BCACE%3BCACA%3BCACA%3B%3BAAGJ%2CiBAjGR%2CeASI%2CMAwFK%3BCACG%3BCACA%2CiBAAA%3BCACA%3B%3BAAGJ%2CiBAvGR%2CeASI%2CMA8FK%2COAAQ%3BCACL%3BCACA%3BCACA%2CgCAAA%3BCACA%3BCACA%3B%3BAAMJ%2CiBAlHR%2CeASI%2CMAyGK%2COAAQ%2CGAAE%3BCACP%3BCACA%3B%3BAAIJ%2CiBAxHR%2CeASI%2CMA%2BGK%3BCACG%3BCACA%3BCACA%3B%3BAAGJ%2CiBA9HR%2CeASI%2CMAqHK%2CSAAU%3BCACP%2CkBAAA%3B%3BAAjIhB%2CiBAEI%2CeASI%2CMAyHI%2CGAAE%3BCACE%2C0BAAA%3BCACA%2C2BAAA%3BCACA%3BCACA%3BCACA%3B%3BAAzIhB%2CiBAEI%2CeASI%2CMAgII%2CGAAE%2CMAAS%2CMAAG%3BCACV%3B%3BAA5IhB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%3B%3B%3B%3B%3B%3BAAhJd%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKACI%2CKAAE%3BCACA%2CyBAAA%3BCACA%3BCACA%2C%2BBAAA%3BCACA%3BCACA%3B%3BAAtJpB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKAcI%2CKAAE%3BCACA%3B%3BAA%5C%2FJpB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKAmBE%2CGAAE%3BCACE%3B%3BAApKpB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKAwBE%2CGAAE%3BCACE%3B%3BAAzKpB%2CiBAEI%2CeASI%2CMAmKI%2CGAAG%2CGAAE%3BCACD%3B%3BAA%5C%2FKhB%2CiBAEI%2CeASI%2CMAuKI%2CGAAE%2CSAAU%2CGAAE%3B%3B%3B%3BCAIV%3B%3BAAtLhB%2CiBAEI%2CeASI%2CMAgLI%2CGAAE%3BCACE%3BCACA%3B%3BAA7LhB%2CiBAsMI%3BCACI%3BCACA%3B%3BAAxMR%2CiBAsMI%2CiBAII%3BCAhNJ%2CkBAAA%3BCACA%2CuBAAA%3BCACA%2C0BAAA%3BCACA%2CyBAAA%3BCA%2BMQ%3BCACA%3BCACA%2CyBAAA%3BCACA%2CcAAA%3BCACA%2CyBAAA%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/image/image */ + +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/group/group */ +.or-group { + border: 1px solid; + border-bottom: 0; + border-left: 0; + border-right: 0; + margin-top: 20px; + margin-bottom: 20px; + margin-left: 0px; + margin-right: 0px; + padding: 10px; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22group.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%3BCAEC%2CiBAAA%3BCAEA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3BCACA%3BCACA%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../template_engine/components/html/upload/upload */ +div.or-dropzone-upload > div.input { + width: 100%; + height: 100px; + border: 1px dotted; +} +/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22upload.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%2CGAAG%2CmBAAsB%2CMAAG%3BCAE3B%3BCACA%3BCAEA%2CkBAAA%22%7D */ +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/simplemde/simplemde */ +/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)} +/* Include style: /mnt/data/dankert/public_html/cms/cms09/modules/cms/ui/themes/../../../editor/trumbowyg/ui/trumbowyg */ +/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +#trumbowyg-icons,#trumbowyg-icons svg{height:0;width:0}#trumbowyg-icons{overflow:hidden;visibility:hidden}.trumbowyg-box *,.trumbowyg-box ::after,.trumbowyg-box ::before{box-sizing:border-box}.trumbowyg-box svg{width:17px;height:100%;fill:#222}.trumbowyg-box,.trumbowyg-editor{display:block;position:relative;border:1px solid #DDD;width:100%;min-height:300px;margin:17px auto}.trumbowyg-box .trumbowyg-editor{margin:0 auto}.trumbowyg-box.trumbowyg-fullscreen{background:#FEFEFE;border:none!important}.trumbowyg-editor,.trumbowyg-textarea{position:relative;box-sizing:border-box;padding:20px;min-height:300px;width:100%;border-style:none;resize:none;outline:0;overflow:auto}.trumbowyg-editor.trumbowyg-autogrow-on-enter,.trumbowyg-textarea.trumbowyg-autogrow-on-enter{transition:height .3s ease-out}.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:transparent!important;text-shadow:0 0 7px #333}@media screen and (min-width:0 \0){.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(200,200,200,.6)!important}}@supports (-ms-accelerator:true){.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(200,200,200,.6)!important}}.trumbowyg-box-blur .trumbowyg-editor hr,.trumbowyg-box-blur .trumbowyg-editor img{opacity:.2}.trumbowyg-textarea{position:relative;display:block;overflow:auto;border:none;font-size:14px;font-family:Inconsolata,Consolas,Courier,"Courier New",sans-serif;line-height:18px}.trumbowyg-box.trumbowyg-editor-visible .trumbowyg-textarea{height:1px!important;width:25%;min-height:0!important;padding:0!important;background:0 0;opacity:0!important}.trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-textarea{display:block}.trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-editor{display:none}.trumbowyg-box.trumbowyg-disabled .trumbowyg-textarea{opacity:.8;background:0 0}.trumbowyg-editor[contenteditable=true]:empty:not(:focus)::before{content:attr(placeholder);color:#999;pointer-events:none}.trumbowyg-button-pane{width:100%;min-height:36px;background:#ecf0f1;border-bottom:1px solid #d7e0e2;margin:0;padding:0 5px;position:relative;list-style-type:none;line-height:10px;backface-visibility:hidden;z-index:11}.trumbowyg-button-pane::after{content:" ";display:block;position:absolute;top:36px;left:0;right:0;width:100%;height:1px;background:#d7e0e2}.trumbowyg-button-pane .trumbowyg-button-group{display:inline-block}.trumbowyg-button-pane .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:transparent}.trumbowyg-button-pane .trumbowyg-button-group::after{content:" ";display:inline-block;width:1px;background:#d7e0e2;margin:0 5px;height:35px;vertical-align:top}.trumbowyg-button-pane .trumbowyg-button-group:last-child::after{content:none}.trumbowyg-button-pane button{display:inline-block;position:relative;width:35px;height:35px;padding:1px 6px!important;margin-bottom:1px;overflow:hidden;border:none;cursor:pointer;background:0 0;vertical-align:middle;transition:background-color 150ms,opacity 150ms}.trumbowyg-button-pane button.trumbowyg-textual-button{width:auto;line-height:35px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-button-pane button.trumbowyg-disable,.trumbowyg-button-pane.trumbowyg-disable button:not(.trumbowyg-not-disable):not(.trumbowyg-active),.trumbowyg-disabled .trumbowyg-button-pane button:not(.trumbowyg-not-disable):not(.trumbowyg-viewHTML-button){opacity:.2;cursor:default}.trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::before,.trumbowyg-disabled .trumbowyg-button-pane .trumbowyg-button-group::before{background:#e3e9eb}.trumbowyg-button-pane button.trumbowyg-active,.trumbowyg-button-pane button:not(.trumbowyg-disable):focus,.trumbowyg-button-pane button:not(.trumbowyg-disable):hover{background-color:#FFF;outline:0}.trumbowyg-button-pane .trumbowyg-open-dropdown::after{display:block;content:" ";position:absolute;top:25px;right:3px;height:0;width:0;border:3px solid transparent;border-top-color:#555}.trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button{padding-left:10px!important;padding-right:18px!important}.trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button::after{top:17px;right:7px}.trumbowyg-modal,.trumbowyg-modal-box{top:0;left:50%;transform:translateX(-50%);backface-visibility:hidden;position:absolute}.trumbowyg-button-pane .trumbowyg-right{float:right}.trumbowyg-dropdown{width:200px;border:1px solid #ecf0f1;padding:5px 0;border-top:none;background:#FFF;margin-left:-1px;box-shadow:rgba(0,0,0,.1) 0 2px 3px;z-index:12}.trumbowyg-dropdown button{display:block;width:100%;height:35px;line-height:35px;text-decoration:none;background:#FFF;padding:0 10px;color:#333!important;border:none;cursor:pointer;text-align:left;font-size:15px;transition:all 150ms}.trumbowyg-dropdown button:focus,.trumbowyg-dropdown button:hover{background:#ecf0f1}.trumbowyg-dropdown button svg{float:left;margin-right:14px}.trumbowyg-modal{max-width:520px;width:100%;height:350px;z-index:12;overflow:hidden}.trumbowyg-modal-box{max-width:500px;width:calc(100% - 20px);padding-bottom:45px;z-index:1;background-color:#FFF;text-align:center;font-size:14px;box-shadow:rgba(0,0,0,.2) 0 2px 3px}.trumbowyg-modal-box .trumbowyg-modal-title{font-size:24px;font-weight:700;margin:0 0 20px;padding:15px 0 13px;display:block;border-bottom:1px solid #EEE;color:#333;background:#fbfcfc}.trumbowyg-modal-box .trumbowyg-progress{width:100%;height:3px;position:absolute;top:58px}.trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar{background:#2BC06A;width:0;height:100%;transition:width 150ms linear}.trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:29px;line-height:29px;overflow:hidden}.trumbowyg-modal-box label .trumbowyg-input-infos{display:block;text-align:left;height:25px;line-height:25px;transition:all 150ms}.trumbowyg-modal-box label .trumbowyg-input-infos span{display:block;color:#69878f;background-color:#fbfcfc;border:1px solid #DEDEDE;padding:0 7px;width:150px}.trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-modal-box label.trumbowyg-input-error textarea{border:1px solid #e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos{margin-top:-27px}.trumbowyg-modal-box label input{position:absolute;top:0;right:0;height:27px;line-height:27px;border:1px solid #DEDEDE;background:#fff;font-size:14px;max-width:330px;width:70%;padding:0 7px;transition:all 150ms}.trumbowyg-modal-box label input:focus,.trumbowyg-modal-box label input:hover{outline:0;border:1px solid #95a5a6}.trumbowyg-modal-box label input:focus{background:#fbfcfc}.trumbowyg-modal-box label input[type=checkbox]{left:5px;top:5px;right:auto}.trumbowyg-modal-box label input[type=checkbox]+.trumbowyg-input-infos span{width:auto;padding-left:25px}.trumbowyg-modal-box .error{margin-top:25px;display:block;color:red}.trumbowyg-modal-box .trumbowyg-modal-button{position:absolute;bottom:10px;right:0;text-decoration:none;color:#FFF;display:block;width:100px;height:35px;line-height:33px;margin:0 10px;background-color:#333;border:none;cursor:pointer;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif;font-size:16px;transition:all 150ms}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{right:110px;background:#2bc06a}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover{background:#40d47e;outline:0}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#25a25a}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{color:#555;background:#e6e6e6}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover{background:#fbfbfb;outline:0}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#d5d5d5}.trumbowyg-overlay{position:absolute;background-color:rgba(255,255,255,.5);height:100%;width:100%;left:0;display:none;top:0;z-index:10}body.trumbowyg-body-fullscreen{overflow:hidden}.trumbowyg-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:99999}.trumbowyg-fullscreen .trumbowyg-editor,.trumbowyg-fullscreen.trumbowyg-box{border:none}.trumbowyg-fullscreen .trumbowyg-editor,.trumbowyg-fullscreen .trumbowyg-textarea{height:calc(100% - 37px)!important;overflow:auto}.trumbowyg-fullscreen .trumbowyg-overlay{height:100%!important}.trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:#222;fill:transparent}.trumbowyg-editor embed,.trumbowyg-editor img,.trumbowyg-editor object,.trumbowyg-editor video{max-width:100%}.trumbowyg-editor img,.trumbowyg-editor video{height:auto}.trumbowyg-editor img{cursor:move}.trumbowyg-editor.trumbowyg-reset-css{background:#FEFEFE!important;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif!important;font-size:14px!important;line-height:1.45em!important;color:#333}.trumbowyg-editor.trumbowyg-reset-css a{color:#15c!important;text-decoration:underline!important}.trumbowyg-editor.trumbowyg-reset-css blockquote,.trumbowyg-editor.trumbowyg-reset-css div,.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css p,.trumbowyg-editor.trumbowyg-reset-css ul{box-shadow:none!important;background:0 0!important;margin:0 0 15px!important;line-height:1.4em!important;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif!important;font-size:14px!important;border:none}.trumbowyg-editor.trumbowyg-reset-css hr,.trumbowyg-editor.trumbowyg-reset-css iframe,.trumbowyg-editor.trumbowyg-reset-css object{margin-bottom:15px!important}.trumbowyg-editor.trumbowyg-reset-css blockquote{margin-left:32px!important;font-style:italic!important;color:#555}.trumbowyg-editor.trumbowyg-reset-css ul{list-style:disc}.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css ul{padding-left:20px!important}.trumbowyg-editor.trumbowyg-reset-css ol ol,.trumbowyg-editor.trumbowyg-reset-css ol ul,.trumbowyg-editor.trumbowyg-reset-css ul ol,.trumbowyg-editor.trumbowyg-reset-css ul ul{border:none;margin:2px!important;padding:0 0 0 24px!important}.trumbowyg-editor.trumbowyg-reset-css hr{display:block;height:1px;border:none;border-top:1px solid #CCC}.trumbowyg-editor.trumbowyg-reset-css h1,.trumbowyg-editor.trumbowyg-reset-css h2,.trumbowyg-editor.trumbowyg-reset-css h3,.trumbowyg-editor.trumbowyg-reset-css h4{color:#111;background:0 0;margin:0!important;padding:0!important;font-weight:700}.trumbowyg-editor.trumbowyg-reset-css h1{font-size:32px!important;line-height:38px!important;margin-bottom:20px!important}.trumbowyg-editor.trumbowyg-reset-css h2{font-size:26px!important;line-height:34px!important;margin-bottom:15px!important}.trumbowyg-editor.trumbowyg-reset-css h3{font-size:22px!important;line-height:28px!important;margin-bottom:7px!important}.trumbowyg-editor.trumbowyg-reset-css h4{font-size:16px!important;line-height:22px!important;margin-bottom:7px!important}.trumbowyg-dark .trumbowyg-textarea{background:#111;color:#ddd}.trumbowyg-dark .trumbowyg-box{border:1px solid #343434}.trumbowyg-dark .trumbowyg-box.trumbowyg-fullscreen{background:#111}.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{text-shadow:0 0 7px #ccc}@media screen and (min-width:0 \0){.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(20,20,20,.6)!important}}@supports (-ms-accelerator:true){.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(20,20,20,.6)!important}}.trumbowyg-dark .trumbowyg-box svg{fill:#ecf0f1;color:#ecf0f1}.trumbowyg-dark .trumbowyg-button-pane{background-color:#222;border-bottom-color:#343434}.trumbowyg-dark .trumbowyg-button-pane::after{background:#343434}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty)::after{background-color:#343434}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty) .trumbowyg-fullscreen-button svg{color:transparent}.trumbowyg-dark .trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::after{background-color:#2a2a2a}.trumbowyg-dark .trumbowyg-button-pane button.trumbowyg-active,.trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):focus,.trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):hover{background-color:#333}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-open-dropdown::after{border-top-color:#fff}.trumbowyg-dark .trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:#ecf0f1;fill:transparent}.trumbowyg-dark .trumbowyg-dropdown{border-color:#222;background:#333;box-shadow:rgba(0,0,0,.3) 0 2px 3px}.trumbowyg-dark .trumbowyg-dropdown button{background:#333;color:#fff!important}.trumbowyg-dark .trumbowyg-dropdown button:focus,.trumbowyg-dark .trumbowyg-dropdown button:hover{background:#222}.trumbowyg-dark .trumbowyg-modal-box{background-color:#222}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-title{border-bottom:1px solid #555;color:#fff;background:#3c3c3c}.trumbowyg-dark .trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:27px;line-height:27px;overflow:hidden}.trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span{color:#eee;background-color:#2f2f2f;border-color:#222}.trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error textarea{border-color:#e74c3c}.trumbowyg-dark .trumbowyg-modal-box label input{border-color:#222;color:#eee;background:#333}.trumbowyg-dark .trumbowyg-modal-box label input:focus,.trumbowyg-dark .trumbowyg-modal-box label input:hover{border-color:#626262}.trumbowyg-dark .trumbowyg-modal-box label input:focus{background-color:#2f2f2f}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{background:#1b7943}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus,.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover{background:#25a25a}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#176437}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{background:#333;color:#ccc}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus,.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover{background:#444}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#111}.trumbowyg-dark .trumbowyg-overlay{background-color:rgba(15,15,15,.6)} diff --git a/modules/cms/ui/themes/default/style/openrat.min.css b/modules/cms/ui/themes/default/style/openrat.min.css @@ -0,0 +1,19 @@ +/*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family: 'Oxygen', 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;font-size: 0.8em;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%}body{margin: 0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display: block}audio,canvas,progress,video{display: inline-block;vertical-align: baseline}audio:not([controls]){display: none;height: 0}[hidden],template{display: none}a{background: transparent}a:active,a:hover{outline: 0}abbr[title]{border-bottom: 1px dotted}b,strong{font-weight: bold}dfn{font-style: italic}h1{font-size: 1.2em;margin: .67em 0}mark{background: #ff0;color: #000}small{font-size: 80%}sub,sup{font-size: 75%;line-height: 0;position: relative;vertical-align: baseline}sup{top: -0.5em}sub{bottom: -0.25em}img{border: 0}svg:not(:root){overflow: hidden}figure{margin: 1em 40px}hr{-moz-box-sizing: content-box;box-sizing: content-box;height: 0}pre{overflow: auto}code,kbd,pre,samp{font-family: 'Source Code Pro', monospace, monospace;font-size: 1em}button,input,optgroup,select,textarea{color: inherit;background-color: inherit;font: inherit;margin: 0}button{overflow: visible}button,select{text-transform: none}button,html input[type="button"]{-webkit-appearance: button;cursor: pointer}button[disabled],html input[disabled]{cursor: default}button input::-moz-focus-inner{border: 0;padding: 0}input{line-height: normal}input[type="reset"],input[type="submit"]{-webkit-appearance: button;cursor: pointer}input[type="checkbox"],input[type="radio"]{box-sizing: border-box;padding: 0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height: auto}input[type="search"]{-webkit-appearance: textfield;-moz-box-sizing: content-box;-webkit-box-sizing: content-box;box-sizing: content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance: none}fieldset{border: 1px solid #c0c0c0;margin: 0 2px;padding: .35em .625em .75em}legend{border: 0;padding: 0}textarea{overflow: auto}optgroup{font-weight: bold}table{border-collapse: collapse;border-spacing: 0}td,th{padding: 0;text-align: left}*,::before,::after{box-sizing: border-box}.initial-hidden{display: none}.sort-value{display: none}legend{font-size: 1.1em;font-weight: bold;padding: 0 .5em} +@font-face{font-family: 'Oxygen';font-style: normal;font-weight: 400;src: local('Oxygen Regular'), local('Oxygen-Regular'), url('../font/oxygen-v7-latin-regular.woff') format('woff2'), url('../font/oxygen-v7-latin-regular.woff') format('woff')}@font-face{font-family: 'Source Code Pro';font-style: normal;font-weight: 400;src: local('Source Code Pro'), local('SourceCodePro-Regular'), url('../font/source-code-pro-v8-latin-regular.woff2') format('woff2'), url('../font/source-code-pro-v8-latin-regular.woff') format('woff')}@font-face{font-family: 'Material Icons';font-style: normal;font-weight: 400;src: local('Material Icons'), local('MaterialIcons-Regular'), url('../font/MaterialIcons-Regular.woff2') format('woff2'), url('../font/MaterialIcons-Regular.woff') format('woff')}.image-icon{font-family: 'Material Icons';font-weight: normal;font-style: normal;display: inline-block;text-transform: none;letter-spacing: normal;word-wrap: normal;white-space: nowrap;direction: ltr;font-feature-settings: 'liga'}.image-icon.image-icon--action-el_text:after{content: "spellcheck"}.image-icon.image-icon--action-el_longtext:after{content: "view_headline"}.image-icon.image-icon--action-el_select:after{content: "list"}.image-icon.image-icon--action-el_number:after{content: "looks_one"}.image-icon.image-icon--action-el_link:after{content: "call_made"}.image-icon.image-icon--action-el_date:after{content: "date_range"}.image-icon.image-icon--action-el_insert:after{content: "keyboard_return"}.image-icon.image-icon--action-el_copy:after{content: "flip_to_back"}.image-icon.image-icon--action-el_linkinfo:after{content: "info"}.image-icon.image-icon--action-el_linkdate:after{content: "info"}.image-icon.image-icon--action-el_code:after{content: "code"}.image-icon.image-icon--action-el_dynamic:after{content: "play_circle_outline"}.image-icon.image-icon--action-el_info:after{content: "info"}.image-icon.image-icon--action-el_infodate:after{content: "info"}.image-icon.image-icon--action-el_checkbox:after{content: "check_box"}.image-icon.image-icon--action-image:after{content: "image"}.image-icon.image-icon--action-link:after{content: "call_made"}.image-icon.image-icon--action-url:after{content: "link"}.image-icon.image-icon--action-alias:after{content: "bookmark_border"}.image-icon.image-icon--action-text:after{content: "text_format"}.image-icon.image-icon--action-page:after{content: "insert_drive_file"}.image-icon.image-icon--action-file:after{content: "save"}.image-icon.image-icon--action-modellist:after{content: "device_hub"}.image-icon.image-icon--action-model:after{content: "device_hub"}.image-icon.image-icon--action-folder:after{content: "folder_open"}.image-icon.image-icon--action-languagelist:after{content: "language"}.image-icon.image-icon--action-language:after{content: "language"}.image-icon.image-icon--action-template:after{content: "receipt"}.image-icon.image-icon--action-templatelist:after{content: "receipt"}.image-icon.image-icon--action-groupllist:after{content: "group"}.image-icon.image-icon--action-group:after{content: "group"}.image-icon.image-icon--action-userlist:after{content: "person"}.image-icon.image-icon--action-user:after{content: "person"}.image-icon.image-icon--action-profile:after{content: "person_pin"}.image-icon.image-icon--method-settings:after{content: "settings"}.image-icon.image-icon--action-configuration:after{content: "settings"}.image-icon.image-icon--action-projectlist:after{content: "list"}.image-icon.image-icon--action-project:after{content: "account_balance"}.image-icon.image-icon--action-macro:after{content: "data_usage"}.image-icon.image-icon--action-membership{content: "card_membership"}.image-icon.image-icon--method-password:after{content: "lock"}.image-icon.image-icon--method-publish:after{content: "cloud_upload"}.image-icon.image-icon--method-show:after{content: "slideshow"}.image-icon.image-icon--method-src:after{content: "code"}.image-icon.image-icon--method-acl:after{content: "https"}.image-icon.image-icon--method-rights:after{content: "https"}.image-icon.image-icon--method-archive:after{content: "schedule"}.image-icon.image-icon--method-mail:after{content: "mail"}.image-icon.image-icon--method-search:after{content: "search"}.image-icon.image-icon--method-add:after{content: "add_box"}.image-icon.image-icon--menu-close:after{content: "close"}.image-icon.image-icon--menu-fullscreen:after{content: "fullscreen"}.image-icon.image-icon--menu-edit:after{content: "description"}.image-icon.image-icon--menu-extra:after{content: "build"}.image-icon.image-icon--menu-menu:after{content: "menu"}.image-icon.image-icon--menu-minimize:after{content: "compare_arrows"}.image-icon.image-icon--menu-qrcode:after{content: "phone_android"}.image-icon.image-icon--node-open:after{content: "expand_more"}.image-icon.image-icon--node-closed:after{content: "chevron_right"}.image-icon.image-icon--form-ok:after{content: "done"}.image-icon.image-icon--form-cancel:after{content: "clear"}.image-icon.image-icon--editor-bold:after{content: "format_bold"}.image-icon.image-icon--editor-italic:after{content: "format_italic"}.image-icon.image-icon--editor-headline:after{content: "format_size"}.image-icon.image-icon--editor-help:after{content: "help_outline"}.image-icon.image-icon--editor-fullscreen:after{content: "fullscreen"}.image-icon.image-icon--editor-quote:after{content: "format_quote"}.image-icon.image-icon--editor-unnumberedlist:after{content: "format_list_bulleted"}.image-icon.image-icon--editor-numberedlist:after{content: "format_list_numbered"}.image-icon.image-icon--editor-preview:after{content: "desktop_windows"}.image-icon.image-icon--editor-sidebyside:after{content: "flip"}.image-icon.image-icon--editor-link:after{content: "link"}.image-icon.image-icon--editor-image:after{content: "image"}.image-icon.image-icon--editor-undo:after{content: "undo"}.image-icon.image-icon--editor-redo:after{content: "redo"}.image-icon.image-icon--editor-code:after{content: "code"}.image-icon.image-icon--editor-horizontalrule:after{content: "remove"}.image-icon.image-icon--editor-table:after{content: "view_comfy"}.editor-toolbar{font-size: 1.5em}iframe{width: 100%;height: 500px;display: block}div.breadcrumb,div.breadcrumb a,div.panel > div.title{font-weight: bold}div#noticebar{display: block;position: fixed;bottom: 40px;right: 40px;width: 25em;z-index: 113}div#noticebar div.notice{border: 2px solid #000;padding: 1.1em;margin: 5px;position: relative;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;-webkit-box-shadow: 3px 2px 5px #000;-moz-box-shadow: 3px 2px 5px #000;box-shadow: 3px 2px 5px #000}div#noticebar div.notice .or-notice-toolbar{float: right;margin: 0 .2em;font-size: 2em;color: gray;cursor: pointer}div#noticebar div.notice:hover .or-notice-toolbar{color: black}div#noticebar div.notice.full{display: block;position: fixed;bottom: 10%;top: 10%;right: 10%;left: 10%;width: 80%;z-index: 114}div#noticebar div.notice.error div.text{font-weight: bold}div#noticebar div.notice div.text{font-size: 1.1em}div#noticebar div.notice:after{content: '';position: absolute;right: 0;top: 50%;width: 0;height: 0;border: 1em solid transparent;border-right: 0;margin-top: -1em;margin-right: -1em}div#noticebar div.notice div.log{display: none;position: relative;max-height: 90%;overflow: auto;font-family: 'Source Code Pro', Monospace, Monospaced, Courier}div#noticebar div.notice.full div.log{display: block}div.onrowvisible{visibility: hidden;display: inline}a:link,a:visited{font-weight: normal;text-decoration: none}a:active,a:hover{font-weight: normal;text-decoration: none}img[align=left],img[align=right]{padding-right: 1px;padding-left: 1px}div.logo h2{font-weight: normal;font-size: 24px}div.logo p{font-size: 13px}label,.clickable{cursor: pointer}.or-droppable--active{background-color: #2E8B57 !important;cursor: move}.or-droppable--hover{background-color: #00d95a !important;cursor: move}img.icon{padding: 4px;width: 16px;height: 16px}div.panel ul.views li{vertical-align: middle;padding: 0px;cursor: pointer;border-right: 1px solid #000;-moz-border-radius-topleft: 5px;-webkit-border-radius-topleft: 5px;-khtml-border-top-radius-topleft: 5px;-moz-border-radius-topright: 5px;-webkit-border-radius-topright: 5px;-khtml-border-top-radius-topright: 5px;border-top-right-radius: 5px;display: inline;white-space: nowrap;float: left}div.panel{margin: 0px;padding: 0px}div.panel div.status{padding: 10px}div.panel div.status div.error,div.message.error{background: url(../images/notice_error.png) no-repeat;background-position: 5px 7px}div.panel div.status div.warn,div.message.warn{background: url(../images/notice_warning.png) no-repeat;background-position: 5px 7px}div.panel div.status div.ok,div.message.ok{background: url(../images/notice_ok.png) no-repeat;background-position: 5px 7px}div.panel div.status div.info,div.message.info{background: url(../images/notice_info.png) no-repeat;background-position: 5px 7px}div.panel div.status div,div.message{border: 1px solid #000;padding: 5px 0px 5px 25px;margin: 10px 10px 20px 10px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border-radius: 5px}#workbench div.panel.fullscreen{display: block;z-index: 109;position: fixed;top: 0;left: 0;background-color: #000;margin: 0px;width: 100% !important;height: 100% !important}#workbench div.panel.fullscreen > div.content{width: 100% !important;height: 100% !important}#workbench div.panel{border: 1px solid #000;margin: 0px;padding: 0px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px;border-radius: 5px}#workbench div.container,#workbench div.panel,#workbench div.divider{display: inline;float: left;margin: 0px}#workbench div.panel > div.content{overflow: auto}.invisible{visibility: hidden}.visible{visibility: visible}div.panel{position: relative}div.content div.bottom{height: 55px;width: 100%;position: absolute;padding-right: 40px;bottom: 0px;right: 0px;xvisibility: hidden}div.content div.bottom > div.command{xvisibility: visible;float: right;z-index: 20}div.content form[data-autosave='true'] div.command{display: none}div.content > form{padding-bottom: 45px}main .or-form .or-form-actionbar{display: none}.or-form{padding: 1em}.or-form input[type=checkbox] + label,.or-form input[type=radio] + label{width: 80%}.or-form .headline{font-size: 1.8em}.or-form div.inputholder > div.dropdown{width: 70%}.or-form input.submit{padding: 7px;border: 0px;-moz-border-radius: 7px;-webkit-border-radius: 7px;-khtml-border-radius: 7px;border-radius: 7px;margin-left: 20px;cursor: pointer}.or-form input[type=text],.or-form select,.or-form textarea{width: 100%;padding: 12px;border: 1px solid #ccc;border-radius: 4px;box-sizing: border-box;resize: vertical}.or-form label{padding: 12px 12px 12px 0;display: inline-block}.or-form input[type=submit]{color: white;padding: 12px 20px;border: none;border-radius: 4px;cursor: pointer;float: right}.or-form div.label{float: left;width: 25%;margin-top: 6px}.or-form div.input{float: left;width: 75%;margin-top: 6px}.or-form .line:after{content: "";display: table;clear: both}.or-form .or-form-row{display: flex;align-items: center}.or-form .or-form-row .or-form-label{width: 25%}.or-form .or-form-row .or-form-input{width: 75%}.or-form .or-form-actionbar{position: sticky;bottom: 0;left: 0;right: 0;display: flex;justify-content: end;padding: 1em;height: auto}.or-form .or-form-actionbar .or-form-btn{padding: 1em 2em;margin-left: 1.5em;min-width: 14em;border: 0;border-radius: .5em;-moz-border-radius: .5em;-webkit-border-radius: .5em;-khtml-border-radius: .5em;cursor: pointer}.or-form .or-form-actionbar .or-form-btn--primary{font-weight: bold}@media screen and (max-width: 65rem){.or-form div.label,.or-form div.input{width: 100%;margin-top: 0}.or-form .or-form-row{flex-direction: column}.or-form .or-form-row .or-form-label,.or-form .or-form-row .or-form-input{width: 100%}.or-form .or-form-actionbar{align-items: center;display: block}.or-form .or-form-actionbar .or-form-btn{width: 90%}}.or-link-btn{padding: .5em 1em;min-width: 5em;border: 0;border-radius: .3em;-moz-border-radius: .3em;-webkit-border-radius: .3em;-khtml-border-radius: .3em;cursor: pointer}div.search > div.inputholder{padding-top: 1px}div.inputholder > input,div.inputholder > textarea,div.inputholder > select{padding: 2px;margin: 0px}fieldset > div input.name,fieldset > div span.name{font-weight: bold}fieldset > div input.filename,fieldset > div input.extension,fieldset > div input.ansidate,fieldset > div span.filename,fieldset > div span.extension,fieldset > div span.ansidate{font-family: 'Source Code Pro', Monospace, Monospaced, Courier}dl.notice{padding: 15px}div.content pre,div.dropdown{min-width: 150px;max-width: 450px}img.image-icon{visibility: hidden}.CodeMirror{height: auto}.or-linklist{display: flex;flex-direction: column;padding: 10% 20%}.or-linklist > .or-linklist-line{border: 1px solid;margin-top: 1em;padding: 1em;border-radius: .5em;-moz-border-radius: .5em;-webkit-border-radius: .5em;-khtml-border-radius: .5em}.or-info{position: relative}.or-info:hover .or-info-popup{display: block}.or-info .or-info-popup{display: none;position: absolute;top: 0px;left: 0px;overflow: visible;border: 0.5em;font-size: 2em;border-radius: .3em;-moz-border-radius: .3em;-webkit-border-radius: .3em;-khtml-border-radius: .3em;padding: 1.0em;z-index: 105}.or-info .or-info-popup > div{display: inline-block} +#title{overflow: hidden;padding: 5px}.or-menu{display: flex;justify-content: space-between}.or-menu .or-menu-group{display: flex}.or-menu .or-menu-group:nth-last-child(1) div.dropdown{right: 10px}.or-menu .or-menu-group i.image-icon{width: 1.1em}.or-menu .or-menu-group div > div.arrow-down{width: 0;height: 0;margin: 6px;padding: 0px;margin-top: 10px}.or-menu .or-menu-group div.toolbar-icon{padding: 2px;margin-left: 10px;float: left}.or-menu .or-menu-group div.toolbar-icon.user,.or-menu .or-menu-group div.toolbar-icon.search,.or-menu .or-menu-group div.toolbar-icon.history{float: right;margin-right: 10px;margin-left: 10px}.or-menu .or-menu-group div.toolbar-icon.menu{cursor: default}.or-menu .or-menu-group div.toolbar-icon.search .inputholder{margin: 0;padding: 0;border: 0;display: inline}.or-menu .or-menu-group div.toolbar-icon.search .inputholder input{border: 0;margin: 0;padding: 0;width: 3em;display: inline;transition: width .3s ease-in-out}.or-menu .or-menu-group div.toolbar-icon.search .inputholder input:focus{width: 8em}.or-menu .or-menu-group div.toolbar-icon div.dropdown{z-index: 120;min-width: 250px;display: none;position: absolute;padding: 5px 0px;font-style: normal;font-weight: normal;text-decoration: none}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry{padding: 0}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a{display: flex;align-items: center;padding: 0 .5em}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a *{margin: 0.25em}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > a span:first-of-type{flex: 1}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.entry > .text{display: block;margin: 10px}.or-menu .or-menu-group div.toolbar-icon div.dropdown div.divide{height: 1px;width: 100%;margin-top: 5px;margin-bottom: 5px}.or-menu.open .toolbar-icon.open > div.dropdown{display: block} +#navigation ul.or-navtree-list{list-style-type: none;margin: 0;padding: 0}#navigation ul.or-navtree-list ul{margin-left: 18px}#navigation ul.or-navtree-list .or-navtree-node-control{width: 18px;min-width: 18px;height: 18px;float: left;cursor: pointer}#navigation ul.or-navtree-list .or-navtree-node{margin: 0;padding: 0;line-height: 18px;font-weight: normal;white-space: nowrap}#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected{font-weight: bold}#navigation ul.or-navtree-list .or-navtree-node.or-navtree-node--selected > div > a{font-weight: bold} +div#dialog > .view{overflow: auto;position: absolute;top: 5%;left: 10%;width: 80%;height: 80%;z-index: 110;border: 1px solid !important}@media only screen and (max-width: 55rem){div#dialog > .view{top: 2.5%;left: 2.5%;width: 95%;height: 95%}}div#dialog.is-closed{display: none;width: 0}div#dialog .filler{position: absolute;z-index: 100;top: 0;left: 0;height: 100%;width: 100%;opacity: 0.5}div#dialog .filler span.icon{opacity: 1;font-size: 3em;font-weight: bold;text-align: center;width: 40px;height: 40px;position: absolute;right: 20px;top: 20px}.arrow{width: 0;height: 0;margin: 6px;padding: 0;font-size: 0}.arrow.arrow-down{border-right: 6px solid transparent;border-top: 6px solid;border-left: 6px solid transparent;border-bottom: 4px solid transparent;margin-top: 10px}.arrow.arrow-right{border-top: 6px solid transparent;border-left: 6px solid;border-bottom: 6px solid transparent;border-right: 4px solid transparent;margin-left: 10px}#editor .dirty{font-weight: bold}.visible-for-nojs{display: none}html.nojs .noscript{display: block}.toggle-open-close{display: flex;flex-direction: column}.toggle-open-close .on-click-open-close{cursor: pointer;font-weight: normal}.toggle-open-close > .closable{transition: opacity .3s ease-out;flex: 1;display: block}.toggle-open-close.closed > .on-click-open-close > .on-closed{display: inline}.toggle-open-close.closed > .on-click-open-close > .on-open{display: none}.toggle-open-close.closed > .closable{opacity: 0;max-height: 0;overflow: hidden}.toggle-open-close.open > .closable{height: auto}.toggle-open-close.open > .on-click-open-close > .on-closed{display: none}.toggle-open-close.open > .on-click-open-close > .on-open{display: inline}html,body{width: 100%;height: 100%}div#workbench{width: 100%;height: 100%;display: flex;flex-direction: column}div#workbench > header{height: 3.0rem}div#workbench > header .toolbar-icon .arrow-down{display: inline}@media only screen and (max-width: 55rem){div#workbench > header .toolbar-icon span.label,div#workbench > header .toolbar-icon .arrow-down{display: none}}div#workbench > .or-main-area{flex: 1;min-height: 0;padding-top: 0.5em}div#workbench > .or-main-area > *{min-width: 0;min-height: 0;overflow-y: auto;overflow-x: hidden;height: 100%}div#workbench > .or-main-area > nav{width: 33%;transition: width .15s ease-in-out;position: fixed;height: calc(100% - 3.0rem - 0.5em)}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > nav{width: 0}}div#workbench > .or-main-area > nav.small{width: 5%;opacity: 0.5;overflow-y: hidden}div#workbench > .or-main-area > nav.small:hover{width: 33%;overflow-y: auto;opacity: 1;background-color: inherit;border-right: 1px solid inherit}div#workbench > .or-main-area > nav.small ~ .or-workplace{margin-left: 5%}div#workbench > .or-main-area > nav.open{overflow-y: auto}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > nav.open{width: 95%;border-right: 1px solid;opacity: 0.95}}@media only screen and (min-width: 75rem){div#workbench > .or-main-area > nav{width: 33%;overflow-y: auto}}div#workbench > .or-main-area > nav div.view{height: 100%}div#workbench > .or-main-area header .or-view-icon,div#workbench > .or-main-area header .or-view-headline{margin: 0.3em;display: inline;font-size: 1.2em;line-height: 1.5em}div#workbench > .or-main-area > .or-workplace{margin-left: 33%;transition: margin-left .15s ease-in-out}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace{margin-left: 0}}div#workbench > .or-main-area > .or-workplace > #editor{transition: opacity .5s ease;display: flex;flex-direction: column}div#workbench > .or-main-area > .or-workplace > #editor.is-closed{flex: 0.5;cursor: not-allowed;pointer-events: none}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace > #editor.is-closed{flex: 0}}div#workbench > .or-main-area > .or-workplace > #editor > section{margin: 1.5em;border: 1px solid;border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;-khtml-border-radius: 5px}@media only screen and (max-width: 55rem){div#workbench > .or-main-area > .or-workplace > #editor > section{margin: 0.5em}}div#workbench > .or-main-area > .or-workplace > #editor > section .view-toolbar{display: inline}div#workbench > .or-main-area > .or-workplace > #editor > section.closed .view-toolbar{display: none}#title .toggle-nav-small{display: inline}@media only screen and (max-width: 55rem){#title .toggle-nav-small{display: none}}#title .toggle-nav-open-close{display: none}@media only screen and (max-width: 55rem){#title .toggle-nav-open-close{display: inline}}@media only screen and (max-width: 55rem){#title .toolbar-icon.search input{width: 3em}}.loader{background: url(../images/loader.gif) no-repeat;background-position: center, top;height: 30px;opacity: 0.5;cursor: wait;pointer-events: none}@media only screen and (max-width: 55rem){html{font-size: 1em}}.toggle-nav-small,.or-navigation{z-index: 102}.toggle-nav-small:hover,.or-navigation:hover{z-index: 112}.or-breadcrumb{margin-bottom: 0.1em;margin-left: 1.5em;line-height: 18px;font-weight: normal;white-space: nowrap}.or-breadcrumb li{display: inline;margin-right: 0.3em}.or-breadcrumb .or-breadcrumb-item .image-icon{margin-right: 0.2em} +.editor__text-editor{width: 100%;height: 300px}textarea.editor__code-editor{display: none}div.editor__code-editor{position: absolute;height: 500px;width: 100%;font-size: 14px;z-index: 256}textarea.editor__text-editor,textarea.editor__wiki-editor,textarea.editor__html-editor{width: 100%}a.editorlink:active,a.editorlink:hover{font-weight: normal;text-decoration: none}a.editorlink:link,a.editorlink:visited{font-weight: normal;text-decoration: none} +@media screen and (max-width: 40em){.or-table-wrapper .or-table-area{overflow-x: auto}}.or-table-wrapper .or-table-area table{overflow: auto;border: 2px;width: 100%}.or-table-wrapper .or-table-area table tr.headline > td,.or-table-wrapper .or-table-area table tr > th{padding: 3px;font-weight: bold}.or-table-wrapper .or-table-area table tr.headline > td.sort-asc > span:last-child:after,.or-table-wrapper .or-table-area table tr > th.sort-asc > span:last-child:after{content: " \2193"}.or-table-wrapper .or-table-area table tr.headline > td.sort-desc > span:last-child:after,.or-table-wrapper .or-table-area table tr > th.sort-desc > span:last-child:after{content: " \2191"}.or-table-wrapper .or-table-area table tr.data > td{padding: 3px}.or-table-wrapper .or-table-area table tr > td{white-space: nowrap;text-overflow: ellipsis;overflow: hidden;max-width: 0}.or-table-wrapper .or-table-area table td.readonly{font-style: italic;font-weight: normal}.or-table-wrapper .or-table-area table td.default{font-style: normal;font-weight: normal}.or-table-wrapper .or-table-area table td.changed{font-style: normal;font-weight: bold}.or-table-wrapper .or-table-area table td.notice{margin: 0px;padding: 5%;text-align: center}.or-table-wrapper .or-table-area table.notice{width: 100%;border: 1px solid;border-spacing: 0px}.or-table-wrapper .or-table-area table.notice th{padding: 2px;white-space: nowrap;border-bottom: 1px solid #000;font-weight: normal;text-align: left}.or-table-wrapper .or-table-area table.notice tr.warning{margin: 0px;padding: 0px}.or-table-wrapper .or-table-area table.calendar{table-layout: fixed;border-collapse: collapse;text-align: center}.or-table-wrapper .or-table-area table.calendar td{border: 1px dotted}.or-table-wrapper .or-table-area table td.notice{margin: 0px;padding: 5%;text-align: center}.or-table-wrapper .or-table-area table.notice{width: 100%;border: 1px solid;border-spacing: 0px}.or-table-wrapper .or-table-area table.notice th{padding: 2px;white-space: nowrap;border-bottom: 1px solid #000;font-weight: normal;text-align: left}.or-table-wrapper .or-table-area table.notice tr.warning{margin: 0px;padding: 0px}.or-table-wrapper .or-table-area table.calendar{table-layout: fixed;border-collapse: collapse;text-align: center}.or-table-wrapper .or-table-area table.calendar td{border: 1px dotted}.or-table-wrapper .or-table-area table td.motd{border-left: 3px solid #f00;border-right: 3px solid #f00;font-weight: bold;padding: 10px;margin: 10px}.or-table-wrapper .or-table-area table td:hover > div.onrowvisible{visibility: visible}.or-table-wrapper .or-table-area table tr.diff > td.line{background-color: #000;padding-right: 2px;border-right: 3px solid #000;text-align: right;margin-right: 2px}.or-table-wrapper .or-table-area table tr.diff > td.old{background-color: red}.or-table-wrapper .or-table-area table tr.diff td.new{background-color: green}.or-table-wrapper .or-table-area table tr.diff td.notequal{background-color: yellow}.or-table-wrapper .or-table-area table tr td.help{font-style: italic}.or-table-wrapper .or-table-area table tr.headline td.help{font-style: normal}.or-table-wrapper .or-table-area table td.logo{padding: 10px;margin: 0px}.or-table-wrapper .or-table-filter{width: 100%;text-align: right}.or-table-wrapper .or-table-filter input{border-radius: 3px;-moz-border-radius: 3px;-webkit-border-radius: 3px;-khtml-border-radius: 3px;padding: 0.5em;margin: 1em;background-color: #000;color: #000;border: 1px solid #000} + +.or-group{border: 1px solid;border-bottom: 0;border-left: 0;border-right: 0;margin-top: 20px;margin-bottom: 20px;margin-left: 0px;margin-right: 0px;padding: 10px} +div.or-dropzone-upload > div.input{width: 100%;height: 100px;border: 1px dotted} +/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)} +/** Trumbowyg v2.10.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */ +#trumbowyg-icons,#trumbowyg-icons svg{height:0;width:0}#trumbowyg-icons{overflow:hidden;visibility:hidden}.trumbowyg-box *,.trumbowyg-box ::after,.trumbowyg-box ::before{box-sizing:border-box}.trumbowyg-box svg{width:17px;height:100%;fill:#222}.trumbowyg-box,.trumbowyg-editor{display:block;position:relative;border:1px solid #DDD;width:100%;min-height:300px;margin:17px auto}.trumbowyg-box .trumbowyg-editor{margin:0 auto}.trumbowyg-box.trumbowyg-fullscreen{background:#FEFEFE;border:none!important}.trumbowyg-editor,.trumbowyg-textarea{position:relative;box-sizing:border-box;padding:20px;min-height:300px;width:100%;border-style:none;resize:none;outline:0;overflow:auto}.trumbowyg-editor.trumbowyg-autogrow-on-enter,.trumbowyg-textarea.trumbowyg-autogrow-on-enter{transition:height .3s ease-out}.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:transparent!important;text-shadow:0 0 7px #333}@media screen and (min-width:0 \0){.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(200,200,200,.6)!important}}@supports (-ms-accelerator:true){.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(200,200,200,.6)!important}}.trumbowyg-box-blur .trumbowyg-editor hr,.trumbowyg-box-blur .trumbowyg-editor img{opacity:.2}.trumbowyg-textarea{position:relative;display:block;overflow:auto;border:none;font-size:14px;font-family:Inconsolata,Consolas,Courier,"Courier New",sans-serif;line-height:18px}.trumbowyg-box.trumbowyg-editor-visible .trumbowyg-textarea{height:1px!important;width:25%;min-height:0!important;padding:0!important;background:0 0;opacity:0!important}.trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-textarea{display:block}.trumbowyg-box.trumbowyg-editor-hidden .trumbowyg-editor{display:none}.trumbowyg-box.trumbowyg-disabled .trumbowyg-textarea{opacity:.8;background:0 0}.trumbowyg-editor[contenteditable=true]:empty:not(:focus)::before{content:attr(placeholder);color:#999;pointer-events:none}.trumbowyg-button-pane{width:100%;min-height:36px;background:#ecf0f1;border-bottom:1px solid #d7e0e2;margin:0;padding:0 5px;position:relative;list-style-type:none;line-height:10px;backface-visibility:hidden;z-index:11}.trumbowyg-button-pane::after{content:" ";display:block;position:absolute;top:36px;left:0;right:0;width:100%;height:1px;background:#d7e0e2}.trumbowyg-button-pane .trumbowyg-button-group{display:inline-block}.trumbowyg-button-pane .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:transparent}.trumbowyg-button-pane .trumbowyg-button-group::after{content:" ";display:inline-block;width:1px;background:#d7e0e2;margin:0 5px;height:35px;vertical-align:top}.trumbowyg-button-pane .trumbowyg-button-group:last-child::after{content:none}.trumbowyg-button-pane button{display:inline-block;position:relative;width:35px;height:35px;padding:1px 6px!important;margin-bottom:1px;overflow:hidden;border:none;cursor:pointer;background:0 0;vertical-align:middle;transition:background-color 150ms,opacity 150ms}.trumbowyg-button-pane button.trumbowyg-textual-button{width:auto;line-height:35px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.trumbowyg-button-pane button.trumbowyg-disable,.trumbowyg-button-pane.trumbowyg-disable button:not(.trumbowyg-not-disable):not(.trumbowyg-active),.trumbowyg-disabled .trumbowyg-button-pane button:not(.trumbowyg-not-disable):not(.trumbowyg-viewHTML-button){opacity:.2;cursor:default}.trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::before,.trumbowyg-disabled .trumbowyg-button-pane .trumbowyg-button-group::before{background:#e3e9eb}.trumbowyg-button-pane button.trumbowyg-active,.trumbowyg-button-pane button:not(.trumbowyg-disable):focus,.trumbowyg-button-pane button:not(.trumbowyg-disable):hover{background-color:#FFF;outline:0}.trumbowyg-button-pane .trumbowyg-open-dropdown::after{display:block;content:" ";position:absolute;top:25px;right:3px;height:0;width:0;border:3px solid transparent;border-top-color:#555}.trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button{padding-left:10px!important;padding-right:18px!important}.trumbowyg-button-pane .trumbowyg-open-dropdown.trumbowyg-textual-button::after{top:17px;right:7px}.trumbowyg-modal,.trumbowyg-modal-box{top:0;left:50%;transform:translateX(-50%);backface-visibility:hidden;position:absolute}.trumbowyg-button-pane .trumbowyg-right{float:right}.trumbowyg-dropdown{width:200px;border:1px solid #ecf0f1;padding:5px 0;border-top:none;background:#FFF;margin-left:-1px;box-shadow:rgba(0,0,0,.1) 0 2px 3px;z-index:12}.trumbowyg-dropdown button{display:block;width:100%;height:35px;line-height:35px;text-decoration:none;background:#FFF;padding:0 10px;color:#333!important;border:none;cursor:pointer;text-align:left;font-size:15px;transition:all 150ms}.trumbowyg-dropdown button:focus,.trumbowyg-dropdown button:hover{background:#ecf0f1}.trumbowyg-dropdown button svg{float:left;margin-right:14px}.trumbowyg-modal{max-width:520px;width:100%;height:350px;z-index:12;overflow:hidden}.trumbowyg-modal-box{max-width:500px;width:calc(100% - 20px);padding-bottom:45px;z-index:1;background-color:#FFF;text-align:center;font-size:14px;box-shadow:rgba(0,0,0,.2) 0 2px 3px}.trumbowyg-modal-box .trumbowyg-modal-title{font-size:24px;font-weight:700;margin:0 0 20px;padding:15px 0 13px;display:block;border-bottom:1px solid #EEE;color:#333;background:#fbfcfc}.trumbowyg-modal-box .trumbowyg-progress{width:100%;height:3px;position:absolute;top:58px}.trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar{background:#2BC06A;width:0;height:100%;transition:width 150ms linear}.trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:29px;line-height:29px;overflow:hidden}.trumbowyg-modal-box label .trumbowyg-input-infos{display:block;text-align:left;height:25px;line-height:25px;transition:all 150ms}.trumbowyg-modal-box label .trumbowyg-input-infos span{display:block;color:#69878f;background-color:#fbfcfc;border:1px solid #DEDEDE;padding:0 7px;width:150px}.trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-modal-box label.trumbowyg-input-error textarea{border:1px solid #e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos{margin-top:-27px}.trumbowyg-modal-box label input{position:absolute;top:0;right:0;height:27px;line-height:27px;border:1px solid #DEDEDE;background:#fff;font-size:14px;max-width:330px;width:70%;padding:0 7px;transition:all 150ms}.trumbowyg-modal-box label input:focus,.trumbowyg-modal-box label input:hover{outline:0;border:1px solid #95a5a6}.trumbowyg-modal-box label input:focus{background:#fbfcfc}.trumbowyg-modal-box label input[type=checkbox]{left:5px;top:5px;right:auto}.trumbowyg-modal-box label input[type=checkbox]+.trumbowyg-input-infos span{width:auto;padding-left:25px}.trumbowyg-modal-box .error{margin-top:25px;display:block;color:red}.trumbowyg-modal-box .trumbowyg-modal-button{position:absolute;bottom:10px;right:0;text-decoration:none;color:#FFF;display:block;width:100px;height:35px;line-height:33px;margin:0 10px;background-color:#333;border:none;cursor:pointer;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif;font-size:16px;transition:all 150ms}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{right:110px;background:#2bc06a}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover{background:#40d47e;outline:0}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#25a25a}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{color:#555;background:#e6e6e6}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover{background:#fbfbfb;outline:0}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#d5d5d5}.trumbowyg-overlay{position:absolute;background-color:rgba(255,255,255,.5);height:100%;width:100%;left:0;display:none;top:0;z-index:10}body.trumbowyg-body-fullscreen{overflow:hidden}.trumbowyg-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:99999}.trumbowyg-fullscreen .trumbowyg-editor,.trumbowyg-fullscreen.trumbowyg-box{border:none}.trumbowyg-fullscreen .trumbowyg-editor,.trumbowyg-fullscreen .trumbowyg-textarea{height:calc(100% - 37px)!important;overflow:auto}.trumbowyg-fullscreen .trumbowyg-overlay{height:100%!important}.trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:#222;fill:transparent}.trumbowyg-editor embed,.trumbowyg-editor img,.trumbowyg-editor object,.trumbowyg-editor video{max-width:100%}.trumbowyg-editor img,.trumbowyg-editor video{height:auto}.trumbowyg-editor img{cursor:move}.trumbowyg-editor.trumbowyg-reset-css{background:#FEFEFE!important;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif!important;font-size:14px!important;line-height:1.45em!important;color:#333}.trumbowyg-editor.trumbowyg-reset-css a{color:#15c!important;text-decoration:underline!important}.trumbowyg-editor.trumbowyg-reset-css blockquote,.trumbowyg-editor.trumbowyg-reset-css div,.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css p,.trumbowyg-editor.trumbowyg-reset-css ul{box-shadow:none!important;background:0 0!important;margin:0 0 15px!important;line-height:1.4em!important;font-family:"Trebuchet MS",Helvetica,Verdana,sans-serif!important;font-size:14px!important;border:none}.trumbowyg-editor.trumbowyg-reset-css hr,.trumbowyg-editor.trumbowyg-reset-css iframe,.trumbowyg-editor.trumbowyg-reset-css object{margin-bottom:15px!important}.trumbowyg-editor.trumbowyg-reset-css blockquote{margin-left:32px!important;font-style:italic!important;color:#555}.trumbowyg-editor.trumbowyg-reset-css ul{list-style:disc}.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css ul{padding-left:20px!important}.trumbowyg-editor.trumbowyg-reset-css ol ol,.trumbowyg-editor.trumbowyg-reset-css ol ul,.trumbowyg-editor.trumbowyg-reset-css ul ol,.trumbowyg-editor.trumbowyg-reset-css ul ul{border:none;margin:2px!important;padding:0 0 0 24px!important}.trumbowyg-editor.trumbowyg-reset-css hr{display:block;height:1px;border:none;border-top:1px solid #CCC}.trumbowyg-editor.trumbowyg-reset-css h1,.trumbowyg-editor.trumbowyg-reset-css h2,.trumbowyg-editor.trumbowyg-reset-css h3,.trumbowyg-editor.trumbowyg-reset-css h4{color:#111;background:0 0;margin:0!important;padding:0!important;font-weight:700}.trumbowyg-editor.trumbowyg-reset-css h1{font-size:32px!important;line-height:38px!important;margin-bottom:20px!important}.trumbowyg-editor.trumbowyg-reset-css h2{font-size:26px!important;line-height:34px!important;margin-bottom:15px!important}.trumbowyg-editor.trumbowyg-reset-css h3{font-size:22px!important;line-height:28px!important;margin-bottom:7px!important}.trumbowyg-editor.trumbowyg-reset-css h4{font-size:16px!important;line-height:22px!important;margin-bottom:7px!important}.trumbowyg-dark .trumbowyg-textarea{background:#111;color:#ddd}.trumbowyg-dark .trumbowyg-box{border:1px solid #343434}.trumbowyg-dark .trumbowyg-box.trumbowyg-fullscreen{background:#111}.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{text-shadow:0 0 7px #ccc}@media screen and (min-width:0 \0){.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(20,20,20,.6)!important}}@supports (-ms-accelerator:true){.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor *,.trumbowyg-dark .trumbowyg-box.trumbowyg-box-blur .trumbowyg-editor::before{color:rgba(20,20,20,.6)!important}}.trumbowyg-dark .trumbowyg-box svg{fill:#ecf0f1;color:#ecf0f1}.trumbowyg-dark .trumbowyg-button-pane{background-color:#222;border-bottom-color:#343434}.trumbowyg-dark .trumbowyg-button-pane::after{background:#343434}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty)::after{background-color:#343434}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-button-group:not(:empty) .trumbowyg-fullscreen-button svg{color:transparent}.trumbowyg-dark .trumbowyg-button-pane.trumbowyg-disable .trumbowyg-button-group::after{background-color:#2a2a2a}.trumbowyg-dark .trumbowyg-button-pane button.trumbowyg-active,.trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):focus,.trumbowyg-dark .trumbowyg-button-pane button:not(.trumbowyg-disable):hover{background-color:#333}.trumbowyg-dark .trumbowyg-button-pane .trumbowyg-open-dropdown::after{border-top-color:#fff}.trumbowyg-dark .trumbowyg-fullscreen .trumbowyg-button-group .trumbowyg-fullscreen-button svg{color:#ecf0f1;fill:transparent}.trumbowyg-dark .trumbowyg-dropdown{border-color:#222;background:#333;box-shadow:rgba(0,0,0,.3) 0 2px 3px}.trumbowyg-dark .trumbowyg-dropdown button{background:#333;color:#fff!important}.trumbowyg-dark .trumbowyg-dropdown button:focus,.trumbowyg-dark .trumbowyg-dropdown button:hover{background:#222}.trumbowyg-dark .trumbowyg-modal-box{background-color:#222}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-title{border-bottom:1px solid #555;color:#fff;background:#3c3c3c}.trumbowyg-dark .trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:27px;line-height:27px;overflow:hidden}.trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span{color:#eee;background-color:#2f2f2f;border-color:#222}.trumbowyg-dark .trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-dark .trumbowyg-modal-box label.trumbowyg-input-error textarea{border-color:#e74c3c}.trumbowyg-dark .trumbowyg-modal-box label input{border-color:#222;color:#eee;background:#333}.trumbowyg-dark .trumbowyg-modal-box label input:focus,.trumbowyg-dark .trumbowyg-modal-box label input:hover{border-color:#626262}.trumbowyg-dark .trumbowyg-modal-box label input:focus{background-color:#2f2f2f}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{background:#1b7943}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus,.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover{background:#25a25a}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#176437}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{background:#333;color:#ccc}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus,.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover{background:#444}.trumbowyg-dark .trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#111}.trumbowyg-dark .trumbowyg-overlay{background-color:rgba(15,15,15,.6)} diff --git a/modules/language/Language.class.php b/modules/language/Language.class.php @@ -2,129 +2,46 @@ namespace language; -use LogicException; -use util\YAML; +use logger\Logger; class Language { - private $srcFile; - public function __construct() { - $this->srcFile = __DIR__ . '/language.yml'; } /** * @param $iso ISO-Code - * @param bool $production Are we in a production environment? * @return array The language values */ - public function getLanguage($iso, $production = true) - { - if ( !$production) { - $this->compileLanguage($iso); - } - - return $this->getLanguageProduction($iso); - } - - /** - * Compiles language YAML source to native language php files. - * Only, if the YAML source file has changed. - * @param $iso ISO-code - */ - private function compileLanguage($iso) - { - if ( filemtime($this->srcFile) > filemtime( $this->getOutputLanguageFile('en')) ) - { - // source file newer than production file => compile. - $this->updateProduction(); - } - } - - /** - * @param $iso ISO-language-code - * @return array - */ - private function getLanguageProduction($iso) + public function getLanguage($iso) { - $langFile = $this->getOutputLanguageFile($iso,'en'); - require($langFile); // Contains the function 'language()' - return language(); - } - - - private function getLanguageSource() - { - return YAML::parse( file_get_contents($this->srcFile) ); - } - - - /** - * Creates the production environment. - */ - public function updateProduction() - { - $lang = $this->getLanguageSource(); - - // creating a list of alle language iso codes. - $isoList = array(); - foreach ($lang as $key => $values) - { - foreach ($values as $isocode => $value) - { - if ( !in_array($isocode, $isoList) ) - $isoList[] = $isocode; - } - - } - - foreach ($isoList as $iso) { - $outputFilename = $this->getOutputLanguageFile($iso); - - $success = file_put_contents($outputFilename, "<?php /* DO NOT CHANGE THIS GENERATED FILE */\n"); - - if ($success) - ; - else - throw new LogicException("File is not writable: '$outputFilename'\n"); - - file_put_contents($outputFilename, "function language() { return array(\n", FILE_APPEND); - foreach ($lang as $key => $value) { - if (isset($value[$iso])) - $t = $value[$iso]; - elseif (isset($value['en'])) - $t = $value['en']; // Fallback to english - else - $t = $key; - $t = str_replace('\'', '\\\'', $t); // escaping - file_put_contents($outputFilename, "'$key'=>'$t',\n", FILE_APPEND); - } - file_put_contents($outputFilename, ");}", FILE_APPEND); - - } + $langFile = $this->getOutputLanguageFile($iso); + require($langFile); // Contains the function 'language()' + return language(); } /** * Returns the native php language file for the selected iso code. * @param $iso string ISO-Code - * @param null string $fallbackiso Fallback to this ISO-Code, if the file does not exist. * @return string filename */ - private function getOutputLanguageFile($iso, $fallbackiso = null ) + private function getOutputLanguageFile($iso) { - $langFile = __DIR__ . '/lang-' . $iso . '.php'; + $fallback = 'en'; + $isos = [ $iso ,$fallback ]; // Using a fallback - // Is language available? - if ( !empty($fallbackiso) && !file_exists($langFile)) - // Fallback to english - $langFile = __DIR__ . '/lang-'.$fallbackiso.'.php'; + foreach( $isos as $l ) { + $langFile = __DIR__ . '/lang-' . $l . '.php'; - return $langFile; - } + // Is language file available? + if ( file_exists($langFile) ) + return $langFile; + } -} + throw new \DomainException('No language file found for iso keys: '.Logger::sanitizeInput(implode(',',$isos))); + } -?>- \ No newline at end of file +}+ \ No newline at end of file diff --git a/modules/language/LanguageCompiler.class.php b/modules/language/LanguageCompiler.class.php @@ -0,0 +1,98 @@ +<?php + +namespace language; + +use LogicException; + +use util\YAML; + +class LanguageCompiler +{ + private $srcFile; + + private $fallback = 'en'; + + public function __construct() + { + $this->srcFile = __DIR__ . '/language.yml'; + } + + /** + * Compiles language YAML source to native language php files. + * Only, if the YAML source file has changed. + */ + private function compile() + { + $this->updateProduction(); + } + + + private function getLanguageSource() + { + return YAML::parse( file_get_contents($this->srcFile) ); + } + + + /** + * Creates the production environment. + */ + public function updateProduction() + { + $lang = $this->getLanguageSource(); + + // creating a list of all language iso codes. + $isoList = array(); + foreach ($lang as $key => $values) + { + foreach ($values as $isocode => $value) + { + if ( !in_array($isocode, $isoList) ) + $isoList[] = $isocode; + } + + } + + foreach ($isoList as $iso) { + $outputFilename = $this->getOutputLanguageFile($iso); + + $success = file_put_contents($outputFilename, "<?php /* DO NOT CHANGE THIS GENERATED FILE */\n"); + + if ($success) + ; + else + throw new LogicException("File is not writable: '$outputFilename'\n"); + + file_put_contents($outputFilename, "function language() { return array(\n", FILE_APPEND); + foreach ($lang as $key => $value) { + if (isset($value[$iso])) + $t = $value[$iso]; + elseif (isset($value[$this->fallback])) + $t = $value[$this->fallback]; // Fallback language + else + echo "WARNING: ".'language key '.$key.' has no value for '.$iso.' and '.$this->fallback.'.'."\n"; + $t = str_replace('\'', '\\\'', $t); // escaping + file_put_contents($outputFilename, "'$key'=>'$t',\n", FILE_APPEND); + } + file_put_contents($outputFilename, ");}", FILE_APPEND); + + echo 'Success: Updated file '.$outputFilename."\n"; + } + } + + + /** + * Returns the native php language file for the selected iso code. + * @param $iso string ISO-Code + * @param null string $fallbackiso Fallback to this ISO-Code, if the file does not exist. + * @return string filename + */ + private function getOutputLanguageFile($iso ) + { + $langFile = __DIR__ . '/lang-' . $iso . '.php'; + + return $langFile; + } + +} + +?>+ \ No newline at end of file diff --git a/modules/language/lang-cn.php b/modules/language/lang-cn.php @@ -753,8 +753,8 @@ function language() { return array( 'MENU_NAME'=>'Name', 'MENU_OPENID'=>'Open-Id', 'MENU_OTHER'=>'Other', -'MENU_ORDER'=>'MENU_ORDER', -'MENU_ORDER_DESC'=>'MENU_ORDER_DESC', +'MENU_ORDER'=>'Order', +'MENU_ORDER_DESC'=>'Change order', 'MENU_PAGE_ACLFORM_DESC'=>'Add a right to this page', 'MENU_PAGE_ACLFORM'=>'Add right', 'MENU_PAGE_CHANGETEMPLATE_DESC'=>'Replace the template of this page', @@ -834,7 +834,7 @@ function language() { return array( 'MENU_REGISTER_DESC'=>'You must be registered to use this application.', 'MENU_REGISTER'=>'Register', 'MENU_REMOVE'=>'Delete', -'MENU_REMOVE_DESC'=>'MENU_REMOVE_DESC', +'MENU_REMOVE_DESC'=>'Delete', 'MENU_RIGHTS'=>'Rights', 'MENU_RIGHTS_DESC'=>'grant or revoke rights', 'MENU_RIGHTS_KEY'=>'X', @@ -955,8 +955,8 @@ function language() { return array( 'MENU_USERS_DESC'=>'Add or remove users', 'MENU_USERS'=>'Memberships', 'MENU_USERTIMELINE'=>'My changes', -'MENU_VALUE'=>'MENU_VALUE', -'MENU_VALUE_DESC'=>'MENU_VALUE_DESC', +'MENU_VALUE'=>'Content', +'MENU_VALUE_DESC'=>'Content', 'MODE_EDIT'=>'Edit', 'MODE_EDIT_CANCEL'=>'Cancel', 'MODE_EDIT_CANCEL_DESC'=>'Cancel input', @@ -977,8 +977,8 @@ function language() { return array( 'NOTICE_COPIED'=>'was copied', 'NOTICE_DUPLICATE_INPUT'=>'Duplicate Input detected.', 'NOTICE_DATABASE_CONNECTION_ERROR'=>'The connection to the database could not be established.', -'ERROR_DATABASE_CONNECTION'=>'ERROR_DATABASE_CONNECTION', -'ERROR_DATABASE'=>'ERROR_DATABASE', +'ERROR_DATABASE_CONNECTION'=>'The connection to the database could not be established.', +'ERROR_DATABASE'=>'The database query could not executed.', 'NOTICE_DELETED'=>'was deleted', 'NOTICE_DONE'=>'Finished successful', 'NOTICE_ERROR'=>'An error occured', @@ -1175,13 +1175,13 @@ function language() { return array( 'USER_YOURPROFILE'=>'My settings', 'WEEK'=>'Week', 'WINDOW_FULLSCREEN'=>'Fullscreen', -'MENU_STRUCTURE_DESC'=>'MENU_STRUCTURE_DESC', -'MENU_PREVIEW_DESC'=>'MENU_PREVIEW_DESC', +'MENU_STRUCTURE_DESC'=>'Show structure', +'MENU_PREVIEW_DESC'=>'Preview', 'MENU_ARCHIVE_DESC'=>'Archive', -'MENU_USERTIMELINE_DESC'=>'MENU_USERTIMELINE_DESC', -'MENU_OPENID_DESC'=>'MENU_OPENID_DESC', -'PAGEELEMENT_RELEASED'=>'PAGEELEMENT_RELEASED', -'PAGEELEMENT_USE_FROM_ARCHIVE'=>'PAGEELEMENT_USE_FROM_ARCHIVE', +'MENU_USERTIMELINE_DESC'=>'My last changes', +'MENU_OPENID_DESC'=>'Login with your OpenId', +'PAGEELEMENT_RELEASED'=>'The content has been released', +'PAGEELEMENT_USE_FROM_ARCHIVE'=>'The content has been restored.', 'REMEMBER_ME'=>'Stay logged in', 'MENU_PROGRESS'=>'Tasks', 'MENU_PROGRESS_DESC'=>'Running tasks', @@ -1196,12 +1196,12 @@ function language() { return array( 'SELECT_LANGUAGE'=>'Select language', 'SELECT_MODEL'=>'Select model', 'PWCHANGE_NOT_ALLOWED'=>'Password change is not available', -'ERROR_IN_ELEMENT'=>'ERROR_IN_ELEMENT', +'ERROR_IN_ELEMENT'=>'The element could not be build', 'USER_PASSWORD_EXPIRES'=>'Password expires', 'USER_HOTP'=>'Counter-based 2-factor authentification', 'USER_TOTP'=>'Time-based 2-factor authentification', -'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'NOTICE_LOGIN_FAILED_TOKEN_FAILED', -'USER_TOKEN'=>'USER_TOKEN', +'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'Please supply a valid token', +'USER_TOKEN'=>'Token', 'ACCESSKEY_WINDOW_ACL'=>'G', 'ELEMENTS'=>'Elements', 'EL_LIST_DESC'=>'The list element contains 1 ore more pages. With this element you can put more page into one together', @@ -1250,8 +1250,8 @@ function language() { return array( 'USER_MAIL_TEXT_PREFIX'=>'Your Password for logging in to OpenRat Content Management System is:', 'USER_MAIL_TEXT_SUFFIX'=>'Note this password at a secure place and remove this E-Mail. Your are able to change your password after logging in.', 'CHARSET'=>'UTF-8', -'MENU_TITLE_SEARCH_CONTENT'=>'MENU_TITLE_SEARCH_CONTENT', -'MENU_TITLE_SEARCH_PROP'=>'MENU_TITLE_SEARCH_PROP', +'MENU_TITLE_SEARCH_CONTENT'=>'Search for value', +'MENU_TITLE_SEARCH_PROP'=>'Search for property', 'MENU_START'=>'Start', 'MENU_START_DESC'=>'Start', 'NOTICE_MOTD'=>'Message: ${motd}', diff --git a/modules/language/lang-de.php b/modules/language/lang-de.php @@ -1250,7 +1250,7 @@ function language() { return array( 'USER_MAIL_TEXT_PREFIX'=>'Your Password for logging in to OpenRat Content Management System is:', 'USER_MAIL_TEXT_SUFFIX'=>'Note this password at a secure place and remove this E-Mail. Your are able to change your password after logging in.', 'CHARSET'=>'UTF-8', -'MENU_TITLE_SEARCH_CONTENT'=>'MENU_TITLE_SEARCH_CONTENT', +'MENU_TITLE_SEARCH_CONTENT'=>'Search for value', 'MENU_TITLE_SEARCH_PROP'=>'Suche nach Eigenschaft', 'MENU_START'=>'Start', 'MENU_START_DESC'=>'Start', diff --git a/modules/language/lang-en.php b/modules/language/lang-en.php @@ -753,8 +753,8 @@ function language() { return array( 'MENU_NAME'=>'Name', 'MENU_OPENID'=>'Open-Id', 'MENU_OTHER'=>'Other', -'MENU_ORDER'=>'MENU_ORDER', -'MENU_ORDER_DESC'=>'MENU_ORDER_DESC', +'MENU_ORDER'=>'Order', +'MENU_ORDER_DESC'=>'Change order', 'MENU_PAGE_ACLFORM_DESC'=>'Add a right to this page', 'MENU_PAGE_ACLFORM'=>'Add right', 'MENU_PAGE_CHANGETEMPLATE_DESC'=>'Replace the template of this page', @@ -834,7 +834,7 @@ function language() { return array( 'MENU_REGISTER_DESC'=>'You must be registered to use this application.', 'MENU_REGISTER'=>'Register', 'MENU_REMOVE'=>'Delete', -'MENU_REMOVE_DESC'=>'MENU_REMOVE_DESC', +'MENU_REMOVE_DESC'=>'Delete', 'MENU_RIGHTS'=>'Rights', 'MENU_RIGHTS_DESC'=>'grant or revoke rights', 'MENU_RIGHTS_KEY'=>'X', @@ -955,8 +955,8 @@ function language() { return array( 'MENU_USERS_DESC'=>'Add or remove users', 'MENU_USERS'=>'Memberships', 'MENU_USERTIMELINE'=>'My changes', -'MENU_VALUE'=>'MENU_VALUE', -'MENU_VALUE_DESC'=>'MENU_VALUE_DESC', +'MENU_VALUE'=>'Content', +'MENU_VALUE_DESC'=>'Content', 'MODE_EDIT'=>'Edit', 'MODE_EDIT_CANCEL'=>'Cancel', 'MODE_EDIT_CANCEL_DESC'=>'Cancel input', @@ -977,8 +977,8 @@ function language() { return array( 'NOTICE_COPIED'=>'was copied', 'NOTICE_DUPLICATE_INPUT'=>'Duplicate Input detected.', 'NOTICE_DATABASE_CONNECTION_ERROR'=>'The connection to the database could not be established.', -'ERROR_DATABASE_CONNECTION'=>'ERROR_DATABASE_CONNECTION', -'ERROR_DATABASE'=>'ERROR_DATABASE', +'ERROR_DATABASE_CONNECTION'=>'The connection to the database could not be established.', +'ERROR_DATABASE'=>'The database query could not executed.', 'NOTICE_DELETED'=>'was deleted', 'NOTICE_DONE'=>'Finished successful', 'NOTICE_ERROR'=>'An error occured', @@ -1175,13 +1175,13 @@ function language() { return array( 'USER_YOURPROFILE'=>'My settings', 'WEEK'=>'Week', 'WINDOW_FULLSCREEN'=>'Fullscreen', -'MENU_STRUCTURE_DESC'=>'MENU_STRUCTURE_DESC', -'MENU_PREVIEW_DESC'=>'MENU_PREVIEW_DESC', +'MENU_STRUCTURE_DESC'=>'Show structure', +'MENU_PREVIEW_DESC'=>'Preview', 'MENU_ARCHIVE_DESC'=>'Archive', -'MENU_USERTIMELINE_DESC'=>'MENU_USERTIMELINE_DESC', -'MENU_OPENID_DESC'=>'MENU_OPENID_DESC', -'PAGEELEMENT_RELEASED'=>'PAGEELEMENT_RELEASED', -'PAGEELEMENT_USE_FROM_ARCHIVE'=>'PAGEELEMENT_USE_FROM_ARCHIVE', +'MENU_USERTIMELINE_DESC'=>'My last changes', +'MENU_OPENID_DESC'=>'Login with your OpenId', +'PAGEELEMENT_RELEASED'=>'The content has been released', +'PAGEELEMENT_USE_FROM_ARCHIVE'=>'The content has been restored.', 'REMEMBER_ME'=>'Stay logged in', 'MENU_PROGRESS'=>'Tasks', 'MENU_PROGRESS_DESC'=>'Running tasks', @@ -1196,12 +1196,12 @@ function language() { return array( 'SELECT_LANGUAGE'=>'Select language', 'SELECT_MODEL'=>'Select model', 'PWCHANGE_NOT_ALLOWED'=>'Password change is not available', -'ERROR_IN_ELEMENT'=>'ERROR_IN_ELEMENT', +'ERROR_IN_ELEMENT'=>'The element could not be build', 'USER_PASSWORD_EXPIRES'=>'Password expires', 'USER_HOTP'=>'Counter-based 2-factor authentification', 'USER_TOTP'=>'Time-based 2-factor authentification', -'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'NOTICE_LOGIN_FAILED_TOKEN_FAILED', -'USER_TOKEN'=>'USER_TOKEN', +'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'Please supply a valid token', +'USER_TOKEN'=>'Token', 'ACCESSKEY_WINDOW_ACL'=>'G', 'ELEMENTS'=>'Elements', 'EL_LIST_DESC'=>'The list element contains 1 ore more pages. With this element you can put more page into one together', @@ -1250,8 +1250,8 @@ function language() { return array( 'USER_MAIL_TEXT_PREFIX'=>'Your Password for logging in to OpenRat Content Management System is:', 'USER_MAIL_TEXT_SUFFIX'=>'Note this password at a secure place and remove this E-Mail. Your are able to change your password after logging in.', 'CHARSET'=>'UTF-8', -'MENU_TITLE_SEARCH_CONTENT'=>'MENU_TITLE_SEARCH_CONTENT', -'MENU_TITLE_SEARCH_PROP'=>'MENU_TITLE_SEARCH_PROP', +'MENU_TITLE_SEARCH_CONTENT'=>'Search for value', +'MENU_TITLE_SEARCH_PROP'=>'Search for property', 'MENU_START'=>'Start', 'MENU_START_DESC'=>'Start', 'NOTICE_MOTD'=>'Message: ${motd}', diff --git a/modules/language/lang-es.php b/modules/language/lang-es.php @@ -777,8 +777,8 @@ MENU_INDEX_ADMINISTRATION_DESC =', 'MENU_NAME'=>'Name', 'MENU_OPENID'=>'Open-Id', 'MENU_OTHER'=>'Other', -'MENU_ORDER'=>'MENU_ORDER', -'MENU_ORDER_DESC'=>'MENU_ORDER_DESC', +'MENU_ORDER'=>'Order', +'MENU_ORDER_DESC'=>'Change order', 'MENU_PAGE_ACLFORM_DESC'=>'Ajouter une droite à cette page', 'MENU_PAGE_ACLFORM'=>'Ajouter bien', 'MENU_PAGE_CHANGETEMPLATE_DESC'=>'Remplacer le calibre de cette page', @@ -858,7 +858,7 @@ MENU_INDEX_ADMINISTRATION_DESC =', 'MENU_REGISTER_DESC'=>'You must be registered to use this application.', 'MENU_REGISTER'=>'Register', 'MENU_REMOVE'=>'Delete', -'MENU_REMOVE_DESC'=>'MENU_REMOVE_DESC', +'MENU_REMOVE_DESC'=>'Delete', 'MENU_RIGHTS'=>'Rights', 'MENU_RIGHTS_DESC'=>'o revocan la demostración de las derechas', 'MENU_RIGHTS_KEY'=>'X', @@ -979,8 +979,8 @@ MENU_INDEX_ADMINISTRATION_DESC =', 'MENU_USERS_DESC'=>'Ajouter ou enlever les utilisateurs', 'MENU_USERS'=>'Adhésions', 'MENU_USERTIMELINE'=>'My changes', -'MENU_VALUE'=>'MENU_VALUE', -'MENU_VALUE_DESC'=>'MENU_VALUE_DESC', +'MENU_VALUE'=>'Content', +'MENU_VALUE_DESC'=>'Content', 'MODE_EDIT'=>'Edit', 'MODE_EDIT_CANCEL'=>'Cancel', 'MODE_EDIT_CANCEL_DESC'=>'Cancel input', @@ -1001,8 +1001,8 @@ MENU_INDEX_ADMINISTRATION_DESC =', 'NOTICE_COPIED'=>'fue copiada', 'NOTICE_DUPLICATE_INPUT'=>'Duplicate Input detected.', 'NOTICE_DATABASE_CONNECTION_ERROR'=>'The connection to the database could not be established.', -'ERROR_DATABASE_CONNECTION'=>'ERROR_DATABASE_CONNECTION', -'ERROR_DATABASE'=>'ERROR_DATABASE', +'ERROR_DATABASE_CONNECTION'=>'The connection to the database could not be established.', +'ERROR_DATABASE'=>'The database query could not executed.', 'NOTICE_DELETED'=>'fue suprimida', 'NOTICE_DONE'=>'Finished successful', 'NOTICE_ERROR'=>'un error', @@ -1199,13 +1199,13 @@ MENU_INDEX_ADMINISTRATION_DESC =', 'USER_YOURPROFILE'=>'mi contenido de los ajustes', 'WEEK'=>'Week', 'WINDOW_FULLSCREEN'=>'Fullscreen', -'MENU_STRUCTURE_DESC'=>'MENU_STRUCTURE_DESC', -'MENU_PREVIEW_DESC'=>'MENU_PREVIEW_DESC', +'MENU_STRUCTURE_DESC'=>'Show structure', +'MENU_PREVIEW_DESC'=>'Preview', 'MENU_ARCHIVE_DESC'=>'Archive', -'MENU_USERTIMELINE_DESC'=>'MENU_USERTIMELINE_DESC', -'MENU_OPENID_DESC'=>'MENU_OPENID_DESC', -'PAGEELEMENT_RELEASED'=>'PAGEELEMENT_RELEASED', -'PAGEELEMENT_USE_FROM_ARCHIVE'=>'PAGEELEMENT_USE_FROM_ARCHIVE', +'MENU_USERTIMELINE_DESC'=>'My last changes', +'MENU_OPENID_DESC'=>'Login with your OpenId', +'PAGEELEMENT_RELEASED'=>'The content has been released', +'PAGEELEMENT_USE_FROM_ARCHIVE'=>'The content has been restored.', 'REMEMBER_ME'=>'Stay logged in', 'MENU_PROGRESS'=>'Tasks', 'MENU_PROGRESS_DESC'=>'Running tasks', @@ -1220,12 +1220,12 @@ MENU_INDEX_ADMINISTRATION_DESC =', 'SELECT_LANGUAGE'=>'Select language', 'SELECT_MODEL'=>'Select model', 'PWCHANGE_NOT_ALLOWED'=>'Password change is not available', -'ERROR_IN_ELEMENT'=>'ERROR_IN_ELEMENT', +'ERROR_IN_ELEMENT'=>'The element could not be build', 'USER_PASSWORD_EXPIRES'=>'Password expires', 'USER_HOTP'=>'Counter-based 2-factor authentification', 'USER_TOTP'=>'Time-based 2-factor authentification', -'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'NOTICE_LOGIN_FAILED_TOKEN_FAILED', -'USER_TOKEN'=>'USER_TOKEN', +'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'Please supply a valid token', +'USER_TOKEN'=>'Token', 'ACCESSKEY_WINDOW_ACL'=>'G', 'ELEMENTS'=>'Elementos', 'EL_LIST_DESC'=>'El elemento de la lista contiene 1 mineral más páginas. Con este elemento puedes juntar más página en una', diff --git a/modules/language/lang-fr.php b/modules/language/lang-fr.php @@ -753,8 +753,8 @@ function language() { return array( 'MENU_NAME'=>'Name', 'MENU_OPENID'=>'Open-Id', 'MENU_OTHER'=>'Other', -'MENU_ORDER'=>'MENU_ORDER', -'MENU_ORDER_DESC'=>'MENU_ORDER_DESC', +'MENU_ORDER'=>'Order', +'MENU_ORDER_DESC'=>'Change order', 'MENU_PAGE_ACLFORM_DESC'=>'Ajouter une droite à cette page', 'MENU_PAGE_ACLFORM'=>'Ajouter bien', 'MENU_PAGE_CHANGETEMPLATE_DESC'=>'Remplacer le calibre de cette page', @@ -834,7 +834,7 @@ function language() { return array( 'MENU_REGISTER_DESC'=>'You must be registered to use this application.', 'MENU_REGISTER'=>'Register', 'MENU_REMOVE'=>'Delete', -'MENU_REMOVE_DESC'=>'MENU_REMOVE_DESC', +'MENU_REMOVE_DESC'=>'Delete', 'MENU_RIGHTS'=>'Droites', 'MENU_RIGHTS_DESC'=>'accorder ou retirer les droites', 'MENU_RIGHTS_KEY'=>'X', @@ -955,8 +955,8 @@ function language() { return array( 'MENU_USERS_DESC'=>'Ajouter ou enlever les utilisateurs', 'MENU_USERS'=>'Adhésions', 'MENU_USERTIMELINE'=>'My changes', -'MENU_VALUE'=>'MENU_VALUE', -'MENU_VALUE_DESC'=>'MENU_VALUE_DESC', +'MENU_VALUE'=>'Content', +'MENU_VALUE_DESC'=>'Content', 'MODE_EDIT'=>'Edit', 'MODE_EDIT_CANCEL'=>'Cancel', 'MODE_EDIT_CANCEL_DESC'=>'Cancel input', @@ -977,8 +977,8 @@ function language() { return array( 'NOTICE_COPIED'=>'a été copié', 'NOTICE_DUPLICATE_INPUT'=>'Duplicate Input detected.', 'NOTICE_DATABASE_CONNECTION_ERROR'=>'The connection to the database could not be established.', -'ERROR_DATABASE_CONNECTION'=>'ERROR_DATABASE_CONNECTION', -'ERROR_DATABASE'=>'ERROR_DATABASE', +'ERROR_DATABASE_CONNECTION'=>'The connection to the database could not be established.', +'ERROR_DATABASE'=>'The database query could not executed.', 'NOTICE_DELETED'=>'a été supprimé', 'NOTICE_DONE'=>'Finished successful', 'NOTICE_ERROR'=>'Une erreur s\'est produite', @@ -1175,13 +1175,13 @@ function language() { return array( 'USER_YOURPROFILE'=>'Mes arrangements', 'WEEK'=>'Week', 'WINDOW_FULLSCREEN'=>'Fullscreen', -'MENU_STRUCTURE_DESC'=>'MENU_STRUCTURE_DESC', -'MENU_PREVIEW_DESC'=>'MENU_PREVIEW_DESC', +'MENU_STRUCTURE_DESC'=>'Show structure', +'MENU_PREVIEW_DESC'=>'Preview', 'MENU_ARCHIVE_DESC'=>'Archive', -'MENU_USERTIMELINE_DESC'=>'MENU_USERTIMELINE_DESC', -'MENU_OPENID_DESC'=>'MENU_OPENID_DESC', -'PAGEELEMENT_RELEASED'=>'PAGEELEMENT_RELEASED', -'PAGEELEMENT_USE_FROM_ARCHIVE'=>'PAGEELEMENT_USE_FROM_ARCHIVE', +'MENU_USERTIMELINE_DESC'=>'My last changes', +'MENU_OPENID_DESC'=>'Login with your OpenId', +'PAGEELEMENT_RELEASED'=>'The content has been released', +'PAGEELEMENT_USE_FROM_ARCHIVE'=>'The content has been restored.', 'REMEMBER_ME'=>'Stay logged in', 'MENU_PROGRESS'=>'Tasks', 'MENU_PROGRESS_DESC'=>'Running tasks', @@ -1196,12 +1196,12 @@ function language() { return array( 'SELECT_LANGUAGE'=>'Select language', 'SELECT_MODEL'=>'Select model', 'PWCHANGE_NOT_ALLOWED'=>'Password change is not available', -'ERROR_IN_ELEMENT'=>'ERROR_IN_ELEMENT', +'ERROR_IN_ELEMENT'=>'The element could not be build', 'USER_PASSWORD_EXPIRES'=>'Password expires', 'USER_HOTP'=>'Counter-based 2-factor authentification', 'USER_TOTP'=>'Time-based 2-factor authentification', -'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'NOTICE_LOGIN_FAILED_TOKEN_FAILED', -'USER_TOKEN'=>'USER_TOKEN', +'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'Please supply a valid token', +'USER_TOKEN'=>'Token', 'ACCESSKEY_WINDOW_ACL'=>'G', 'ELEMENTS'=>'Éléments', 'EL_LIST_DESC'=>'L\'élément de liste contient 1 öre plus de pages. Avec cet élément vous pouvez remonter plus de page dans une', diff --git a/modules/language/lang-it.php b/modules/language/lang-it.php @@ -753,8 +753,8 @@ function language() { return array( 'MENU_NAME'=>'Name', 'MENU_OPENID'=>'Open-Id', 'MENU_OTHER'=>'Other', -'MENU_ORDER'=>'MENU_ORDER', -'MENU_ORDER_DESC'=>'MENU_ORDER_DESC', +'MENU_ORDER'=>'Order', +'MENU_ORDER_DESC'=>'Change order', 'MENU_PAGE_ACLFORM_DESC'=>'agrega una derecha a esta página', 'MENU_PAGE_ACLFORM'=>'agrega a la derecha', 'MENU_PAGE_CHANGETEMPLATE_DESC'=>'substituye la plantilla de esta página', @@ -834,7 +834,7 @@ function language() { return array( 'MENU_REGISTER_DESC'=>'You must be registered to use this application.', 'MENU_REGISTER'=>'Register', 'MENU_REMOVE'=>'Delete', -'MENU_REMOVE_DESC'=>'MENU_REMOVE_DESC', +'MENU_REMOVE_DESC'=>'Delete', 'MENU_RIGHTS'=>'Rights', 'MENU_RIGHTS_DESC'=>'o revocano l\'esposizione di diritti', 'MENU_RIGHTS_KEY'=>'X', @@ -955,8 +955,8 @@ function language() { return array( 'MENU_USERS_DESC'=>'aggiungono o rimuovono gli utenti', 'MENU_USERS'=>'Gli insiemi dei membri', 'MENU_USERTIMELINE'=>'My changes', -'MENU_VALUE'=>'MENU_VALUE', -'MENU_VALUE_DESC'=>'MENU_VALUE_DESC', +'MENU_VALUE'=>'Content', +'MENU_VALUE_DESC'=>'Content', 'MODE_EDIT'=>'Edit', 'MODE_EDIT_CANCEL'=>'Cancel', 'MODE_EDIT_CANCEL_DESC'=>'Cancel input', @@ -977,8 +977,8 @@ function language() { return array( 'NOTICE_COPIED'=>'è stata copiata', 'NOTICE_DUPLICATE_INPUT'=>'Duplicate Input detected.', 'NOTICE_DATABASE_CONNECTION_ERROR'=>'The connection to the database could not be established.', -'ERROR_DATABASE_CONNECTION'=>'ERROR_DATABASE_CONNECTION', -'ERROR_DATABASE'=>'ERROR_DATABASE', +'ERROR_DATABASE_CONNECTION'=>'The connection to the database could not be established.', +'ERROR_DATABASE'=>'The database query could not executed.', 'NOTICE_DELETED'=>'è stata cancellata', 'NOTICE_DONE'=>'Finished successful', 'NOTICE_ERROR'=>'un errore ha accaduto', @@ -1175,13 +1175,13 @@ function language() { return array( 'USER_YOURPROFILE'=>'il mio soddisfare delle regolazioni', 'WEEK'=>'Week', 'WINDOW_FULLSCREEN'=>'Fullscreen', -'MENU_STRUCTURE_DESC'=>'MENU_STRUCTURE_DESC', -'MENU_PREVIEW_DESC'=>'MENU_PREVIEW_DESC', +'MENU_STRUCTURE_DESC'=>'Show structure', +'MENU_PREVIEW_DESC'=>'Preview', 'MENU_ARCHIVE_DESC'=>'Archive', -'MENU_USERTIMELINE_DESC'=>'MENU_USERTIMELINE_DESC', -'MENU_OPENID_DESC'=>'MENU_OPENID_DESC', -'PAGEELEMENT_RELEASED'=>'PAGEELEMENT_RELEASED', -'PAGEELEMENT_USE_FROM_ARCHIVE'=>'PAGEELEMENT_USE_FROM_ARCHIVE', +'MENU_USERTIMELINE_DESC'=>'My last changes', +'MENU_OPENID_DESC'=>'Login with your OpenId', +'PAGEELEMENT_RELEASED'=>'The content has been released', +'PAGEELEMENT_USE_FROM_ARCHIVE'=>'The content has been restored.', 'REMEMBER_ME'=>'Stay logged in', 'MENU_PROGRESS'=>'Tasks', 'MENU_PROGRESS_DESC'=>'Running tasks', @@ -1196,12 +1196,12 @@ function language() { return array( 'SELECT_LANGUAGE'=>'Select language', 'SELECT_MODEL'=>'Select model', 'PWCHANGE_NOT_ALLOWED'=>'Password change is not available', -'ERROR_IN_ELEMENT'=>'ERROR_IN_ELEMENT', +'ERROR_IN_ELEMENT'=>'The element could not be build', 'USER_PASSWORD_EXPIRES'=>'Password expires', 'USER_HOTP'=>'Counter-based 2-factor authentification', 'USER_TOTP'=>'Time-based 2-factor authentification', -'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'NOTICE_LOGIN_FAILED_TOKEN_FAILED', -'USER_TOKEN'=>'USER_TOKEN', +'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'Please supply a valid token', +'USER_TOKEN'=>'Token', 'ACCESSKEY_WINDOW_ACL'=>'G', 'ELEMENTS'=>'Elements', 'EL_LIST_DESC'=>'l\'elemento della lista contiene 1 öre più pagine. Con questo elemento che potete unire più pagina in un', diff --git a/modules/language/lang-ru.php b/modules/language/lang-ru.php @@ -753,8 +753,8 @@ function language() { return array( 'MENU_NAME'=>'Name', 'MENU_OPENID'=>'Open-Id', 'MENU_OTHER'=>'Other', -'MENU_ORDER'=>'MENU_ORDER', -'MENU_ORDER_DESC'=>'MENU_ORDER_DESC', +'MENU_ORDER'=>'Order', +'MENU_ORDER_DESC'=>'Change order', 'MENU_PAGE_ACLFORM_DESC'=>'Добавить права на эту страницу Заменить', 'MENU_PAGE_ACLFORM'=>'Добавить Право', 'MENU_PAGE_CHANGETEMPLATE_DESC'=>'шаблоне заменить шаблон на этой странице Редактировать', @@ -834,7 +834,7 @@ function language() { return array( 'MENU_REGISTER_DESC'=>'You must be registered to use this application.', 'MENU_REGISTER'=>'Register', 'MENU_REMOVE'=>'Delete', -'MENU_REMOVE_DESC'=>'MENU_REMOVE_DESC', +'MENU_REMOVE_DESC'=>'Delete', 'MENU_RIGHTS'=>'Rights', 'MENU_RIGHTS_DESC'=>'выдавать или отзывать человека X', 'MENU_RIGHTS_KEY'=>'X', @@ -955,8 +955,8 @@ function language() { return array( 'MENU_USERS_DESC'=>'Членство Добавить или удалить пользователей Добавить', 'MENU_USERS'=>'Memberships', 'MENU_USERTIMELINE'=>'My changes', -'MENU_VALUE'=>'MENU_VALUE', -'MENU_VALUE_DESC'=>'MENU_VALUE_DESC', +'MENU_VALUE'=>'Content', +'MENU_VALUE_DESC'=>'Content', 'MODE_EDIT'=>'Edit', 'MODE_EDIT_CANCEL'=>'Cancel', 'MODE_EDIT_CANCEL_DESC'=>'Cancel input', @@ -977,8 +977,8 @@ function language() { return array( 'NOTICE_COPIED'=>'копирования', 'NOTICE_DUPLICATE_INPUT'=>'Duplicate Input detected.', 'NOTICE_DATABASE_CONNECTION_ERROR'=>'The connection to the database could not be established.', -'ERROR_DATABASE_CONNECTION'=>'ERROR_DATABASE_CONNECTION', -'ERROR_DATABASE'=>'ERROR_DATABASE', +'ERROR_DATABASE_CONNECTION'=>'The connection to the database could not be established.', +'ERROR_DATABASE'=>'The database query could not executed.', 'NOTICE_DELETED'=>'удалена', 'NOTICE_DONE'=>'Finished successful', 'NOTICE_ERROR'=>'Произошла ошибка', @@ -1175,13 +1175,13 @@ function language() { return array( 'USER_YOURPROFILE'=>'Мои настройки Содержимое', 'WEEK'=>'Week', 'WINDOW_FULLSCREEN'=>'Fullscreen', -'MENU_STRUCTURE_DESC'=>'MENU_STRUCTURE_DESC', -'MENU_PREVIEW_DESC'=>'MENU_PREVIEW_DESC', +'MENU_STRUCTURE_DESC'=>'Show structure', +'MENU_PREVIEW_DESC'=>'Preview', 'MENU_ARCHIVE_DESC'=>'Archive', -'MENU_USERTIMELINE_DESC'=>'MENU_USERTIMELINE_DESC', -'MENU_OPENID_DESC'=>'MENU_OPENID_DESC', -'PAGEELEMENT_RELEASED'=>'PAGEELEMENT_RELEASED', -'PAGEELEMENT_USE_FROM_ARCHIVE'=>'PAGEELEMENT_USE_FROM_ARCHIVE', +'MENU_USERTIMELINE_DESC'=>'My last changes', +'MENU_OPENID_DESC'=>'Login with your OpenId', +'PAGEELEMENT_RELEASED'=>'The content has been released', +'PAGEELEMENT_USE_FROM_ARCHIVE'=>'The content has been restored.', 'REMEMBER_ME'=>'Stay logged in', 'MENU_PROGRESS'=>'Tasks', 'MENU_PROGRESS_DESC'=>'Running tasks', @@ -1196,12 +1196,12 @@ function language() { return array( 'SELECT_LANGUAGE'=>'Select language', 'SELECT_MODEL'=>'Select model', 'PWCHANGE_NOT_ALLOWED'=>'Password change is not available', -'ERROR_IN_ELEMENT'=>'ERROR_IN_ELEMENT', +'ERROR_IN_ELEMENT'=>'The element could not be build', 'USER_PASSWORD_EXPIRES'=>'Password expires', 'USER_HOTP'=>'Counter-based 2-factor authentification', 'USER_TOTP'=>'Time-based 2-factor authentification', -'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'NOTICE_LOGIN_FAILED_TOKEN_FAILED', -'USER_TOKEN'=>'USER_TOKEN', +'NOTICE_LOGIN_FAILED_TOKEN_FAILED'=>'Please supply a valid token', +'USER_TOKEN'=>'Token', 'ACCESSKEY_WINDOW_ACL'=>'G', 'ELEMENTS'=>'Elements', 'EL_LIST_DESC'=>'Список Список элементов включает 1 или более страниц. С этим элементом вы можете поместить несколько страниц на одном вместе', diff --git a/modules/language/language.yml b/modules/language/language.yml @@ -3825,8 +3825,10 @@ MENU_OTHER: de: Andere en: Other MENU_ORDER: + en: Order de: Reihenfolge MENU_ORDER_DESC: + en: Change order de: Reihenfolge verändern MENU_PAGE_ACLFORM_DESC: de: Ein Recht zu dieser Seite hinzufügen @@ -4196,6 +4198,7 @@ MENU_REMOVE: en: Delete MENU_REMOVE_DESC: de: Löschen + en: Delete MENU_RIGHTS: de: Berechtigungen en: Rights @@ -4699,8 +4702,10 @@ MENU_USERTIMELINE: de: Meine Änderungen en: My changes MENU_VALUE: + en: Content de: Inhalt MENU_VALUE_DESC: + en: Content de: Inhalt MODE_EDIT: de: Bearbeiten @@ -4775,8 +4780,10 @@ NOTICE_DATABASE_CONNECTION_ERROR: de: Es konnte keine Verbindung zur Datenbank hergestellt werden. en: The connection to the database could not be established. ERROR_DATABASE_CONNECTION: + en: The connection to the database could not be established. de: Es konnte keine Verbindung zur Datenbank hergestellt werden. ERROR_DATABASE: + en: The database query could not executed. de: Es gab einen Fehler bei der Durchführung einer Datenbankanfrage. NOTICE_DELETED: de: wurde gelöscht. @@ -5751,19 +5758,25 @@ WINDOW_FULLSCREEN: de: Vollbild en: Fullscreen MENU_STRUCTURE_DESC: + en: Show structure de: Struktur anzeigen MENU_PREVIEW_DESC: + en: Preview de: Vorschau MENU_ARCHIVE_DESC: de: Archiv anzeigen en: Archive MENU_USERTIMELINE_DESC: + en: My last changes de: Meine letzten Änderungen MENU_OPENID_DESC: + en: Login with your OpenId de: Anmeldung über Ihre Open-Id-Kennung PAGEELEMENT_RELEASED: + en: The content has been released de: Der Inhalt wurde freigegeben. PAGEELEMENT_USE_FROM_ARCHIVE: + en: The content has been restored. de: Der Inhalt wurde wieder hergestellt. REMEMBER_ME: de: Angemeldet bleiben @@ -5808,6 +5821,7 @@ PWCHANGE_NOT_ALLOWED: de: Eine Kennwortänderung ist nicht möglich en: Password change is not available ERROR_IN_ELEMENT: + en: The element could not be build de: Dieses Seitenelement konnte nicht erzeugt werden USER_PASSWORD_EXPIRES: de: Kennwort läuft ab @@ -5819,8 +5833,10 @@ USER_TOTP: de: Zeitbasieres Token als Zweifaktorauthentifizierung en: Time-based 2-factor authentification NOTICE_LOGIN_FAILED_TOKEN_FAILED: + en: Please supply a valid token de: Bitte geben Sie ein gültiges Token ein USER_TOKEN: + en: Token de: Token ACCESSKEY_WINDOW_ACL: en: G @@ -6059,12 +6075,14 @@ USER_MAIL_TEXT_SUFFIX: CHARSET: en: UTF-8 MENU_TITLE_SEARCH_CONTENT: + en: Search for value es: Search for value fr: Search for value it: Search for value ru: Search for value MENU_TITLE_SEARCH_PROP: de: Suche nach Eigenschaft + en: Search for property es: Search for property fr: Search for property it: Search for property diff --git a/modules/template_engine/TemplateCompiler.php b/modules/template_engine/TemplateCompiler.php @@ -9,17 +9,15 @@ error_reporting(E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); -require('../../modules/autoload.php'); - use template_engine\engine\TemplateEngine; use util\FileUtils; $dir = __DIR__ . '/../../modules/cms/ui/themes/default/html/views'; -require('../../modules/util/require.php'); -require('../../modules/template_engine/require.php'); -require('../../modules/cms/base/require.php'); +require(__DIR__.'/../util/require.php'); +require(__DIR__.'/../template_engine/require.php'); +require(__DIR__.'/../cms/base/require.php'); echo "Searching in $dir\n"; diff --git a/modules/template_engine/components/XSDGenerator.php b/modules/template_engine/components/XSDGenerator.php @@ -5,15 +5,12 @@ use util\FileUtils; -error_reporting(E_ALL); - -require('../../util/FileUtils.class.php'); +require(__DIR__.'/../../util/FileUtils.class.php'); // Baseclass of all components. require('html/Component.class.php'); require('html/HtmlComponent.class.php'); require('html/FieldComponent.class.php'); -header('Content-Type: text/plain'); echo "XSD Generator\n\n"; diff --git a/modules/template_engine/components/html/column/column.min.js b/modules/template_engine/components/html/column/column.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(e){});- \ No newline at end of file diff --git a/modules/template_engine/components/html/editor/editor.css b/modules/template_engine/components/html/editor/editor.css @@ -1,32 +0,0 @@ -.editor__text-editor { - width: 100%; - height: 300px; -} -/* ACE-Editor */ -textarea.editor__code-editor { - display: none; - /* Textarea nicht anzeigen, da durch Editor im DIV ersetzt */ -} -div.editor__code-editor { - position: absolute; - height: 500px; - width: 100%; - font-size: 14px; - z-index: 256; -} -textarea.editor__text-editor, -textarea.editor__wiki-editor, -textarea.editor__html-editor { - width: 100%; -} -a.editorlink:active, -a.editorlink:hover { - font-weight: normal; - text-decoration: none; -} -a.editorlink:link, -a.editorlink:visited { - font-weight: normal; - text-decoration: none; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22editor.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AACA%3BCACC%3BCACA%3B%3B%3BAAID%2CQAAQ%3BCACP%3B%3B%3BAAID%2CGAAG%3BCAED%3BCACE%3BCACA%3BCACA%3BCACA%3B%3BAAKJ%2CQAAQ%3BAACR%2CQAAQ%3BAACR%2CQAAQ%3BCAEP%3B%3BAAID%2CCAAC%2CWAAW%3BAACZ%2CCAAC%2CWAAW%3BCAEX%3BCACA%3B%3BAAGD%2CCAAC%2CWAAW%3BAACZ%2CCAAC%2CWAAW%3BCAEX%3BCACA%22%7D */- \ No newline at end of file diff --git a/modules/template_engine/components/html/editor/editor.min.css b/modules/template_engine/components/html/editor/editor.min.css @@ -1 +0,0 @@ -.editor__text-editor{width: 100%;height: 300px}textarea.editor__code-editor{display: none}div.editor__code-editor{position: absolute;height: 500px;width: 100%;font-size: 14px;z-index: 256}textarea.editor__text-editor,textarea.editor__wiki-editor,textarea.editor__html-editor{width: 100%}a.editorlink:active,a.editorlink:hover{font-weight: normal;text-decoration: none}a.editorlink:link,a.editorlink:visited{font-weight: normal;text-decoration: none}- \ No newline at end of file diff --git a/modules/template_engine/components/html/editor/editor.min.js b/modules/template_engine/components/html/editor/editor.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('textarea').orAutoheight();$(e).find('textarea.editor.code-editor').each(function(){let mode=$(this).data('mode');let mimetype=$(this).data('mimetype');if(mimetype.length>0)mode=mimetype;let textareaEl=this;let editor=CodeMirror.fromTextArea(textareaEl,{lineNumbers:!0,viewportMargin:Infinity,mode:mode});editor.on('change',function(){let newValue=editor.getValue();$(textareaEl).val(newValue)});$(editor.getWrapperElement()).droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let pos=editor.getCursor();editor.setSelection(pos,pos);let insertText=dropped.data('id');let toInsert=''+insertText;editor.replaceSelection(toInsert)}})});$(e).find('textarea.editor.markdown-editor').each(function(){let textarea=this;let toolbar=[{name:'bold',action:SimpleMDE.toggleBold,className:'image-icon image-icon--editor-bold',title:'Bold',},{name:'italic',action:SimpleMDE.toggleItalic,className:'image-icon image-icon--editor-italic',title:'Italic',},{name:'heading',action:SimpleMDE.toggleHeadingBigger,className:'image-icon image-icon--editor-headline',title:'Headline',},'|',{name:'quote',action:SimpleMDE.toggleBlockquote,className:'image-icon image-icon--editor-quote',title:'Quote',},{name:'code',action:SimpleMDE.toggleCodeBlock,className:'image-icon image-icon--editor-code',title:'Code',},'|',{name:'generic list',action:SimpleMDE.toggleUnorderedList,className:'image-icon image-icon--editor-unnumberedlist',title:'Unnumbered list',},{name:'numbered list',action:SimpleMDE.toggleOrderedList,className:'image-icon image-icon--editor-numberedlist',title:'Numbered list',},'|',{name:'table',action:SimpleMDE.drawTable,className:'image-icon image-icon--editor-table',title:'Table',},{name:'horizontalrule',action:SimpleMDE.drawHorizontalRule,className:'image-icon image-icon--editor-horizontalrule',title:'Horizontal rule',},'|',{name:'undo',action:SimpleMDE.undo,className:'image-icon image-icon--editor-undo',title:'Undo',},{name:'redo',action:SimpleMDE.redo,className:'image-icon image-icon--editor-redo',title:'Redo',},'|',{name:'link',action:SimpleMDE.drawLink,className:'image-icon image-icon--editor-link',title:'Link',},{name:'image',action:SimpleMDE.drawImage,className:'image-icon image-icon--editor-image',title:'Image',},'|',{name:'guide',action:'https://simplemde.com/markdown-guide',className:'image-icon image-icon--editor-help',title:'Howto markdown',},];let mde=new SimpleMDE({element:$(this)[0],toolbar:toolbar,autoDownloadFontAwesome:!1});let codemirror=mde.codemirror;$(codemirror.getWrapperElement()).droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let insertText='';let id=dropped.data('id');let url='__OID__'+id+'__';if(dropped.data('type')=='image')insertText='![]('+url+')';else insertText='['+id+']('+url+')';let pos=codemirror.getCursor();codemirror.setSelection(pos,pos);codemirror.replaceSelection(insertText)}});codemirror.on('change',function(){let newValue=codemirror.getValue();$(textarea).val(newValue)})});$(e).find('textarea.editor.html-editor').each(function(){let textarea=this;$.trumbowyg.svgPath='./modules/editor/trumbowyg/ui/icons.svg';$(textarea).trumbowyg();$(textarea).closest('form').find('.trumbowyg-editor').droppable({accept:'.or-draggable',hoverClass:'or-droppable--hover',activeClass:'or-droppable--active',drop:function(e,t){let dropped=t.draggable;let id=dropped.data('id');let url='./?_='+dropped.data('type')+'-'+id+'&subaction=show&embed=1&__OID__'+id+'__='+id;let insertText='';if(dropped.data('type')=='image')insertText='<img src="'+url+'" alt="" />';else insertText='<a href="'+url+'" />'+id+'</a>';$(textarea).trumbowyg('execCmd',{cmd:'insertHTML',param:insertText,forceCss:!1,})}})})});- \ No newline at end of file diff --git a/modules/template_engine/components/html/group/group.css b/modules/template_engine/components/html/group/group.css @@ -1,12 +0,0 @@ -.or-group { - border: 1px solid; - border-bottom: 0; - border-left: 0; - border-right: 0; - margin-top: 20px; - margin-bottom: 20px; - margin-left: 0px; - margin-right: 0px; - padding: 10px; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22group.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%3BCAEC%2CiBAAA%3BCAEA%3BCACA%3BCACA%3BCAEA%3BCACA%3BCACA%3BCACA%3BCACA%22%7D */- \ No newline at end of file diff --git a/modules/template_engine/components/html/group/group.min.css b/modules/template_engine/components/html/group/group.min.css @@ -1 +0,0 @@ -.or-group{border: 1px solid;border-bottom: 0;border-left: 0;border-right: 0;margin-top: 20px;margin-bottom: 20px;margin-left: 0px;margin-right: 0px;padding: 10px}- \ No newline at end of file diff --git a/modules/template_engine/components/html/group/group.min.js b/modules/template_engine/components/html/group/group.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(e){registerOpenClose($(e).find('.or-group.toggle-open-close'))});- \ No newline at end of file diff --git a/modules/template_engine/components/html/image/image.css b/modules/template_engine/components/html/image/image.css @@ -1,2 +0,0 @@ - -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%22%7D */- \ No newline at end of file diff --git a/modules/template_engine/components/html/image/image.min.css b/modules/template_engine/components/html/image/image.min.css diff --git a/modules/template_engine/components/html/image/image.min.js b/modules/template_engine/components/html/image/image.min.js @@ -1 +0,0 @@ -;- \ No newline at end of file diff --git a/modules/template_engine/components/html/link/link.min.js b/modules/template_engine/components/html/link/link.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(e){$(e).find('.clickable').orLinkify()});- \ No newline at end of file diff --git a/modules/template_engine/components/html/qrcode/qrcode.min.js b/modules/template_engine/components/html/qrcode/qrcode.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(r){$(r).find('.or-qrcode').mouseover(function(){let r=this;if($(r).children().length>0)return;let wrapper=$('<div class="or-info-popup"></div>');$(r).append(wrapper);var e=$(r).attr('data-qrcode');$(wrapper).qrcode({render:'div',text:e,fill:'currentColor'});wrapper.attr('title','')})});- \ No newline at end of file diff --git a/modules/template_engine/components/html/table/table.css b/modules/template_engine/components/html/table/table.css @@ -1,175 +0,0 @@ -.or-table-wrapper .or-table-area { - /* Responsive Tables */ - /* T a b l e s */ -} -@media screen and (max-width: 40em) { - .or-table-wrapper .or-table-area { - overflow-x: auto; - } -} -.or-table-wrapper .or-table-area table { - overflow: auto; - border: 2px; - width: 100%; - /* Notizen */ - /* Kalender */ - /* Notizen */ - /* Kalender */ - /* Message of the day */ - /* D i f f */ - /* Hilfe-Texte */ - /* Logo */ -} -.or-table-wrapper .or-table-area table tr.headline > td, -.or-table-wrapper .or-table-area table tr > th { - padding: 3px; - font-weight: bold; -} -.or-table-wrapper .or-table-area table tr.headline > td.sort-asc > span:last-child:after, -.or-table-wrapper .or-table-area table tr > th.sort-asc > span:last-child:after { - content: " \2193"; -} -.or-table-wrapper .or-table-area table tr.headline > td.sort-desc > span:last-child:after, -.or-table-wrapper .or-table-area table tr > th.sort-desc > span:last-child:after { - content: " \2191"; -} -.or-table-wrapper .or-table-area table tr.data > td { - padding: 3px; -} -.or-table-wrapper .or-table-area table tr > td { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - max-width: 0; -} -.or-table-wrapper .or-table-area table td.readonly { - font-style: italic; - font-weight: normal; -} -.or-table-wrapper .or-table-area table td.default { - font-style: normal; - font-weight: normal; -} -.or-table-wrapper .or-table-area table td.changed { - font-style: normal; - font-weight: bold; -} -.or-table-wrapper .or-table-area table td.notice { - margin: 0px; - padding: 5%; - text-align: center; -} -.or-table-wrapper .or-table-area table.notice { - width: 100%; - border: 1px solid; - border-spacing: 0px; -} -.or-table-wrapper .or-table-area table.notice th { - padding: 2px; - white-space: nowrap; - border-bottom: 1px solid #000000; - font-weight: normal; - text-align: left; -} -.or-table-wrapper .or-table-area table.notice tr.warning { - margin: 0px; - padding: 0px; -} -.or-table-wrapper .or-table-area table.calendar { - table-layout: fixed; - border-collapse: collapse; - text-align: center; -} -.or-table-wrapper .or-table-area table.calendar td { - border: 1px dotted; -} -.or-table-wrapper .or-table-area table td.notice { - margin: 0px; - padding: 5%; - text-align: center; -} -.or-table-wrapper .or-table-area table.notice { - width: 100%; - border: 1px solid; - border-spacing: 0px; -} -.or-table-wrapper .or-table-area table.notice th { - padding: 2px; - white-space: nowrap; - border-bottom: 1px solid #000000; - font-weight: normal; - text-align: left; -} -.or-table-wrapper .or-table-area table.notice tr.warning { - margin: 0px; - padding: 0px; -} -.or-table-wrapper .or-table-area table.calendar { - table-layout: fixed; - border-collapse: collapse; - text-align: center; -} -.or-table-wrapper .or-table-area table.calendar td { - border: 1px dotted; -} -.or-table-wrapper .or-table-area table td.motd { - border-left: 3px solid red; - border-right: 3px solid red; - font-weight: bold; - padding: 10px; - margin: 10px; -} -.or-table-wrapper .or-table-area table td:hover > div.onrowvisible { - visibility: visible; -} -.or-table-wrapper .or-table-area table tr.diff { - /* Unveränderter Text */ - /* Entfernter Text */ - /* Hinzugefuegter Text */ - /* Geaenderter Text */ -} -.or-table-wrapper .or-table-area table tr.diff > td.line { - background-color: #000000; - padding-right: 2px; - border-right: 3px solid #000000; - text-align: right; - margin-right: 2px; -} -.or-table-wrapper .or-table-area table tr.diff > td.old { - background-color: red; -} -.or-table-wrapper .or-table-area table tr.diff td.new { - background-color: green; -} -.or-table-wrapper .or-table-area table tr.diff td.notequal { - background-color: yellow; -} -.or-table-wrapper .or-table-area table tr td.help { - font-style: italic; -} -.or-table-wrapper .or-table-area table tr.headline td.help { - /* - border-bottom:1px solid @color-overridden-by-theme; - */ - font-style: normal; -} -.or-table-wrapper .or-table-area table td.logo { - padding: 10px; - margin: 0px; -} -.or-table-wrapper .or-table-filter { - width: 100%; - text-align: right; -} -.or-table-wrapper .or-table-filter input { - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -khtml-border-radius: 3px; - padding: 0.5em; - margin: 1em; - background-color: #000000; - color: #000000; - border: 1px solid #000000; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22table.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AASA%2CiBAEI%3B%3B%3B%3BAAQI%2CmBALoC%3BCAKpC%2CiBARJ%3BEAKQ%3B%3B%3BAAPZ%2CiBAEI%2CeASI%3BCACI%3BCACA%3BCACA%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BAAdZ%2CiBAEI%2CeASI%2CMAKI%2CGAAE%2CSAAY%3BAAhB1B%2CiBAEI%2CeASI%2CMAMI%2CGAAK%3BCAED%3BCACA%3B%3BAAEA%2CiBApBZ%2CeASI%2CMAKI%2CGAAE%2CSAAY%2CKAMT%2CSAAY%2COAAI%2CWAAW%3BAAA5B%2CiBApBZ%2CeASI%2CMAMI%2CGAAK%2CKAKA%2CSAAY%2COAAI%2CWAAW%3BCACxB%2CSAAS%2CQAAT%3B%3BAAEJ%2CiBAvBZ%2CeASI%2CMAKI%2CGAAE%2CSAAY%2CKAST%2CUAAa%2COAAI%2CWAAW%3BAAA7B%2CiBAvBZ%2CeASI%2CMAMI%2CGAAK%2CKAQA%2CUAAa%2COAAI%2CWAAW%3BCACzB%2CSAAS%2CQAAT%3B%3BAA1BpB%2CiBAEI%2CeASI%2CMAmBI%2CGAAE%2CKAAQ%3BCACN%3B%3BAA%5C%2FBhB%2CiBAEI%2CeASI%2CMAuBI%2CGAAK%3BCACD%3BCACA%3BCACA%3BCACA%3B%3BAAtChB%2CiBAEI%2CeASI%2CMA8BI%2CGAAE%3BCACE%3BCACA%3B%3BAA3ChB%2CiBAEI%2CeASI%2CMAkCI%2CGAAE%3BCACE%3BCACA%3B%3BAA%5C%2FChB%2CiBAEI%2CeASI%2CMAsCI%2CGAAE%3BCACE%3BCACA%3B%3BAAnDhB%2CiBAEI%2CeASI%2CMA2CI%2CGAAE%3BCACE%3BCACA%3BCACA%3B%3BAAGJ%2CiBA1DR%2CeASI%2CMAiDK%3BCACG%3BCACA%2CiBAAA%3BCACA%3B%3BAAHJ%2CiBA1DR%2CeASI%2CMAiDK%2COAIG%3BCACI%3BCACA%3BCACA%2CgCAAA%3BCACA%3BCACA%3B%3BAATR%2CiBA1DR%2CeASI%2CMAiDK%2COAeG%2CGAAE%3BCACE%3BCACA%3B%3BAAKR%2CiBAhFR%2CeASI%2CMAuEK%3BCACG%3BCACA%3BCACA%3B%3BAAHJ%2CiBAhFR%2CeASI%2CMAuEK%2CSAKG%3BCACI%2CkBAAA%3B%3BAAxFpB%2CiBAEI%2CeASI%2CMAkFI%2CGAAE%3BCACE%3BCACA%3BCACA%3B%3BAAGJ%2CiBAjGR%2CeASI%2CMAwFK%3BCACG%3BCACA%2CiBAAA%3BCACA%3B%3BAAGJ%2CiBAvGR%2CeASI%2CMA8FK%2COAAQ%3BCACL%3BCACA%3BCACA%2CgCAAA%3BCACA%3BCACA%3B%3BAAMJ%2CiBAlHR%2CeASI%2CMAyGK%2COAAQ%2CGAAE%3BCACP%3BCACA%3B%3BAAIJ%2CiBAxHR%2CeASI%2CMA%2BGK%3BCACG%3BCACA%3BCACA%3B%3BAAGJ%2CiBA9HR%2CeASI%2CMAqHK%2CSAAU%3BCACP%2CkBAAA%3B%3BAAjIhB%2CiBAEI%2CeASI%2CMAyHI%2CGAAE%3BCACE%2C0BAAA%3BCACA%2C2BAAA%3BCACA%3BCACA%3BCACA%3B%3BAAzIhB%2CiBAEI%2CeASI%2CMAgII%2CGAAE%2CMAAS%2CMAAG%3BCACV%3B%3BAA5IhB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%3B%3B%3B%3B%3B%3BAAhJd%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKACI%2CKAAE%3BCACA%2CyBAAA%3BCACA%3BCACA%2C%2BBAAA%3BCACA%3BCACA%3B%3BAAtJpB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKAcI%2CKAAE%3BCACA%3B%3BAA%5C%2FJpB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKAmBE%2CGAAE%3BCACE%3B%3BAApKpB%2CiBAEI%2CeASI%2CMAqII%2CGAAE%2CKAwBE%2CGAAE%3BCACE%3B%3BAAzKpB%2CiBAEI%2CeASI%2CMAmKI%2CGAAG%2CGAAE%3BCACD%3B%3BAA%5C%2FKhB%2CiBAEI%2CeASI%2CMAuKI%2CGAAE%2CSAAU%2CGAAE%3B%3B%3B%3BCAIV%3B%3BAAtLhB%2CiBAEI%2CeASI%2CMAgLI%2CGAAE%3BCACE%3BCACA%3B%3BAA7LhB%2CiBAsMI%3BCACI%3BCACA%3B%3BAAxMR%2CiBAsMI%2CiBAII%3BCAhNJ%2CkBAAA%3BCACA%2CuBAAA%3BCACA%2C0BAAA%3BCACA%2CyBAAA%3BCA%2BMQ%3BCACA%3BCACA%2CyBAAA%3BCACA%2CcAAA%3BCACA%2CyBAAA%22%7D */- \ No newline at end of file diff --git a/modules/template_engine/components/html/table/table.min.css b/modules/template_engine/components/html/table/table.min.css @@ -1 +0,0 @@ -@media screen and (max-width: 40em){.or-table-wrapper .or-table-area{overflow-x: auto}}.or-table-wrapper .or-table-area table{overflow: auto;border: 2px;width: 100%}.or-table-wrapper .or-table-area table tr.headline > td,.or-table-wrapper .or-table-area table tr > th{padding: 3px;font-weight: bold}.or-table-wrapper .or-table-area table tr.headline > td.sort-asc > span:last-child:after,.or-table-wrapper .or-table-area table tr > th.sort-asc > span:last-child:after{content: " \2193"}.or-table-wrapper .or-table-area table tr.headline > td.sort-desc > span:last-child:after,.or-table-wrapper .or-table-area table tr > th.sort-desc > span:last-child:after{content: " \2191"}.or-table-wrapper .or-table-area table tr.data > td{padding: 3px}.or-table-wrapper .or-table-area table tr > td{white-space: nowrap;text-overflow: ellipsis;overflow: hidden;max-width: 0}.or-table-wrapper .or-table-area table td.readonly{font-style: italic;font-weight: normal}.or-table-wrapper .or-table-area table td.default{font-style: normal;font-weight: normal}.or-table-wrapper .or-table-area table td.changed{font-style: normal;font-weight: bold}.or-table-wrapper .or-table-area table td.notice{margin: 0px;padding: 5%;text-align: center}.or-table-wrapper .or-table-area table.notice{width: 100%;border: 1px solid;border-spacing: 0px}.or-table-wrapper .or-table-area table.notice th{padding: 2px;white-space: nowrap;border-bottom: 1px solid #000;font-weight: normal;text-align: left}.or-table-wrapper .or-table-area table.notice tr.warning{margin: 0px;padding: 0px}.or-table-wrapper .or-table-area table.calendar{table-layout: fixed;border-collapse: collapse;text-align: center}.or-table-wrapper .or-table-area table.calendar td{border: 1px dotted}.or-table-wrapper .or-table-area table td.notice{margin: 0px;padding: 5%;text-align: center}.or-table-wrapper .or-table-area table.notice{width: 100%;border: 1px solid;border-spacing: 0px}.or-table-wrapper .or-table-area table.notice th{padding: 2px;white-space: nowrap;border-bottom: 1px solid #000;font-weight: normal;text-align: left}.or-table-wrapper .or-table-area table.notice tr.warning{margin: 0px;padding: 0px}.or-table-wrapper .or-table-area table.calendar{table-layout: fixed;border-collapse: collapse;text-align: center}.or-table-wrapper .or-table-area table.calendar td{border: 1px dotted}.or-table-wrapper .or-table-area table td.motd{border-left: 3px solid #f00;border-right: 3px solid #f00;font-weight: bold;padding: 10px;margin: 10px}.or-table-wrapper .or-table-area table td:hover > div.onrowvisible{visibility: visible}.or-table-wrapper .or-table-area table tr.diff > td.line{background-color: #000;padding-right: 2px;border-right: 3px solid #000;text-align: right;margin-right: 2px}.or-table-wrapper .or-table-area table tr.diff > td.old{background-color: red}.or-table-wrapper .or-table-area table tr.diff td.new{background-color: green}.or-table-wrapper .or-table-area table tr.diff td.notequal{background-color: yellow}.or-table-wrapper .or-table-area table tr td.help{font-style: italic}.or-table-wrapper .or-table-area table tr.headline td.help{font-style: normal}.or-table-wrapper .or-table-area table td.logo{padding: 10px;margin: 0px}.or-table-wrapper .or-table-filter{width: 100%;text-align: right}.or-table-wrapper .or-table-filter input{border-radius: 3px;-moz-border-radius: 3px;-webkit-border-radius: 3px;-khtml-border-radius: 3px;padding: 0.5em;margin: 1em;background-color: #000;color: #000;border: 1px solid #000}- \ No newline at end of file diff --git a/modules/template_engine/components/html/table/table.min.js b/modules/template_engine/components/html/table/table.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(t){$(t).find('table.or-table--sortable > tbody').sortable();$(t).find('table.or-table--sortable > tbody').closest('form').submit(function(){var t=[];$(this).find('table.or-table--sortable').find('tbody > tr.data').each(function(){let objectid=$(this).data('id');t.push(objectid)});$(this).find('input[name=order]').val(t.join(','))});$(t).find('tr.headline > td > input.checkbox').click(function(){$(this).closest('table').find('tr.data > td > input.checkbox').attr('checked',Boolean($(this).attr('checked')))});$(t).find('.or-table-filter > input').keyup(function(){let filterExpression=$(this).val().toLowerCase();let table=$(this).parents('.or-table-wrapper').find('table');table.addClass('loader');setTimeout(()=>{table.find('tr:not(.headline)').filter(function(){$(this).toggle($(this).text().toLowerCase().indexOf(filterExpression)>-1)});table.removeClass('loader')},50)});$(t).find('table > tbody > tr.headline > td, table > tbody > tr > th').click(function(){let column=$(this);let table=column.parents('table');table.addClass('loader');let isAscending=!column.hasClass('sort-asc');table.find('tr.headline > td, tr > th').removeClass('sort-asc sort-desc');if(isAscending)column.addClass('sort-asc');else column.addClass('sort-desc');setTimeout(function(){let rows=table.find('tr:gt(0)').toArray().sort(a(column.index()));if(!isAscending){rows=rows.reverse()};for(var t=0;t<rows.length;t++){table.append(rows[t])};table.removeClass('loader')},50)});function a(t){return function(a,l){let valA=e(a,t),valB=e(l,t);return $.isNumeric(valA)&&$.isNumeric(valB)?valA-valB:valA.toString().localeCompare(valB)}};function e(t,e){return $(t).children('td').eq(e).text()}});- \ No newline at end of file diff --git a/modules/template_engine/components/html/tree/tree.min.js b/modules/template_engine/components/html/tree/tree.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(e){});- \ No newline at end of file diff --git a/modules/template_engine/components/html/upload/upload.css b/modules/template_engine/components/html/upload/upload.css @@ -1,6 +0,0 @@ -div.or-dropzone-upload > div.input { - width: 100%; - height: 100px; - border: 1px dotted; -} -/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22upload.less%22%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22AAAA%2CGAAG%2CmBAAsB%2CMAAG%3BCAE3B%3BCACA%3BCAEA%2CkBAAA%22%7D */- \ No newline at end of file diff --git a/modules/template_engine/components/html/upload/upload.min.css b/modules/template_engine/components/html/upload/upload.min.css @@ -1 +0,0 @@ -div.or-dropzone-upload > div.input{width: 100%;height: 100px;border: 1px dotted}- \ No newline at end of file diff --git a/modules/template_engine/components/html/upload/upload.min.js b/modules/template_engine/components/html/upload/upload.min.js @@ -1 +0,0 @@ -;Openrat.Workbench.afterViewLoadedHandler.add(function(e){var o=$(e).find('form'),n=$(e).find('div.or-dropzone-upload > div.input');n.on('dragenter',function(e){e.stopPropagation();e.preventDefault();$(this).css('border','1px dotted gray')});n.on('dragover',function(e){e.stopPropagation();e.preventDefault()});n.on('drop',function(e){$(this).css('border','1px dotted red');e.preventDefault();var n=e.originalEvent.dataTransfer.files;handleFileUpload(o,n)});$(e).find('input[type=file]').change(function(){var e=$(this).prop('files');handleFileUpload(o,e)})});function handleFileUpload(e,a){for(var r=0,t;t=a[r];r++){var n=new FormData();n.append('file',t);n.append('action','folder');n.append('subaction',$(e).data('method'));n.append('output','json');n.append('token',$(e).find('input[name=token]').val());n.append('id',$(e).find('input[name=id]').val());var o=$('<div class="notice info"><div class="text loader"></div></div>');$('#noticebar').prepend(o);$(o).show();$.ajax({'type':'POST',url:'./api/',cache:!1,contentType:!1,processData:!1,data:n,success:function(n,a,r){$(o).remove();let oform=new Openrat.Form();oform.doResponse(n,a,e)},error:function(n,t,d){$(e).closest('div.content').removeClass('loader');$(o).remove();var r;try{var a=jQuery.parseJSON(n.responseText);r=a.error+'/'+a.description+': '+a.reason}catch(i){r=n.responseText};Openrat.Workbench.notify('Upload error',r)}})}};- \ No newline at end of file